svn merge ^/trunk/blender -r43033:43062

This commit is contained in:
Campbell Barton 2012-01-02 02:57:36 +00:00
commit b64f352270
38 changed files with 634 additions and 192 deletions

@ -1393,7 +1393,10 @@ if(CMAKE_COMPILER_IS_GNUCC)
# disable because it gives warnings for printf() & friends.
# ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_DOUBLE_PROMOTION -Wdouble-promotion -Wno-error=double-promotion)
if(NOT APPLE)
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_NO_ERROR_UNUSED_BUT_SET_VARIABLE -Wno-error=unused-but-set-variable)
endif()
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_ALL -Wall)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_INVALID_OFFSETOF -Wno-invalid-offsetof)
@ -1405,7 +1408,10 @@ if(CMAKE_COMPILER_IS_GNUCC)
# flags to undo strict flags
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_DEPRECATED_DECLARATIONS -Wno-deprecated-declarations)
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_PARAMETER -Wno-unused-parameter)
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_BUT_SET_VARIABLE -Wno-unused-but-set-variable)
if(NOT APPLE)
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_ERROR_UNUSED_BUT_SET_VARIABLE -Wno-error=unused-but-set-variable)
endif()
elseif(CMAKE_C_COMPILER_ID MATCHES "Intel")

@ -57,7 +57,7 @@ WITH_BF_STATICOPENEXR = False
BF_OPENEXR = LIBDIR + '/openexr'
BF_OPENEXR_INC = '${BF_OPENEXR}/include ${BF_OPENEXR}/include/IlmImf ${BF_OPENEXR}/include/Iex ${BF_OPENEXR}/include/Imath '
BF_OPENEXR_LIB = ' Iex Half IlmImf Imath IlmThread '
BF_OPENEXR_LIBPATH = '${BF_OPENEXR}/lib_vs2008'
BF_OPENEXR_LIBPATH = '${BF_OPENEXR}/lib'
# Warning, this static lib configuration is untested! users of this OS please confirm.
BF_OPENEXR_LIB_STATIC = '${BF_OPENEXR}/lib/libHalf.a ${BF_OPENEXR}/lib/libIlmImf.a ${BF_OPENEXR}/lib/libIex.a ${BF_OPENEXR}/lib/libImath.a ${BF_OPENEXR}/lib/libIlmThread.a'

@ -61,7 +61,7 @@ WITH_BF_STATICOPENEXR = False
BF_OPENEXR = LIBDIR + '/openexr'
BF_OPENEXR_INC = '${BF_OPENEXR}/include ${BF_OPENEXR}/include/IlmImf ${BF_OPENEXR}/include/Iex ${BF_OPENEXR}/include/Imath '
BF_OPENEXR_LIB = ' Iex Half IlmImf Imath IlmThread '
BF_OPENEXR_LIBPATH = '${BF_OPENEXR}/lib_vs2008'
BF_OPENEXR_LIBPATH = '${BF_OPENEXR}/lib'
# Warning, this static lib configuration is untested! users of this OS please confirm.
BF_OPENEXR_LIB_STATIC = '${BF_OPENEXR}/lib/libHalf.a ${BF_OPENEXR}/lib/libIlmImf.a ${BF_OPENEXR}/lib/libIex.a ${BF_OPENEXR}/lib/libImath.a ${BF_OPENEXR}/lib/libIlmThread.a'

@ -38,7 +38,8 @@ CCL_NAMESPACE_BEGIN
DeviceTask::DeviceTask(Type type_)
: type(type_), x(0), y(0), w(0), h(0), rng_state(0), rgba(0), buffer(0),
sample(0), resolution(0),
displace_input(0), displace_offset(0), displace_x(0), displace_w(0)
shader_input(0), shader_output(0),
shader_eval_type(0), shader_x(0), shader_w(0)
{
}
@ -46,8 +47,8 @@ void DeviceTask::split_max_size(list<DeviceTask>& tasks, int max_size)
{
int num;
if(type == DISPLACE) {
num = (displace_w + max_size - 1)/max_size;
if(type == SHADER) {
num = (shader_w + max_size - 1)/max_size;
}
else {
max_size = max(1, max_size/w);
@ -68,17 +69,17 @@ void DeviceTask::split(ThreadQueue<DeviceTask>& queue, int num)
void DeviceTask::split(list<DeviceTask>& tasks, int num)
{
if(type == DISPLACE) {
num = min(displace_w, num);
if(type == SHADER) {
num = min(shader_w, num);
for(int i = 0; i < num; i++) {
int tx = displace_x + (displace_w/num)*i;
int tw = (i == num-1)? displace_w - i*(displace_w/num): displace_w/num;
int tx = shader_x + (shader_w/num)*i;
int tw = (i == num-1)? shader_w - i*(shader_w/num): shader_w/num;
DeviceTask task = *this;
task.displace_x = tx;
task.displace_w = tw;
task.shader_x = tx;
task.shader_w = tw;
tasks.push_back(task);
}

@ -52,7 +52,7 @@ enum MemoryType {
class DeviceTask {
public:
typedef enum { PATH_TRACE, TONEMAP, DISPLACE } Type;
typedef enum { PATH_TRACE, TONEMAP, SHADER } Type;
Type type;
int x, y, w, h;
@ -63,9 +63,10 @@ public:
int resolution;
int offset, stride;
device_ptr displace_input;
device_ptr displace_offset;
int displace_x, displace_w;
device_ptr shader_input;
device_ptr shader_output;
int shader_eval_type;
int shader_x, shader_w;
DeviceTask(Type type = PATH_TRACE);

@ -141,8 +141,8 @@ public:
thread_path_trace(task);
else if(task.type == DeviceTask::TONEMAP)
thread_tonemap(task);
else if(task.type == DeviceTask::DISPLACE)
thread_displace(task);
else if(task.type == DeviceTask::SHADER)
thread_shader(task);
tasks.worker_done();
}
@ -207,7 +207,7 @@ public:
}
}
void thread_displace(DeviceTask& task)
void thread_shader(DeviceTask& task)
{
#ifdef WITH_OSL
if(kernel_osl_use(kg))
@ -216,8 +216,8 @@ public:
#ifdef WITH_OPTIMIZED_KERNEL
if(system_cpu_support_optimized()) {
for(int x = task.displace_x; x < task.displace_x + task.displace_w; x++) {
kernel_cpu_optimized_displace(kg, (uint4*)task.displace_input, (float3*)task.displace_offset, x);
for(int x = task.shader_x; x < task.shader_x + task.shader_w; x++) {
kernel_cpu_optimized_shader(kg, (uint4*)task.shader_input, (float3*)task.shader_output, task.shader_eval_type, x);
if(tasks.worker_cancel())
break;
@ -226,8 +226,8 @@ public:
else
#endif
{
for(int x = task.displace_x; x < task.displace_x + task.displace_w; x++) {
kernel_cpu_displace(kg, (uint4*)task.displace_input, (float3*)task.displace_offset, x);
for(int x = task.shader_x; x < task.shader_x + task.shader_w; x++) {
kernel_cpu_shader(kg, (uint4*)task.shader_input, (float3*)task.shader_output, task.shader_eval_type, x);
if(tasks.worker_cancel())
break;

@ -615,16 +615,16 @@ public:
cuda_pop_context();
}
void displace(DeviceTask& task)
void shader(DeviceTask& task)
{
cuda_push_context();
CUfunction cuDisplace;
CUdeviceptr d_input = cuda_device_ptr(task.displace_input);
CUdeviceptr d_offset = cuda_device_ptr(task.displace_offset);
CUdeviceptr d_input = cuda_device_ptr(task.shader_input);
CUdeviceptr d_offset = cuda_device_ptr(task.shader_output);
/* get kernel function */
cuda_assert(cuModuleGetFunction(&cuDisplace, cuModule, "kernel_cuda_displace"))
cuda_assert(cuModuleGetFunction(&cuDisplace, cuModule, "kernel_cuda_shader"))
/* pass in parameters */
int offset = 0;
@ -635,11 +635,14 @@ public:
cuda_assert(cuParamSetv(cuDisplace, offset, &d_offset, sizeof(d_offset)))
offset += sizeof(d_offset);
int displace_x = task.displace_x;
offset = cuda_align_up(offset, __alignof(displace_x));
int shader_eval_type = task.shader_eval_type;
offset = cuda_align_up(offset, __alignof(shader_eval_type));
cuda_assert(cuParamSeti(cuDisplace, offset, task.displace_x))
offset += sizeof(task.displace_x);
cuda_assert(cuParamSeti(cuDisplace, offset, task.shader_eval_type))
offset += sizeof(task.shader_eval_type);
cuda_assert(cuParamSeti(cuDisplace, offset, task.shader_x))
offset += sizeof(task.shader_x);
cuda_assert(cuParamSetSize(cuDisplace, offset))
@ -649,7 +652,7 @@ public:
#else
int xthreads = 8;
#endif
int xblocks = (task.displace_w + xthreads - 1)/xthreads;
int xblocks = (task.shader_w + xthreads - 1)/xthreads;
cuda_assert(cuFuncSetCacheConfig(cuDisplace, CU_FUNC_CACHE_PREFER_L1))
cuda_assert(cuFuncSetBlockShape(cuDisplace, xthreads, 1, 1))
@ -828,8 +831,8 @@ public:
tonemap(task);
else if(task.type == DeviceTask::PATH_TRACE)
path_trace(task);
else if(task.type == DeviceTask::DISPLACE)
displace(task);
else if(task.type == DeviceTask::SHADER)
shader(task);
}
void task_wait()

@ -306,8 +306,8 @@ public:
if(task.buffer) subtask.buffer = sub.ptr_map[task.buffer];
if(task.rng_state) subtask.rng_state = sub.ptr_map[task.rng_state];
if(task.rgba) subtask.rgba = sub.ptr_map[task.rgba];
if(task.displace_input) subtask.displace_input = sub.ptr_map[task.displace_input];
if(task.displace_offset) subtask.displace_offset = sub.ptr_map[task.displace_offset];
if(task.shader_input) subtask.shader_input = sub.ptr_map[task.shader_input];
if(task.shader_output) subtask.shader_output = sub.ptr_map[task.shader_output];
sub.device->task_add(subtask);
}

@ -80,10 +80,10 @@ __kernel void kernel_ocl_tonemap(
kernel_film_tonemap(kg, rgba, buffer, sample, resolution, x, y, offset, stride);
}
/*__kernel void kernel_ocl_displace(__global uint4 *input, __global float3 *offset, int sx)
/*__kernel void kernel_ocl_shader(__global uint4 *input, __global float3 *output, int type, int sx)
{
int x = sx + get_global_id(0);
kernel_displace(input, offset, x);
kernel_shader_evaluate(input, output, (ShaderEvalType)type, x);
}*/

@ -216,11 +216,11 @@ void kernel_cpu_tonemap(KernelGlobals *kg, uchar4 *rgba, float4 *buffer, int sam
kernel_film_tonemap(kg, rgba, buffer, sample, resolution, x, y, offset, stride);
}
/* Displacement */
/* Shader Evaluation */
void kernel_cpu_displace(KernelGlobals *kg, uint4 *input, float3 *offset, int i)
void kernel_cpu_shader(KernelGlobals *kg, uint4 *input, float3 *output, int type, int i)
{
kernel_displace(kg, input, offset, i);
kernel_shader_evaluate(kg, input, output, (ShaderEvalType)type, i);
}
CCL_NAMESPACE_END

@ -44,10 +44,10 @@ extern "C" __global__ void kernel_cuda_tonemap(uchar4 *rgba, float4 *buffer, int
kernel_film_tonemap(NULL, rgba, buffer, sample, resolution, x, y, offset, stride);
}
extern "C" __global__ void kernel_cuda_displace(uint4 *input, float3 *offset, int sx)
extern "C" __global__ void kernel_cuda_shader(uint4 *input, float3 *output, int type, int sx)
{
int x = sx + blockDim.x*blockIdx.x + threadIdx.x;
kernel_displace(NULL, input, offset, x);
kernel_shader_evaluate(NULL, input, output, (ShaderEvalType)type, x);
}

@ -40,14 +40,16 @@ void kernel_cpu_path_trace(KernelGlobals *kg, float4 *buffer, unsigned int *rng_
int sample, int x, int y, int offset, int stride);
void kernel_cpu_tonemap(KernelGlobals *kg, uchar4 *rgba, float4 *buffer,
int sample, int resolution, int x, int y, int offset, int stride);
void kernel_cpu_displace(KernelGlobals *kg, uint4 *input, float3 *offset, int i);
void kernel_cpu_shader(KernelGlobals *kg, uint4 *input, float3 *output,
int type, int i);
#ifdef WITH_OPTIMIZED_KERNEL
void kernel_cpu_optimized_path_trace(KernelGlobals *kg, float4 *buffer, unsigned int *rng_state,
int sample, int x, int y, int offset, int stride);
void kernel_cpu_optimized_tonemap(KernelGlobals *kg, uchar4 *rgba, float4 *buffer,
int sample, int resolution, int x, int y, int offset, int stride);
void kernel_cpu_optimized_displace(KernelGlobals *kg, uint4 *input, float3 *offset, int i);
void kernel_cpu_optimized_shader(KernelGlobals *kg, uint4 *input, float3 *output,
int type, int i);
#endif
CCL_NAMESPACE_END

@ -18,17 +18,51 @@
CCL_NAMESPACE_BEGIN
__device void kernel_displace(KernelGlobals *kg, uint4 *input, float3 *offset, int i)
__device void kernel_shader_evaluate(KernelGlobals *kg, uint4 *input, float3 *output, ShaderEvalType type, int i)
{
/* setup shader data */
ShaderData sd;
uint4 in = input[i];
shader_setup_from_displace(kg, &sd, in.x, in.y, __int_as_float(in.z), __int_as_float(in.w));
float3 out;
if(type == SHADER_EVAL_DISPLACE) {
/* setup shader data */
int object = in.x;
int prim = in.y;
float u = __int_as_float(in.z);
float v = __int_as_float(in.w);
shader_setup_from_displace(kg, &sd, object, prim, u, v);
/* evaluate */
float3 P = sd.P;
shader_eval_displacement(kg, &sd);
offset[i] = sd.P - P;
out = sd.P - P;
}
else { // SHADER_EVAL_BACKGROUND
/* setup ray */
Ray ray;
ray.P = make_float3(0.0f, 0.0f, 0.0f);
ray.D = make_float3(__int_as_float(in.x), __int_as_float(in.y), __int_as_float(in.z));
ray.t = 0.0f;
#ifdef __RAY_DIFFERENTIALS__
ray.dD.dx = make_float3(0.0f, 0.0f, 0.0f);
ray.dD.dy = make_float3(0.0f, 0.0f, 0.0f);
ray.dP.dx = make_float3(0.0f, 0.0f, 0.0f);
ray.dP.dy = make_float3(0.0f, 0.0f, 0.0f);
#endif
/* setup shader data */
shader_setup_from_background(kg, &sd, &ray);
/* evaluate */
int flag = 0; /* we can't know which type of BSDF this is for */
out = shader_eval_background(kg, &sd, flag);
}
/* write output */
output[i] = out;
}
CCL_NAMESPACE_END

@ -47,11 +47,11 @@ void kernel_cpu_optimized_tonemap(KernelGlobals *kg, uchar4 *rgba, float4 *buffe
kernel_film_tonemap(kg, rgba, buffer, sample, resolution, x, y, offset, stride);
}
/* Displacement */
/* Shader Evaluate */
void kernel_cpu_optimized_displace(KernelGlobals *kg, uint4 *input, float3 *offset, int i)
void kernel_cpu_optimized_shader(KernelGlobals *kg, uint4 *input, float3 *output, int type, int i)
{
kernel_displace(kg, input, offset, i);
kernel_shader_evaluate(kg, input, output, (ShaderEvalType)type, i);
}
CCL_NAMESPACE_END

@ -78,6 +78,13 @@ CCL_NAMESPACE_BEGIN
//#define __MODIFY_TP__
//#define __QBVH__
/* Shader Evaluation */
enum ShaderEvalType {
SHADER_EVAL_DISPLACE,
SHADER_EVAL_BACKGROUND
};
/* Path Tracing */
enum PathTraceDimension {

@ -89,25 +89,26 @@ bool MeshManager::displace(Device *device, Scene *scene, Mesh *mesh, Progress& p
return false;
/* run device task */
device_vector<float3> d_offset;
d_offset.resize(d_input.size());
device_vector<float3> d_output;
d_output.resize(d_input.size());
device->mem_alloc(d_input, MEM_READ_ONLY);
device->mem_copy_to(d_input);
device->mem_alloc(d_offset, MEM_WRITE_ONLY);
device->mem_alloc(d_output, MEM_WRITE_ONLY);
DeviceTask task(DeviceTask::DISPLACE);
task.displace_input = d_input.device_pointer;
task.displace_offset = d_offset.device_pointer;
task.displace_x = 0;
task.displace_w = d_input.size();
DeviceTask task(DeviceTask::SHADER);
task.shader_input = d_input.device_pointer;
task.shader_output = d_output.device_pointer;
task.shader_eval_type = SHADER_EVAL_DISPLACE;
task.shader_x = 0;
task.shader_w = d_input.size();
device->task_add(task);
device->task_wait();
device->mem_copy_from(d_offset, 0, sizeof(float3)*d_offset.size());
device->mem_copy_from(d_output, 0, sizeof(float3)*d_output.size());
device->mem_free(d_input);
device->mem_free(d_offset);
device->mem_free(d_output);
if(progress.get_cancel())
return false;
@ -117,7 +118,7 @@ bool MeshManager::displace(Device *device, Scene *scene, Mesh *mesh, Progress& p
done.resize(mesh->verts.size(), false);
int k = 0;
float3 *offset = (float3*)d_offset.data_pointer;
float3 *offset = (float3*)d_output.data_pointer;
for(size_t i = 0; i < mesh->triangles.size(); i++) {
Mesh::Triangle t = mesh->triangles[i];

@ -38,6 +38,7 @@ class DataPathBuilder(object):
""" Dummy class used to parse fcurve and driver data paths.
"""
__slots__ = ("data_path", )
def __init__(self, attrs):
self.data_path = attrs

@ -145,11 +145,11 @@ def draw(layout, context, context_member, property_type, use_edit=True):
if use_edit:
row = split.row(align=True)
prop = row.operator("wm.properties_edit", text="edit")
assign_props(prop, val_draw, key)
props = row.operator("wm.properties_edit", text="edit")
assign_props(props, val_draw, key)
prop = row.operator("wm.properties_remove", text="", icon='ZOOMOUT')
assign_props(prop, val_draw, key)
props = row.operator("wm.properties_remove", text="", icon='ZOOMOUT')
assign_props(props, val_draw, key)
class PropertyPanel():

@ -0,0 +1,300 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# Contributor(s): Campbell Barton
#
# ***** END GPL LICENSE BLOCK *****
# <pep8 compliant>
import bpy
def build_property_typemap(skip_classes):
property_typemap = {}
for attr in dir(bpy.types):
cls = getattr(bpy.types, attr)
if issubclass(cls, skip_classes):
continue
properties = cls.bl_rna.properties.keys()
properties.remove("rna_type")
property_typemap[attr] = properties
return property_typemap
def print_ln(data):
print(data, end="")
def rna2xml(fw=print_ln,
root_node="",
root_rna=None, # must be set
root_rna_skip=set(),
ident_val=" ",
skip_classes=(bpy.types.Operator,
bpy.types.Panel,
bpy.types.KeyingSet,
bpy.types.Header,
),
pretty_format=True,
method='DATA'):
from xml.sax.saxutils import quoteattr
property_typemap = build_property_typemap(skip_classes)
def number_to_str(val, val_type):
if val_type == int:
return "%d" % val
elif val_type == float:
return "%.6g" % val
elif val_type == bool:
return "TRUE" if val else "FALSE"
else:
raise NotImplemented("this type is not a number %s" % val_type)
def rna2xml_node(ident, value, parent):
ident_next = ident + ident_val
# divide into attrs and nodes.
node_attrs = []
nodes_items = []
nodes_lists = []
value_type = type(value)
if issubclass(value_type, skip_classes):
return
# XXX, fixme, pointcache has eternal nested pointer to its self.
if value == parent:
return
value_type_name = value_type.__name__
for prop in property_typemap[value_type_name]:
subvalue = getattr(value, prop)
subvalue_type = type(subvalue)
if subvalue_type in (int, bool, float):
node_attrs.append("%s=\"%s\"" % (prop, number_to_str(subvalue, subvalue_type)))
elif subvalue_type is str:
node_attrs.append("%s=%s" % (prop, quoteattr(subvalue)))
elif subvalue_type == set:
node_attrs.append("%s=%s" % (prop, quoteattr("{" + ",".join(list(subvalue)) + "}")))
elif subvalue is None:
node_attrs.append("%s=\"NONE\"" % prop)
elif issubclass(subvalue_type, bpy.types.ID):
# special case, ID's are always referenced.
node_attrs.append("%s=%s" % (prop, quoteattr(subvalue_type.__name__ + "::" + subvalue.name)))
else:
try:
subvalue_ls = list(subvalue)
except:
subvalue_ls = None
if subvalue_ls is None:
nodes_items.append((prop, subvalue, subvalue_type))
else:
# check if the list contains native types
subvalue_rna = value.path_resolve(prop, False)
if type(subvalue_rna).__name__ == "bpy_prop_array":
# check if this is a 0-1 color (rgb, rgba)
# in that case write as a hexidecimal
prop_rna = value.bl_rna.properties[prop]
if (prop_rna.subtype == 'COLOR_GAMMA' and
prop_rna.hard_min == 0.0 and
prop_rna.hard_max == 1.0 and
prop_rna.array_length in {3, 4}):
# -----
# color
array_value = "#" + "".join(("%.2x" % int(v * 255) for v in subvalue_rna))
else:
# default
def str_recursive(s):
subsubvalue_type = type(s)
if subsubvalue_type in (int, float, bool):
return number_to_str(s, subsubvalue_type)
else:
return " ".join([str_recursive(si) for si in s])
array_value = " ".join(str_recursive(v) for v in subvalue_rna)
node_attrs.append("%s=\"%s\"" % (prop, array_value))
else:
nodes_lists.append((prop, subvalue_ls, subvalue_type))
# declare + attributes
if pretty_format:
tmp_str = "<%s " % value_type_name
tmp_ident = "\n" + ident + (" " * len(tmp_str))
fw("%s%s%s>\n" % (ident, tmp_str, tmp_ident.join(node_attrs)))
del tmp_str
del tmp_ident
else:
fw("%s<%s %s>\n" % (ident, value_type_name, " ".join(node_attrs)))
# unique members
for prop, subvalue, subvalue_type in nodes_items:
fw("%s<%s>\n" % (ident_next, prop)) # XXX, this is awkward, how best to solve?
rna2xml_node(ident_next + ident_val, subvalue, value)
fw("%s</%s>\n" % (ident_next, prop)) # XXX, need to check on this.
# list members
for prop, subvalue, subvalue_type in nodes_lists:
fw("%s<%s>\n" % (ident_next, prop))
for subvalue_item in subvalue:
if subvalue_item is not None:
rna2xml_node(ident_next + ident_val, subvalue_item, value)
fw("%s</%s>\n" % (ident_next, prop))
fw("%s</%s>\n" % (ident, value_type_name))
# -------------------------------------------------------------------------
# needs re-workign to be generic
if root_node:
fw("<%s>\n" % root_node)
# bpy.data
if method == 'DATA':
for attr in dir(root_rna):
# exceptions
if attr.startswith("_"):
continue
elif attr in root_rna_skip:
continue
value = getattr(root_rna, attr)
try:
ls = value[:]
except:
ls = None
if type(ls) == list:
fw("%s<%s>\n" % (ident_val, attr))
for blend_id in ls:
rna2xml_node(ident_val + ident_val, blend_id, None)
fw("%s</%s>\n" % (ident_val, attr))
# any attribute
elif method == 'ATTR':
rna2xml_node("", root_rna, None)
if root_node:
fw("</%s>\n" % root_node)
def xml2rna(root_xml,
root_rna=None, # must be set
):
def rna2xml_node(xml_node, value):
# print("evaluating:", xml_node.nodeName)
# ---------------------------------------------------------------------
# Simple attributes
for attr in xml_node.attributes.keys():
# print(" ", attr)
subvalue = getattr(value, attr, Ellipsis)
if subvalue is Ellipsis:
print("%s.%s not found" % (type(value).__name__, attr))
else:
value_xml = xml_node.attributes[attr].value
subvalue_type = type(subvalue)
tp_name = 'UNKNOWN'
if subvalue_type == float:
value_xml_coerce = float(value_xml)
tp_name = 'FLOAT'
elif subvalue_type == int:
value_xml_coerce = int(value_xml)
tp_name = 'INT'
elif subvalue_type == bool:
value_xml_coerce = {'TRUE': True, 'FALSE': False}[value_xml]
tp_name = 'BOOL'
elif subvalue_type == str:
value_xml_coerce = value_xml
tp_name = 'STR'
elif hasattr(subvalue, "__len__"):
if value_xml.startswith("#"):
# read hexidecimal value as float array
value_xml_split = value_xml[1:]
value_xml_coerce = [int(value_xml_split[i:i + 2], 16) / 255 for i in range(0, len(value_xml_split), 2)]
del value_xml_split
else:
value_xml_split = value_xml.split()
try:
value_xml_coerce = [int(v) for v in value_xml_split]
except ValueError:
value_xml_coerce = [float(v) for v in value_xml_split]
del value_xml_split
tp_name = 'ARRAY'
# print(" %s.%s (%s) --- %s" % (type(value).__name__, attr, tp_name, subvalue_type))
setattr(value, attr, value_xml_coerce)
# ---------------------------------------------------------------------
# Complex attributes
for child_xml in xml_node.childNodes:
if child_xml.nodeType == child_xml.ELEMENT_NODE:
# print()
# print(child_xml.nodeName)
subvalue = getattr(value, child_xml.nodeName, None)
if subvalue is not None:
elems = []
for child_xml_real in child_xml.childNodes:
if child_xml_real.nodeType == child_xml_real.ELEMENT_NODE:
elems.append(child_xml_real)
del child_xml_real
if hasattr(subvalue, "__len__"):
# Collection
if len(elems) != len(subvalue):
print("Size Mismatch! collection:", child_xml.nodeName)
else:
for i in range(len(elems)):
child_xml_real = elems[i]
subsubvalue = subvalue[i]
if child_xml_real is None or subsubvalue is None:
print("None found %s - %d collection:", (child_xml.nodeName, i))
else:
rna2xml_node(child_xml_real, subsubvalue)
else:
# print(elems)
if len(elems) == 1:
# sub node named by its type
child_xml_real, = elems
# print(child_xml_real, subvalue)
rna2xml_node(child_xml_real, subvalue)
else:
# empty is valid too
pass
rna2xml_node(root_xml, root_rna)

@ -32,6 +32,7 @@ from rna_prop_ui import rna_idprop_ui_prop_get, rna_idprop_ui_prop_clear
import subprocess
import os
class MESH_OT_delete_edgeloop(Operator):
'''Delete an edge loop by merging the faces on each side to a single face loop'''
bl_idname = "mesh.delete_edgeloop"
@ -501,9 +502,9 @@ class WM_MT_context_menu_enum(Menu):
values = [(i.name, i.identifier) for i in value_base.bl_rna.properties[prop_string].enum_items]
for name, identifier in values:
prop = self.layout.operator("wm.context_set_enum", text=name)
prop.data_path = data_path
prop.value = identifier
props = self.layout.operator("wm.context_set_enum", text=name)
props.data_path = data_path
props.value = identifier
class WM_OT_context_menu_enum(Operator):
@ -1176,6 +1177,7 @@ class WM_OT_copy_prev_settings(Operator):
return {'CANCELLED'}
class WM_OT_blenderplayer_start(bpy.types.Operator):
'''Launch the Blenderplayer with the current blendfile'''
bl_idname = "wm.blenderplayer_start"
@ -1197,6 +1199,7 @@ class WM_OT_blenderplayer_start(bpy.types.Operator):
subprocess.call([self.player_path, filepath])
return {'FINISHED'}
class WM_OT_keyconfig_test(Operator):
"Test keyconfig for conflicts"
bl_idname = "wm.keyconfig_test"
@ -1463,6 +1466,9 @@ class WM_OT_operator_cheat_sheet(Operator):
return {'FINISHED'}
# -----------------------------------------------------------------------------
# Addon Operators
class WM_OT_addon_enable(Operator):
"Enable an addon"
bl_idname = "wm.addon_enable"
@ -1762,3 +1768,61 @@ class WM_OT_addon_expand(Operator):
info = addon_utils.module_bl_info(mod)
info["show_expanded"] = not info["show_expanded"]
return {'FINISHED'}
# -----------------------------------------------------------------------------
# Theme IO
from bpy_extras.io_utils import (ImportHelper,
ExportHelper,
)
class WM_OT_theme_import(Operator, ImportHelper):
bl_idname = "wm.theme_import"
bl_label = "Import Theme"
bl_options = {'REGISTER', 'UNDO'}
filename_ext = ".xml"
filter_glob = StringProperty(default="*.xml", options={'HIDDEN'})
def execute(self, context):
import rna_xml
import xml.dom.minidom
filepath = self.filepath
xml_nodes = xml.dom.minidom.parse(filepath)
theme_xml = xml_nodes.getElementsByTagName("Theme")[0]
# XXX, why always 0?, allow many?
theme = context.user_preferences.themes[0]
rna_xml.xml2rna(theme_xml,
root_rna=theme,
)
return {'FINISHED'}
class WM_OT_theme_export(Operator, ExportHelper):
bl_idname = "wm.theme_export"
bl_label = "Export Theme"
filename_ext = ".xml"
filter_glob = StringProperty(default="*.xml", options={'HIDDEN'})
def execute(self, context):
import rna_xml
filepath = self.filepath
file = open(filepath, 'w', encoding='utf-8')
# XXX, why always 0?, allow many?
theme = context.user_preferences.themes[0]
rna_xml.rna2xml(file.write,
root_rna=theme,
method='ATTR',
)
return {'FINISHED'}

@ -247,6 +247,7 @@ class RenderButtonsPanel():
class RENDER_PT_embedded(RenderButtonsPanel, bpy.types.Panel):
bl_label = "Embedded Player"
COMPAT_ENGINES = {'BLENDER_GAME'}
def draw(self, context):
layout = self.layout
@ -288,7 +289,6 @@ class RENDER_PT_game_player(RenderButtonsPanel, Panel):
col.prop(gs, "frequency", text="Refresh Rate", slider=False)
class RENDER_PT_game_stereo(RenderButtonsPanel, Panel):
bl_label = "Stereo"
COMPAT_ENGINES = {'BLENDER_GAME'}
@ -476,6 +476,7 @@ class SCENE_PT_game_navmesh(SceneButtonsPanel, Panel):
row.prop(rd, "sample_dist")
row.prop(rd, "sample_max_error")
class RENDER_PT_game_sound(RenderButtonsPanel, Panel):
bl_label = "Sound"
COMPAT_ENGINES = {'BLENDER_GAME'}
@ -491,6 +492,7 @@ class RENDER_PT_game_sound(RenderButtonsPanel, Panel):
col.prop(scene, "audio_doppler_speed", text="Speed")
col.prop(scene, "audio_doppler_factor")
class WorldButtonsPanel():
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'

@ -181,9 +181,9 @@ class OBJECT_PT_groups(ObjectButtonsPanel, Panel):
col = split.column()
col.prop(group, "dupli_offset", text="")
prop = col.operator("wm.context_set_value", text="From Cursor")
prop.data_path = "object.users_group[%d].dupli_offset" % index
prop.value = value
props = col.operator("wm.context_set_value", text="From Cursor")
props.data_path = "object.users_group[%d].dupli_offset" % index
props.value = value
index += 1

@ -298,34 +298,34 @@ class IMAGE_MT_uvs_select_mode(Menu):
# do smart things depending on whether uv_select_sync is on
if toolsettings.use_uv_select_sync:
prop = layout.operator("wm.context_set_value", text="Vertex", icon='VERTEXSEL')
prop.value = "(True, False, False)"
prop.data_path = "tool_settings.mesh_select_mode"
props = layout.operator("wm.context_set_value", text="Vertex", icon='VERTEXSEL')
props.value = "(True, False, False)"
props.data_path = "tool_settings.mesh_select_mode"
prop = layout.operator("wm.context_set_value", text="Edge", icon='EDGESEL')
prop.value = "(False, True, False)"
prop.data_path = "tool_settings.mesh_select_mode"
props = layout.operator("wm.context_set_value", text="Edge", icon='EDGESEL')
props.value = "(False, True, False)"
props.data_path = "tool_settings.mesh_select_mode"
prop = layout.operator("wm.context_set_value", text="Face", icon='FACESEL')
prop.value = "(False, False, True)"
prop.data_path = "tool_settings.mesh_select_mode"
props = layout.operator("wm.context_set_value", text="Face", icon='FACESEL')
props.value = "(False, False, True)"
props.data_path = "tool_settings.mesh_select_mode"
else:
prop = layout.operator("wm.context_set_string", text="Vertex", icon='UV_VERTEXSEL')
prop.value = 'VERTEX'
prop.data_path = "tool_settings.uv_select_mode"
props = layout.operator("wm.context_set_string", text="Vertex", icon='UV_VERTEXSEL')
props.value = 'VERTEX'
props.data_path = "tool_settings.uv_select_mode"
prop = layout.operator("wm.context_set_string", text="Edge", icon='UV_EDGESEL')
prop.value = 'EDGE'
prop.data_path = "tool_settings.uv_select_mode"
props = layout.operator("wm.context_set_string", text="Edge", icon='UV_EDGESEL')
props.value = 'EDGE'
props.data_path = "tool_settings.uv_select_mode"
prop = layout.operator("wm.context_set_string", text="Face", icon='UV_FACESEL')
prop.value = 'FACE'
prop.data_path = "tool_settings.uv_select_mode"
props = layout.operator("wm.context_set_string", text="Face", icon='UV_FACESEL')
props.value = 'FACE'
props.data_path = "tool_settings.uv_select_mode"
prop = layout.operator("wm.context_set_string", text="Island", icon='UV_ISLANDSEL')
prop.value = 'ISLAND'
prop.data_path = "tool_settings.uv_select_mode"
props = layout.operator("wm.context_set_string", text="Island", icon='UV_ISLANDSEL')
props.value = 'ISLAND'
props.data_path = "tool_settings.uv_select_mode"
class IMAGE_HT_header(Header):

@ -89,13 +89,15 @@ class USERPREF_HT_header(Header):
layout.operator_context = 'INVOKE_DEFAULT'
if userpref.active_section == 'INPUT':
layout.operator("wm.keyconfig_export")
layout.operator("wm.keyconfig_import")
layout.operator("wm.keyconfig_export")
elif userpref.active_section == 'ADDONS':
layout.operator("wm.addon_install")
layout.menu("USERPREF_MT_addons_dev_guides")
elif userpref.active_section == 'THEMES':
layout.operator("ui.reset_default_theme")
layout.operator("wm.theme_import")
layout.operator("wm.theme_export")
class USERPREF_PT_tabs(Panel):

@ -1524,17 +1524,17 @@ class VIEW3D_MT_edit_mesh_select_mode(Menu):
layout.operator_context = 'INVOKE_REGION_WIN'
prop = layout.operator("wm.context_set_value", text="Vertex", icon='VERTEXSEL')
prop.value = "(True, False, False)"
prop.data_path = "tool_settings.mesh_select_mode"
props = layout.operator("wm.context_set_value", text="Vertex", icon='VERTEXSEL')
props.value = "(True, False, False)"
props.data_path = "tool_settings.mesh_select_mode"
prop = layout.operator("wm.context_set_value", text="Edge", icon='EDGESEL')
prop.value = "(False, True, False)"
prop.data_path = "tool_settings.mesh_select_mode"
props = layout.operator("wm.context_set_value", text="Edge", icon='EDGESEL')
props.value = "(False, True, False)"
props.data_path = "tool_settings.mesh_select_mode"
prop = layout.operator("wm.context_set_value", text="Face", icon='FACESEL')
prop.value = "(False, False, True)"
prop.data_path = "tool_settings.mesh_select_mode"
props = layout.operator("wm.context_set_value", text="Face", icon='FACESEL')
props.value = "(False, False, True)"
props.data_path = "tool_settings.mesh_select_mode"
class VIEW3D_MT_edit_mesh_extrude(Menu):

@ -1198,9 +1198,9 @@ class VIEW3D_MT_tools_projectpaint_clone(Menu):
def draw(self, context):
layout = self.layout
for i, tex in enumerate(context.active_object.data.uv_textures):
prop = layout.operator("wm.context_set_int", text=tex.name)
prop.data_path = "active_object.data.uv_texture_clone_index"
prop.value = i
props = layout.operator("wm.context_set_int", text=tex.name)
props.data_path = "active_object.data.uv_texture_clone_index"
props.value = i
class VIEW3D_MT_tools_projectpaint_stencil(Menu):
@ -1209,9 +1209,9 @@ class VIEW3D_MT_tools_projectpaint_stencil(Menu):
def draw(self, context):
layout = self.layout
for i, tex in enumerate(context.active_object.data.uv_textures):
prop = layout.operator("wm.context_set_int", text=tex.name)
prop.data_path = "active_object.data.uv_texture_stencil_index"
prop.value = i
props = layout.operator("wm.context_set_int", text=tex.name)
props.data_path = "active_object.data.uv_texture_stencil_index"
props.value = i
class VIEW3D_PT_tools_particlemode(View3DPanel, Panel):

@ -52,7 +52,7 @@ float bvhtree_ray_tri_intersection(const BVHTreeRay *ray, const float UNUSED(m_d
{
float dist;
if(isect_ray_tri_v3(ray->origin, ray->direction, v0, v1, v2, &dist, NULL))
if(isect_ray_tri_epsilon_v3(ray->origin, ray->direction, v0, v1, v2, &dist, NULL, FLT_EPSILON))
return dist;
return FLT_MAX;

@ -52,7 +52,7 @@ static unsigned int _ehash_hashsizes[]= {
/* ensure v0 is smaller */
#define EDGE_ORD(v0, v1) \
if (v0 < v1) { \
if (v0 > v1) { \
v0 ^= v1; \
v1 ^= v0; \
v0 ^= v1; \

@ -1,6 +1,4 @@
/*
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or

@ -1,6 +1,4 @@
/*
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or

@ -585,9 +585,9 @@ extern StructRNA RNA_VoxelData;
extern StructRNA RNA_VoxelDataTexture;
extern StructRNA RNA_WarpModifier;
extern StructRNA RNA_WaveModifier;
extern StructRNA RNA_WeightVGEditModifier;
extern StructRNA RNA_WeightVGMixModifier;
extern StructRNA RNA_WeightVGProximityModifier;
extern StructRNA RNA_VertexWeightEditModifier;
extern StructRNA RNA_VertexWeightMixModifier;
extern StructRNA RNA_VertexWeightProximityModifier;
extern StructRNA RNA_Window;
extern StructRNA RNA_WindowManager;
extern StructRNA RNA_WipeSequence;

@ -48,6 +48,11 @@
# endif
#endif
/* so we can use __func__ everywhere */
#if defined(_MSC_VER)
# define __func__ __FUNCTION__
#endif
/* Replace if different */
#define TMP_EXT ".tmp"
@ -448,11 +453,9 @@ static int rna_enum_bitmask(PropertyRNA *prop)
static int rna_color_quantize(PropertyRNA *prop, PropertyDefRNA *dp)
{
if(prop->type == PROP_FLOAT && (prop->subtype==PROP_COLOR || prop->subtype==PROP_COLOR_GAMMA))
if(strcmp(dp->dnatype, "float") != 0 && strcmp(dp->dnatype, "double") != 0)
return 1;
return 0;
return ( (prop->type == PROP_FLOAT) &&
(prop->subtype==PROP_COLOR || prop->subtype==PROP_COLOR_GAMMA) &&
(IS_DNATYPE_FLOAT_COMPAT(dp->dnatype) == 0) );
}
static const char *rna_function_string(void *func)
@ -484,7 +487,8 @@ static char *rna_def_property_get_func(FILE *f, StructRNA *srna, PropertyRNA *pr
if(!manualfunc) {
if(!dp->dnastructname || !dp->dnaname) {
fprintf(stderr, "rna_def_property_get_func: %s.%s has no valid dna info.\n", srna->identifier, prop->identifier);
fprintf(stderr, "%s (0): %s.%s has no valid dna info.\n",
__func__, srna->identifier, prop->identifier);
DefRNA.error= 1;
return NULL;
}
@ -495,7 +499,8 @@ static char *rna_def_property_get_func(FILE *f, StructRNA *srna, PropertyRNA *pr
if(prop->type == PROP_FLOAT) {
if(IS_DNATYPE_FLOAT_COMPAT(dp->dnatype) == 0) {
if(prop->subtype != PROP_COLOR_GAMMA) { /* colors are an exception. these get translated */
fprintf(stderr, "rna_def_property_get_func1: %s.%s is a '%s' but wrapped as type '%s'.\n", srna->identifier, prop->identifier, dp->dnatype, RNA_property_typename(prop->type));
fprintf(stderr, "%s (1): %s.%s is a '%s' but wrapped as type '%s'.\n",
__func__, srna->identifier, prop->identifier, dp->dnatype, RNA_property_typename(prop->type));
DefRNA.error= 1;
return NULL;
}
@ -503,7 +508,8 @@ static char *rna_def_property_get_func(FILE *f, StructRNA *srna, PropertyRNA *pr
}
else if(prop->type == PROP_INT || prop->type == PROP_BOOLEAN || prop->type == PROP_ENUM) {
if(IS_DNATYPE_INT_COMPAT(dp->dnatype) == 0) {
fprintf(stderr, "rna_def_property_get_func2: %s.%s is a '%s' but wrapped as type '%s'.\n", srna->identifier, prop->identifier, dp->dnatype, RNA_property_typename(prop->type));
fprintf(stderr, "%s (2): %s.%s is a '%s' but wrapped as type '%s'.\n",
__func__, srna->identifier, prop->identifier, dp->dnatype, RNA_property_typename(prop->type));
DefRNA.error= 1;
return NULL;
}
@ -724,7 +730,8 @@ static char *rna_def_property_set_func(FILE *f, StructRNA *srna, PropertyRNA *pr
if(!manualfunc) {
if(!dp->dnastructname || !dp->dnaname) {
if(prop->flag & PROP_EDITABLE) {
fprintf(stderr, "rna_def_property_set_func: %s.%s has no valid dna info.\n", srna->identifier, prop->identifier);
fprintf(stderr, "%s: %s.%s has no valid dna info.\n",
__func__, srna->identifier, prop->identifier);
DefRNA.error= 1;
}
return NULL;
@ -902,7 +909,8 @@ static char *rna_def_property_length_func(FILE *f, StructRNA *srna, PropertyRNA
if(prop->type == PROP_STRING) {
if(!manualfunc) {
if(!dp->dnastructname || !dp->dnaname) {
fprintf(stderr, "rna_def_property_length_func: %s.%s has no valid dna info.\n", srna->identifier, prop->identifier);
fprintf(stderr, "%s: %s.%s has no valid dna info.\n",
__func__, srna->identifier, prop->identifier);
DefRNA.error= 1;
return NULL;
}
@ -924,7 +932,8 @@ static char *rna_def_property_length_func(FILE *f, StructRNA *srna, PropertyRNA
else if(prop->type == PROP_COLLECTION) {
if(!manualfunc) {
if(prop->type == PROP_COLLECTION && (!(dp->dnalengthname || dp->dnalengthfixed)|| !dp->dnaname)) {
fprintf(stderr, "rna_def_property_length_func: %s.%s has no valid dna info.\n", srna->identifier, prop->identifier);
fprintf(stderr, "%s: %s.%s has no valid dna info.\n",
__func__, srna->identifier, prop->identifier);
DefRNA.error= 1;
return NULL;
}
@ -959,7 +968,8 @@ static char *rna_def_property_begin_func(FILE *f, StructRNA *srna, PropertyRNA *
if(!manualfunc) {
if(!dp->dnastructname || !dp->dnaname) {
fprintf(stderr, "rna_def_property_begin_func: %s.%s has no valid dna info.\n", srna->identifier, prop->identifier);
fprintf(stderr, "%s: %s.%s has no valid dna info.\n",
__func__, srna->identifier, prop->identifier);
DefRNA.error= 1;
return NULL;
}
@ -1270,7 +1280,8 @@ static void rna_def_property_funcs(FILE *f, StructRNA *srna, PropertyDefRNA *dp)
pprop->get= (void*)rna_def_property_get_func(f, srna, prop, dp, (const char*)pprop->get);
pprop->set= (void*)rna_def_property_set_func(f, srna, prop, dp, (const char*)pprop->set);
if(!pprop->type) {
fprintf(stderr, "rna_def_property_funcs: %s.%s, pointer must have a struct type.\n", srna->identifier, prop->identifier);
fprintf(stderr, "%s: %s.%s, pointer must have a struct type.\n",
__func__, srna->identifier, prop->identifier);
DefRNA.error= 1;
}
break;
@ -1298,20 +1309,24 @@ static void rna_def_property_funcs(FILE *f, StructRNA *srna, PropertyDefRNA *dp)
if(!(prop->flag & PROP_IDPROPERTY)) {
if(!cprop->begin) {
fprintf(stderr, "rna_def_property_funcs: %s.%s, collection must have a begin function.\n", srna->identifier, prop->identifier);
fprintf(stderr, "%s: %s.%s, collection must have a begin function.\n",
__func__, srna->identifier, prop->identifier);
DefRNA.error= 1;
}
if(!cprop->next) {
fprintf(stderr, "rna_def_property_funcs: %s.%s, collection must have a next function.\n", srna->identifier, prop->identifier);
fprintf(stderr, "%s: %s.%s, collection must have a next function.\n",
__func__, srna->identifier, prop->identifier);
DefRNA.error= 1;
}
if(!cprop->get) {
fprintf(stderr, "rna_def_property_funcs: %s.%s, collection must have a get function.\n", srna->identifier, prop->identifier);
fprintf(stderr, "%s: %s.%s, collection must have a get function.\n",
__func__, srna->identifier, prop->identifier);
DefRNA.error= 1;
}
}
if(!cprop->item_type) {
fprintf(stderr, "rna_def_property_funcs: %s.%s, collection must have a struct type.\n", srna->identifier, prop->identifier);
fprintf(stderr, "%s: %s.%s, collection must have a struct type.\n",
__func__, srna->identifier, prop->identifier);
DefRNA.error= 1;
}
break;
@ -2136,19 +2151,22 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr
if(prop->flag & PROP_ENUM_FLAG) {
if(eprop->defaultvalue & ~totflag) {
fprintf(stderr, "rna_generate_structs: %s%s.%s, enum default includes unused bits (%d).\n", srna->identifier, errnest, prop->identifier, eprop->defaultvalue & ~totflag);
fprintf(stderr, "%s: %s%s.%s, enum default includes unused bits (%d).\n",
__func__, srna->identifier, errnest, prop->identifier, eprop->defaultvalue & ~totflag);
DefRNA.error= 1;
}
}
else {
if(!defaultfound) {
fprintf(stderr, "rna_generate_structs: %s%s.%s, enum default is not in items.\n", srna->identifier, errnest, prop->identifier);
fprintf(stderr, "%s: %s%s.%s, enum default is not in items.\n",
__func__, srna->identifier, errnest, prop->identifier);
DefRNA.error= 1;
}
}
}
else {
fprintf(stderr, "rna_generate_structs: %s%s.%s, enum must have items defined.\n", srna->identifier, errnest, prop->identifier);
fprintf(stderr, "%s: %s%s.%s, enum must have items defined.\n",
__func__, srna->identifier, errnest, prop->identifier);
DefRNA.error= 1;
}
break;
@ -2421,7 +2439,8 @@ static void rna_generate_struct(BlenderRNA *brna, StructRNA *srna, FILE *f)
fprintf(f, "\t%s,\n", rna_function_string(srna->idproperties));
if(srna->reg && !srna->refine) {
fprintf(stderr, "rna_generate_struct: %s has a register function, must also have refine function.\n", srna->identifier);
fprintf(stderr, "%s: %s has a register function, must also have refine function.\n",
__func__, srna->identifier);
DefRNA.error= 1;
}
@ -2841,7 +2860,7 @@ static int rna_preprocess(const char *outfile)
file = fopen(deffile, "w");
if(!file) {
printf ("Unable to open file: %s\n", deffile);
fprintf(stderr, "Unable to open file: %s\n", deffile);
status = 1;
}
else {
@ -2869,7 +2888,7 @@ static int rna_preprocess(const char *outfile)
file = fopen(deffile, "w");
if(!file) {
printf ("Unable to open file: %s\n", deffile);
fprintf(stderr, "Unable to open file: %s\n", deffile);
status = 1;
}
else {
@ -2898,7 +2917,7 @@ static int rna_preprocess(const char *outfile)
file = fopen(deffile, "w");
if(!file) {
printf ("Unable to open file: %s\n", deffile);
fprintf(stderr, "Unable to open file: %s\n", deffile);
status = 1;
}
else {
@ -2928,18 +2947,18 @@ int main(int argc, char **argv)
int totblock, return_status = 0;
if(argc<2) {
printf("Usage: %s outdirectory/\n", argv[0]);
fprintf(stderr, "Usage: %s outdirectory/\n", argv[0]);
return_status = 1;
}
else {
printf("Running makesrna, program versions %s\n", RNA_VERSION_DATE);
fprintf(stderr, "Running makesrna, program versions %s\n", RNA_VERSION_DATE);
makesrna_path= argv[0];
return_status= rna_preprocess(argv[1]);
}
totblock= MEM_get_memory_blocks_in_use();
if(totblock!=0) {
printf("Error Totblock: %d\n",totblock);
fprintf(stderr, "Error Totblock: %d\n",totblock);
MEM_set_error_callback(mem_error_cb);
MEM_printmemlist();
}

@ -1628,6 +1628,7 @@ void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const
void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, const char *propname)
{
PropertyDefRNA *dp;
FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop;
StructRNA *srna= DefRNA.laststruct;
if(!DefRNA.preprocess) {
@ -1652,6 +1653,11 @@ void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, cons
}
}
}
if(dp->dnatype && strcmp(dp->dnatype, "char") == 0) {
fprop->hardmin= fprop->softmin= 0.0f;
fprop->hardmax= fprop->softmax= 1.0f;
}
}
rna_def_property_sdna(prop, structname, propname);

@ -798,8 +798,8 @@ static DerivedMesh * explodeMesh(ExplodeModifierData *emd,
/* float timestep; */
int *facepa=emd->facepa;
int totdup=0,totvert=0,totface=0,totpart=0;
int i, v, mindex=0;
unsigned int ed_v1, ed_v2;
int i, v;
unsigned int ed_v1, ed_v2, mindex=0;
MTFace *mtface = NULL, *mtf;
totface= dm->getNumTessFaces(dm);

@ -1,6 +1,4 @@
/*
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
@ -20,7 +18,6 @@
* The Original Code is Copyright (C) 2011 by Nicholas Bishop.
*
* ***** END GPL LICENSE BLOCK *****
*
*/
/** \file blender/modifiers/intern/MOD_remesh.c
@ -152,7 +149,7 @@ static DerivedMesh *applyModifier(ModifierData *md,
DualConInput input;
DerivedMesh *result;
DualConFlags flags = 0;
DualConMode mode;
DualConMode mode = 0;
rmd = (RemeshModifierData*)md;