diff options
Diffstat (limited to 'source/blender/makesrna')
62 files changed, 3550 insertions, 1630 deletions
diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index ea7451ee77a..ca3ac62ba00 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -213,6 +213,11 @@ extern StructRNA RNA_GameSoftBodySettings; extern StructRNA RNA_GameStringProperty; extern StructRNA RNA_GameTimerProperty; extern StructRNA RNA_GlowSequence; +extern StructRNA RNA_GreasePencil; +extern StructRNA RNA_GPencilLayer; +extern StructRNA RNA_GPencilFrame; +extern StructRNA RNA_GPencilStroke; +extern StructRNA RNA_GPencilStrokePoint; extern StructRNA RNA_Group; extern StructRNA RNA_Header; extern StructRNA RNA_HemiLamp; @@ -581,9 +586,10 @@ PropertyUnit RNA_property_unit(PropertyRNA *prop); int RNA_property_flag(PropertyRNA *prop); int RNA_property_array_length(PointerRNA *ptr, PropertyRNA *prop); -int RNA_property_dynamic_array_set_length(PointerRNA *ptr, PropertyRNA *prop, int length); +int RNA_property_array_check(PointerRNA *ptr, PropertyRNA *prop); +int RNA_property_multi_array_length(PointerRNA *ptr, PropertyRNA *prop, int dimension); +int RNA_property_array_dimension(PointerRNA *ptr, PropertyRNA *prop, int length[]); char RNA_property_array_item_char(PropertyRNA *prop, int index); -unsigned short RNA_property_array_dimension(PropertyRNA *prop, unsigned short dim_size[]); int RNA_property_string_maxlength(PropertyRNA *prop); diff --git a/source/blender/makesrna/RNA_define.h b/source/blender/makesrna/RNA_define.h index 1c6837bbcc8..595562503aa 100644 --- a/source/blender/makesrna/RNA_define.h +++ b/source/blender/makesrna/RNA_define.h @@ -72,6 +72,8 @@ typedef void StructOrFunctionRNA; PropertyRNA *RNA_def_boolean(StructOrFunctionRNA *cont, const char *identifier, int default_value, const char *ui_name, const char *ui_description); PropertyRNA *RNA_def_boolean_array(StructOrFunctionRNA *cont, const char *identifier, int len, int *default_value, const char *ui_name, const char *ui_description); +PropertyRNA *RNA_def_boolean_layer(StructOrFunctionRNA *cont, const char *identifier, int len, int *default_value, const char *ui_name, const char *ui_description); +PropertyRNA *RNA_def_boolean_layer_member(StructOrFunctionRNA *cont, const char *identifier, int len, int *default_value, const char *ui_name, const char *ui_description); PropertyRNA *RNA_def_boolean_vector(StructOrFunctionRNA *cont, const char *identifier, int len, int *default_value, const char *ui_name, const char *ui_description); PropertyRNA *RNA_def_int(StructOrFunctionRNA *cont, const char *identifier, int default_value, int hardmin, int hardmax, const char *ui_name, const char *ui_description, int softmin, int softmax); @@ -81,6 +83,7 @@ PropertyRNA *RNA_def_int_array(StructOrFunctionRNA *cont, const char *identifier PropertyRNA *RNA_def_string(StructOrFunctionRNA *cont, const char *identifier, const char *default_value, int maxlen, const char *ui_name, const char *ui_description); PropertyRNA *RNA_def_string_file_path(StructOrFunctionRNA *cont, const char *identifier, const char *default_value, int maxlen, const char *ui_name, const char *ui_description); PropertyRNA *RNA_def_string_dir_path(StructOrFunctionRNA *cont, const char *identifier, const char *default_value, int maxlen, const char *ui_name, const char *ui_description); +PropertyRNA *RNA_def_string_file_name(StructOrFunctionRNA *cont, const char *identifier, const char *default_value, int maxlen, const char *ui_name, const char *ui_description); PropertyRNA *RNA_def_enum(StructOrFunctionRNA *cont, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description); void RNA_def_enum_funcs(PropertyRNA *prop, EnumPropertyItemFunc itemfunc); @@ -88,7 +91,7 @@ void RNA_def_enum_funcs(PropertyRNA *prop, EnumPropertyItemFunc itemfunc); PropertyRNA *RNA_def_float(StructOrFunctionRNA *cont, const char *identifier, float default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax); PropertyRNA *RNA_def_float_vector(StructOrFunctionRNA *cont, const char *identifier, int len, const float *default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax); PropertyRNA *RNA_def_float_color(StructOrFunctionRNA *cont, const char *identifier, int len, const float *default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax); -PropertyRNA *RNA_def_float_matrix(StructOrFunctionRNA *cont, const char *identifier, int len, int rowsize, const float *default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax); +PropertyRNA *RNA_def_float_matrix(StructOrFunctionRNA *cont, const char *identifier, int rows, int columns, const float *default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax); PropertyRNA *RNA_def_float_rotation(StructOrFunctionRNA *cont, const char *identifier, int len, const float *default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax); PropertyRNA *RNA_def_float_array(StructOrFunctionRNA *cont, const char *identifier, int len, const float *default_value, @@ -126,8 +129,8 @@ void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname, void RNA_def_property_flag(PropertyRNA *prop, int flag); void RNA_def_property_clear_flag(PropertyRNA *prop, int flag); -void RNA_def_property_array(PropertyRNA *prop, int arraylength); -void RNA_def_property_multidimensional_array(PropertyRNA *prop, int arraylength, unsigned short arraydimension, unsigned short dimsize[]); +void RNA_def_property_array(PropertyRNA *prop, int length); +void RNA_def_property_multi_array(PropertyRNA *prop, int dimension, int length[]); void RNA_def_property_range(PropertyRNA *prop, double min, double max); void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item); @@ -151,7 +154,7 @@ void RNA_def_property_ui_icon(PropertyRNA *prop, int icon, int consecutive); void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *updatefunc); void RNA_def_property_editable_func(PropertyRNA *prop, const char *editable); -void RNA_def_property_dynamic_array_funcs(PropertyRNA *prop, const char *getlength, const char *setlength); +void RNA_def_property_dynamic_array_funcs(PropertyRNA *prop, const char *getlength); void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const char *set); void RNA_def_property_int_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range); void RNA_def_property_float_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range); diff --git a/source/blender/makesrna/RNA_enum_types.h b/source/blender/makesrna/RNA_enum_types.h index 06be0e69be5..ccf4b7a2db3 100644 --- a/source/blender/makesrna/RNA_enum_types.h +++ b/source/blender/makesrna/RNA_enum_types.h @@ -38,6 +38,7 @@ extern EnumPropertyItem modifier_type_items[]; extern EnumPropertyItem constraint_type_items[]; extern EnumPropertyItem boidrule_type_items[]; +extern EnumPropertyItem beztriple_keyframe_type_items[]; extern EnumPropertyItem beztriple_handle_type_items[]; extern EnumPropertyItem beztriple_interpolation_mode_items[]; @@ -53,6 +54,10 @@ extern EnumPropertyItem event_type_items[]; extern EnumPropertyItem brush_sculpt_tool_items[]; +extern EnumPropertyItem unpack_method_items[]; + +extern EnumPropertyItem object_type_items[]; + #endif /* RNA_ENUM_TYPES */ diff --git a/source/blender/makesrna/RNA_types.h b/source/blender/makesrna/RNA_types.h index 1acbfb21385..e7fe86afd03 100644 --- a/source/blender/makesrna/RNA_types.h +++ b/source/blender/makesrna/RNA_types.h @@ -89,6 +89,7 @@ typedef enum PropertySubType { /* strings */ PROP_FILEPATH = 1, PROP_DIRPATH = 2, + PROP_FILENAME = 3, /* numbers */ PROP_UNSIGNED = 13, @@ -111,6 +112,10 @@ typedef enum PropertySubType { /* pointers */ PROP_NEVER_NULL = 30, + + /* booleans */ + PROP_LAYER = 40, + PROP_LAYER_MEMBER = 41 } PropertySubType; typedef enum PropertyFlag { @@ -176,11 +181,11 @@ typedef struct CollectionPointerLink { } CollectionPointerLink; typedef enum RawPropertyType { - PROP_RAW_CHAR, + PROP_RAW_INT, // XXX - abused for types that are not set, eg. MFace.verts, needs fixing. PROP_RAW_SHORT, - PROP_RAW_INT, - PROP_RAW_FLOAT, - PROP_RAW_DOUBLE + PROP_RAW_CHAR, + PROP_RAW_DOUBLE, + PROP_RAW_FLOAT } RawPropertyType; typedef struct RawArray { diff --git a/source/blender/makesrna/SConscript b/source/blender/makesrna/SConscript index 8a4f3912814..6234bd8d2af 100644 --- a/source/blender/makesrna/SConscript +++ b/source/blender/makesrna/SConscript @@ -37,4 +37,7 @@ if env['WITH_BF_LCMS']: if env['WITH_BF_GAMEENGINE']: defs.append('GAMEBLENDER=1') -env.BlenderLib ( 'bf_rna', objs, Split(incs), defines=defs, libtype=['core'], priority = [195] ) +if env['BF_UNIT_TEST']: + defs.append('UNIT_TEST') + +env.BlenderLib ( 'bf_rna', objs, Split(incs), defines=defs, libtype=['core','player'], priority = [165,20] ) diff --git a/source/blender/makesrna/intern/CMakeLists.txt b/source/blender/makesrna/intern/CMakeLists.txt index 50f48b0b683..b68f48c3194 100644 --- a/source/blender/makesrna/intern/CMakeLists.txt +++ b/source/blender/makesrna/intern/CMakeLists.txt @@ -32,58 +32,70 @@ LIST(REMOVE_ITEM DEFSRC ${APISRC}) STRING(REGEX REPLACE "rna_([a-zA-Z0-9_-]*).c" "${CMAKE_CURRENT_BINARY_DIR}/rna_\\1_gen.c" GENSRC "${DEFSRC}") SET(SRC - makesrna.c - rna_define.c - ${DEFSRC} - ${APISRC} - ../../../../intern/guardedalloc/intern/mallocn.c - ../../../../intern/guardedalloc/intern/mmap_win.c) + makesrna.c + rna_define.c + ${DEFSRC} + ${APISRC} + ../../../../intern/guardedalloc/intern/mallocn.c + ../../../../intern/guardedalloc/intern/mmap_win.c) INCLUDE_DIRECTORIES(../../../../intern/guardedalloc .. ../../makesdna ../../blenkernel ../../blenlib ../../windowmanager ../../editors/include ../../imbuf ../../render/extern/include ../../bmesh .) FILE(GLOB INC_FILES ../*.h ../../makesdna/*.h) IF(WITH_GAMEENGINE) - ADD_DEFINITIONS(-DGAMEBLENDER) + ADD_DEFINITIONS(-DGAMEBLENDER) ENDIF(WITH_GAMEENGINE) IF(WITH_OPENEXR) - ADD_DEFINITIONS(-DWITH_OPENEXR) + ADD_DEFINITIONS(-DWITH_OPENEXR) ENDIF(WITH_OPENEXR) IF(WITH_OPENJPEG) - ADD_DEFINITIONS(-DWITH_OPENJPEG) + ADD_DEFINITIONS(-DWITH_OPENJPEG) ENDIF(WITH_OPENJPEG) IF(WITH_DDS) - ADD_DEFINITIONS(-DWITH_DDS) + ADD_DEFINITIONS(-DWITH_DDS) ENDIF(WITH_DDS) IF(WITH_QUICKTIME) - ADD_DEFINITIONS(-DWITH_QUICKTIME) + ADD_DEFINITIONS(-DWITH_QUICKTIME) ENDIF(WITH_QUICKTIME) IF(WITH_FFMPEG) - SET(INC ${INC} ${FFMPEG_INC}) - ADD_DEFINITIONS(-DWITH_FFMPEG) + SET(INC ${INC} ${FFMPEG_INC}) + ADD_DEFINITIONS(-DWITH_FFMPEG) ENDIF(WITH_FFMPEG) IF(NOT WITH_ELBEEM) - ADD_DEFINITIONS(-DDISABLE_ELBEEM) + ADD_DEFINITIONS(-DDISABLE_ELBEEM) ENDIF(NOT WITH_ELBEEM) IF(WITH_FFTW3) - ADD_DEFINITIONS(-DFFTW3=1) + ADD_DEFINITIONS(-DFFTW3=1) ENDIF(WITH_FFTW3) +IF(WITH_SDL) + ADD_DEFINITIONS(-DWITH_SDL) +ENDIF(WITH_SDL) + +IF(WITH_OPENAL) + ADD_DEFINITIONS(-DWITH_OPENAL) +ENDIF(WITH_OPENAL) + +IF(WITH_JACK) + ADD_DEFINITIONS(-DWITH_JACK) +ENDIF(WITH_JACK) + # Build makesrna executable ADD_EXECUTABLE(makesrna ${SRC} ${INC_FILES}) TARGET_LINK_LIBRARIES(makesrna bf_dna) # Output rna_*_gen.c ADD_CUSTOM_COMMAND( - OUTPUT ${GENSRC} - COMMAND ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/makesrna ${CMAKE_CURRENT_BINARY_DIR}/ - DEPENDS makesrna + OUTPUT ${GENSRC} + COMMAND ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/makesrna ${CMAKE_CURRENT_BINARY_DIR}/ + DEPENDS makesrna ) # Build bf_rna diff --git a/source/blender/makesrna/intern/Makefile b/source/blender/makesrna/intern/Makefile index a2268e11aa2..a1e824de657 100644 --- a/source/blender/makesrna/intern/Makefile +++ b/source/blender/makesrna/intern/Makefile @@ -78,6 +78,18 @@ ifeq ($(WITH_QUICKTIME), true) CPPFLAGS += -DWITH_QUICKTIME endif +ifeq ($(WITH_SDL),true) + CPPFLAGS += -DWITH_SDL +endif + +ifeq ($(WITH_JACK),true) + CPPFLAGS += -DWITH_JACK +endif + +ifeq ($(WITH_OPENAL),true) + CPPFLAGS += -DWITH_OPENAL +endif + ifeq ($(OS),windows) # Windows needs these extra libs because of winstuff... It is not # _really_ needed, but it is the easiest fix for now. If you have diff --git a/source/blender/makesrna/intern/SConscript b/source/blender/makesrna/intern/SConscript index 4313ff3bec1..19d6af3e9eb 100644 --- a/source/blender/makesrna/intern/SConscript +++ b/source/blender/makesrna/intern/SConscript @@ -6,7 +6,7 @@ def normpath(path): return os.path.abspath(os.path.normpath(path)) Import ('env') -cflags = '-Wall' +cflags = ['-Wall'] defines = [] root_build_dir=normpath(env['BF_BUILDDIR']) @@ -62,6 +62,18 @@ if env['WITH_BF_GAMEENGINE']: if env['WITH_BF_FFTW3']: defs.append('FFTW3=1') +if env['WITH_BF_SDL']: + defs.append('WITH_SDL') + +if env['WITH_BF_OPENAL']: + defs.append('WITH_OPENAL') + +if env['WITH_BF_JACK']: + defs.append('WITH_JACK') + +if env['BF_UNIT_TEST']: + defs.append('UNIT_TEST') + makesrna_tool.Append(CPPDEFINES=defs) makesrna_tool.Append (CPPPATH = Split(incs)) @@ -87,6 +99,10 @@ if not (root_build_dir[0]==os.sep or root_build_dir[1]==':'): makesrna_tool.Append (LIBPATH = libdir) +makesrna_tool.Append( CFLAGS = env['CFLAGS']) +makesrna_tool.Append( CCFLAGS = env['CCFLAGS']) +makesrna_tool.Append( LINKFLAGS = env['PLATFORM_LINKFLAGS']) + if env['BF_PROFILE']: makesrna_tool.Append (LINKFLAGS = env['BF_PROFILE_FLAGS']) diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index 0c90a28a0e9..d0c7824dc9d 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -306,11 +306,10 @@ static void rna_int_print(FILE *f, int num) static char *rna_def_property_get_func(FILE *f, StructRNA *srna, PropertyRNA *prop, PropertyDefRNA *dp, const char *manualfunc) { char *func; - int i; if(prop->flag & PROP_IDPROPERTY) return NULL; - + 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); @@ -373,8 +372,11 @@ static char *rna_def_property_get_func(FILE *f, StructRNA *srna, PropertyRNA *pr break; } default: - if(prop->arraylength) { - fprintf(f, "void %s(PointerRNA *ptr, %s values[%d])\n", func, rna_type_type(prop), prop->arraylength); + if(prop->arraydimension) { + if(prop->flag & PROP_DYNAMIC) + fprintf(f, "void %s(PointerRNA *ptr, %s values[])\n", func, rna_type_type(prop)); + else + fprintf(f, "void %s(PointerRNA *ptr, %s values[%d])\n", func, rna_type_type(prop), prop->totarraylength); fprintf(f, "{\n"); if(manualfunc) { @@ -383,27 +385,38 @@ static char *rna_def_property_get_func(FILE *f, StructRNA *srna, PropertyRNA *pr else { rna_print_data_get(f, dp); - for(i=0; i<prop->arraylength; i++) { - if(dp->dnaarraylength == 1) { - if(prop->type == PROP_BOOLEAN && dp->booleanbit) - fprintf(f, " values[%d]= (%s(data->%s & (%d<<%d)) != 0);\n", i, (dp->booleannegative)? "!": "", dp->dnaname, dp->booleanbit, i); - else - fprintf(f, " values[%d]= (%s)%s((&data->%s)[%d]);\n", i, rna_type_type(prop), (dp->booleannegative)? "!": "", dp->dnaname, i); - } - else { - if(prop->type == PROP_BOOLEAN && dp->booleanbit) { - fprintf(f, " values[%d]= (%s(data->%s[%d] & ", i, (dp->booleannegative)? "!": "", dp->dnaname, i); - rna_int_print(f, dp->booleanbit); - fprintf(f, ") != 0);\n"); - } - else if(rna_color_quantize(prop, dp)) - fprintf(f, " values[%d]= (%s)(data->%s[%d]*(1.0f/255.0f));\n", i, rna_type_type(prop), dp->dnaname, i); - else if(dp->dnatype) - fprintf(f, " values[%d]= (%s)%s(((%s*)data->%s)[%d]);\n", i, rna_type_type(prop), (dp->booleannegative)? "!": "", dp->dnatype, dp->dnaname, i); - else - fprintf(f, " values[%d]= (%s)%s((data->%s)[%d]);\n", i, rna_type_type(prop), (dp->booleannegative)? "!": "", dp->dnaname, i); + if(prop->flag & PROP_DYNAMIC) { + char *lenfunc= rna_alloc_function_name(srna->identifier, prop->identifier, "get_length"); + fprintf(f, " int i, arraylen[RNA_MAX_ARRAY_DIMENSION];\n"); + fprintf(f, " int len= %s(ptr, arraylen);\n\n", lenfunc); + fprintf(f, " for(i=0; i<len; i++) {\n"); + MEM_freeN(lenfunc); + } + else { + fprintf(f, " int i;\n\n"); + fprintf(f, " for(i=0; i<%d; i++) {\n", prop->totarraylength); + } + + if(dp->dnaarraylength == 1) { + if(prop->type == PROP_BOOLEAN && dp->booleanbit) + fprintf(f, " values[i]= (%s(data->%s & (%d<<i)) != 0);\n", (dp->booleannegative)? "!": "", dp->dnaname, dp->booleanbit); + else + fprintf(f, " values[i]= (%s)%s((&data->%s)[i]);\n", rna_type_type(prop), (dp->booleannegative)? "!": "", dp->dnaname); + } + else { + if(prop->type == PROP_BOOLEAN && dp->booleanbit) { + fprintf(f, " values[i]= (%s(data->%s[i] & ", (dp->booleannegative)? "!": "", dp->dnaname); + rna_int_print(f, dp->booleanbit); + fprintf(f, ") != 0);\n"); } + else if(rna_color_quantize(prop, dp)) + fprintf(f, " values[i]= (%s)(data->%s[i]*(1.0f/255.0f));\n", rna_type_type(prop), dp->dnaname); + else if(dp->dnatype) + fprintf(f, " values[i]= (%s)%s(((%s*)data->%s)[i]);\n", rna_type_type(prop), (dp->booleannegative)? "!": "", dp->dnatype, dp->dnaname); + else + fprintf(f, " values[i]= (%s)%s((data->%s)[i]);\n", rna_type_type(prop), (dp->booleannegative)? "!": "", dp->dnaname); } + fprintf(f, " }\n"); } fprintf(f, "}\n\n"); } @@ -438,13 +451,13 @@ static char *rna_def_property_get_func(FILE *f, StructRNA *srna, PropertyRNA *pr return func; } -static void rna_clamp_value(FILE *f, PropertyRNA *prop, int array, int i) +static void rna_clamp_value(FILE *f, PropertyRNA *prop, int array) { if(prop->type == PROP_INT) { IntPropertyRNA *iprop= (IntPropertyRNA*)prop; if(iprop->hardmin != INT_MIN || iprop->hardmax != INT_MAX) { - if(array) fprintf(f, "CLAMPIS(values[%d], ", i); + if(array) fprintf(f, "CLAMPIS(values[i], "); else fprintf(f, "CLAMPIS(value, "); rna_int_print(f, iprop->hardmin); fprintf(f, ", "); rna_int_print(f, iprop->hardmax); fprintf(f, ");\n"); @@ -455,7 +468,7 @@ static void rna_clamp_value(FILE *f, PropertyRNA *prop, int array, int i) FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop; if(fprop->hardmin != -FLT_MAX || fprop->hardmax != FLT_MAX) { - if(array) fprintf(f, "CLAMPIS(values[%d], ", i); + if(array) fprintf(f, "CLAMPIS(values[i], "); else fprintf(f, "CLAMPIS(value, "); rna_float_print(f, fprop->hardmin); fprintf(f, ", "); rna_float_print(f, fprop->hardmax); fprintf(f, ");\n"); @@ -464,7 +477,7 @@ static void rna_clamp_value(FILE *f, PropertyRNA *prop, int array, int i) } if(array) - fprintf(f, "values[%d];\n", i); + fprintf(f, "values[i];\n"); else fprintf(f, "value;\n"); } @@ -472,7 +485,6 @@ static void rna_clamp_value(FILE *f, PropertyRNA *prop, int array, int i) static char *rna_def_property_set_func(FILE *f, StructRNA *srna, PropertyRNA *prop, PropertyDefRNA *dp, char *manualfunc) { char *func; - int i; if(!(prop->flag & PROP_EDITABLE)) return NULL; @@ -532,8 +544,11 @@ static char *rna_def_property_set_func(FILE *f, StructRNA *srna, PropertyRNA *pr break; } default: - if(prop->arraylength) { - fprintf(f, "void %s(PointerRNA *ptr, const %s values[%d])\n", func, rna_type_type(prop), prop->arraylength); + if(prop->arraydimension) { + if(prop->flag & PROP_DYNAMIC) + fprintf(f, "void %s(PointerRNA *ptr, const %s values[])\n", func, rna_type_type(prop)); + else + fprintf(f, "void %s(PointerRNA *ptr, const %s values[%d])\n", func, rna_type_type(prop), prop->totarraylength); fprintf(f, "{\n"); if(manualfunc) { @@ -542,38 +557,49 @@ static char *rna_def_property_set_func(FILE *f, StructRNA *srna, PropertyRNA *pr else { rna_print_data_get(f, dp); - for(i=0; i<prop->arraylength; i++) { - if(dp->dnaarraylength == 1) { - if(prop->type == PROP_BOOLEAN && dp->booleanbit) { - fprintf(f, " if(%svalues[%d]) data->%s |= (%d<<%d);\n", (dp->booleannegative)? "!": "", i, dp->dnaname, dp->booleanbit, i); - fprintf(f, " else data->%s &= ~(%d<<%d);\n", dp->dnaname, dp->booleanbit, i); - } - else { - fprintf(f, " (&data->%s)[%d]= %s", dp->dnaname, i, (dp->booleannegative)? "!": ""); - rna_clamp_value(f, prop, 1, i); - } + if(prop->flag & PROP_DYNAMIC) { + char *lenfunc= rna_alloc_function_name(srna->identifier, prop->identifier, "set_length"); + fprintf(f, " int i, arraylen[RNA_MAX_ARRAY_DIMENSION];\n"); + fprintf(f, " int len= %s(ptr, arraylen);\n\n", lenfunc); + fprintf(f, " for(i=0; i<len; i++) {\n"); + MEM_freeN(lenfunc); + } + else { + fprintf(f, " int i;\n\n"); + fprintf(f, " for(i=0; i<%d; i++) {\n", prop->totarraylength); + } + + if(dp->dnaarraylength == 1) { + if(prop->type == PROP_BOOLEAN && dp->booleanbit) { + fprintf(f, " if(%svalues[i]) data->%s |= (%d<<i);\n", (dp->booleannegative)? "!": "", dp->dnaname, dp->booleanbit); + fprintf(f, " else data->%s &= ~(%d<<i);\n", dp->dnaname, dp->booleanbit); + } + else { + fprintf(f, " (&data->%s)[i]= %s", dp->dnaname, (dp->booleannegative)? "!": ""); + rna_clamp_value(f, prop, 1); + } + } + else { + if(prop->type == PROP_BOOLEAN && dp->booleanbit) { + fprintf(f, " if(%svalues[i]) data->%s[i] |= ", (dp->booleannegative)? "!": "", dp->dnaname); + rna_int_print(f, dp->booleanbit); + fprintf(f, ";\n"); + fprintf(f, " else data->%s[i] &= ~", dp->dnaname); + rna_int_print(f, dp->booleanbit); + fprintf(f, ";\n"); + } + else if(rna_color_quantize(prop, dp)) { + fprintf(f, " data->%s[i]= FTOCHAR(values[i]);\n", dp->dnaname); } else { - if(prop->type == PROP_BOOLEAN && dp->booleanbit) { - fprintf(f, " if(%svalues[%d]) data->%s[%d] |= ", (dp->booleannegative)? "!": "", i, dp->dnaname, i); - rna_int_print(f, dp->booleanbit); - fprintf(f, ";\n"); - fprintf(f, " else data->%s[%d] &= ~", dp->dnaname, i); - rna_int_print(f, dp->booleanbit); - fprintf(f, ";\n"); - } - else if(rna_color_quantize(prop, dp)) { - fprintf(f, " data->%s[%d]= FTOCHAR(values[%d]);\n", dp->dnaname, i, i); - } - else { - if(dp->dnatype) - fprintf(f, " ((%s*)data->%s)[%d]= %s", dp->dnatype, dp->dnaname, i, (dp->booleannegative)? "!": ""); - else - fprintf(f, " (data->%s)[%d]= %s", dp->dnaname, i, (dp->booleannegative)? "!": ""); - rna_clamp_value(f, prop, 1, i); - } + if(dp->dnatype) + fprintf(f, " ((%s*)data->%s)[i]= %s", dp->dnatype, dp->dnaname, (dp->booleannegative)? "!": ""); + else + fprintf(f, " (data->%s)[i]= %s", dp->dnaname, (dp->booleannegative)? "!": ""); + rna_clamp_value(f, prop, 1); } } + fprintf(f, " }\n"); } fprintf(f, "}\n\n"); } @@ -602,7 +628,7 @@ static char *rna_def_property_set_func(FILE *f, StructRNA *srna, PropertyRNA *pr } else { fprintf(f, " data->%s= %s", dp->dnaname, (dp->booleannegative)? "!": ""); - rna_clamp_value(f, prop, 0, 0); + rna_clamp_value(f, prop, 0); } } fprintf(f, "}\n\n"); @@ -819,7 +845,7 @@ static void rna_def_property_funcs(FILE *f, StructRNA *srna, PropertyDefRNA *dp) case PROP_BOOLEAN: { BooleanPropertyRNA *bprop= (BooleanPropertyRNA*)prop; - if(!prop->arraylength) { + if(!prop->arraydimension) { if(!bprop->get && !bprop->set && !dp->booleanbit) rna_set_raw_property(dp, prop); @@ -835,7 +861,7 @@ static void rna_def_property_funcs(FILE *f, StructRNA *srna, PropertyDefRNA *dp) case PROP_INT: { IntPropertyRNA *iprop= (IntPropertyRNA*)prop; - if(!prop->arraylength) { + if(!prop->arraydimension) { if(!iprop->get && !iprop->set) rna_set_raw_property(dp, prop); @@ -854,7 +880,7 @@ static void rna_def_property_funcs(FILE *f, StructRNA *srna, PropertyDefRNA *dp) case PROP_FLOAT: { FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop; - if(!prop->arraylength) { + if(!prop->arraydimension) { if(!fprop->get && !fprop->set) rna_set_raw_property(dp, prop); @@ -953,23 +979,23 @@ static void rna_def_property_funcs_header(FILE *f, StructRNA *srna, PropertyDefR switch(prop->type) { case PROP_BOOLEAN: case PROP_INT: { - if(!prop->arraylength) { + if(!prop->arraydimension) { fprintf(f, "int %sget(PointerRNA *ptr);\n", func); //fprintf(f, "void %sset(PointerRNA *ptr, int value);\n", func); } else { - fprintf(f, "void %sget(PointerRNA *ptr, int values[%d]);\n", func, prop->arraylength); + fprintf(f, "void %sget(PointerRNA *ptr, int values[%d]);\n", func, prop->totarraylength); //fprintf(f, "void %sset(PointerRNA *ptr, const int values[%d]);\n", func, prop->arraylength); } break; } case PROP_FLOAT: { - if(!prop->arraylength) { + if(!prop->arraydimension) { fprintf(f, "float %sget(PointerRNA *ptr);\n", func); //fprintf(f, "void %sset(PointerRNA *ptr, float value);\n", func); } else { - fprintf(f, "void %sget(PointerRNA *ptr, float values[%d]);\n", func, prop->arraylength); + fprintf(f, "void %sget(PointerRNA *ptr, float values[%d]);\n", func, prop->totarraylength); //fprintf(f, "void %sset(PointerRNA *ptr, const float values[%d]);\n", func, prop->arraylength); } break; @@ -1043,24 +1069,24 @@ static void rna_def_property_funcs_header_cpp(FILE *f, StructRNA *srna, Property switch(prop->type) { case PROP_BOOLEAN: { - if(!prop->arraylength) + if(!prop->arraydimension) fprintf(f, "\tbool %s(void);", prop->identifier); else - fprintf(f, "\tArray<int, %d> %s(void);", prop->arraylength, prop->identifier); + fprintf(f, "\tArray<int, %d> %s(void);", prop->totarraylength, prop->identifier); break; } case PROP_INT: { - if(!prop->arraylength) + if(!prop->arraydimension) fprintf(f, "\tint %s(void);", prop->identifier); else - fprintf(f, "\tArray<int, %d> %s(void);", prop->arraylength, prop->identifier); + fprintf(f, "\tArray<int, %d> %s(void);", prop->totarraylength, prop->identifier); break; } case PROP_FLOAT: { - if(!prop->arraylength) + if(!prop->arraydimension) fprintf(f, "\tfloat %s(void);", prop->identifier); else - fprintf(f, "\tArray<float, %d> %s(void);", prop->arraylength, prop->identifier); + fprintf(f, "\tArray<float, %d> %s(void);", prop->totarraylength, prop->identifier); break; } case PROP_ENUM: { @@ -1118,24 +1144,24 @@ static void rna_def_property_funcs_impl_cpp(FILE *f, StructRNA *srna, PropertyDe switch(prop->type) { case PROP_BOOLEAN: { - if(!prop->arraylength) + if(!prop->arraydimension) fprintf(f, "\tBOOLEAN_PROPERTY(%s, %s)", srna->identifier, prop->identifier); else - fprintf(f, "\tBOOLEAN_ARRAY_PROPERTY(%s, %d, %s)", srna->identifier, prop->arraylength, prop->identifier); + fprintf(f, "\tBOOLEAN_ARRAY_PROPERTY(%s, %d, %s)", srna->identifier, prop->totarraylength, prop->identifier); break; } case PROP_INT: { - if(!prop->arraylength) + if(!prop->arraydimension) fprintf(f, "\tINT_PROPERTY(%s, %s)", srna->identifier, prop->identifier); else - fprintf(f, "\tINT_ARRAY_PROPERTY(%s, %d, %s)", srna->identifier, prop->arraylength, prop->identifier); + fprintf(f, "\tINT_ARRAY_PROPERTY(%s, %d, %s)", srna->identifier, prop->totarraylength, prop->identifier); break; } case PROP_FLOAT: { - if(!prop->arraylength) + if(!prop->arraydimension) fprintf(f, "\tFLOAT_PROPERTY(%s, %s)", srna->identifier, prop->identifier); else - fprintf(f, "\tFLOAT_ARRAY_PROPERTY(%s, %d, %s)", srna->identifier, prop->arraylength, prop->identifier); + fprintf(f, "\tFLOAT_ARRAY_PROPERTY(%s, %d, %s)", srna->identifier, prop->totarraylength, prop->identifier); break; } case PROP_ENUM: { @@ -1198,7 +1224,7 @@ static void rna_def_function_funcs(FILE *f, StructDefRNA *dsrna, FunctionDefRNA dparm= dfunc->cont.properties.first; for(; dparm; dparm= dparm->next) { - if(dparm->prop->arraylength > 0) + if(dparm->prop->arraydimension) ptrstr= "*"; else if(dparm->prop==func->ret) ptrstr= ((dparm->prop->type == PROP_POINTER) && !(dparm->prop->flag & PROP_RNAPTR))? "*": ""; @@ -1225,7 +1251,7 @@ static void rna_def_function_funcs(FILE *f, StructDefRNA *dsrna, FunctionDefRNA for(; dparm; dparm= dparm->next) { if(dparm->prop==func->ret) fprintf(f, "\t_retdata= _data;\n"); - else if(dparm->prop->arraylength) + else if(dparm->prop->arraydimension) fprintf(f, "\t%s= ((%s%s*)_data);\n", dparm->prop->identifier, rna_type_struct(dparm->prop), rna_parameter_type_name(dparm->prop)); else if(dparm->prop->type == PROP_POINTER) { if(dparm->prop->flag & PROP_RNAPTR) @@ -1280,7 +1306,7 @@ static void rna_def_function_funcs(FILE *f, StructDefRNA *dsrna, FunctionDefRNA if(func->ret) { dparm= rna_find_parameter_def(func->ret); - ptrstr= (((dparm->prop->type == PROP_POINTER) && !(dparm->prop->flag & PROP_RNAPTR)) || (dparm->prop->arraylength > 0))? "*": ""; + ptrstr= (((dparm->prop->type == PROP_POINTER) && !(dparm->prop->flag & PROP_RNAPTR)) || (dparm->prop->arraydimension))? "*": ""; fprintf(f, "\t*((%s%s%s*)_retdata)= %s;\n", rna_type_struct(dparm->prop), rna_parameter_type_name(dparm->prop), ptrstr, func->ret->identifier); } } @@ -1394,6 +1420,8 @@ static const char *rna_property_subtypename(PropertyType type) case PROP_XYZ: return "PROP_XYZ"; case PROP_RGB: return "PROP_RGB"; case PROP_NEVER_NULL: return "PROP_NEVER_NULL"; + case PROP_LAYER: return "PROP_LAYER"; + case PROP_LAYER_MEMBER: return "PROP_LAYER_MEMBER"; default: { /* incase we dont have a type preset that includes the subtype */ if(RNA_SUBTYPE_UNIT(type)) { @@ -1520,7 +1548,7 @@ static void rna_generate_static_parameter_prototypes(BlenderRNA *brna, StructRNA /* return type */ for(dparm= dfunc->cont.properties.first; dparm; dparm= dparm->next) { if(dparm->prop==func->ret) { - if(dparm->prop->arraylength) + if(dparm->prop->arraydimension) fprintf(f, "XXX no array return types yet"); /* XXX not supported */ else if(dparm->prop->type == PROP_POINTER && !(dparm->prop->flag & PROP_RNAPTR)) fprintf(f, "%s%s *", rna_type_struct(dparm->prop), rna_parameter_type_name(dparm->prop)); @@ -1567,8 +1595,8 @@ static void rna_generate_static_parameter_prototypes(BlenderRNA *brna, StructRNA if(!first) fprintf(f, ", "); first= 0; - if(dparm->prop->arraylength) - fprintf(f, "%s%s %s[%d]", rna_type_struct(dparm->prop), rna_parameter_type_name(dparm->prop), dparm->prop->identifier, dparm->prop->arraylength); + if(dparm->prop->arraydimension) + fprintf(f, "%s%s %s[%d]", rna_type_struct(dparm->prop), rna_parameter_type_name(dparm->prop), dparm->prop->identifier, dparm->prop->totarraylength); else if(dparm->prop->type == PROP_POINTER) fprintf(f, "%s%s *%s", rna_type_struct(dparm->prop), rna_parameter_type_name(dparm->prop), dparm->prop->identifier); else @@ -1651,15 +1679,15 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr BooleanPropertyRNA *bprop= (BooleanPropertyRNA*)prop; unsigned int i; - if(prop->arraylength) { - fprintf(f, "static int rna_%s%s_%s_default[%d] = {", srna->identifier, strnest, prop->identifier, prop->arraylength); + if(prop->arraydimension && prop->totarraylength) { + fprintf(f, "static int rna_%s%s_%s_default[%d] = {", srna->identifier, strnest, prop->identifier, prop->totarraylength); - for(i=0; i<prop->arraylength; i++) { + for(i=0; i<prop->totarraylength; i++) { if(bprop->defaultarray) fprintf(f, "%d", bprop->defaultarray[i]); else fprintf(f, "%d", bprop->defaultvalue); - if(i != prop->arraylength-1) + if(i != prop->totarraylength-1) fprintf(f, ", "); } @@ -1671,15 +1699,15 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr IntPropertyRNA *iprop= (IntPropertyRNA*)prop; unsigned int i; - if(prop->arraylength) { - fprintf(f, "static int rna_%s%s_%s_default[%d] = {", srna->identifier, strnest, prop->identifier, prop->arraylength); + if(prop->arraydimension && prop->totarraylength) { + fprintf(f, "static int rna_%s%s_%s_default[%d] = {", srna->identifier, strnest, prop->identifier, prop->totarraylength); - for(i=0; i<prop->arraylength; i++) { + for(i=0; i<prop->totarraylength; i++) { if(iprop->defaultarray) fprintf(f, "%d", iprop->defaultarray[i]); else fprintf(f, "%d", iprop->defaultvalue); - if(i != prop->arraylength-1) + if(i != prop->totarraylength-1) fprintf(f, ", "); } @@ -1691,15 +1719,15 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop; unsigned int i; - if(prop->arraylength) { - fprintf(f, "static float rna_%s%s_%s_default[%d] = {", srna->identifier, strnest, prop->identifier, prop->arraylength); + if(prop->arraydimension && prop->totarraylength) { + fprintf(f, "static float rna_%s%s_%s_default[%d] = {", srna->identifier, strnest, prop->identifier, prop->totarraylength); - for(i=0; i<prop->arraylength; i++) { + for(i=0; i<prop->totarraylength; i++) { if(fprop->defaultarray) rna_float_print(f, fprop->defaultarray[i]); else rna_float_print(f, fprop->defaultvalue); - if(i != prop->arraylength-1) + if(i != prop->totarraylength-1) fprintf(f, ", "); } @@ -1723,15 +1751,7 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr rna_print_c_string(f, prop->name); fprintf(f, ",\n\t"); rna_print_c_string(f, prop->description); fprintf(f, ",\n\t"); fprintf(f, "%d,\n", prop->icon); - fprintf(f, "\t%s, %s|%s, %d,\n", rna_property_typename(prop->type), rna_property_subtypename(prop->subtype), rna_property_subtype_unit(prop->subtype), prop->arraylength); - { - int i; - int tot= sizeof(prop->dimsize) / sizeof(prop->dimsize[0]); - fprintf(f, "\t%s, %s, %d, {", rna_function_string(prop->getlength), rna_function_string(prop->setlength), (int)prop->arraydimension); - for(i= 0; i < tot; i++) { - fprintf(f, i == tot - 1 ? "%d},\n" : "%d, ", (int)prop->dimsize[i]); - } - } + fprintf(f, "\t%s, %s|%s, %s, %d, {%d, %d, %d}, %d,\n", rna_property_typename(prop->type), rna_property_subtypename(prop->subtype), rna_property_subtype_unit(prop->subtype), rna_function_string(prop->getlength), prop->arraydimension, prop->arraylength[0], prop->arraylength[1], prop->arraylength[2], prop->totarraylength); fprintf(f, "\t%s, %d, %s,\n", rna_function_string(prop->update), prop->noteflag, rna_function_string(prop->editable)); if(prop->flag & PROP_RAW_ACCESS) rna_set_raw_offset(f, srna, prop); @@ -1742,7 +1762,7 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr case PROP_BOOLEAN: { BooleanPropertyRNA *bprop= (BooleanPropertyRNA*)prop; fprintf(f, "\t%s, %s, %s, %s, %d, ", rna_function_string(bprop->get), rna_function_string(bprop->set), rna_function_string(bprop->getarray), rna_function_string(bprop->setarray), bprop->defaultvalue); - if(prop->arraylength) fprintf(f, "rna_%s%s_%s_default\n", srna->identifier, strnest, prop->identifier); + if(prop->arraydimension && prop->totarraylength) fprintf(f, "rna_%s%s_%s_default\n", srna->identifier, strnest, prop->identifier); else fprintf(f, "NULL\n"); break; } @@ -1755,7 +1775,7 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr rna_int_print(f, iprop->hardmax); fprintf(f, ", "); rna_int_print(f, iprop->step); fprintf(f, ", "); rna_int_print(f, iprop->defaultvalue); fprintf(f, ", "); - if(prop->arraylength) fprintf(f, "rna_%s%s_%s_default\n", srna->identifier, strnest, prop->identifier); + if(prop->arraydimension && prop->totarraylength) fprintf(f, "rna_%s%s_%s_default\n", srna->identifier, strnest, prop->identifier); else fprintf(f, "NULL\n"); break; } @@ -1769,7 +1789,7 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr rna_float_print(f, fprop->step); fprintf(f, ", "); rna_int_print(f, (int)fprop->precision); fprintf(f, ", "); rna_float_print(f, fprop->defaultvalue); fprintf(f, ", "); - if(prop->arraylength) fprintf(f, "rna_%s%s_%s_default\n", srna->identifier, strnest, prop->identifier); + if(prop->arraydimension && prop->totarraylength) fprintf(f, "rna_%s%s_%s_default\n", srna->identifier, strnest, prop->identifier); else fprintf(f, "NULL\n"); break; } @@ -1964,6 +1984,7 @@ RNAProcessItem PROCESS_ITEMS[]= { {"rna_curve.c", NULL, RNA_def_curve}, {"rna_fcurve.c", NULL, RNA_def_fcurve}, {"rna_fluidsim.c", NULL, RNA_def_fluidsim}, + {"rna_gpencil.c", NULL, RNA_def_gpencil}, {"rna_group.c", NULL, RNA_def_group}, {"rna_image.c", NULL, RNA_def_image}, {"rna_key.c", NULL, RNA_def_key}, @@ -1990,6 +2011,7 @@ RNAProcessItem PROCESS_ITEMS[]= { {"rna_sequence.c", NULL, RNA_def_sequence}, {"rna_smoke.c", NULL, RNA_def_smoke}, {"rna_space.c", NULL, RNA_def_space}, + {"rna_test.c", NULL, RNA_def_test}, {"rna_text.c", NULL, RNA_def_text}, {"rna_timeline.c", NULL, RNA_def_timeline_marker}, {"rna_sound.c", NULL, RNA_def_sound}, diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c index f6e0a2468c4..f5c6063e892 100644 --- a/source/blender/makesrna/intern/rna_ID.c +++ b/source/blender/makesrna/intern/rna_ID.c @@ -65,6 +65,7 @@ short RNA_type_to_ID_code(StructRNA *type) if(RNA_struct_is_a(type, &RNA_Brush)) return ID_BR; if(RNA_struct_is_a(type, &RNA_Camera)) return ID_CA; if(RNA_struct_is_a(type, &RNA_Curve)) return ID_CU; + if(RNA_struct_is_a(type, &RNA_GreasePencil)) return ID_GD; if(RNA_struct_is_a(type, &RNA_Group)) return ID_GR; if(RNA_struct_is_a(type, &RNA_Image)) return ID_IM; if(RNA_struct_is_a(type, &RNA_Key)) return ID_KE; @@ -97,6 +98,7 @@ StructRNA *ID_code_to_RNA_type(short idcode) case ID_BR: return &RNA_Brush; case ID_CA: return &RNA_Camera; case ID_CU: return &RNA_Curve; + case ID_GD: return &RNA_GreasePencil; case ID_GR: return &RNA_Group; case ID_IM: return &RNA_Image; case ID_KE: return &RNA_Key; diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index e71dcc2a586..9472cdb300c 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -209,7 +209,53 @@ static IDProperty *rna_idproperty_find(PointerRNA *ptr, const char *name) return NULL; } -static int rna_idproperty_verify_valid(PropertyRNA *prop, IDProperty *idprop) +static int rna_ensure_property_array_length(PointerRNA *ptr, PropertyRNA *prop) +{ + if(prop->magic == RNA_MAGIC) { + int arraylen[RNA_MAX_ARRAY_DIMENSION]; + return (prop->getlength)? prop->getlength(ptr, arraylen): prop->totarraylength; + } + else { + IDProperty *idprop= (IDProperty*)prop; + + if(idprop->type == IDP_ARRAY) + return idprop->len; + else + return 0; + } +} + +static int rna_ensure_property_array_check(PointerRNA *ptr, PropertyRNA *prop) +{ + if(prop->magic == RNA_MAGIC) { + return (prop->getlength || prop->totarraylength) ? 1:0; + } + else { + IDProperty *idprop= (IDProperty*)prop; + + return idprop->type == IDP_ARRAY ? 1:0; + } +} + +static void rna_ensure_property_multi_array_length(PointerRNA *ptr, PropertyRNA *prop, int length[]) +{ + if(prop->magic == RNA_MAGIC) { + if(prop->getlength) + prop->getlength(ptr, length); + else + memcpy(length, prop->arraylength, prop->arraydimension*sizeof(int)); + } + else { + IDProperty *idprop= (IDProperty*)prop; + + if(idprop->type == IDP_ARRAY) + length[0]= idprop->len; + else + length[0]= 0; + } +} + +static int rna_idproperty_verify_valid(PointerRNA *ptr, PropertyRNA *prop, IDProperty *idprop) { /* this verifies if the idproperty actually matches the property * description and otherwise removes it. this is to ensure that @@ -222,7 +268,7 @@ static int rna_idproperty_verify_valid(PropertyRNA *prop, IDProperty *idprop) return 0; break; case IDP_ARRAY: - if(prop->arraylength != idprop->len) + if(rna_ensure_property_array_length(ptr, prop) != idprop->len) return 0; if(idprop->subtype == IDP_FLOAT && prop->type != PROP_FLOAT) @@ -283,7 +329,7 @@ IDProperty *rna_idproperty_check(PropertyRNA **prop, PointerRNA *ptr) if((*prop)->flag & PROP_IDPROPERTY) { IDProperty *idprop= rna_idproperty_find(ptr, (*prop)->identifier); - if(idprop && !rna_idproperty_verify_valid(*prop, idprop)) { + if(idprop && !rna_idproperty_verify_valid(ptr, *prop, idprop)) { IDProperty *group= RNA_struct_idproperties(ptr, 0); IDP_RemFromGroup(group, idprop); @@ -310,7 +356,7 @@ IDProperty *rna_idproperty_check(PropertyRNA **prop, PointerRNA *ptr) } } -PropertyRNA *rna_ensure_property(PropertyRNA *prop) +static PropertyRNA *rna_ensure_property(PropertyRNA *prop) { /* the quick version if we don't need the idproperty */ @@ -327,7 +373,7 @@ PropertyRNA *rna_ensure_property(PropertyRNA *prop) } } -const char *rna_ensure_property_identifier(PropertyRNA *prop) +static const char *rna_ensure_property_identifier(PropertyRNA *prop) { if(prop->magic == RNA_MAGIC) return prop->identifier; @@ -335,7 +381,7 @@ const char *rna_ensure_property_identifier(PropertyRNA *prop) return ((IDProperty*)prop)->name; } -const char *rna_ensure_property_name(PropertyRNA *prop) +static const char *rna_ensure_property_name(PropertyRNA *prop) { if(prop->magic == RNA_MAGIC) return prop->name; @@ -343,21 +389,6 @@ const char *rna_ensure_property_name(PropertyRNA *prop) return ((IDProperty*)prop)->name; } -int rna_ensure_property_array_length(PointerRNA *ptr, PropertyRNA *prop) -{ - if(prop->magic == RNA_MAGIC) { - return prop->getlength ? prop->getlength(ptr) : prop->arraylength; - } - else { - IDProperty *idprop= (IDProperty*)prop; - - if(idprop->type == IDP_ARRAY) - return idprop->len; - else - return 0; - } -} - /* Structs */ const char *RNA_struct_identifier(StructRNA *type) @@ -555,22 +586,30 @@ int RNA_property_array_length(PointerRNA *ptr, PropertyRNA *prop) return rna_ensure_property_array_length(ptr, prop); } -int RNA_property_dynamic_array_set_length(PointerRNA *ptr, PropertyRNA *prop, int length) +int RNA_property_array_check(PointerRNA *ptr, PropertyRNA *prop) { - if (prop->setlength) - return prop->setlength(ptr, length); - else - prop->arraylength= length; /* function parameters only? */ + return rna_ensure_property_array_check(ptr, prop); +} - return 1; +/* used by BPY to make an array from the python object */ +int RNA_property_array_dimension(PointerRNA *ptr, PropertyRNA *prop, int length[]) +{ + PropertyRNA *rprop= rna_ensure_property(prop); + + if(length && rprop->arraydimension > 1) + rna_ensure_property_multi_array_length(ptr, prop, length); + + return rprop->arraydimension; } -unsigned short RNA_property_array_dimension(PropertyRNA *prop, unsigned short dimsize[]) +/* Return the size of Nth dimension. */ +int RNA_property_multi_array_length(PointerRNA *ptr, PropertyRNA *prop, int dim) { - if (dimsize && prop->arraydimension > 1) { - memcpy(dimsize, prop->dimsize, sizeof(prop->dimsize[0]) * (prop->arraydimension - 1)); - } - return prop->arraydimension; + int len[RNA_MAX_ARRAY_DIMENSION]; + + rna_ensure_property_multi_array_length(ptr, prop, len); + + return len[dim]; } char RNA_property_array_item_char(PropertyRNA *prop, int index) @@ -873,27 +912,40 @@ void RNA_property_boolean_get_array(PointerRNA *ptr, PropertyRNA *prop, int *val IDProperty *idprop; if((idprop=rna_idproperty_check(&prop, ptr))) { - if(prop->arraylength == 0) + if(prop->arraydimension == 0) values[0]= RNA_property_boolean_get(ptr, prop); else memcpy(values, IDP_Array(idprop), sizeof(int)*idprop->len); } - else if(prop->arraylength == 0) + else if(prop->arraydimension == 0) values[0]= RNA_property_boolean_get(ptr, prop); else if(bprop->getarray) bprop->getarray(ptr, values); else if(bprop->defaultarray) - memcpy(values, bprop->defaultarray, sizeof(int)*prop->arraylength); + memcpy(values, bprop->defaultarray, sizeof(int)*prop->totarraylength); else - memset(values, 0, sizeof(int)*prop->arraylength); + memset(values, 0, sizeof(int)*prop->totarraylength); } int RNA_property_boolean_get_index(PointerRNA *ptr, PropertyRNA *prop, int index) { - int tmp[RNA_MAX_ARRAY]; + int tmp[RNA_MAX_ARRAY_LENGTH]; + int len= rna_ensure_property_array_length(ptr, prop); + + if(len <= RNA_MAX_ARRAY_LENGTH) { + RNA_property_boolean_get_array(ptr, prop, tmp); + return tmp[index]; + } + else { + int *tmparray, value; + + tmparray= MEM_callocN(sizeof(int)*len, "RNA_property_boolean_get_index"); + RNA_property_boolean_get_array(ptr, prop, tmparray); + value= tmparray[index]; + MEM_freeN(tmparray); - RNA_property_boolean_get_array(ptr, prop, tmp); - return tmp[index]; + return value; + } } void RNA_property_boolean_set_array(PointerRNA *ptr, PropertyRNA *prop, const int *values) @@ -902,12 +954,12 @@ void RNA_property_boolean_set_array(PointerRNA *ptr, PropertyRNA *prop, const in IDProperty *idprop; if((idprop=rna_idproperty_check(&prop, ptr))) { - if(prop->arraylength == 0) + if(prop->arraydimension == 0) IDP_Int(idprop)= values[0]; else memcpy(IDP_Array(idprop), values, sizeof(int)*idprop->len); } - else if(prop->arraylength == 0) + else if(prop->arraydimension == 0) RNA_property_boolean_set(ptr, prop, values[0]); else if(bprop->setarray) bprop->setarray(ptr, values); @@ -915,7 +967,7 @@ void RNA_property_boolean_set_array(PointerRNA *ptr, PropertyRNA *prop, const in IDPropertyTemplate val = {0}; IDProperty *group; - val.array.len= prop->arraylength; + val.array.len= prop->totarraylength; val.array.type= IDP_INT; group= RNA_struct_idproperties(ptr, 1); @@ -929,11 +981,23 @@ void RNA_property_boolean_set_array(PointerRNA *ptr, PropertyRNA *prop, const in void RNA_property_boolean_set_index(PointerRNA *ptr, PropertyRNA *prop, int index, int value) { - int tmp[RNA_MAX_ARRAY]; + int tmp[RNA_MAX_ARRAY_LENGTH]; + int len= rna_ensure_property_array_length(ptr, prop); + + if(len <= RNA_MAX_ARRAY_LENGTH) { + RNA_property_boolean_get_array(ptr, prop, tmp); + tmp[index]= value; + RNA_property_boolean_set_array(ptr, prop, tmp); + } + else { + int *tmparray; - RNA_property_boolean_get_array(ptr, prop, tmp); - tmp[index]= value; - RNA_property_boolean_set_array(ptr, prop, tmp); + tmparray= MEM_callocN(sizeof(int)*len, "RNA_property_boolean_get_index"); + RNA_property_boolean_get_array(ptr, prop, tmparray); + tmparray[index]= value; + RNA_property_boolean_set_array(ptr, prop, tmparray); + MEM_freeN(tmparray); + } } int RNA_property_int_get(PointerRNA *ptr, PropertyRNA *prop) @@ -976,27 +1040,40 @@ void RNA_property_int_get_array(PointerRNA *ptr, PropertyRNA *prop, int *values) IDProperty *idprop; if((idprop=rna_idproperty_check(&prop, ptr))) { - if(prop->arraylength == 0) + if(prop->arraydimension == 0) values[0]= RNA_property_int_get(ptr, prop); else memcpy(values, IDP_Array(idprop), sizeof(int)*idprop->len); } - else if(prop->arraylength == 0) + else if(prop->arraydimension == 0) values[0]= RNA_property_int_get(ptr, prop); else if(iprop->getarray) iprop->getarray(ptr, values); else if(iprop->defaultarray) - memcpy(values, iprop->defaultarray, sizeof(int)*prop->arraylength); + memcpy(values, iprop->defaultarray, sizeof(int)*prop->totarraylength); else - memset(values, 0, sizeof(int)*prop->arraylength); + memset(values, 0, sizeof(int)*prop->totarraylength); } int RNA_property_int_get_index(PointerRNA *ptr, PropertyRNA *prop, int index) { - int tmp[RNA_MAX_ARRAY]; + int tmp[RNA_MAX_ARRAY_LENGTH]; + int len= rna_ensure_property_array_length(ptr, prop); + + if(len <= RNA_MAX_ARRAY_LENGTH) { + RNA_property_int_get_array(ptr, prop, tmp); + return tmp[index]; + } + else { + int *tmparray, value; + + tmparray= MEM_callocN(sizeof(int)*len, "RNA_property_int_get_index"); + RNA_property_int_get_array(ptr, prop, tmparray); + value= tmparray[index]; + MEM_freeN(tmparray); - RNA_property_int_get_array(ptr, prop, tmp); - return tmp[index]; + return value; + } } void RNA_property_int_set_array(PointerRNA *ptr, PropertyRNA *prop, const int *values) @@ -1005,12 +1082,12 @@ void RNA_property_int_set_array(PointerRNA *ptr, PropertyRNA *prop, const int *v IDProperty *idprop; if((idprop=rna_idproperty_check(&prop, ptr))) { - if(prop->arraylength == 0) + if(prop->arraydimension == 0) IDP_Int(idprop)= values[0]; else memcpy(IDP_Array(idprop), values, sizeof(int)*idprop->len);\ } - else if(prop->arraylength == 0) + else if(prop->arraydimension == 0) RNA_property_int_set(ptr, prop, values[0]); else if(iprop->setarray) iprop->setarray(ptr, values); @@ -1018,7 +1095,7 @@ void RNA_property_int_set_array(PointerRNA *ptr, PropertyRNA *prop, const int *v IDPropertyTemplate val = {0}; IDProperty *group; - val.array.len= prop->arraylength; + val.array.len= prop->totarraylength; val.array.type= IDP_INT; group= RNA_struct_idproperties(ptr, 1); @@ -1032,11 +1109,23 @@ void RNA_property_int_set_array(PointerRNA *ptr, PropertyRNA *prop, const int *v void RNA_property_int_set_index(PointerRNA *ptr, PropertyRNA *prop, int index, int value) { - int tmp[RNA_MAX_ARRAY]; + int tmp[RNA_MAX_ARRAY_LENGTH]; + int len= rna_ensure_property_array_length(ptr, prop); - RNA_property_int_get_array(ptr, prop, tmp); - tmp[index]= value; - RNA_property_int_set_array(ptr, prop, tmp); + if(len <= RNA_MAX_ARRAY_LENGTH) { + RNA_property_int_get_array(ptr, prop, tmp); + tmp[index]= value; + RNA_property_int_set_array(ptr, prop, tmp); + } + else { + int *tmparray; + + tmparray= MEM_callocN(sizeof(int)*len, "RNA_property_int_get_index"); + RNA_property_int_get_array(ptr, prop, tmparray); + tmparray[index]= value; + RNA_property_int_set_array(ptr, prop, tmparray); + MEM_freeN(tmparray); + } } float RNA_property_float_get(PointerRNA *ptr, PropertyRNA *prop) @@ -1089,7 +1178,7 @@ void RNA_property_float_get_array(PointerRNA *ptr, PropertyRNA *prop, float *val int i; if((idprop=rna_idproperty_check(&prop, ptr))) { - if(prop->arraylength == 0) + if(prop->arraydimension == 0) values[0]= RNA_property_float_get(ptr, prop); else if(idprop->subtype == IDP_FLOAT) { memcpy(values, IDP_Array(idprop), sizeof(float)*idprop->len); @@ -1099,22 +1188,36 @@ void RNA_property_float_get_array(PointerRNA *ptr, PropertyRNA *prop, float *val values[i]= (float)(((double*)IDP_Array(idprop))[i]); } } - else if(prop->arraylength == 0) + else if(prop->arraydimension == 0) values[0]= RNA_property_float_get(ptr, prop); else if(fprop->getarray) fprop->getarray(ptr, values); else if(fprop->defaultarray) - memcpy(values, fprop->defaultarray, sizeof(float)*prop->arraylength); + memcpy(values, fprop->defaultarray, sizeof(float)*prop->totarraylength); else - memset(values, 0, sizeof(float)*prop->arraylength); + memset(values, 0, sizeof(float)*prop->totarraylength); } float RNA_property_float_get_index(PointerRNA *ptr, PropertyRNA *prop, int index) { - float tmp[RNA_MAX_ARRAY]; + float tmp[RNA_MAX_ARRAY_LENGTH]; + int len= rna_ensure_property_array_length(ptr, prop); + + if(len <= RNA_MAX_ARRAY_LENGTH) { + RNA_property_float_get_array(ptr, prop, tmp); + return tmp[index]; + } + else { + float *tmparray, value; + + tmparray= MEM_callocN(sizeof(float)*len, "RNA_property_float_get_index"); + RNA_property_float_get_array(ptr, prop, tmparray); + value= tmparray[index]; + MEM_freeN(tmparray); + + return value; + } - RNA_property_float_get_array(ptr, prop, tmp); - return tmp[index]; } void RNA_property_float_set_array(PointerRNA *ptr, PropertyRNA *prop, const float *values) @@ -1124,7 +1227,7 @@ void RNA_property_float_set_array(PointerRNA *ptr, PropertyRNA *prop, const floa int i; if((idprop=rna_idproperty_check(&prop, ptr))) { - if(prop->arraylength == 0) + if(prop->arraydimension == 0) IDP_Double(idprop)= values[0]; else if(idprop->subtype == IDP_FLOAT) { memcpy(IDP_Array(idprop), values, sizeof(float)*idprop->len); @@ -1134,7 +1237,7 @@ void RNA_property_float_set_array(PointerRNA *ptr, PropertyRNA *prop, const floa ((double*)IDP_Array(idprop))[i]= values[i]; } } - else if(prop->arraylength == 0) + else if(prop->arraydimension == 0) RNA_property_float_set(ptr, prop, values[0]); else if(fprop->setarray) { fprop->setarray(ptr, values); @@ -1143,7 +1246,7 @@ void RNA_property_float_set_array(PointerRNA *ptr, PropertyRNA *prop, const floa IDPropertyTemplate val = {0}; IDProperty *group; - val.array.len= prop->arraylength; + val.array.len= prop->totarraylength; val.array.type= IDP_FLOAT; group= RNA_struct_idproperties(ptr, 1); @@ -1157,11 +1260,23 @@ void RNA_property_float_set_array(PointerRNA *ptr, PropertyRNA *prop, const floa void RNA_property_float_set_index(PointerRNA *ptr, PropertyRNA *prop, int index, float value) { - float tmp[RNA_MAX_ARRAY]; + float tmp[RNA_MAX_ARRAY_LENGTH]; + int len= rna_ensure_property_array_length(ptr, prop); - RNA_property_float_get_array(ptr, prop, tmp); - tmp[index]= value; - RNA_property_float_set_array(ptr, prop, tmp); + if(len <= RNA_MAX_ARRAY_LENGTH) { + RNA_property_float_get_array(ptr, prop, tmp); + tmp[index]= value; + RNA_property_float_set_array(ptr, prop, tmp); + } + else { + float *tmparray; + + tmparray= MEM_callocN(sizeof(float)*len, "RNA_property_float_get_index"); + RNA_property_float_get_array(ptr, prop, tmparray); + tmparray[index]= value; + RNA_property_float_set_array(ptr, prop, tmparray); + MEM_freeN(tmparray); + } } void RNA_property_string_get(PointerRNA *ptr, PropertyRNA *prop, char *value) @@ -2650,7 +2765,7 @@ int RNA_property_is_set(PointerRNA *ptr, const char *name) return (rna_idproperty_find(ptr, name) != NULL); } else { - printf("RNA_property_is_set: %s.%s not found.\n", ptr->type->identifier, name); + // printf("RNA_property_is_set: %s.%s not found.\n", ptr->type->identifier, name); return 0; } } @@ -2883,15 +2998,15 @@ ParameterList *RNA_parameter_list_create(ParameterList *parms, PointerRNA *ptr, if(!(parm->flag & PROP_REQUIRED)) { switch(parm->type) { case PROP_BOOLEAN: - if(parm->arraylength) memcpy(data, &((BooleanPropertyRNA*)parm)->defaultarray, size); + if(parm->arraydimension) memcpy(data, &((BooleanPropertyRNA*)parm)->defaultarray, size); else memcpy(data, &((BooleanPropertyRNA*)parm)->defaultvalue, size); break; case PROP_INT: - if(parm->arraylength) memcpy(data, &((IntPropertyRNA*)parm)->defaultarray, size); + if(parm->arraydimension) memcpy(data, &((IntPropertyRNA*)parm)->defaultarray, size); else memcpy(data, &((IntPropertyRNA*)parm)->defaultvalue, size); break; case PROP_FLOAT: - if(parm->arraylength) memcpy(data, &((FloatPropertyRNA*)parm)->defaultarray, size); + if(parm->arraydimension) memcpy(data, &((FloatPropertyRNA*)parm)->defaultarray, size); else memcpy(data, &((FloatPropertyRNA*)parm)->defaultvalue, size); break; case PROP_ENUM: diff --git a/source/blender/makesrna/intern/rna_action.c b/source/blender/makesrna/intern/rna_action.c index 3639d6d3fff..99090b62938 100644 --- a/source/blender/makesrna/intern/rna_action.c +++ b/source/blender/makesrna/intern/rna_action.c @@ -38,19 +38,19 @@ #else -void rna_def_action_group(BlenderRNA *brna) +static void rna_def_action_group(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + srna= RNA_def_struct(brna, "ActionGroup", NULL); RNA_def_struct_sdna(srna, "bActionGroup"); RNA_def_struct_ui_text(srna, "Action Group", "Groups of F-Curves."); - + prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_property_ui_text(prop, "Name", ""); RNA_def_struct_name_property(srna, prop); - + /* dna warns not to treat the Action Channel listbase in the Action Group struct like a normal listbase. I'll leave this here but comment out, for Joshua to review. He can probably shed some more light on why this is */ @@ -58,25 +58,25 @@ void rna_def_action_group(BlenderRNA *brna) RNA_def_property_collection_sdna(prop, NULL, "channels", NULL); RNA_def_property_struct_type(prop, "FCurve"); RNA_def_property_ui_text(prop, "Channels", "F-Curves in this group.");*/ - + prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", AGRP_SELECTED); RNA_def_property_ui_text(prop, "Selected", "Action Group is selected."); - + prop= RNA_def_property(srna, "locked", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", AGRP_PROTECTED); RNA_def_property_ui_text(prop, "Locked", "Action Group is locked."); - + prop= RNA_def_property(srna, "expanded", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", AGRP_EXPANDED); RNA_def_property_ui_text(prop, "Expanded", "Action Group is expanded."); - + prop= RNA_def_property(srna, "custom_color", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "customCol"); RNA_def_property_ui_text(prop, "Custom Color", "Index of custom color set."); } -void rna_def_action(BlenderRNA *brna) +static void rna_def_action(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; @@ -85,17 +85,17 @@ void rna_def_action(BlenderRNA *brna) RNA_def_struct_sdna(srna, "bAction"); RNA_def_struct_ui_text(srna, "Action", "A collection of F-Curves for animation."); RNA_def_struct_ui_icon(srna, ICON_ACTION); - + prop= RNA_def_property(srna, "fcurves", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "curves", NULL); RNA_def_property_struct_type(prop, "FCurve"); RNA_def_property_ui_text(prop, "F-Curves", "The individual F-Curves that make up the Action."); - + prop= RNA_def_property(srna, "groups", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "groups", NULL); RNA_def_property_struct_type(prop, "ActionGroup"); RNA_def_property_ui_text(prop, "Groups", "Convenient groupings of F-Curves."); - + prop= RNA_def_property(srna, "pose_markers", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "markers", NULL); RNA_def_property_struct_type(prop, "TimelineMarker"); diff --git a/source/blender/makesrna/intern/rna_animation.c b/source/blender/makesrna/intern/rna_animation.c index 7652987ac86..a8d3a6edaae 100644 --- a/source/blender/makesrna/intern/rna_animation.c +++ b/source/blender/makesrna/intern/rna_animation.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * Contributor(s): Blender Foundation (2008), Roland Hess + * Contributor(s): Blender Foundation (2009), Joshua Leung * * ***** END GPL LICENSE BLOCK ***** */ @@ -93,7 +93,7 @@ static void rna_ksPath_RnaPath_set(PointerRNA *ptr, const char *value) #else -void rna_def_keyingset_path(BlenderRNA *brna) +static void rna_def_keyingset_path(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; @@ -132,7 +132,7 @@ void rna_def_keyingset_path(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Entire Array", "When an 'array/vector' type is chosen (Location, Rotation, Color, etc.), entire array is to be used."); } -void rna_def_keyingset(BlenderRNA *brna) +static void rna_def_keyingset(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; @@ -157,7 +157,6 @@ void rna_def_keyingset(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", KEYINGSET_BUILTIN); RNA_def_property_ui_text(prop, "Built-In", "Keying Set is a built-in to Blender."); - /* TODO: for now, this is editable, but do we really want this to happen? */ prop= RNA_def_property(srna, "absolute", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", KEYINGSET_ABSOLUTE); RNA_def_property_ui_text(prop, "Absolute", "Keying Set defines specific paths/settings to be keyframed (i.e. is not reliant on context info)"); diff --git a/source/blender/makesrna/intern/rna_armature.c b/source/blender/makesrna/intern/rna_armature.c index 7bab7947843..dcf89b7ac1e 100644 --- a/source/blender/makesrna/intern/rna_armature.c +++ b/source/blender/makesrna/intern/rna_armature.c @@ -48,29 +48,17 @@ static void rna_Armature_update_data(bContext *C, PointerRNA *ptr) { - Main *bmain= CTX_data_main(C); - Scene *scene= CTX_data_scene(C); ID *id= ptr->id.data; - Object *ob; - for(ob=bmain->object.first; ob; ob= ob->id.next) { - if(ob->data == id) { - /* XXX this will loop over all objects again (slow) */ - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob); - } - } + DAG_id_flush_update(id, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, id); } static void rna_Armature_redraw_data(bContext *C, PointerRNA *ptr) { - Main *bmain= CTX_data_main(C); ID *id= ptr->id.data; - Object *ob; - for(ob=bmain->object.first; ob; ob= ob->id.next) - if(ob->data == id) - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, id); } static void rna_bone_layer_set(short *layer, const int *values) @@ -337,7 +325,7 @@ static void rna_def_bone_common(StructRNA *srna, int editbone) RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); /* flags */ - prop= RNA_def_property(srna, "layer", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "layer", PROP_BOOLEAN, PROP_LAYER_MEMBER); RNA_def_property_boolean_sdna(prop, NULL, "layer", 1); RNA_def_property_array(prop, 16); if(editbone) RNA_def_property_boolean_funcs(prop, "rna_EditBone_layer_get", "rna_EditBone_layer_set"); @@ -532,7 +520,7 @@ static void rna_def_edit_bone(BlenderRNA *brna) RNA_define_verify_sdna(1); } -void rna_def_armature(BlenderRNA *brna) +static void rna_def_armature(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; @@ -581,7 +569,7 @@ void rna_def_armature(BlenderRNA *brna) /* Boolean values */ /* layer */ - prop= RNA_def_property(srna, "layer", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "layer", PROP_BOOLEAN, PROP_LAYER_MEMBER); RNA_def_property_boolean_sdna(prop, NULL, "layer", 1); RNA_def_property_array(prop, 16); RNA_def_property_ui_text(prop, "Visible Layers", "Armature layer visibility."); @@ -590,7 +578,7 @@ void rna_def_armature(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_LIB_EXCEPTION); /* layer protection */ - prop= RNA_def_property(srna, "layer_protection", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "layer_protection", PROP_BOOLEAN, PROP_LAYER); RNA_def_property_boolean_sdna(prop, NULL, "layer_protected", 1); RNA_def_property_array(prop, 16); RNA_def_property_ui_text(prop, "Layer Proxy Protection", "Protected layers in Proxy Instances are restored to Proxy settings on file reload and undo."); diff --git a/source/blender/makesrna/intern/rna_boid.c b/source/blender/makesrna/intern/rna_boid.c index 0c5565e253a..8002aa89313 100644 --- a/source/blender/makesrna/intern/rna_boid.c +++ b/source/blender/makesrna/intern/rna_boid.c @@ -41,6 +41,7 @@ #include "DNA_object_types.h" #include "DNA_particle_types.h" +#include "WM_api.h" #include "WM_types.h" EnumPropertyItem boidrule_type_items[] ={ @@ -82,14 +83,15 @@ static void rna_Boids_reset(bContext *C, PointerRNA *ptr) psys->recalc = PSYS_RECALC_RESET; - if(ob) { - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); - } + if(ob) + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); } else { part = ptr->id.data; psys_flush_particle_settings(scene, part, PSYS_RECALC_RESET); } + + WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_DATA, NULL); } static void rna_Boids_reset_deps(bContext *C, PointerRNA *ptr) { @@ -102,15 +104,16 @@ static void rna_Boids_reset_deps(bContext *C, PointerRNA *ptr) psys->recalc = PSYS_RECALC_RESET; - if(ob) { - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); - } + if(ob) + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); } else { part = ptr->id.data; psys_flush_particle_settings(scene, part, PSYS_RECALC_RESET); DAG_scene_sort(scene); } + + WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_DATA, NULL); } static StructRNA* rna_BoidRule_refine(struct PointerRNA *ptr) @@ -247,12 +250,12 @@ static void rna_def_boidrule_goal(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "ob"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Object", "Goal object."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset_deps"); + RNA_def_property_update(prop, 0, "rna_Boids_reset_deps"); prop= RNA_def_property(srna, "predict", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "options", BRULE_GOAL_AVOID_PREDICT); RNA_def_property_ui_text(prop, "Predict", "Predict target movement."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); } static void rna_def_boidrule_avoid(BlenderRNA *brna) @@ -268,17 +271,17 @@ static void rna_def_boidrule_avoid(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "ob"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Object", "Object to avoid."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset_deps"); + RNA_def_property_update(prop, 0, "rna_Boids_reset_deps"); prop= RNA_def_property(srna, "predict", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "options", BRULE_GOAL_AVOID_PREDICT); RNA_def_property_ui_text(prop, "Predict", "Predict target movement."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); prop= RNA_def_property(srna, "fear_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0f, 100.0f); RNA_def_property_ui_text(prop, "Fear factor", "Avoid object if danger from it is above this threshol."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); } static void rna_def_boidrule_avoid_collision(BlenderRNA *brna) @@ -292,17 +295,17 @@ static void rna_def_boidrule_avoid_collision(BlenderRNA *brna) prop= RNA_def_property(srna, "boids", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "options", BRULE_ACOLL_WITH_BOIDS); RNA_def_property_ui_text(prop, "Boids", "Avoid collision with other boids."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); prop= RNA_def_property(srna, "deflectors", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "options", BRULE_ACOLL_WITH_DEFLECTORS); RNA_def_property_ui_text(prop, "Deflectors", "Avoid collision with deflector objects."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); prop= RNA_def_property(srna, "look_ahead", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0f, 100.0f); RNA_def_property_ui_text(prop, "Look ahead", "Time to look ahead in seconds."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); } static void rna_def_boidrule_follow_leader(BlenderRNA *brna) @@ -317,22 +320,22 @@ static void rna_def_boidrule_follow_leader(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "ob"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Object", "Follow this object instead of a boid."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset_deps"); + RNA_def_property_update(prop, 0, "rna_Boids_reset_deps"); prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0f, 100.0f); RNA_def_property_ui_text(prop, "Distance", "Distance behind leader to follow."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); prop= RNA_def_property(srna, "queue_size", PROP_INT, PROP_NONE); RNA_def_property_range(prop, 0.0f, 100.0f); RNA_def_property_ui_text(prop, "Queue Size", "How many boids in a line."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); prop= RNA_def_property(srna, "line", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "options", BRULE_LEADER_IN_LINE); RNA_def_property_ui_text(prop, "Line", "Follow leader in a line."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); } static void rna_def_boidrule_average_speed(BlenderRNA *brna) @@ -346,17 +349,17 @@ static void rna_def_boidrule_average_speed(BlenderRNA *brna) prop= RNA_def_property(srna, "wander", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Wander", "How fast velocity's direction is randomized."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); prop= RNA_def_property(srna, "level", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Level", "How much velocity's z-component is kept constant."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); prop= RNA_def_property(srna, "speed", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Speed", "Percentage of maximum speed."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); } static void rna_def_boidrule_fight(BlenderRNA *brna) @@ -370,12 +373,12 @@ static void rna_def_boidrule_fight(BlenderRNA *brna) prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0f, 100.0f); RNA_def_property_ui_text(prop, "Fight Distance", "Attack boids at max this distance."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); prop= RNA_def_property(srna, "flee_distance", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0f, 100.0f); RNA_def_property_ui_text(prop, "Flee Distance", "Flee to this distance."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); } static void rna_def_boidrule(BlenderRNA *brna) @@ -405,12 +408,12 @@ static void rna_def_boidrule(BlenderRNA *brna) prop= RNA_def_property(srna, "in_air", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BOIDRULE_IN_AIR); RNA_def_property_ui_text(prop, "In Air", "Use rule when boid is flying."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); prop= RNA_def_property(srna, "on_land", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BOIDRULE_ON_LAND); RNA_def_property_ui_text(prop, "On Land", "Use rule when boid is on land."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); //prop= RNA_def_property(srna, "expanded", PROP_BOOLEAN, PROP_NONE); //RNA_def_property_boolean_sdna(prop, NULL, "mode", eModifierMode_Expanded); @@ -457,17 +460,17 @@ static void rna_def_boidstate(BlenderRNA *brna) prop= RNA_def_property(srna, "rule_fuzziness", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0, 1.0); RNA_def_property_ui_text(prop, "Rule Fuzzines", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); prop= RNA_def_property(srna, "volume", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0, 100.0); RNA_def_property_ui_text(prop, "Volume", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); prop= RNA_def_property(srna, "falloff", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0, 10.0); RNA_def_property_ui_text(prop, "Falloff", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); } static void rna_def_boid_settings(BlenderRNA *brna) { @@ -480,17 +483,17 @@ static void rna_def_boid_settings(BlenderRNA *brna) prop= RNA_def_property(srna, "landing_smoothness", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0, 10.0); RNA_def_property_ui_text(prop, "Landing Smoothness", "How smoothly the boids land."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); prop= RNA_def_property(srna, "banking", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0, 2.0); RNA_def_property_ui_text(prop, "Banking", "Amount of rotation around velocity vector on turns."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); prop= RNA_def_property(srna, "height", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0, 2.0); RNA_def_property_ui_text(prop, "Height", "Boid height relative to particle size."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); /* states */ prop= RNA_def_property(srna, "states", PROP_COLLECTION, PROP_NONE); @@ -510,99 +513,99 @@ static void rna_def_boid_settings(BlenderRNA *brna) prop= RNA_def_property(srna, "health", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0, 100.0); RNA_def_property_ui_text(prop, "Health", "Initial boid health when born."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); prop= RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0, 100.0); RNA_def_property_ui_text(prop, "Strength", "Maximum caused damage on attack per second."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); prop= RNA_def_property(srna, "aggression", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0, 100.0); RNA_def_property_ui_text(prop, "Aggression", "Boid will fight this times stronger enemy."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); prop= RNA_def_property(srna, "accuracy", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0, 1.0); RNA_def_property_ui_text(prop, "Accuracy", "Accuracy of attack."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); prop= RNA_def_property(srna, "range", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0, 100.0); RNA_def_property_ui_text(prop, "Range", "The maximum distance from which a boid can attack."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); /* physical properties */ prop= RNA_def_property(srna, "air_min_speed", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0, 1.0); RNA_def_property_ui_text(prop, "Min Air Speed", "Minimum speed in air (relative to maximum speed)."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); prop= RNA_def_property(srna, "air_max_speed", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0, 100.0); RNA_def_property_ui_text(prop, "Max Air Speed", "Maximum speed in air."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); prop= RNA_def_property(srna, "air_max_acc", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0, 1.0); RNA_def_property_ui_text(prop, "Max Air Acceleration", "Maximum acceleration in air (relative to maximum speed)."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); prop= RNA_def_property(srna, "air_max_ave", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0, 1.0); RNA_def_property_ui_text(prop, "Max Air Angular Velocity", "Maximum angular velocity in air (relative to 180 degrees)."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); prop= RNA_def_property(srna, "air_personal_space", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0, 10.0); RNA_def_property_ui_text(prop, "Air Personal Space", "Radius of boids personal space in air (% of particle size)."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); prop= RNA_def_property(srna, "land_jump_speed", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0, 100.0); RNA_def_property_ui_text(prop, "Jump Speed", "Maximum speed for jumping."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); prop= RNA_def_property(srna, "land_max_speed", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0, 100.0); RNA_def_property_ui_text(prop, "Max Land Speed", "Maximum speed on land."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); prop= RNA_def_property(srna, "land_max_acc", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0, 1.0); RNA_def_property_ui_text(prop, "Max Land Acceleration", "Maximum acceleration on land (relative to maximum speed)."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); prop= RNA_def_property(srna, "land_max_ave", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0, 1.0); RNA_def_property_ui_text(prop, "Max Land Angular Velocity", "Maximum angular velocity on land (relative to 180 degrees)."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); prop= RNA_def_property(srna, "land_personal_space", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0, 10.0); RNA_def_property_ui_text(prop, "Land Personal Space", "Radius of boids personal space on land (% of particle size)."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); prop= RNA_def_property(srna, "land_stick_force", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0, 1000.0); RNA_def_property_ui_text(prop, "Land Stick Force", "How strong a force must be to start effecting a boid on land."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); /* options */ prop= RNA_def_property(srna, "allow_flight", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "options", BOID_ALLOW_FLIGHT); RNA_def_property_ui_text(prop, "Allow Flight", "Allow boids to move in air."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); prop= RNA_def_property(srna, "allow_land", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "options", BOID_ALLOW_LAND); RNA_def_property_ui_text(prop, "Allow Land", "Allow boids to move on land."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); prop= RNA_def_property(srna, "allow_climb", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "options", BOID_ALLOW_CLIMB); RNA_def_property_ui_text(prop, "Allow Climbing", "Allow boids to climb goal objects."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); } void RNA_def_boid(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c index 9c453ac44df..70daa3690da 100644 --- a/source/blender/makesrna/intern/rna_brush.c +++ b/source/blender/makesrna/intern/rna_brush.c @@ -89,7 +89,7 @@ static void rna_Brush_active_texture_set(PointerRNA *ptr, PointerRNA value) #else -void rna_def_brush(BlenderRNA *brna) +static void rna_def_brush(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; @@ -104,6 +104,11 @@ void rna_def_brush(BlenderRNA *brna) {IMB_BLEND_ERASE_ALPHA, "ERASE_ALPHA", 0, "Erase Alpha", "Erase alpha while painting."}, {IMB_BLEND_ADD_ALPHA, "ADD_ALPHA", 0, "Add Alpha", "Add alpha while painting."}, {0, NULL, 0, NULL, NULL}}; + + static const EnumPropertyItem prop_flip_direction_items[]= { + {0, "ADD", 0, "Add", "Add effect of brush"}, + {BRUSH_DIR_IN, "SUBTRACT", 0, "Subtract", "Subtract effect of brush"}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "Brush", "ID"); RNA_def_struct_ui_text(srna, "Brush", "Brush datablock for storing brush settings for painting and sculpting."); @@ -117,6 +122,11 @@ void rna_def_brush(BlenderRNA *brna) prop= RNA_def_property(srna, "sculpt_tool", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, brush_sculpt_tool_items); RNA_def_property_ui_text(prop, "Sculpt Tool", ""); + + prop= RNA_def_property(srna, "direction", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); + RNA_def_property_enum_items(prop, prop_flip_direction_items); + RNA_def_property_ui_text(prop, "Direction", "Mapping type to use for this image in the game engine."); /* number values */ prop= RNA_def_property(srna, "size", PROP_INT, PROP_NONE); @@ -166,18 +176,22 @@ void rna_def_brush(BlenderRNA *brna) prop= RNA_def_property(srna, "strength_pressure", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_ALPHA_PRESSURE); + RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0); RNA_def_property_ui_text(prop, "Strength Pressure", "Enable tablet pressure sensitivity for strength."); prop= RNA_def_property(srna, "size_pressure", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_SIZE_PRESSURE); + RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0); RNA_def_property_ui_text(prop, "Size Pressure", "Enable tablet pressure sensitivity for size."); prop= RNA_def_property(srna, "falloff_pressure", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_RAD_PRESSURE); + RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0); RNA_def_property_ui_text(prop, "Falloff Pressure", "Enable tablet pressure sensitivity for falloff."); prop= RNA_def_property(srna, "spacing_pressure", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_SPACING_PRESSURE); + RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0); RNA_def_property_ui_text(prop, "Spacing Pressure", "Enable tablet pressure sensitivity for spacing."); prop= RNA_def_property(srna, "rake", PROP_BOOLEAN, PROP_NONE); @@ -188,10 +202,6 @@ void rna_def_brush(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_ANCHORED); RNA_def_property_ui_text(prop, "Anchored", "Keep the brush anchored to the initial location."); - prop= RNA_def_property(srna, "flip_direction", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_DIR_IN); - RNA_def_property_ui_text(prop, "Flip Direction", "Move vertices in the opposite direction."); - prop= RNA_def_property(srna, "space", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_SPACE); RNA_def_property_ui_text(prop, "Space", "Limit brush application to the distance specified by spacing."); diff --git a/source/blender/makesrna/intern/rna_cloth.c b/source/blender/makesrna/intern/rna_cloth.c index 9096bfc2844..22cc2e2c9c3 100644 --- a/source/blender/makesrna/intern/rna_cloth.c +++ b/source/blender/makesrna/intern/rna_cloth.c @@ -37,6 +37,7 @@ #include "DNA_object_types.h" #include "DNA_scene_types.h" +#include "WM_api.h" #include "WM_types.h" #ifdef RNA_RUNTIME @@ -46,10 +47,10 @@ static void rna_cloth_update(bContext *C, PointerRNA *ptr) { - Scene *scene = CTX_data_scene(C); - Object *ob = ptr->id.data; + Object *ob= (Object*)ptr->id.data; - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob); } static void rna_ClothSettings_max_bend_set(struct PointerRNA *ptr, float value) @@ -151,7 +152,7 @@ static char *rna_ClothSettings_path(PointerRNA *ptr) Object *ob= (Object*)ptr->id.data; ModifierData *md= modifiers_findByType(ob, eModifierType_Cloth); - return BLI_sprintfN("modifiers[%s].settings", md->name); + return md ? BLI_sprintfN("modifiers[%s].settings", md->name) : NULL; } static char *rna_ClothCollisionSettings_path(PointerRNA *ptr) @@ -159,7 +160,7 @@ static char *rna_ClothCollisionSettings_path(PointerRNA *ptr) Object *ob= (Object*)ptr->id.data; ModifierData *md= modifiers_findByType(ob, eModifierType_Cloth); - return BLI_sprintfN("modifiers[%s].collision_settings", md->name); + return md ? BLI_sprintfN("modifiers[%s].collision_settings", md->name) : NULL; } #else @@ -180,50 +181,56 @@ static void rna_def_cloth_sim_settings(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "mingoal"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Goal Minimum", "Goal minimum, vertex group weights are scaled to match this range."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); + RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "goal_max", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "maxgoal"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Goal Maximum", "Goal maximum, vertex group weights are scaled to match this range."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); + RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "goal_default", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "defgoal"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Goal Default", "Default Goal (vertex target position) value, when no Vertex Group used."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); + RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "goal_spring", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "goalspring"); RNA_def_property_range(prop, 0.0f, 0.999f); RNA_def_property_ui_text(prop, "Goal Stiffness", "Goal (vertex target position) spring stiffness."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); + RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "goal_friction", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "goalfrict"); RNA_def_property_range(prop, 0.0f, 50.0f); RNA_def_property_ui_text(prop, "Goal Damping", "Goal (vertex target position) friction."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); + RNA_def_property_update(prop, 0, "rna_cloth_update"); + + prop= RNA_def_property(srna, "internal_friction", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "velocity_smooth"); + RNA_def_property_range(prop, 0.0f, 1.0f); + RNA_def_property_ui_text(prop, "Internal Friction", ""); + RNA_def_property_update(prop, 0, "rna_cloth_update"); /* mass */ prop= RNA_def_property(srna, "mass", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0f, 10.0f); RNA_def_property_ui_text(prop, "Mass", "Mass of cloth material."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); + RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "mass_vertex_group", PROP_STRING, PROP_NONE); RNA_def_property_string_funcs(prop, "rna_ClothSettings_mass_vgroup_get", "rna_ClothSettings_mass_vgroup_length", "rna_ClothSettings_mass_vgroup_set"); RNA_def_property_ui_text(prop, "Mass Vertex Group", "Vertex Group for pinning of vertices."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); + RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "gravity", PROP_FLOAT, PROP_ACCELERATION); RNA_def_property_array(prop, 3); RNA_def_property_range(prop, -100.0, 100.0); RNA_def_property_float_funcs(prop, "rna_ClothSettings_gravity_get", "rna_ClothSettings_gravity_set", NULL); RNA_def_property_ui_text(prop, "Gravity", "Gravity or external force vector."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); + RNA_def_property_update(prop, 0, "rna_cloth_update"); /* various */ @@ -231,73 +238,73 @@ static void rna_def_cloth_sim_settings(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "Cvi"); RNA_def_property_range(prop, 0.0f, 10.0f); RNA_def_property_ui_text(prop, "Air Damping", "Air has normally some thickness which slows falling things down."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); + RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "pin_cloth", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", CLOTH_SIMSETTINGS_FLAG_GOAL); RNA_def_property_ui_text(prop, "Pin Cloth", "Enable pinning of cloth vertices to other objects/positions."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); + RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "pin_stiffness", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "goalspring"); RNA_def_property_range(prop, 0.0f, 50.0); RNA_def_property_ui_text(prop, "Pin Stiffness", "Pin (vertex target position) spring stiffness."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); + RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "quality", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "stepsPerFrame"); RNA_def_property_range(prop, 4, 80); RNA_def_property_ui_text(prop, "Quality", "Quality of the simulation in steps per frame. (higher is better quality but slower)"); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); + RNA_def_property_update(prop, 0, "rna_cloth_update"); /* springs */ prop= RNA_def_property(srna, "stiffness_scaling", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", CLOTH_SIMSETTINGS_FLAG_SCALING); RNA_def_property_ui_text(prop, "Stiffness Scaling", "If enabled, stiffness can be scaled along a weight painted vertex group."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); + RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "spring_damping", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "Cdis"); RNA_def_property_range(prop, 0.0f, 50.0f); RNA_def_property_ui_text(prop, "Spring Damping", "Damping of cloth velocity. (higher = more smooth, less jiggling)"); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); + RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "structural_stiffness", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "structural"); RNA_def_property_range(prop, 1.0f, 10000.0f); RNA_def_property_ui_text(prop, "Structural Stiffness", "Overall stiffness of structure."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); + RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "structural_stiffness_max", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "max_struct"); RNA_def_property_range(prop, 0.0f, 10000.0f); RNA_def_property_float_funcs(prop, NULL, "rna_ClothSettings_max_struct_set", NULL); RNA_def_property_ui_text(prop, "Structural Stiffness Maximum", "Maximum structural stiffness value."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); + RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "structural_stiffness_vertex_group", PROP_STRING, PROP_NONE); RNA_def_property_string_funcs(prop, "rna_ClothSettings_struct_vgroup_get", "rna_ClothSettings_struct_vgroup_length", "rna_ClothSettings_struct_vgroup_set"); RNA_def_property_ui_text(prop, "Structural Stiffness Vertex Group", "Vertex group for fine control over structural stiffness."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); + RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "bending_stiffness", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "bending"); RNA_def_property_range(prop, 0.0f, 10000.0f); RNA_def_property_ui_text(prop, "Bending Stiffness", "Wrinkle coefficient. (higher = less smaller but more big wrinkles)"); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); + RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "bending_stiffness_max", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "max_bend"); RNA_def_property_range(prop, 0.0f, 10000.0f); RNA_def_property_float_funcs(prop, NULL, "rna_ClothSettings_max_bend_set", NULL); RNA_def_property_ui_text(prop, "Bending Stiffness Maximum", "Maximum bending stiffness value."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); + RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "bending_vertex_group", PROP_STRING, PROP_NONE); RNA_def_property_string_funcs(prop, "rna_ClothSettings_bend_vgroup_get", "rna_ClothSettings_bend_vgroup_length", "rna_ClothSettings_bend_vgroup_set"); RNA_def_property_ui_text(prop, "Bending Stiffness Vertex Group", "Vertex group for fine control over bending stiffness."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); + RNA_def_property_update(prop, 0, "rna_cloth_update"); /* unused */ @@ -358,48 +365,48 @@ static void rna_def_cloth_collision_settings(BlenderRNA *brna) prop= RNA_def_property(srna, "enable_collision", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", CLOTH_COLLSETTINGS_FLAG_ENABLED); RNA_def_property_ui_text(prop, "Enable Collision", "Enable collisions with other objects."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); + RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "min_distance", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "epsilon"); RNA_def_property_range(prop, 0.001f, 1.0f); RNA_def_property_ui_text(prop, "Minimum Distance", "Minimum distance between collision objects before collision response takes in."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); + RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "friction", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0f, 80.0f); RNA_def_property_ui_text(prop, "Friction", "Friction force if a collision happened. (higher = less movement)"); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); + RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "collision_quality", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "loop_count"); RNA_def_property_range(prop, 1, 20); RNA_def_property_ui_text(prop, "Collision Quality", "How many collision iterations should be done. (higher is better quality but slower)"); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); + RNA_def_property_update(prop, 0, "rna_cloth_update"); /* self collision */ prop= RNA_def_property(srna, "enable_self_collision", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", CLOTH_COLLSETTINGS_FLAG_SELF); RNA_def_property_ui_text(prop, "Enable Self Collision", "Enable self collisions."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); + RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "self_min_distance", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "selfepsilon"); RNA_def_property_range(prop, 0.5f, 1.0f); RNA_def_property_ui_text(prop, "Self Minimum Distance", "0.5 means no distance at all, 1.0 is maximum distance."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); + RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "self_friction", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0f, 80.0f); RNA_def_property_ui_text(prop, "Self Friction", "Friction/damping with self contact."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); + RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "self_collision_quality", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "self_loop_count"); RNA_def_property_range(prop, 1, 10); RNA_def_property_ui_text(prop, "Self Collision Quality", "How many self collision iterations should be done. (higher is better quality but slower)"); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); + RNA_def_property_update(prop, 0, "rna_cloth_update"); } void RNA_def_cloth(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c index a8dc0454cef..04d56eb666e 100644 --- a/source/blender/makesrna/intern/rna_constraint.c +++ b/source/blender/makesrna/intern/rna_constraint.c @@ -89,7 +89,7 @@ EnumPropertyItem space_object_items[] = { #include "ED_object.h" -StructRNA *rna_ConstraintType_refine(struct PointerRNA *ptr) +static StructRNA *rna_ConstraintType_refine(struct PointerRNA *ptr) { bConstraint *con= (bConstraint*)ptr->data; @@ -160,15 +160,14 @@ static char *rna_Constraint_path(PointerRNA *ptr) static void rna_Constraint_update(bContext *C, PointerRNA *ptr) { - Scene *scene= CTX_data_scene(C); Object *ob= ptr->id.data; if(ob->pose) update_pose_constraint_flags(ob->pose); object_test_constraints(ob); - if(ob->type==OB_ARMATURE) DAG_object_flush_update(scene, ob, OB_RECALC_DATA|OB_RECALC_OB); - else DAG_object_flush_update(scene, ob, OB_RECALC_OB); + if(ob->type==OB_ARMATURE) DAG_id_flush_update(&ob->id, OB_RECALC_DATA|OB_RECALC_OB); + else DAG_id_flush_update(&ob->id, OB_RECALC_OB); } static void rna_Constraint_dependency_update(bContext *C, PointerRNA *ptr) @@ -872,9 +871,15 @@ static void rna_def_constraint_follow_path(BlenderRNA *brna) RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); prop= RNA_def_property(srna, "offset", PROP_INT, PROP_TIME); - RNA_def_property_range(prop, -300000.0, 300000.f); + RNA_def_property_range(prop, MINAFRAME, MAXFRAME); RNA_def_property_ui_text(prop, "Offset", "Offset from the position corresponding to the time frame."); RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + + prop= RNA_def_property(srna, "offset_percentage", PROP_FLOAT, PROP_PERCENTAGE); + RNA_def_property_float_sdna(prop, NULL, "offset"); // XXX we might be better with another var or some hackery? + RNA_def_property_range(prop, 0.0f, 1.0f); + RNA_def_property_ui_text(prop, "Offset Percentage", "Percentage value defining target position along length of bone."); + RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); prop= RNA_def_property(srna, "forward", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "trackflag"); @@ -888,10 +893,21 @@ static void rna_def_constraint_follow_path(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Up Axis", "Axis that points upward."); RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); - prop= RNA_def_property(srna, "curve_follow", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "followflag", 1); + prop= RNA_def_property(srna, "use_curve_follow", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "followflag", FOLLOWPATH_FOLLOW); RNA_def_property_ui_text(prop, "Follow Curve", "Object will follow the heading and banking of the curve."); RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + + // TODO: do we need to do some special trickery to get offset sane for this? + prop= RNA_def_property(srna, "use_fixed_position", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "followflag", FOLLOWPATH_STATIC); + RNA_def_property_ui_text(prop, "Fixed Position", "Object will stay locked to a single point somewhere along the length of the curve regardless of time."); + RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + + prop= RNA_def_property(srna, "use_curve_radius", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "followflag", FOLLOWPATH_RADIUS); + RNA_def_property_ui_text(prop, "Curve Radius", "Objects scale by the curve radius."); + RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); } static void rna_def_constraint_stretch_to(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c index 1dd3d0e63c5..4a5af56d64a 100644 --- a/source/blender/makesrna/intern/rna_curve.c +++ b/source/blender/makesrna/intern/rna_curve.c @@ -35,6 +35,8 @@ #include "BKE_font.h" +#include "WM_types.h" + EnumPropertyItem beztriple_handle_type_items[] = { {HD_FREE, "FREE", 0, "Free", ""}, {HD_AUTO, "AUTO", 0, "Auto", ""}, @@ -48,6 +50,11 @@ EnumPropertyItem beztriple_interpolation_mode_items[] = { {BEZT_IPO_LIN, "LINEAR", 0, "Linear", ""}, {BEZT_IPO_BEZ, "BEZIER", 0, "Bezier", ""}, {0, NULL, 0, NULL, NULL}}; + +EnumPropertyItem beztriple_keyframe_type_items[] = { + {BEZT_KEYTYPE_KEYFRAME, "KEYFRAME", 0, "Keyframe", ""}, + {BEZT_KEYTYPE_BREAKDOWN, "BREAKDOWN", 0, "Breakdown", ""}, + {0, NULL, 0, NULL, NULL}}; #ifdef RNA_RUNTIME @@ -58,9 +65,8 @@ EnumPropertyItem beztriple_interpolation_mode_items[] = { #include "BKE_main.h" #include "WM_api.h" -#include "WM_types.h" -StructRNA *rna_Curve_refine(PointerRNA *ptr) +static StructRNA *rna_Curve_refine(PointerRNA *ptr) { Curve *cu= (Curve*)ptr->data; short obtype= curve_type(cu); @@ -70,6 +76,22 @@ StructRNA *rna_Curve_refine(PointerRNA *ptr) else return &RNA_Curve; } + +static PointerRNA rna_Curve_active_nurb_get(PointerRNA *ptr) +{ + Curve *cu= (Curve*)ptr->data; + Nurb *nu= NULL; + + if(cu->editnurb) + nu = BLI_findlink(cu->editnurb, cu->actnu); + + if(nu) + return rna_pointer_inherit_refine(ptr, &RNA_Nurb, nu); + + return rna_pointer_inherit_refine(ptr, NULL, NULL); +} + + static void rna_BezTriple_handle1_get(PointerRNA *ptr, float *values) { BezTriple *bt= (BezTriple*)ptr->data; @@ -137,12 +159,53 @@ static void rna_Curve_material_index_range(PointerRNA *ptr, int *min, int *max) *max= cu->totcol-1; } +static void rna_Curve_active_textbox_index_range(PointerRNA *ptr, int *min, int *max) +{ + Curve *cu= (Curve*)ptr->id.data; + *min= 0; + *max= cu->totbox-1; +} + + +static void rna_Curve_dimension_set(PointerRNA *ptr, int value) +{ + Curve *cu= (Curve*)ptr->id.data; + Nurb *nu= cu->editnurb ? cu->editnurb->first : cu->nurb.first; + + if(value==CU_3D) { + cu->flag |= CU_3D; + for( ; nu; nu= nu->next) { + nu->flag &= ~CU_2D; + } + } + else { + cu->flag &= ~CU_3D; + for( ; nu; nu= nu->next) { + nu->flag |= CU_2D; + test2DNurb(nu); + + /* since the handles are moved they need to be auto-located again */ + if(nu->type == CU_BEZIER) + calchandlesNurb(nu); + } + } +} + + + static int rna_Nurb_length(PointerRNA *ptr) { Nurb *nu= (Nurb*)ptr->data; return nu->pntsv>0 ? nu->pntsu*nu->pntsv : nu->pntsu; } +static void rna_Nurb_type_set(PointerRNA *ptr, int value) +{ + Nurb *nu= (Nurb*)ptr->data; + nu->type = value; + // XXX - TODO change datatypes +} + static void rna_BPoint_array_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Nurb *nu= (Nurb*)ptr->data; @@ -151,20 +214,44 @@ static void rna_BPoint_array_begin(CollectionPropertyIterator *iter, PointerRNA static void rna_Curve_update_data(bContext *C, PointerRNA *ptr) { - Main *bmain= CTX_data_main(C); - Scene *scene= CTX_data_scene(C); - Curve *cu= ptr->id.data; - Object *ob; - - for(ob=bmain->object.first; ob; ob= ob->id.next) { - if(ob->data == cu) { - /* XXX this will loop over all objects again (slow) */ - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob); - } - } + ID *id= ptr->id.data; + + DAG_id_flush_update(id, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, id); +} + +static void rna_Nurb_update_handle_data(bContext *C, PointerRNA *ptr) +{ + Nurb *nu= (Nurb*)ptr->data; + + if(nu->type == CU_BEZIER) + calchandlesNurb(nu); + + rna_Curve_update_data(C, ptr); +} + +static void rna_Nurb_update_knot_u(bContext *C, PointerRNA *ptr) +{ + Nurb *nu= (Nurb*)ptr->data; + + clamp_nurb_order_u(nu); + makeknots(nu, 1); + + rna_Curve_update_data(C, ptr); +} + +static void rna_Nurb_update_knot_v(bContext *C, PointerRNA *ptr) +{ + Nurb *nu= (Nurb*)ptr->data; + + clamp_nurb_order_v(nu); + makeknots(nu, 2); + + rna_Curve_update_data(C, ptr); } + + #else static void rna_def_bpoint(BlenderRNA *brna) @@ -206,7 +293,7 @@ static void rna_def_bpoint(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Weight", "Softbody goal weight"); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); - prop= RNA_def_property(srna, "bevel_radius", PROP_FLOAT, PROP_NONE); + prop= RNA_def_property(srna, "radius", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "radius"); /*RNA_def_property_range(prop, 0.0f, 1.0f);*/ RNA_def_property_clear_flag(prop, PROP_EDITABLE); @@ -259,10 +346,15 @@ static void rna_def_beztriple(BlenderRNA *brna) prop= RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "ipo"); - RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_enum_items(prop, beztriple_interpolation_mode_items); RNA_def_property_ui_text(prop, "Interpolation", "(For F-Curves Only) Interpolation to use for segment of curve starting from current BezTriple."); - RNA_def_property_update(prop, 0, "rna_Curve_update_data"); + //RNA_def_property_update(prop, 0, "rna_Curve_update_data"); // this should be an F-Curve update call instead... + + prop= RNA_def_property(srna, "keyframe_type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "hide"); + RNA_def_property_enum_items(prop, beztriple_keyframe_type_items); + RNA_def_property_ui_text(prop, "Keyframe Type", "(For F-Curves only) The type of keyframe this control point defines."); + //RNA_def_property_update(prop, 0, "rna_Curve_update_data"); // this should be an F-Curve update call instead... /* Vector values */ prop= RNA_def_property(srna, "handle1", PROP_FLOAT, PROP_TRANSLATION); @@ -295,7 +387,7 @@ static void rna_def_beztriple(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Weight", "Softbody goal weight"); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); - prop= RNA_def_property(srna, "bevel_radius", PROP_FLOAT, PROP_NONE); + prop= RNA_def_property(srna, "radius", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "radius"); /*RNA_def_property_range(prop, 0.0f, 1.0f);*/ RNA_def_property_clear_flag(prop, PROP_EDITABLE); @@ -315,25 +407,30 @@ static void rna_def_path(BlenderRNA *brna, StructRNA *srna) RNA_def_property_update(prop, 0, "rna_Curve_update_data"); /* flags */ - prop= RNA_def_property(srna, "path", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "use_path", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_PATH); RNA_def_property_ui_text(prop, "Path", "Enable the curve to become a translation path."); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); - prop= RNA_def_property(srna, "follow", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "use_path_follow", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_FOLLOW); RNA_def_property_ui_text(prop, "Follow", "Make curve path children to rotate along the path."); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); - prop= RNA_def_property(srna, "stretch", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "use_stretch", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_STRETCH); RNA_def_property_ui_text(prop, "Stretch", "Option for curve-deform: makes deformed child to stretch along entire path."); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); - prop= RNA_def_property(srna, "offset_path_distance", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "use_time_offset", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_OFFS_PATHDIST); RNA_def_property_ui_text(prop, "Offset Path Distance", "Children will use TimeOffs value as path distance offset."); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); + + prop= RNA_def_property(srna, "use_radius", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_PATH_RADIUS); + RNA_def_property_ui_text(prop, "Radius", "Option for paths: apply the curve radius with path following it and deforming."); + RNA_def_property_update(prop, 0, "rna_Curve_update_data"); } static void rna_def_nurbs(BlenderRNA *brna, StructRNA *srna) @@ -401,13 +498,13 @@ static void rna_def_font(BlenderRNA *brna, StructRNA *srna) RNA_def_property_ui_text(prop, "Shear", "Italic angle of the characters"); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); - prop= RNA_def_property(srna, "x_offset", PROP_FLOAT, PROP_NONE); + prop= RNA_def_property(srna, "offset_x", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "xof"); RNA_def_property_range(prop, -50.0f, 50.0f); RNA_def_property_ui_text(prop, "X Offset", "Horizontal offset from the object center"); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); - prop= RNA_def_property(srna, "y_offset", PROP_FLOAT, PROP_NONE); + prop= RNA_def_property(srna, "offset_y", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "yof"); RNA_def_property_range(prop, -50.0f, 50.0f); RNA_def_property_ui_text(prop, "Y Offset", "Vertical offset from the object center"); @@ -416,25 +513,29 @@ static void rna_def_font(BlenderRNA *brna, StructRNA *srna) prop= RNA_def_property(srna, "ul_position", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "ulpos"); RNA_def_property_range(prop, -0.2f, 0.8f); - RNA_def_property_ui_text(prop, "Underline position", "Vertical position of underline"); + RNA_def_property_ui_text(prop, "Underline Position", "Vertical position of underline"); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); prop= RNA_def_property(srna, "ul_height", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "ulheight"); RNA_def_property_range(prop, -0.2f, 0.8f); - RNA_def_property_ui_text(prop, "Underline thickness", ""); + RNA_def_property_ui_text(prop, "Underline Thickness", ""); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); + prop= RNA_def_property(srna, "textboxes", PROP_COLLECTION, PROP_NONE); + RNA_def_property_collection_sdna(prop, NULL, "tb", "totbox"); + RNA_def_property_struct_type(prop, "TextBox"); + RNA_def_property_ui_text(prop, "Textboxes", ""); + prop= RNA_def_property(srna, "active_textbox", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "actbox"); - RNA_def_property_range(prop, 0, 100); RNA_def_property_ui_text(prop, "The active text box", ""); - RNA_def_property_update(prop, 0, "rna_Curve_update_data"); + RNA_def_property_int_funcs(prop, NULL, NULL, "rna_Curve_active_textbox_index_range"); /* strings */ prop= RNA_def_property(srna, "family", PROP_STRING, PROP_NONE); RNA_def_property_string_maxlength(prop, 21); - RNA_def_property_ui_text(prop, "Family", "Blender uses font from selfmade objects."); + RNA_def_property_ui_text(prop, "Object Font", "Use Blender Objects as font characters. Give font objects a common name followed by the character it represents, eg. familya, familyb etc, and turn on Verts Duplication"); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); prop= RNA_def_property(srna, "str", PROP_STRING, PROP_NONE); @@ -455,12 +556,7 @@ static void rna_def_font(BlenderRNA *brna, StructRNA *srna) RNA_def_property_pointer_sdna(prop, NULL, "vfont"); RNA_def_property_ui_text(prop, "Font", ""); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); - - prop= RNA_def_property(srna, "textbox", PROP_POINTER, PROP_NONE); - RNA_def_property_pointer_sdna(prop, NULL, "tb"); - RNA_def_property_ui_text(prop, "Textbox", ""); - RNA_def_property_update(prop, 0, "rna_Curve_update_data"); - + prop= RNA_def_property(srna, "edit_format", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "curinfo"); RNA_def_property_ui_text(prop, "Edit Format", "Editing settings character formatting."); @@ -573,6 +669,17 @@ static void rna_def_curve(BlenderRNA *brna) StructRNA *srna; PropertyRNA *prop; + static EnumPropertyItem curve_twist_mode_items[] = { + {CU_TWIST_Z_UP, "Z_UP", 0, "Z-Up", "Use Z-Up axis to calculate the curve twist at each point"}, + {CU_TWIST_MINIMUM, "MINIMUM", 0, "Minimum", "Use the least twist over the entire curve"}, + {CU_TWIST_TANGENT, "TANGENT", 0, "Tangent", "Use the tangent to calculate twist"}, + {0, NULL, 0, NULL, NULL}}; + + static const EnumPropertyItem curve_axis_items[]= { + {0, "2D", 0, "2D", "Clamp the Z axis of of the curve"}, + {CU_3D, "3D", 0, "3D", "Allow editing on the Z axis of this curve, also alows tilt and curve radius to be used."}, + {0, NULL, 0, NULL, NULL}}; + srna= RNA_def_struct(brna, "Curve", "ID"); RNA_def_struct_ui_text(srna, "Curve", "Curve datablock storing curves, splines and NURBS."); RNA_def_struct_ui_icon(srna, ICON_CURVE_DATA); @@ -585,10 +692,26 @@ static void rna_def_curve(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "key"); RNA_def_property_ui_text(prop, "Shape Keys", ""); - prop= RNA_def_property(srna, "curves", PROP_COLLECTION, PROP_NONE); + prop= RNA_def_property(srna, "splines", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "nurb", NULL); RNA_def_property_struct_type(prop, "Nurb"); - RNA_def_property_ui_text(prop, "Curves", "Collection of curves in this curve data object."); + RNA_def_property_ui_text(prop, "Splines", "Collection of splines in this curve data object."); + + prop= RNA_def_property(srna, "active_spline", PROP_POINTER, PROP_NONE); + RNA_def_property_struct_type(prop, "Nurb"); + RNA_def_property_pointer_funcs(prop, "rna_Curve_active_nurb_get", NULL, NULL); + RNA_def_property_ui_text(prop, "Active Spline", "The active editmode spline"); + + + prop= RNA_def_property(srna, "draw_handles", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "drawflag", CU_HIDE_HANDLES); + RNA_def_property_ui_text(prop, "Draw Handles", "Display bezier handles in editmode."); + RNA_def_property_update(prop, NC_GEOM|ND_DATA, NULL); + + prop= RNA_def_property(srna, "draw_normals", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "drawflag", CU_HIDE_NORMALS); + RNA_def_property_ui_text(prop, "Draw Normals", "Display 3D curve normals in editmode."); + RNA_def_property_update(prop, NC_GEOM|ND_DATA, NULL); rna_def_path(brna, srna); @@ -660,9 +783,12 @@ static void rna_def_curve(BlenderRNA *brna) RNA_def_property_update(prop, 0, "rna_Curve_update_data"); /* Flags */ - prop= RNA_def_property(srna, "curve_2d", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", CU_3D); - RNA_def_property_ui_text(prop, "2D Curve", "Define curve in two dimensions only. Note that fill only works when this is enabled."); + + prop= RNA_def_property(srna, "dimensions", PROP_ENUM, PROP_NONE); /* as an enum */ + RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); + RNA_def_property_enum_items(prop, curve_axis_items); + RNA_def_property_enum_funcs(prop, NULL, "rna_Curve_dimension_set", NULL); + RNA_def_property_ui_text(prop, "Dimensions", "Select 2D or 3D curve type."); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); prop= RNA_def_property(srna, "front", PROP_BOOLEAN, PROP_NONE); @@ -674,7 +800,22 @@ static void rna_def_curve(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_BACK); RNA_def_property_ui_text(prop, "Back", "Draw filled back for extruded/beveled curves."); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); - + + prop= RNA_def_property(srna, "twist_mode", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "twist_mode"); + RNA_def_property_enum_items(prop, curve_twist_mode_items); + RNA_def_property_ui_text(prop, "Twist Method", "The type of tilt calculation for 3D Curves."); + RNA_def_property_update(prop, 0, "rna_Curve_update_data"); + + // XXX - would be nice to have a better way to do this, only add for testing. + prop= RNA_def_property(srna, "twist_smooth", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "twist_smooth"); + RNA_def_property_ui_range(prop, 0, 100.0, 0.1, 0); + RNA_def_property_ui_text(prop, "Twist Smooth", "Smoothing iteration for tangents"); + RNA_def_property_update(prop, 0, "rna_Curve_update_data"); + + + prop= RNA_def_property(srna, "retopo", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_RETOPO); RNA_def_property_ui_text(prop, "Retopo", "Turn on the re-topology tool."); @@ -683,6 +824,14 @@ static void rna_def_curve(BlenderRNA *brna) static void rna_def_curve_nurb(BlenderRNA *brna) { + static EnumPropertyItem curve_type_items[] = { + {CU_POLY, "POLY", 0, "Poly", ""}, + {CU_BEZIER, "BEZIER", 0, "Bezier", ""}, + {CU_BSPLINE, "BSPLINE", 0, "BSpline", ""}, + {CU_CARDINAL, "CARDINAL", 0, "Cardinal", ""}, + {CU_NURBS, "NURBS", 0, "Ease", ""}, + {0, NULL, 0, NULL, NULL}}; + static EnumPropertyItem spline_interpolation_items[] = { {BEZT_IPO_CONST, "LINEAR", 0, "Linear", ""}, {BEZT_IPO_LIN, "CARDINAL", 0, "Cardinal", ""}, @@ -694,18 +843,18 @@ static void rna_def_curve_nurb(BlenderRNA *brna) PropertyRNA *prop; srna= RNA_def_struct(brna, "Nurb", NULL); - RNA_def_struct_ui_text(srna, "Nurb", "Element of a curve, either Nurb, Bezier or Polyline or a character with text objects."); + RNA_def_struct_ui_text(srna, "Spline", "Element of a curve, either Nurbs, Bezier or Polyline or a character with text objects."); prop= RNA_def_property(srna, "points", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "bp", NULL); RNA_def_property_struct_type(prop, "CurvePoint"); RNA_def_property_collection_funcs(prop, "rna_BPoint_array_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_Nurb_length", 0, 0, 0, 0); - RNA_def_property_ui_text(prop, "Points", "Collection of points for Poly and Nurbs curves."); + RNA_def_property_ui_text(prop, "Points", "Collection of points that make up this poly or nurbs spline."); prop= RNA_def_property(srna, "bezier_points", PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_type(prop, "BezierCurvePoint"); RNA_def_property_collection_sdna(prop, NULL, "bezt", "pntsu"); - RNA_def_property_ui_text(prop, "Bezier Points", "Collection of points bezier curves only."); + RNA_def_property_ui_text(prop, "Bezier Points", "Collection of points for bezier curves only."); prop= RNA_def_property(srna, "tilt_interpolation", PROP_ENUM, PROP_NONE); @@ -720,6 +869,12 @@ static void rna_def_curve_nurb(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Radius Interpolation", "The type of radius interpolation for Bezier curves."); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); + // XXX - switching type probably needs comprehensive recalc of data like in 2.4x + prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_items(prop, curve_type_items); + RNA_def_property_enum_funcs(prop, NULL, "rna_Nurb_type_set", NULL); + RNA_def_property_ui_text(prop, "Type", "The interpolation type for this curve element."); + RNA_def_property_update(prop, 0, "rna_Curve_update_data"); prop= RNA_def_property(srna, "point_count_u", PROP_INT, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* editing this needs knot recalc*/ @@ -737,14 +892,14 @@ static void rna_def_curve_nurb(BlenderRNA *brna) prop= RNA_def_property(srna, "order_u", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "orderu"); RNA_def_property_range(prop, 2, 6); - RNA_def_property_ui_text(prop, "Order U", "Nurbs order in the U direction (For curves and surfaces), Higher values let points influence a greater area"); - RNA_def_property_update(prop, 0, "rna_Curve_update_data"); + RNA_def_property_ui_text(prop, "Order U", "Nurbs order in the U direction (For splines and surfaces), Higher values let points influence a greater area"); + RNA_def_property_update(prop, 0, "rna_Nurb_update_knot_u"); prop= RNA_def_property(srna, "order_v", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "orderv"); RNA_def_property_range(prop, 2, 6); RNA_def_property_ui_text(prop, "Order V", "Nurbs order in the V direction (For surfaces only), Higher values let points influence a greater area"); - RNA_def_property_update(prop, 0, "rna_Curve_update_data"); + RNA_def_property_update(prop, 0, "rna_Nurb_update_knot_v"); prop= RNA_def_property(srna, "resolution_u", PROP_INT, PROP_NONE); @@ -762,7 +917,7 @@ static void rna_def_curve_nurb(BlenderRNA *brna) prop= RNA_def_property(srna, "cyclic_u", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flagu", CU_CYCLIC); RNA_def_property_ui_text(prop, "Cyclic U", "Make this curve or surface a closed loop in the U direction."); - RNA_def_property_update(prop, 0, "rna_Curve_update_data"); + RNA_def_property_update(prop, 0, "rna_Nurb_update_handle_data"); /* only needed for cyclic_u because cyclic_v cant do bezier */ prop= RNA_def_property(srna, "cyclic_v", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flagv", CU_CYCLIC); @@ -774,22 +929,22 @@ static void rna_def_curve_nurb(BlenderRNA *brna) prop= RNA_def_property(srna, "endpoint_u", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flagu", 2); RNA_def_property_ui_text(prop, "Endpoint U", "Make this nurbs curve or surface meet the endpoints in the U direction (Cyclic U must be disabled)."); - RNA_def_property_update(prop, 0, "rna_Curve_update_data"); + RNA_def_property_update(prop, 0, "rna_Nurb_update_knot_u"); prop= RNA_def_property(srna, "endpoint_v", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flagv", 2); RNA_def_property_ui_text(prop, "Endpoint V", "Make this nurbs surface meet the endpoints in the V direction (Cyclic V must be disabled)."); - RNA_def_property_update(prop, 0, "rna_Curve_update_data"); + RNA_def_property_update(prop, 0, "rna_Nurb_update_knot_v"); prop= RNA_def_property(srna, "bezier_u", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flagu", 4); RNA_def_property_ui_text(prop, "Bezier U", "Make this nurbs curve or surface act like a bezier spline in the U direction (Order U must be 3 or 4, Cyclic U must be disabled)."); - RNA_def_property_update(prop, 0, "rna_Curve_update_data"); + RNA_def_property_update(prop, 0, "rna_Nurb_update_knot_u"); prop= RNA_def_property(srna, "bezier_v", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flagv", 4); RNA_def_property_ui_text(prop, "Bezier V", "Make this nurbs surface act like a bezier spline in the V direction (Order V must be 3 or 4, Cyclic V must be disabled)."); - RNA_def_property_update(prop, 0, "rna_Curve_update_data"); + RNA_def_property_update(prop, 0, "rna_Nurb_update_knot_v"); prop= RNA_def_property(srna, "smooth", PROP_BOOLEAN, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c index 1f51b3ff34c..0b54d4a8e14 100644 --- a/source/blender/makesrna/intern/rna_define.c +++ b/source/blender/makesrna/intern/rna_define.c @@ -66,7 +66,7 @@ void rna_addtail(ListBase *listbase, void *vlink) listbase->last = link; } -void rna_remlink(ListBase *listbase, void *vlink) +static void rna_remlink(ListBase *listbase, void *vlink) { Link *link= vlink; @@ -155,7 +155,7 @@ PropertyDefRNA *rna_find_struct_property_def(StructRNA *srna, PropertyRNA *prop) return NULL; } -PropertyDefRNA *rna_find_property_def(PropertyRNA *prop) +static PropertyDefRNA *rna_find_property_def(PropertyRNA *prop) { PropertyDefRNA *dprop; @@ -239,7 +239,7 @@ PropertyDefRNA *rna_find_parameter_def(PropertyRNA *parm) return NULL; } -ContainerDefRNA *rna_find_container_def(ContainerRNA *cont) +static ContainerDefRNA *rna_find_container_def(ContainerRNA *cont) { StructDefRNA *ds; FunctionDefRNA *dfunc; @@ -1001,18 +1001,18 @@ void RNA_def_property_clear_flag(PropertyRNA *prop, int flag) prop->flag &= ~flag; } -void RNA_def_property_array(PropertyRNA *prop, int arraylength) +void RNA_def_property_array(PropertyRNA *prop, int length) { StructRNA *srna= DefRNA.laststruct; - if(arraylength<0) { + if(length<0) { fprintf(stderr, "RNA_def_property_array: %s.%s, array length must be zero of greater.\n", srna->identifier, prop->identifier); DefRNA.error= 1; return; } - if(arraylength>RNA_MAX_ARRAY) { - fprintf(stderr, "RNA_def_property_array: %s.%s, array length must be smaller than %d.\n", srna->identifier, prop->identifier, RNA_MAX_ARRAY); + if(length>RNA_MAX_ARRAY_LENGTH) { + fprintf(stderr, "RNA_def_property_array: %s.%s, array length must be smaller than %d.\n", srna->identifier, prop->identifier, RNA_MAX_ARRAY_LENGTH); DefRNA.error= 1; return; } @@ -1021,33 +1021,53 @@ void RNA_def_property_array(PropertyRNA *prop, int arraylength) case PROP_BOOLEAN: case PROP_INT: case PROP_FLOAT: - prop->arraylength= arraylength; + prop->arraylength[0]= length; + prop->totarraylength= length; + prop->arraydimension= 1; break; default: fprintf(stderr, "RNA_def_property_array: %s.%s, only boolean/int/float can be array.\n", srna->identifier, prop->identifier); DefRNA.error= 1; break; } - - prop->arraydimension= 1; } -void RNA_def_property_multidimensional_array(PropertyRNA *prop, int arraylength, unsigned short dimension, unsigned short dimsize[]) +void RNA_def_property_multi_array(PropertyRNA *prop, int dimension, int length[]) { StructRNA *srna= DefRNA.laststruct; + int i; if (dimension < 1 || dimension > RNA_MAX_ARRAY_DIMENSION) { - fprintf(stderr, "RNA_def_property_multidimensional_array: %s.%s, array dimension must be between 1 and %d.\n", srna->identifier, prop->identifier, RNA_MAX_ARRAY_DIMENSION); + fprintf(stderr, "RNA_def_property_multi_array: %s.%s, array dimension must be between 1 and %d.\n", srna->identifier, prop->identifier, RNA_MAX_ARRAY_DIMENSION); DefRNA.error= 1; return; } - RNA_def_property_array(prop, arraylength); + switch(prop->type) { + case PROP_BOOLEAN: + case PROP_INT: + case PROP_FLOAT: + break; + default: + fprintf(stderr, "RNA_def_property_multi_array: %s.%s, only boolean/int/float can be array.\n", srna->identifier, prop->identifier); + DefRNA.error= 1; + break; + } prop->arraydimension= dimension; + prop->totarraylength= 0; - if (dimension > 1) - memcpy(prop->dimsize, dimsize, sizeof(dimsize[0]) * (dimension - 1)); + if(length) { + memcpy(prop->arraylength, length, sizeof(int)*dimension); + + prop->totarraylength= length[0]; + for(i=1; i<dimension; i++) + prop->totarraylength *= length[i]; + } + else + memset(prop->arraylength, 0, sizeof(prop->arraylength)); + + /* TODO make sure arraylength values are sane */ } void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description) @@ -1420,10 +1440,15 @@ static PropertyDefRNA *rna_def_property_sdna(PropertyRNA *prop, const char *stru } } - if(smember.arraylength > 1) - prop->arraylength= smember.arraylength; - else - prop->arraylength= 0; + if(smember.arraylength > 1) { + prop->arraylength[0]= smember.arraylength; + prop->totarraylength= smember.arraylength; + prop->arraydimension= 1; + } + else { + prop->arraydimension= 0; + prop->totarraylength= 0; + } dp->dnastructname= structname; dp->dnastructfromname= ds->dnafromname; @@ -1543,8 +1568,10 @@ void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const } if((dp=rna_def_property_sdna(prop, structname, propname))) { - if(prop->arraylength) { - prop->arraylength= 0; + if(prop->arraydimension) { + prop->arraydimension= 0; + prop->totarraylength= 0; + if(!DefRNA.silent) { fprintf(stderr, "RNA_def_property_enum_sdna: %s.%s, array not supported for enum type.\n", structname, propname); DefRNA.error= 1; @@ -1583,9 +1610,10 @@ void RNA_def_property_string_sdna(PropertyRNA *prop, const char *structname, con } if((dp=rna_def_property_sdna(prop, structname, propname))) { - if(prop->arraylength) { - sprop->maxlength= prop->arraylength; - prop->arraylength= 0; + if(prop->arraydimension) { + sprop->maxlength= prop->totarraylength; + prop->arraydimension= 0; + prop->totarraylength= 0; } } } @@ -1607,8 +1635,10 @@ void RNA_def_property_pointer_sdna(PropertyRNA *prop, const char *structname, co } if((dp=rna_def_property_sdna(prop, structname, propname))) { - if(prop->arraylength) { - prop->arraylength= 0; + if(prop->arraydimension) { + prop->arraydimension= 0; + prop->totarraylength= 0; + if(!DefRNA.silent) { fprintf(stderr, "RNA_def_property_pointer_sdna: %s.%s, array not supported for pointer type.\n", structname, propname); DefRNA.error= 1; @@ -1635,8 +1665,9 @@ void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname, } if((dp=rna_def_property_sdna(prop, structname, propname))) { - if(prop->arraylength && !lengthpropname) { - prop->arraylength= 0; + if(prop->arraydimension && !lengthpropname) { + prop->arraydimension= 0; + prop->totarraylength= 0; if(!DefRNA.silent) { fprintf(stderr, "RNA_def_property_collection_sdna: %s.%s, array of collections not supported.\n", structname, propname); @@ -1660,8 +1691,9 @@ void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname, if(lengthpropname[0] == 0 || rna_find_sdna_member(DefRNA.sdna, structname, lengthpropname, &smember)) { if(lengthpropname[0] == 0) { - dp->dnalengthfixed= prop->arraylength; - prop->arraylength= 0; + dp->dnalengthfixed= prop->totarraylength; + prop->arraydimension= 0; + prop->totarraylength= 0; } else { dp->dnalengthstructname= structname; @@ -1708,7 +1740,7 @@ void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *func) prop->update= (UpdateFunc)func; } -void RNA_def_property_dynamic_array_funcs(PropertyRNA *prop, const char *getlength, const char *setlength) +void RNA_def_property_dynamic_array_funcs(PropertyRNA *prop, const char *getlength) { if(!DefRNA.preprocess) { fprintf(stderr, "RNA_def_property_*_funcs: only during preprocessing.\n"); @@ -1722,7 +1754,6 @@ void RNA_def_property_dynamic_array_funcs(PropertyRNA *prop, const char *getleng } if(getlength) prop->getlength= (PropArrayLengthGetFunc)getlength; - if(setlength) prop->setlength= (PropArrayLengthSetFunc)setlength; } void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const char *set) @@ -1738,7 +1769,7 @@ void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const ch case PROP_BOOLEAN: { BooleanPropertyRNA *bprop= (BooleanPropertyRNA*)prop; - if(prop->arraylength) { + if(prop->arraydimension) { if(get) bprop->getarray= (PropBooleanArrayGetFunc)get; if(set) bprop->setarray= (PropBooleanArraySetFunc)set; } @@ -1768,7 +1799,7 @@ void RNA_def_property_int_funcs(PropertyRNA *prop, const char *get, const char * case PROP_INT: { IntPropertyRNA *iprop= (IntPropertyRNA*)prop; - if(prop->arraylength) { + if(prop->arraydimension) { if(get) iprop->getarray= (PropIntArrayGetFunc)get; if(set) iprop->setarray= (PropIntArraySetFunc)set; } @@ -1799,7 +1830,7 @@ void RNA_def_property_float_funcs(PropertyRNA *prop, const char *get, const char case PROP_FLOAT: { FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop; - if(prop->arraylength) { + if(prop->arraydimension) { if(get) fprop->getarray= (PropFloatArrayGetFunc)get; if(set) fprop->setarray= (PropFloatArraySetFunc)set; } @@ -1951,6 +1982,34 @@ PropertyRNA *RNA_def_boolean_array(StructOrFunctionRNA *cont_, const char *ident return prop; } +PropertyRNA *RNA_def_boolean_layer(StructOrFunctionRNA *cont_, const char *identifier, int len, int *default_value, + const char *ui_name, const char *ui_description) +{ + ContainerRNA *cont= cont_; + PropertyRNA *prop; + + prop= RNA_def_property(cont, identifier, PROP_BOOLEAN, PROP_LAYER); + if(len != 0) RNA_def_property_array(prop, len); + if(default_value) RNA_def_property_boolean_array_default(prop, default_value); + RNA_def_property_ui_text(prop, ui_name, ui_description); + + return prop; +} + +PropertyRNA *RNA_def_boolean_layer_member(StructOrFunctionRNA *cont_, const char *identifier, int len, int *default_value, + const char *ui_name, const char *ui_description) +{ + ContainerRNA *cont= cont_; + PropertyRNA *prop; + + prop= RNA_def_property(cont, identifier, PROP_BOOLEAN, PROP_LAYER_MEMBER); + if(len != 0) RNA_def_property_array(prop, len); + if(default_value) RNA_def_property_boolean_array_default(prop, default_value); + RNA_def_property_ui_text(prop, ui_name, ui_description); + + return prop; +} + PropertyRNA *RNA_def_boolean_vector(StructOrFunctionRNA *cont_, const char *identifier, int len, int *default_value, const char *ui_name, const char *ui_description) { @@ -2054,6 +2113,20 @@ PropertyRNA *RNA_def_string_dir_path(StructOrFunctionRNA *cont_, const char *ide return prop; } +PropertyRNA *RNA_def_string_file_name(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, int maxlen, + const char *ui_name, const char *ui_description) +{ + ContainerRNA *cont= cont_; + PropertyRNA *prop; + + prop= RNA_def_property(cont, identifier, PROP_STRING, PROP_FILENAME); + if(maxlen != 0) RNA_def_property_string_maxlength(prop, maxlen); + if(default_value) RNA_def_property_string_default(prop, default_value); + RNA_def_property_ui_text(prop, ui_name, ui_description); + + return prop; +} + PropertyRNA *RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description) { @@ -2122,15 +2195,15 @@ PropertyRNA *RNA_def_float_color(StructOrFunctionRNA *cont_, const char *identif } -PropertyRNA *RNA_def_float_matrix(StructOrFunctionRNA *cont_, const char *identifier, int len, int rowsize, const float *default_value, +PropertyRNA *RNA_def_float_matrix(StructOrFunctionRNA *cont_, const char *identifier, int rows, int columns, const float *default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax) { ContainerRNA *cont= cont_; PropertyRNA *prop; - unsigned short dimsize[1]= {rowsize}; + int length[2]= {rows, columns}; prop= RNA_def_property(cont, identifier, PROP_FLOAT, PROP_MATRIX); - if(len != 0) RNA_def_property_multidimensional_array(prop, len, 2, dimsize); + RNA_def_property_multi_array(prop, 2, length); if(default_value) RNA_def_property_float_array_default(prop, default_value); if(hardmin != hardmax) RNA_def_property_range(prop, hardmin, hardmax); RNA_def_property_ui_text(prop, ui_name, ui_description); @@ -2327,10 +2400,9 @@ void RNA_def_function_ui_description(FunctionRNA *func, const char *description) int rna_parameter_size(PropertyRNA *parm) { PropertyType ptype= parm->type; - int len= parm->arraylength; + int len= parm->totarraylength; /* only supports fixed length at the moment */ if(len > 0) { - if (parm->flag & PROP_DYNAMIC) return sizeof(void *); @@ -2478,8 +2550,8 @@ void RNA_def_property_duplicate_pointers(PropertyRNA *prop) BooleanPropertyRNA *bprop= (BooleanPropertyRNA*)prop; if(bprop->defaultarray) { - iarray= MEM_callocN(sizeof(int)*prop->arraylength, "RNA_def_property_store"); - memcpy(iarray, bprop->defaultarray, sizeof(int)*prop->arraylength); + iarray= MEM_callocN(sizeof(int)*prop->totarraylength, "RNA_def_property_store"); + memcpy(iarray, bprop->defaultarray, sizeof(int)*prop->totarraylength); bprop->defaultarray= iarray; } break; @@ -2488,8 +2560,8 @@ void RNA_def_property_duplicate_pointers(PropertyRNA *prop) IntPropertyRNA *iprop= (IntPropertyRNA*)prop; if(iprop->defaultarray) { - iarray= MEM_callocN(sizeof(int)*prop->arraylength, "RNA_def_property_store"); - memcpy(iarray, iprop->defaultarray, sizeof(int)*prop->arraylength); + iarray= MEM_callocN(sizeof(int)*prop->totarraylength, "RNA_def_property_store"); + memcpy(iarray, iprop->defaultarray, sizeof(int)*prop->totarraylength); iprop->defaultarray= iarray; } break; @@ -2514,8 +2586,8 @@ void RNA_def_property_duplicate_pointers(PropertyRNA *prop) FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop; if(fprop->defaultarray) { - farray= MEM_callocN(sizeof(float)*prop->arraylength, "RNA_def_property_store"); - memcpy(farray, fprop->defaultarray, sizeof(float)*prop->arraylength); + farray= MEM_callocN(sizeof(float)*prop->totarraylength, "RNA_def_property_store"); + memcpy(farray, fprop->defaultarray, sizeof(float)*prop->totarraylength); fprop->defaultarray= farray; } break; @@ -2559,13 +2631,14 @@ void RNA_def_property_free_pointers(PropertyRNA *prop) } case PROP_ENUM: { EnumPropertyRNA *eprop= (EnumPropertyRNA*)prop; - if(eprop->item) MEM_freeN((void*)eprop->item); for(a=0; a<eprop->totitem; a++) { if(eprop->item[a].identifier) MEM_freeN((void*)eprop->item[a].identifier); if(eprop->item[a].name) MEM_freeN((void*)eprop->item[a].name); if(eprop->item[a].description) MEM_freeN((void*)eprop->item[a].description); } + + if(eprop->item) MEM_freeN((void*)eprop->item); break; } case PROP_STRING: { diff --git a/source/blender/makesrna/intern/rna_fcurve.c b/source/blender/makesrna/intern/rna_fcurve.c index fa6eea5f8a9..2802665c639 100644 --- a/source/blender/makesrna/intern/rna_fcurve.c +++ b/source/blender/makesrna/intern/rna_fcurve.c @@ -34,6 +34,8 @@ #include "MEM_guardedalloc.h" +#include "WM_types.h" + EnumPropertyItem fmodifier_type_items[] = { {FMODIFIER_TYPE_NULL, "NULL", 0, "Invalid", ""}, {FMODIFIER_TYPE_GENERATOR, "GENERATOR", 0, "Generator", ""}, @@ -50,7 +52,7 @@ EnumPropertyItem fmodifier_type_items[] = { /* --------- */ -StructRNA *rna_FModifierType_refine(struct PointerRNA *ptr) +static StructRNA *rna_FModifierType_refine(struct PointerRNA *ptr) { FModifier *fcm= (FModifier *)ptr->data; @@ -168,17 +170,20 @@ static void rna_def_fmodifier_generator(BlenderRNA *brna) prop= RNA_def_property(srna, "additive", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_GENERATOR_ADDITIVE); RNA_def_property_ui_text(prop, "Additive", "Values generated by this modifier are applied on top of the existing values instead of overwriting them."); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); // XXX this has a special validation func prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, prop_mode_items); RNA_def_property_ui_text(prop, "Mode", "Type of generator to use."); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); /* order of the polynomial */ // XXX this has a special validation func prop= RNA_def_property(srna, "poly_order", PROP_INT, PROP_NONE); RNA_def_property_ui_text(prop, "Polynomial Order", "The highest power of 'x' for this polynomial. (number of coefficients - 1)"); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); /* coefficients array */ // FIXME: this is quite difficult to try to wrap @@ -210,25 +215,31 @@ static void rna_def_fmodifier_function_generator(BlenderRNA *brna) /* coefficients */ prop= RNA_def_property(srna, "amplitude", PROP_FLOAT, PROP_NONE); RNA_def_property_ui_text(prop, "Amplitude", "Scale factor determining the maximum/minimum values."); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); prop= RNA_def_property(srna, "phase_multiplier", PROP_FLOAT, PROP_NONE); RNA_def_property_ui_text(prop, "Phase Multiplier", "Scale factor determining the 'speed' of the function."); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); prop= RNA_def_property(srna, "phase_offset", PROP_FLOAT, PROP_NONE); RNA_def_property_ui_text(prop, "Phase Offset", "Constant factor to offset time by for function."); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); prop= RNA_def_property(srna, "value_offset", PROP_FLOAT, PROP_NONE); RNA_def_property_ui_text(prop, "Value Offset", "Constant factor to offset values by."); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); /* flags */ prop= RNA_def_property(srna, "additive", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_GENERATOR_ADDITIVE); RNA_def_property_ui_text(prop, "Additive", "Values generated by this modifier are applied on top of the existing values instead of overwriting them."); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); prop= RNA_def_property(srna, "function_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "type"); RNA_def_property_enum_items(prop, prop_type_items); RNA_def_property_ui_text(prop, "Type", "Type of built-in function to use."); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); } /* --------- */ @@ -249,15 +260,18 @@ static void rna_def_fmodifier_envelope_ctrl(BlenderRNA *brna) prop= RNA_def_property(srna, "minimum", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "min"); RNA_def_property_ui_text(prop, "Minimum Value", "Lower bound of envelope at this control-point."); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); prop= RNA_def_property(srna, "maximum", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "max"); RNA_def_property_ui_text(prop, "Maximum Value", "Upper bound of envelope at this control-point."); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); /* Frame */ prop= RNA_def_property(srna, "frame", PROP_FLOAT, PROP_TIME); RNA_def_property_float_sdna(prop, NULL, "time"); RNA_def_property_ui_text(prop, "Frame", "Frame this control-point occurs on."); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); // TODO: // - selection flags (not implemented in UI yet though) @@ -282,14 +296,17 @@ static void rna_def_fmodifier_envelope(BlenderRNA *brna) prop= RNA_def_property(srna, "reference_value", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "midval"); RNA_def_property_ui_text(prop, "Reference Value", "Value that envelope's influence is centered around / based on."); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); prop= RNA_def_property(srna, "default_minimum", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "min"); RNA_def_property_ui_text(prop, "Default Minimum", "Lower distance from Reference Value for 1:1 default influence."); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); prop= RNA_def_property(srna, "default_maximum", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "max"); RNA_def_property_ui_text(prop, "Default Maximum", "Upper distance from Reference Value for 1:1 default influence."); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); } /* --------- */ @@ -314,18 +331,21 @@ static void rna_def_fmodifier_cycles(BlenderRNA *brna) prop= RNA_def_property(srna, "before_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, prop_type_items); RNA_def_property_ui_text(prop, "Before Mode", "Cycling mode to use before first keyframe."); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); prop= RNA_def_property(srna, "before_cycles", PROP_FLOAT, PROP_NONE); RNA_def_property_ui_text(prop, "Before Cycles", "Maximum number of cycles to allow before first keyframe. (0 = infinite)"); - + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); /* after */ prop= RNA_def_property(srna, "after_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, prop_type_items); RNA_def_property_ui_text(prop, "After Mode", "Cycling mode to use after last keyframe."); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); prop= RNA_def_property(srna, "after_cycles", PROP_FLOAT, PROP_NONE); RNA_def_property_ui_text(prop, "After Cycles", "Maximum number of cycles to allow after last keyframe. (0 = infinite)"); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); } /* --------- */ @@ -354,34 +374,42 @@ static void rna_def_fmodifier_limits(BlenderRNA *brna) prop= RNA_def_property(srna, "use_minimum_x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_LIMIT_XMIN); RNA_def_property_ui_text(prop, "Minimum X", "Use the minimum X value."); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); prop= RNA_def_property(srna, "use_minimum_y", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_LIMIT_YMIN); RNA_def_property_ui_text(prop, "Minimum Y", "Use the minimum Y value."); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); prop= RNA_def_property(srna, "use_maximum_x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_LIMIT_XMAX); RNA_def_property_ui_text(prop, "Maximum X", "Use the maximum X value."); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); prop= RNA_def_property(srna, "use_maximum_y", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_LIMIT_YMAX); RNA_def_property_ui_text(prop, "Maximum Y", "Use the maximum Y value."); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); prop= RNA_def_property(srna, "minimum_x", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "rect.xmin"); RNA_def_property_ui_text(prop, "Minimum X", "Lowest X value to allow."); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); prop= RNA_def_property(srna, "minimum_y", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "rect.ymin"); RNA_def_property_ui_text(prop, "Minimum Y", "Lowest Y value to allow."); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); prop= RNA_def_property(srna, "maximum_x", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "rect.xmax"); RNA_def_property_ui_text(prop, "Maximum X", "Highest X value to allow."); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); prop= RNA_def_property(srna, "maximum_y", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "rect.ymax"); RNA_def_property_ui_text(prop, "Maximum Y", "Highest Y value to allow."); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); } /* --------- */ @@ -405,29 +433,34 @@ static void rna_def_fmodifier_noise(BlenderRNA *brna) prop= RNA_def_property(srna, "modification", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, prop_modification_items); RNA_def_property_ui_text(prop, "Modification", "Method of modifying the existing F-Curve."); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); prop= RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "size"); RNA_def_property_ui_text(prop, "Size", "Scaling (in time) of the noise"); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); prop= RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "strength"); RNA_def_property_ui_text(prop, "Strength", "Amplitude of the noise - the amount that it modifies the underlying curve"); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); prop= RNA_def_property(srna, "phase", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "phase"); RNA_def_property_ui_text(prop, "Phase", "A random seed for the noise effect"); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); prop= RNA_def_property(srna, "depth", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "depth"); RNA_def_property_ui_text(prop, "Depth", "Amount of fine level detail present in the noise"); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); } /* --------- */ -void rna_def_fmodifier(BlenderRNA *brna) +static void rna_def_fmodifier(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; @@ -459,22 +492,25 @@ void rna_def_fmodifier(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_boolean_sdna(prop, NULL, "flag", FMODIFIER_FLAG_MUTED); RNA_def_property_ui_text(prop, "Muted", "F-Curve Modifier will not be evaluated."); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL); // XXX this is really an internal flag, but it may be useful for some tools to be able to access this... prop= RNA_def_property(srna, "disabled", PROP_BOOLEAN, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_boolean_sdna(prop, NULL, "flag", FMODIFIER_FLAG_DISABLED); RNA_def_property_ui_text(prop, "Disabled", "F-Curve Modifier has invalid settings and will not be evaluated."); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL); // TODO: setting this to true must ensure that all others in stack are turned off too... prop= RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", FMODIFIER_FLAG_ACTIVE); RNA_def_property_ui_text(prop, "Active", "F-Curve Modifier is the one being edited "); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL); } /* *********************** */ -void rna_def_drivertarget(BlenderRNA *brna) +static void rna_def_drivertarget(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; @@ -500,7 +536,7 @@ void rna_def_drivertarget(BlenderRNA *brna) RNA_def_property_ui_text(prop, "RNA Array Index", "Index to the specific property used (if applicable)"); } -void rna_def_channeldriver(BlenderRNA *brna) +static void rna_def_channeldriver(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; @@ -554,7 +590,7 @@ static void rna_def_fpoint(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Point", "Point coordinates"); } -void rna_def_fcurve(BlenderRNA *brna) +static void rna_def_fcurve(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; diff --git a/source/blender/makesrna/intern/rna_fluidsim.c b/source/blender/makesrna/intern/rna_fluidsim.c index 936e1700ed7..c415b3d716a 100644 --- a/source/blender/makesrna/intern/rna_fluidsim.c +++ b/source/blender/makesrna/intern/rna_fluidsim.c @@ -72,10 +72,17 @@ static StructRNA* rna_FluidSettings_refine(struct PointerRNA *ptr) } } +static void rna_fluid_update(bContext *C, PointerRNA *ptr) +{ + Object *ob= ptr->id.data; + + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob); +} + static void rna_FluidSettings_update_type(bContext *C, PointerRNA *ptr) { Main *bmain= CTX_data_main(C); - Scene *scene= CTX_data_scene(C); Object *ob= (Object*)ptr->id.data; FluidsimModifierData *fluidmd; ParticleSystemModifierData *psmd; @@ -124,8 +131,7 @@ static void rna_FluidSettings_update_type(bContext *C, PointerRNA *ptr) } } - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob); + rna_fluid_update(C, ptr); } static void rna_DomainFluidSettings_memory_estimate_get(PointerRNA *ptr, char *value) @@ -145,6 +151,14 @@ static int rna_DomainFluidSettings_memory_estimate_length(PointerRNA *ptr) return 32; } +static char *rna_FluidSettings_path(PointerRNA *ptr) +{ + FluidsimSettings *fss = (FluidsimSettings*)ptr->data; + ModifierData *md= (ModifierData *)fss->fmd; + + return BLI_sprintfN("modifiers[%s].settings", md->name); +} + #else static void rna_def_fluidsim_slip(StructRNA *srna) @@ -162,7 +176,7 @@ static void rna_def_fluidsim_slip(StructRNA *srna) RNA_def_property_enum_items(prop, slip_items); RNA_def_property_ui_text(prop, "Slip Type", ""); - prop= RNA_def_property(srna, "partial_slip_amount", PROP_FLOAT, PROP_NONE); + prop= RNA_def_property(srna, "partial_slip_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "partSlipValue"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Partial Slip Amount", "Amount of mixing between no- and free-slip, 0 is no slip and 1 is free slip."); @@ -216,7 +230,7 @@ static void rna_def_fluidsim_domain(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "guiDisplayMode"); RNA_def_property_enum_items(prop, quality_items); RNA_def_property_ui_text(prop, "Viewport Display Mode", "How to display the mesh in the viewport."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_fluid_update"); prop= RNA_def_property(srna, "render_display_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "renderDisplayMode"); @@ -231,7 +245,7 @@ static void rna_def_fluidsim_domain(BlenderRNA *brna) RNA_def_property_string_maxlength(prop, 240); RNA_def_property_string_sdna(prop, NULL, "surfdataPath"); RNA_def_property_ui_text(prop, "Path", "Directory (and/or filename prefix) to store baked fluid simulation files in."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_fluid_update"); prop= RNA_def_property(srna, "memory_estimate", PROP_STRING, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); @@ -431,7 +445,7 @@ static void rna_def_fluidsim_particle(BlenderRNA *brna) RNA_def_property_string_maxlength(prop, 240); RNA_def_property_string_sdna(prop, NULL, "surfdataPath"); RNA_def_property_ui_text(prop, "Path", "Directory (and/or filename prefix) to store and load particles from."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_fluid_update"); } static void rna_def_fluidsim_control(BlenderRNA *brna) @@ -503,6 +517,7 @@ void RNA_def_fluidsim(BlenderRNA *brna) srna= RNA_def_struct(brna, "FluidSettings", NULL); RNA_def_struct_sdna(srna, "FluidsimSettings"); RNA_def_struct_refine_func(srna, "rna_FluidSettings_refine"); + RNA_def_struct_path_func(srna, "rna_FluidSettings_path"); RNA_def_struct_ui_text(srna, "Fluid Simulation Settings", "Fluid simulation settings for an object taking part in the simulation."); prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c new file mode 100644 index 00000000000..2a4ff112c3c --- /dev/null +++ b/source/blender/makesrna/intern/rna_gpencil.c @@ -0,0 +1,252 @@ +/** + * $Id$ + * + * ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * Contributor(s): Blender Foundation (2009), Joshua Leung + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include <stdlib.h> + +#include "RNA_define.h" +#include "RNA_types.h" +#include "RNA_enum_types.h" + +#include "rna_internal.h" + +#include "DNA_gpencil_types.h" +#include "DNA_scene_types.h" + +#include "MEM_guardedalloc.h" + +#ifdef RNA_RUNTIME + +static int rna_GPencilLayer_active_frame_editable(PointerRNA *ptr) +{ + bGPDlayer *gpl= (bGPDlayer *)ptr->data; + + /* surely there must be other criteria too... */ + if (gpl->flag & GP_LAYER_LOCKED) + return 0; + else + return 1; +} + +static void rna_GPencilLayer_active_set(PointerRNA *ptr, int value) +{ + bGPdata *gpd= ptr->id.data; + bGPDlayer *gpl= ptr->data; + + /* disabled all other layers anyway */ + if (GS(gpd->id.name) == ID_GD) { + bGPDlayer *gl; + + for (gl= gpd->layers.first; gl; gl= gl->next) + gl->flag &= ~GP_LAYER_ACTIVE; + } + + /* if enabling value, make it active */ + if (value) + gpl->flag |= GP_LAYER_ACTIVE; +} + +#else + +static void rna_def_gpencil_stroke_point(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + srna= RNA_def_struct(brna, "GPencilStrokePoint", NULL); + RNA_def_struct_sdna(srna, "bGPDspoint"); + RNA_def_struct_ui_text(srna, "Grease Pencil Stroke Point", "Data point for freehand stroke curve."); + + prop= RNA_def_property(srna, "coordinates", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "x"); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Coordinates", ""); + + prop= RNA_def_property(srna, "pressure", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "pressure"); + RNA_def_property_range(prop, 0.0f, 1.0f); + RNA_def_property_ui_text(prop, "Pressure", "Pressure of tablet at point when drawing it."); +} + +static void rna_def_gpencil_stroke(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + srna= RNA_def_struct(brna, "GPencilStroke", NULL); + RNA_def_struct_sdna(srna, "bGPDstroke"); + RNA_def_struct_ui_text(srna, "Grease Pencil Stroke", "Freehand curve defining part of a sketch."); + + /* Points */ + prop= RNA_def_property(srna, "points", PROP_COLLECTION, PROP_NONE); + RNA_def_property_collection_sdna(prop, NULL, "points", "totpoints"); + RNA_def_property_struct_type(prop, "GPencilStrokePoint"); + RNA_def_property_ui_text(prop, "Stroke Points", "Stroke data points"); + + /* Flags - Readonly type-info really... */ + // TODO... +} + +static void rna_def_gpencil_frame(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + srna= RNA_def_struct(brna, "GPencilFrame", NULL); + RNA_def_struct_sdna(srna, "bGPDframe"); + RNA_def_struct_ui_text(srna, "Grease Pencil Frame", "Collection of related sketches on a particular frame"); + + /* Strokes */ + prop= RNA_def_property(srna, "strokes", PROP_COLLECTION, PROP_NONE); + RNA_def_property_collection_sdna(prop, NULL, "strokes", NULL); + RNA_def_property_struct_type(prop, "GPencilStroke"); + RNA_def_property_ui_text(prop, "Strokes", "Freehand curves defining the sketch on this frame."); + + /* Frame Number */ + prop= RNA_def_property(srna, "frame_number", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "framenum"); + RNA_def_property_range(prop, MINFRAME, MAXFRAME); // XXX note: this cannot occur on the same frame as another sketch + RNA_def_property_ui_text(prop, "Frame Number", "The frame on which this sketch appears."); + + /* Flags */ + prop= RNA_def_property(srna, "paint_lock", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_FRAME_PAINT); // XXX should it be editable? + RNA_def_property_ui_text(prop, "Paint Lock", "Frame is being edited (painted on)."); + + prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_FRAME_SELECT); + RNA_def_property_ui_text(prop, "Selected", "Frame is selected for editing in the DopeSheet."); +} + +static void rna_def_gpencil_layer(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + srna= RNA_def_struct(brna, "GPencilLayer", NULL); + RNA_def_struct_sdna(srna, "bGPDlayer"); + RNA_def_struct_ui_text(srna, "Grease Pencil Layer", "Collection of related sketches"); + + /* Name */ + prop= RNA_def_property(srna, "info", PROP_STRING, PROP_NONE); + RNA_def_property_ui_text(prop, "Info", "Description of layer"); + RNA_def_struct_name_property(srna, prop); + + /* Frames */ + prop= RNA_def_property(srna, "frames", PROP_COLLECTION, PROP_NONE); + RNA_def_property_collection_sdna(prop, NULL, "frames", NULL); + RNA_def_property_struct_type(prop, "GPencilFrame"); + RNA_def_property_ui_text(prop, "Frames", "Sketches for this layer on different frames."); + + /* Active Frame */ + prop= RNA_def_property(srna, "active_frame", PROP_POINTER, PROP_NONE); + RNA_def_property_pointer_sdna(prop, NULL, "actframe"); + RNA_def_property_ui_text(prop, "Active Frame", "Frame currently being displayed for this layer."); + RNA_def_property_editable_func(prop, "rna_GPencilLayer_active_frame_editable"); + + /* Drawing Color */ + prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Color", "Color that all sketches in this layer are drawn with."); + + prop= RNA_def_property(srna, "opacity", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "color[3]"); + RNA_def_property_range(prop, 0.3, 1.0f); + RNA_def_property_ui_text(prop, "Opacity", "Visibility of strokes."); + + /* Line Thickness */ + prop= RNA_def_property(srna, "line_thickness", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "thickness"); + RNA_def_property_range(prop, 1, 10); + RNA_def_property_ui_text(prop, "Thickness", "Thickness of strokes (in pixels)."); + + /* Onion-Skinning */ + prop= RNA_def_property(srna, "use_onion_skinning", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_ONIONSKIN); + RNA_def_property_ui_text(prop, "Use Onion Skinning", "Ghost frames on either side of frame."); + + prop= RNA_def_property(srna, "max_ghost_range", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "gstep"); + RNA_def_property_range(prop, 0, 120); + RNA_def_property_ui_text(prop, "Max Ghost Range", "Maximum number of frames on either side of the active frame to show. (0 = just show the 'first' available sketch on either side)"); + + /* Flags */ + prop= RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_HIDE); + RNA_def_property_ui_text(prop, "Hide", "Layer doesn't get drawn."); + + prop= RNA_def_property(srna, "locked", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_LOCKED); + RNA_def_property_ui_text(prop, "Locked", "Layer is protected from further editing and/or frame changes."); + + prop= RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_ACTIVE); + RNA_def_property_boolean_funcs(prop, NULL, "rna_GPencilLayer_active_set"); + RNA_def_property_ui_text(prop, "Active", "Layer is 'active' layer being edited."); + + prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_SELECT); + RNA_def_property_ui_text(prop, "Selected", "Layer is selected for editing in the DopeSheet."); + + // XXX keep this option? + prop= RNA_def_property(srna, "show_points", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_DRAWDEBUG); + RNA_def_property_ui_text(prop, "Show Points", "Draw the points which make up the strokes (for debugging purposes)."); + +} + +static void rna_def_gpencil_data(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + srna= RNA_def_struct(brna, "GreasePencil", "ID"); + RNA_def_struct_sdna(srna, "bGPdata"); + RNA_def_struct_ui_text(srna, "Grease Pencil", "Freehand annotation sketchbook."); + RNA_def_struct_ui_icon(srna, ICON_GREASEPENCIL); + + /* Layers */ + prop= RNA_def_property(srna, "layers", PROP_COLLECTION, PROP_NONE); + RNA_def_property_collection_sdna(prop, NULL, "layers", NULL); + RNA_def_property_struct_type(prop, "GPencilLayer"); + RNA_def_property_ui_text(prop, "Layers", "Similar to layers in Photoshop."); + + /* Flags */ + prop= RNA_def_property(srna, "view_space_draw", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GP_DATA_VIEWALIGN); + RNA_def_property_ui_text(prop, "Stick to View", "Newly drawn strokes get added in view space (i.e. sketches stick to data when view is manipulated)."); +} + +/* --- */ + +void RNA_def_gpencil(BlenderRNA *brna) +{ + rna_def_gpencil_data(brna); + + rna_def_gpencil_layer(brna); + rna_def_gpencil_frame(brna); + rna_def_gpencil_stroke(brna); + rna_def_gpencil_stroke_point(brna); +} + +#endif diff --git a/source/blender/makesrna/intern/rna_group.c b/source/blender/makesrna/intern/rna_group.c index 18c04fbfb50..dddc2062f07 100644 --- a/source/blender/makesrna/intern/rna_group.c +++ b/source/blender/makesrna/intern/rna_group.c @@ -33,7 +33,7 @@ #ifdef RNA_RUNTIME -PointerRNA rna_Group_objects_get(CollectionPropertyIterator *iter) +static PointerRNA rna_Group_objects_get(CollectionPropertyIterator *iter) { ListBaseIterator *internal= iter->internal; @@ -63,7 +63,7 @@ void RNA_def_group(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Objects", "A collection of this groups objects."); RNA_def_property_collection_funcs(prop, 0, 0, 0, "rna_Group_objects_get", 0, 0, 0, 0, 0); - prop= RNA_def_property(srna, "layer", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "layer", PROP_BOOLEAN, PROP_LAYER); RNA_def_property_boolean_sdna(prop, NULL, "layer", 1); RNA_def_property_array(prop, 20); RNA_def_property_ui_text(prop, "Dupli Layers", "Layers visible when this groups is instanced as a dupli."); diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h index bd28085692f..4d8ef7082b6 100644 --- a/source/blender/makesrna/intern/rna_internal.h +++ b/source/blender/makesrna/intern/rna_internal.h @@ -130,6 +130,7 @@ void RNA_def_curve(struct BlenderRNA *brna); void RNA_def_fluidsim(struct BlenderRNA *brna); void RNA_def_fcurve(struct BlenderRNA *brna); void RNA_def_gameproperty(struct BlenderRNA *brna); +void RNA_def_gpencil(struct BlenderRNA *brna); void RNA_def_group(struct BlenderRNA *brna); void RNA_def_image(struct BlenderRNA *brna); void RNA_def_key(struct BlenderRNA *brna); @@ -156,6 +157,7 @@ void RNA_def_sensor(struct BlenderRNA *brna); void RNA_def_sequence(struct BlenderRNA *brna); void RNA_def_smoke(struct BlenderRNA *brna); void RNA_def_space(struct BlenderRNA *brna); +void RNA_def_test(struct BlenderRNA *brna); void RNA_def_text(struct BlenderRNA *brna); void RNA_def_texture(struct BlenderRNA *brna); void RNA_def_timeline_marker(struct BlenderRNA *brna); @@ -194,6 +196,7 @@ void rna_object_vcollayer_name_set(struct PointerRNA *ptr, const char *value, ch void rna_Object_update(struct bContext *C, struct PointerRNA *ptr); void rna_Object_update_data(struct bContext *C, struct PointerRNA *ptr); +void rna_Mesh_update_draw(struct bContext *C, struct PointerRNA *ptr); /* API functions */ @@ -202,6 +205,7 @@ void RNA_api_main(struct StructRNA *srna); void RNA_api_mesh(struct StructRNA *srna); void RNA_api_object(struct StructRNA *srna); void RNA_api_scene(struct StructRNA *srna); +void RNA_api_text(struct StructRNA *srna); void RNA_api_ui_layout(struct StructRNA *srna); void RNA_api_wm(struct StructRNA *srna); diff --git a/source/blender/makesrna/intern/rna_internal_types.h b/source/blender/makesrna/intern/rna_internal_types.h index d706fd5ac19..645bc50ed89 100644 --- a/source/blender/makesrna/intern/rna_internal_types.h +++ b/source/blender/makesrna/intern/rna_internal_types.h @@ -39,7 +39,12 @@ struct bContext; struct IDProperty; struct GHash; -#define RNA_MAX_ARRAY 32 +#ifdef UNIT_TEST +#define RNA_MAX_ARRAY_LENGTH 64 +#else +#define RNA_MAX_ARRAY_LENGTH 32 +#endif + #define RNA_MAX_ARRAY_DIMENSION 3 /* Function Callbacks */ @@ -50,8 +55,7 @@ typedef struct IDProperty* (*IDPropertiesFunc)(struct PointerRNA *ptr, int creat typedef struct StructRNA *(*StructRefineFunc)(struct PointerRNA *ptr); typedef char *(*StructPathFunc)(struct PointerRNA *ptr); -typedef int (*PropArrayLengthGetFunc)(struct PointerRNA *ptr); -typedef int (*PropArrayLengthSetFunc)(struct PointerRNA *ptr, int length); +typedef int (*PropArrayLengthGetFunc)(struct PointerRNA *ptr, int length[RNA_MAX_ARRAY_DIMENSION]); typedef int (*PropBooleanGetFunc)(struct PointerRNA *ptr); typedef void (*PropBooleanSetFunc)(struct PointerRNA *ptr, int value); typedef void (*PropBooleanArrayGetFunc)(struct PointerRNA *ptr, int *values); @@ -132,16 +136,13 @@ struct PropertyRNA { PropertyType type; /* subtype, 'interpretation' of the property */ PropertySubType subtype; - /* if an array this is > 0, specifying the length */ - unsigned int arraylength; - /* these, if non-NULL, override arraylength */ + /* if non-NULL, overrides arraylength. Must not return 0? */ PropArrayLengthGetFunc getlength; - /* if NULL, length cannot be changed by a user */ - PropArrayLengthSetFunc setlength; - /* used only for dynamic arrays for now, default 1 */ - unsigned short arraydimension; - /* dimension sizes for dimensions greater than 1, first dimension size is not specified */ - unsigned short dimsize[RNA_MAX_ARRAY_DIMENSION - 1]; + /* dimension of array */ + unsigned int arraydimension; + /* array lengths lengths for all dimensions (when arraydimension > 0) */ + unsigned int arraylength[RNA_MAX_ARRAY_DIMENSION]; + unsigned int totarraylength; /* callback for updates on change */ UpdateFunc update; diff --git a/source/blender/makesrna/intern/rna_key.c b/source/blender/makesrna/intern/rna_key.c index 88047cda12b..fbe339fe7f3 100644 --- a/source/blender/makesrna/intern/rna_key.c +++ b/source/blender/makesrna/intern/rna_key.c @@ -260,14 +260,13 @@ static PointerRNA rna_ShapeKey_data_get(CollectionPropertyIterator *iter) static void rna_Key_update_data(bContext *C, PointerRNA *ptr) { Main *bmain= CTX_data_main(C); - Scene *scene= CTX_data_scene(C); Key *key= ptr->id.data; Object *ob; for(ob=bmain->object.first; ob; ob= ob->id.next) { if(ob_get_key(ob) == key) { - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob); } } } diff --git a/source/blender/makesrna/intern/rna_lamp.c b/source/blender/makesrna/intern/rna_lamp.c index 57aa1ba2736..dc59a75edbc 100644 --- a/source/blender/makesrna/intern/rna_lamp.c +++ b/source/blender/makesrna/intern/rna_lamp.c @@ -431,7 +431,7 @@ static void rna_def_lamp_shadow(StructRNA *srna, int spot, int area) prop= RNA_def_property(srna, "shadow_color", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "shdwr"); RNA_def_property_array(prop, 3); - RNA_def_property_ui_text(prop, "Shadow Color", "Color of shadows casted by the lamp."); + RNA_def_property_ui_text(prop, "Shadow Color", "Color of shadows cast by the lamp."); RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL); prop= RNA_def_property(srna, "only_shadow", PROP_BOOLEAN, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_lattice.c b/source/blender/makesrna/intern/rna_lattice.c index b53a0589ba6..1f7eee4d2d8 100644 --- a/source/blender/makesrna/intern/rna_lattice.c +++ b/source/blender/makesrna/intern/rna_lattice.c @@ -89,18 +89,10 @@ static void rna_Lattice_points_begin(CollectionPropertyIterator *iter, PointerRN static void rna_Lattice_update_data(bContext *C, PointerRNA *ptr) { - Main *bmain= CTX_data_main(C); - Scene *scene= CTX_data_scene(C); - Lattice *lt= ptr->id.data; - Object *ob; + ID *id= ptr->id.data; - for(ob=bmain->object.first; ob; ob= ob->id.next) { - if(ob->data == lt) { - /* XXX this will loop over all objects again (slow) */ - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob); - } - } + DAG_id_flush_update(id, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, id); } static void rna_Lattice_update_size(bContext *C, PointerRNA *ptr) diff --git a/source/blender/makesrna/intern/rna_main.c b/source/blender/makesrna/intern/rna_main.c index 4a24027f7e9..344135acaff 100644 --- a/source/blender/makesrna/intern/rna_main.c +++ b/source/blender/makesrna/intern/rna_main.c @@ -207,12 +207,30 @@ static void rna_Main_particle_begin(CollectionPropertyIterator *iter, PointerRNA rna_iterator_listbase_begin(iter, &bmain->particle, NULL); } +static void rna_Main_gpencil_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) +{ + Main *bmain= (Main*)ptr->data; + rna_iterator_listbase_begin(iter, &bmain->gpencil, NULL); +} + static void rna_Main_wm_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Main *bmain= (Main*)ptr->data; rna_iterator_listbase_begin(iter, &bmain->wm, NULL); } +#ifdef UNIT_TEST + +static PointerRNA rna_Test_test_get(PointerRNA *ptr) +{ + PointerRNA ret= *ptr; + ret.type= &RNA_Test; + + return ret; +} + +#endif + #else void RNA_def_main(BlenderRNA *brna) @@ -240,13 +258,14 @@ void RNA_def_main(BlenderRNA *brna) {"brushes", "Brush", "rna_Main_brush_begin", "Brushes", "Brush datablocks.", NULL, NULL}, {"worlds", "World", "rna_Main_world_begin", "Worlds", "World datablocks.", NULL, NULL}, {"groups", "Group", "rna_Main_group_begin", "Groups", "Group datablocks.", NULL, NULL}, - {"keys", "ID", "rna_Main_key_begin", "Keys", "Key datablocks.", NULL, NULL}, + {"keys", "Key", "rna_Main_key_begin", "Keys", "Key datablocks.", NULL, NULL}, {"scripts", "ID", "rna_Main_script_begin", "Scripts", "Script datablocks.", NULL, NULL}, {"texts", "Text", "rna_Main_text_begin", "Texts", "Text datablocks.", NULL, NULL}, {"sounds", "ID", "rna_Main_sound_begin", "Sounds", "Sound datablocks.", NULL, NULL}, {"armatures", "Armature", "rna_Main_armature_begin", "Armatures", "Armature datablocks.", NULL, NULL}, {"actions", "Action", "rna_Main_action_begin", "Actions", "Action datablocks.", NULL, NULL}, {"particles", "ParticleSettings", "rna_Main_particle_begin", "Particles", "Particle datablocks.", NULL, NULL}, + {"gpencil", "GreasePencil", "rna_Main_gpencil_begin", "Grease Pencil", "Grease Pencil datablocks.", NULL, NULL}, {NULL, NULL, NULL, NULL, NULL, NULL, NULL}}; int i; @@ -269,6 +288,18 @@ void RNA_def_main(BlenderRNA *brna) } RNA_api_main(srna); + +#ifdef UNIT_TEST + + RNA_define_verify_sdna(0); + + prop= RNA_def_property(srna, "test", PROP_POINTER, PROP_NONE); + RNA_def_property_struct_type(prop, "Test"); + RNA_def_property_pointer_funcs(prop, "rna_Test_test_get", NULL, NULL); + + RNA_define_verify_sdna(1); + +#endif } #endif diff --git a/source/blender/makesrna/intern/rna_main_api.c b/source/blender/makesrna/intern/rna_main_api.c index 42244476808..5e3cdb2f842 100644 --- a/source/blender/makesrna/intern/rna_main_api.c +++ b/source/blender/makesrna/intern/rna_main_api.c @@ -40,14 +40,14 @@ #include "DNA_mesh_types.h" -Mesh *rna_Main_add_mesh(Main *main, char *name) +static Mesh *rna_Main_add_mesh(Main *main, char *name) { Mesh *me= add_mesh(name); me->id.us--; return me; } -void rna_Main_remove_mesh(Main *main, ReportList *reports, Mesh *me) +static void rna_Main_remove_mesh(Main *main, ReportList *reports, Mesh *me) { if(me->id.us == 0) free_libblock(&main->mesh, me); diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c index cde65f46e5c..e23333713c4 100644 --- a/source/blender/makesrna/intern/rna_material.c +++ b/source/blender/makesrna/intern/rna_material.c @@ -35,6 +35,20 @@ #include "WM_types.h" +static EnumPropertyItem prop_texture_coordinates_items[] = { +{TEXCO_GLOB, "GLOBAL", 0, "Global", "Uses global coordinates for the texture coordinates."}, +{TEXCO_OBJECT, "OBJECT", 0, "Object", "Uses linked object's coordinates for texture coordinates."}, +{TEXCO_UV, "UV", 0, "UV", "Uses UV coordinates for texture coordinates."}, +{TEXCO_ORCO, "ORCO", 0, "Generated", "Uses the original undeformed coordinates of the object."}, +{TEXCO_STRAND, "STRAND", 0, "Strand", "Uses normalized strand texture coordinate (1D)."}, +{TEXCO_STICKY, "STICKY", 0, "Sticky", "Uses mesh's sticky coordinates for the texture coordinates."}, +{TEXCO_WINDOW, "WINDOW", 0, "Window", "Uses screen coordinates as texture coordinates."}, +{TEXCO_NORM, "NORMAL", 0, "Normal", "Uses normal vector as texture coordinates."}, +{TEXCO_REFL, "REFLECTION", 0, "Reflection", "Uses reflection vector as texture coordinates."}, +{TEXCO_STRESS, "STRESS", 0, "Stress", "Uses the difference of edge lengths compared to original coordinates of the mesh."}, +{TEXCO_TANGENT, "TANGENT", 0, "Tangent", "Uses the optional tangent vector as texture coordinates."}, +{0, NULL, 0, NULL, NULL}}; + #ifdef RNA_RUNTIME #include "MEM_guardedalloc.h" @@ -198,7 +212,7 @@ static void rna_Material_use_specular_ramp_set(PointerRNA *ptr, int value) ma->ramp_spec= add_colorband(0); } -void rna_Material_use_nodes_set(PointerRNA *ptr, int value) +static void rna_Material_use_nodes_set(PointerRNA *ptr, int value) { Material *ma= (Material*)ptr->data; @@ -207,6 +221,42 @@ void rna_Material_use_nodes_set(PointerRNA *ptr, int value) ED_node_shader_default(ma); } +static EnumPropertyItem *rna_Material_texture_coordinates_itemf(bContext *C, PointerRNA *ptr, int *free) +{ + Material *ma= (Material*)ptr->id.data; + EnumPropertyItem *item= NULL; + int totitem= 0; + + if(C==NULL) { + return prop_texture_coordinates_items; + } + + RNA_enum_items_add_value(&item, &totitem, prop_texture_coordinates_items, TEXCO_GLOB); + RNA_enum_items_add_value(&item, &totitem, prop_texture_coordinates_items, TEXCO_OBJECT); + RNA_enum_items_add_value(&item, &totitem, prop_texture_coordinates_items, TEXCO_ORCO); + + if(ma->material_type == MA_TYPE_VOLUME) { + + } + else if (ELEM3(ma->material_type, MA_TYPE_SURFACE, MA_TYPE_HALO, MA_TYPE_WIRE)) { + RNA_enum_items_add_value(&item, &totitem, prop_texture_coordinates_items, TEXCO_UV); + RNA_enum_items_add_value(&item, &totitem, prop_texture_coordinates_items, TEXCO_STRAND); + RNA_enum_items_add_value(&item, &totitem, prop_texture_coordinates_items, TEXCO_STICKY); + RNA_enum_items_add_value(&item, &totitem, prop_texture_coordinates_items, TEXCO_WINDOW); + RNA_enum_items_add_value(&item, &totitem, prop_texture_coordinates_items, TEXCO_NORM); + RNA_enum_items_add_value(&item, &totitem, prop_texture_coordinates_items, TEXCO_REFL); + RNA_enum_items_add_value(&item, &totitem, prop_texture_coordinates_items, TEXCO_STRESS); + RNA_enum_items_add_value(&item, &totitem, prop_texture_coordinates_items, TEXCO_TANGENT); + } + + RNA_enum_item_end(&item, &totitem); + + *free= 1; + + return item; +} + + #else static void rna_def_material_mtex(BlenderRNA *brna) @@ -214,21 +264,6 @@ static void rna_def_material_mtex(BlenderRNA *brna) StructRNA *srna; PropertyRNA *prop; - static EnumPropertyItem prop_texture_coordinates_items[] = { - {TEXCO_GLOB, "GLOBAL", 0, "Global", "Uses global coordinates for the texture coordinates."}, - {TEXCO_OBJECT, "OBJECT", 0, "Object", "Uses linked object's coordinates for texture coordinates."}, - {TEXCO_UV, "UV", 0, "UV", "Uses UV coordinates for texture coordinates."}, - {TEXCO_ORCO, "ORCO", 0, "Generated", "Uses the original undeformed coordinates of the object."}, - {TEXCO_STRAND, "STRAND", 0, "Strand", "Uses normalized strand texture coordinate (1D)."}, - {TEXCO_STICKY, "STICKY", 0, "Sticky", "Uses mesh's sticky coordinates for the texture coordinates."}, - {TEXCO_WINDOW, "WINDOW", 0, "Window", "Uses screen coordinates as texture coordinates."}, - {TEXCO_NORM, "NORMAL", 0, "Normal", "Uses normal vector as texture coordinates."}, - {TEXCO_REFL, "REFLECTION", 0, "Reflection", "Uses reflection vector as texture coordinates."}, - {TEXCO_STRESS, "STRESS", 0, "Stress", "Uses the difference of edge lengths compared to original coordinates of the mesh."}, - {TEXCO_TANGENT, "TANGENT", 0, "Tangent", "Uses the optional tangent vector as texture coordinates."}, - - {0, NULL, 0, NULL, NULL}}; - static EnumPropertyItem prop_mapping_items[] = { {MTEX_FLAT, "FLAT", 0, "Flat", "Maps X and Y coordinates directly."}, {MTEX_CUBE, "CUBE", 0, "Cube", "Maps using the normal vector."}, @@ -271,9 +306,10 @@ static void rna_def_material_mtex(BlenderRNA *brna) prop= RNA_def_property(srna, "texture_coordinates", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "texco"); RNA_def_property_enum_items(prop, prop_texture_coordinates_items); + RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Material_texture_coordinates_itemf"); RNA_def_property_ui_text(prop, "Texture Coordinates", ""); RNA_def_property_update(prop, NC_TEXTURE, NULL); - + prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "object"); RNA_def_property_struct_type(prop, "Object"); @@ -580,6 +616,8 @@ static void rna_def_material_colors(StructRNA *srna) {MA_RAMP_SAT, "SATURATION", 0, "Saturation", ""}, {MA_RAMP_VAL, "VALUE", 0, "Value", ""}, {MA_RAMP_COLOR, "COLOR", 0, "Color", ""}, + {MA_RAMP_SOFT, "SOFT LIGHT", 0, "Soft Light", ""}, + {MA_RAMP_LINEAR, "LINEAR LIGHT", 0, "Linear Light", ""}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem prop_ramp_input_items[] = { @@ -685,10 +723,10 @@ static void rna_def_material_diffuse(StructRNA *srna) RNA_def_property_ui_text(prop, "Diffuse Shader Model", ""); RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); - prop= RNA_def_property(srna, "diffuse_reflection", PROP_FLOAT, PROP_PERCENTAGE); + prop= RNA_def_property(srna, "diffuse_intensity", PROP_FLOAT, PROP_PERCENTAGE); RNA_def_property_float_sdna(prop, NULL, "ref"); RNA_def_property_range(prop, 0.0f, 1.0f); - RNA_def_property_ui_text(prop, "Diffuse Reflection", "Amount of diffuse reflection."); + RNA_def_property_ui_text(prop, "Diffuse Intensity", "Amount of diffuse reflection."); RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW, NULL); prop= RNA_def_property(srna, "roughness", PROP_FLOAT, PROP_NONE); @@ -746,10 +784,10 @@ static void rna_def_material_raymirror(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Enabled", "Enable raytraced reflections."); RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); - prop= RNA_def_property(srna, "reflect", PROP_FLOAT, PROP_PERCENTAGE); + prop= RNA_def_property(srna, "reflect_factor", PROP_FLOAT, PROP_PERCENTAGE); RNA_def_property_float_sdna(prop, NULL, "ray_mirror"); RNA_def_property_range(prop, 0.0f, 1.0f); - RNA_def_property_ui_text(prop, "Reflect", "Sets the amount mirror reflection for raytrace."); + RNA_def_property_ui_text(prop, "Reflectivity", "Sets the amount mirror reflection for raytrace."); RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); prop= RNA_def_property(srna, "fresnel", PROP_FLOAT, PROP_NONE); @@ -764,10 +802,10 @@ static void rna_def_material_raymirror(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Fresnel Factor", "Blending factor for Fresnel."); RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); - prop= RNA_def_property(srna, "gloss", PROP_FLOAT, PROP_PERCENTAGE); + prop= RNA_def_property(srna, "gloss_factor", PROP_FLOAT, PROP_PERCENTAGE); RNA_def_property_float_sdna(prop, NULL, "gloss_mir"); RNA_def_property_range(prop, 0.0f, 1.0f); - RNA_def_property_ui_text(prop, "Gloss", "The shininess of the reflection. Values < 1.0 give diffuse, blurry reflections."); + RNA_def_property_ui_text(prop, "Gloss Amount", "The shininess of the reflection. Values < 1.0 give diffuse, blurry reflections."); RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); prop= RNA_def_property(srna, "gloss_anisotropic", PROP_FLOAT, PROP_PERCENTAGE); @@ -835,10 +873,10 @@ static void rna_def_material_raytra(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Fresnel Factor", "Blending factor for Fresnel."); RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); - prop= RNA_def_property(srna, "gloss", PROP_FLOAT, PROP_PERCENTAGE); + prop= RNA_def_property(srna, "gloss_factor", PROP_FLOAT, PROP_PERCENTAGE); RNA_def_property_float_sdna(prop, NULL, "gloss_tra"); RNA_def_property_range(prop, 0.0f, 1.0f); - RNA_def_property_ui_text(prop, "Gloss", "The clarity of the refraction. Values < 1.0 give diffuse, blurry refractions."); + RNA_def_property_ui_text(prop, "Gloss Amount", "The clarity of the refraction. Values < 1.0 give diffuse, blurry refractions."); RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); prop= RNA_def_property(srna, "gloss_samples", PROP_INT, PROP_NONE); @@ -1133,14 +1171,14 @@ static void rna_def_material_halo(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Star", "Renders halo as a star."); RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); - prop= RNA_def_property(srna, "use_texture", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "texture", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_HALOTEX); - RNA_def_property_ui_text(prop, "Use Texture", "Gives halo a texture."); + RNA_def_property_ui_text(prop, "Texture", "Gives halo a texture."); RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); - prop= RNA_def_property(srna, "use_vertex_normal", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "vertex_normal", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_HALOPUNO); - RNA_def_property_ui_text(prop, "Use Vertex Normal", "Uses the vertex normal to specify the dimension of the halo."); + RNA_def_property_ui_text(prop, "Vertex Normal", "Uses the vertex normal to specify the dimension of the halo."); RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); prop= RNA_def_property(srna, "xalpha", PROP_BOOLEAN, PROP_NONE); @@ -1229,7 +1267,7 @@ static void rna_def_material_sss(BlenderRNA *brna) RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); } -void rna_def_material_specularity(StructRNA *srna) +static void rna_def_material_specularity(StructRNA *srna) { PropertyRNA *prop; @@ -1247,10 +1285,10 @@ void rna_def_material_specularity(StructRNA *srna) RNA_def_property_ui_text(prop, "Specular Shader Model", ""); RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); - prop= RNA_def_property(srna, "specular_reflection", PROP_FLOAT, PROP_PERCENTAGE); + prop= RNA_def_property(srna, "specular_intensity", PROP_FLOAT, PROP_PERCENTAGE); RNA_def_property_float_sdna(prop, NULL, "spec"); RNA_def_property_range(prop, 0, 1); - RNA_def_property_ui_text(prop, "Specularity Intensity", ""); + RNA_def_property_ui_text(prop, "Specular Intensity", ""); RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); /* NOTE: "har", "param", etc are used for multiple purposes depending on @@ -1289,7 +1327,7 @@ void rna_def_material_specularity(StructRNA *srna) RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); } -void rna_def_material_strand(BlenderRNA *brna) +static void rna_def_material_strand(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; @@ -1320,16 +1358,16 @@ void rna_def_material_strand(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Blender Units", "Use Blender units for widths instead of pixels."); RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); - prop= RNA_def_property(srna, "start_size", PROP_FLOAT, PROP_UNSIGNED); + prop= RNA_def_property(srna, "root_size", PROP_FLOAT, PROP_UNSIGNED); RNA_def_property_float_sdna(prop, NULL, "strand_sta"); RNA_def_property_float_funcs(prop, NULL, NULL, "rna_MaterialStrand_start_size_range"); - RNA_def_property_ui_text(prop, "Start Size", "Start size of strands in pixels Blender units."); + RNA_def_property_ui_text(prop, "Root Size", "Start size of strands in pixels Blender units."); RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); - prop= RNA_def_property(srna, "end_size", PROP_FLOAT, PROP_UNSIGNED); + prop= RNA_def_property(srna, "tip_size", PROP_FLOAT, PROP_UNSIGNED); RNA_def_property_float_sdna(prop, NULL, "strand_end"); RNA_def_property_float_funcs(prop, NULL, NULL, "rna_MaterialStrand_end_size_range"); - RNA_def_property_ui_text(prop, "End Size", "Start size of strands in pixels or Blender units."); + RNA_def_property_ui_text(prop, "Tip Size", "Start size of strands in pixels or Blender units."); RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); prop= RNA_def_property(srna, "min_size", PROP_FLOAT, PROP_UNSIGNED); @@ -1356,7 +1394,7 @@ void rna_def_material_strand(BlenderRNA *brna) RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); } -void rna_def_material_physics(BlenderRNA *brna) +static void rna_def_material_physics(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; @@ -1551,9 +1589,9 @@ void RNA_def_material(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Exclude Mist", "Excludes this material from mist effects (in world settings)"); RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); - prop= RNA_def_property(srna, "transparent_shadows", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "receive_transparent_shadows", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_SHADOW_TRA); - RNA_def_property_ui_text(prop, "Transparent Shadows", "Allow this object to receive transparent shadows casted through other objects"); + RNA_def_property_ui_text(prop, "Receive Transparent Shadows", "Allow this object to receive transparent shadows casted through other objects"); RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); prop= RNA_def_property(srna, "ray_shadow_bias", PROP_BOOLEAN, PROP_NONE); @@ -1658,11 +1696,13 @@ void rna_def_mtex_common(StructRNA *srna, const char *begin, const char *activeg RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_pointer_funcs(prop, activeget, activeset, NULL); RNA_def_property_ui_text(prop, "Active Texture", "Active texture slot being displayed."); + RNA_def_property_update(prop, NC_TEXTURE|ND_SHADING_DRAW, NULL); prop= RNA_def_property(srna, "active_texture_index", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "texact"); RNA_def_property_range(prop, 0, MAX_MTEX-1); RNA_def_property_ui_text(prop, "Active Texture Index", "Index of active texture slot."); + RNA_def_property_update(prop, NC_TEXTURE|ND_SHADING_DRAW, NULL); } #endif diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c index a94ef66cccb..53c34a8de32 100644 --- a/source/blender/makesrna/intern/rna_mesh.c +++ b/source/blender/makesrna/intern/rna_mesh.c @@ -57,18 +57,24 @@ static void rna_Mesh_update_data(bContext *C, PointerRNA *ptr) { - Main *bmain= CTX_data_main(C); - Scene *scene= CTX_data_scene(C); ID *id= ptr->id.data; - Object *ob; - for(ob=bmain->object.first; ob; ob= ob->id.next) { - if(ob->data == id) { - /* XXX this will loop over all objects again (slow) */ - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob); - } - } + DAG_id_flush_update(id, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, id); +} + +static void rna_Mesh_update_select(bContext *C, PointerRNA *ptr) +{ + ID *id= ptr->id.data; + + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, id); +} + +void rna_Mesh_update_draw(bContext *C, PointerRNA *ptr) +{ + ID *id= ptr->id.data; + + WM_event_add_notifier(C, NC_GEOM|ND_DATA, id); } static void rna_MeshVertex_normal_get(PointerRNA *ptr, float *value) @@ -381,18 +387,12 @@ static int rna_CustomDataData_numverts(PointerRNA *ptr, int type) return 0; } -static int rna_MeshTextureFace_uv_get_length(PointerRNA *ptr) +static int rna_MeshTextureFace_uv_get_length(PointerRNA *ptr, int length[RNA_MAX_ARRAY_DIMENSION]) { //return rna_CustomDataData_numverts(ptr, CD_MTFACE) * 2; return 0; //BMESH_TODO } -static int rna_MeshTextureFace_uv_set_length(PointerRNA *ptr, int length) -{ - //return length == rna_MeshTextureFace_uv_get_length(ptr); - return 0; //BMESH_TODO -} - static void rna_MeshTextureFace_uv_get(PointerRNA *ptr, float *values) { //MTFace *mtface= (MTFace*)ptr->data; @@ -676,32 +676,22 @@ static void rna_TextureFace_image_set(PointerRNA *ptr, PointerRNA value) tf->tpage= (struct Image*)id; } -static int rna_MeshFace_verts_get_length(PointerRNA *ptr) +static int rna_MeshFace_verts_get_length(PointerRNA *ptr, int length[RNA_MAX_ARRAY_DIMENSION]) { MFace *face= (MFace*)ptr->data; - return face->v4 ? 4 : 3; -} -static int rna_MeshFace_verts_set_length(PointerRNA *ptr, int length) -{ - MFace *face= (MFace*)ptr->data; - if (length == 3) { - face->v4= 0; - } - else if(length == 4) { - face->v4= 1; - } + if(face) + length[0]= (face->v4)? 4: 3; else - return 0; - - return 1; + length[0]= 4; // XXX rna_raw_access wants the length of a dummy face. this needs fixing. - Campbell + + return length[0]; } static void rna_MeshFace_verts_get(PointerRNA *ptr, int *values) { MFace *face= (MFace*)ptr->data; - int verts[4] = {face->v1, face->v2, face->v3, face->v4}; - memcpy(values, verts, (face->v4 ? 4 : 3) * sizeof(int)); + memcpy(values, &face->v1, (face->v4 ? 4 : 3) * sizeof(int)); } static void rna_MeshFace_verts_set(PointerRNA *ptr, const int *values) @@ -835,10 +825,12 @@ static void rna_def_mvert_group(BlenderRNA *brna) RNA_def_property_int_sdna(prop, NULL, "def_nr"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Group Index", ""); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "weight", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Weight", "Vertex Weight"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); } static void rna_def_mvert(BlenderRNA *brna) @@ -854,6 +846,7 @@ static void rna_def_mvert(BlenderRNA *brna) prop= RNA_def_property(srna, "co", PROP_FLOAT, PROP_TRANSLATION); RNA_def_property_ui_text(prop, "Location", ""); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "normal", PROP_FLOAT, PROP_DIRECTION); RNA_def_property_float_sdna(prop, NULL, "no"); @@ -864,14 +857,17 @@ static void rna_def_mvert(BlenderRNA *brna) prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SELECT); RNA_def_property_ui_text(prop, "Selected", ""); + RNA_def_property_update(prop, 0, "rna_Mesh_update_select"); prop= RNA_def_property(srna, "hidden", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_HIDE); RNA_def_property_ui_text(prop, "Hidden", ""); + RNA_def_property_update(prop, 0, "rna_Mesh_update_select"); prop= RNA_def_property(srna, "bevel_weight", PROP_FLOAT, PROP_NONE); RNA_def_property_float_funcs(prop, "rna_MeshVertex_bevel_weight_get", "rna_MeshVertex_bevel_weight_set", NULL); RNA_def_property_ui_text(prop, "Bevel Weight", "Weight used by the Bevel modifier 'Only Vertices' option"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "groups", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_funcs(prop, "rna_MeshVertex_groups_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", 0, 0, 0, 0, 0); @@ -899,26 +895,32 @@ static void rna_def_medge(BlenderRNA *brna) prop= RNA_def_property(srna, "crease", PROP_FLOAT, PROP_NONE); RNA_def_property_float_funcs(prop, "rna_MEdge_crease_get", "rna_MEdge_crease_set", NULL); RNA_def_property_ui_text(prop, "Crease", "Weight used by the Subsurf modifier for creasing"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "bevel_weight", PROP_FLOAT, PROP_NONE); RNA_def_property_float_funcs(prop, "rna_MEdge_bevel_weight_get", "rna_MEdge_bevel_weight_set", NULL); RNA_def_property_ui_text(prop, "Bevel Weight", "Weight used by the Bevel modifier"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SELECT); RNA_def_property_ui_text(prop, "Selected", ""); + RNA_def_property_update(prop, 0, "rna_Mesh_update_select"); prop= RNA_def_property(srna, "hidden", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_HIDE); RNA_def_property_ui_text(prop, "Hidden", ""); + RNA_def_property_update(prop, 0, "rna_Mesh_update_select"); prop= RNA_def_property(srna, "seam", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_SEAM); RNA_def_property_ui_text(prop, "Seam", "Seam edge for UV unwrapping"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_select"); prop= RNA_def_property(srna, "sharp", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_SHARP); RNA_def_property_ui_text(prop, "Sharp", "Sharp edge for the EdgeSplit modifier"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); } static void rna_def_mface(BlenderRNA *brna) @@ -932,19 +934,11 @@ static void rna_def_mface(BlenderRNA *brna) RNA_def_struct_path_func(srna, "rna_MeshFace_path"); RNA_def_struct_ui_icon(srna, ICON_FACESEL); - /* - // XXX allows creating invalid meshes - prop= RNA_def_property(srna, "verts", PROP_INT, PROP_UNSIGNED); - RNA_def_property_int_sdna(prop, NULL, "v1"); - RNA_def_property_array(prop, 4); - RNA_def_property_ui_text(prop, "Vertices", "Vertex indices"); - */ - // XXX allows creating invalid meshes prop= RNA_def_property(srna, "verts", PROP_INT, PROP_UNSIGNED); RNA_def_property_array(prop, 4); RNA_def_property_flag(prop, PROP_DYNAMIC); - RNA_def_property_dynamic_array_funcs(prop, "rna_MeshFace_verts_get_length", "rna_MeshFace_verts_set_length"); + RNA_def_property_dynamic_array_funcs(prop, "rna_MeshFace_verts_get_length"); RNA_def_property_int_funcs(prop, "rna_MeshFace_verts_get", "rna_MeshFace_verts_set", NULL); RNA_def_property_ui_text(prop, "Vertices", "Vertex indices"); @@ -952,18 +946,22 @@ static void rna_def_mface(BlenderRNA *brna) RNA_def_property_int_sdna(prop, NULL, "mat_nr"); RNA_def_property_ui_text(prop, "Material Index", ""); RNA_def_property_int_funcs(prop, NULL, NULL, "rna_MeshFace_material_index_range"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_FACE_SEL); RNA_def_property_ui_text(prop, "Selected", ""); + RNA_def_property_update(prop, 0, "rna_Mesh_update_select"); prop= RNA_def_property(srna, "hidden", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_HIDE); RNA_def_property_ui_text(prop, "Hidden", ""); + RNA_def_property_update(prop, 0, "rna_Mesh_update_select"); prop= RNA_def_property(srna, "smooth", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_SMOOTH); RNA_def_property_ui_text(prop, "Smooth", ""); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "normal", PROP_FLOAT, PROP_DIRECTION); RNA_def_property_array(prop, 3); @@ -983,26 +981,30 @@ static void rna_def_mtexpoly(BlenderRNA *brna) {TF_ALPHA, "ALPHA", 0, "Alpha", "Render polygon transparent, depending on alpha channel of the texture"}, {TF_CLIP, "CLIPALPHA", 0, "Clip Alpha", "Use the images alpha values clipped with no blending (binary alpha)"}, {0, NULL, 0, NULL, NULL}}; - unsigned short uv_dim[1]= {2}; + int uv_dim[]= {4, 2}; srna= RNA_def_struct(brna, "MeshTextureFaceLayer", NULL); RNA_def_struct_ui_text(srna, "Mesh Texture Face Layer", "Layer of texture faces in a Mesh datablock."); RNA_def_struct_sdna(srna, "CustomDataLayer"); RNA_def_struct_path_func(srna, "rna_MeshTextureFaceLayer_path"); + RNA_def_struct_ui_icon(srna, ICON_GROUP_UVS); prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_struct_name_property(srna, prop); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_MeshTextureFaceLayer_name_set"); RNA_def_property_ui_text(prop, "Name", ""); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_MeshTextureFaceLayer_active_get", "rna_MeshTextureFaceLayer_active_set"); RNA_def_property_ui_text(prop, "Active", "Sets the layer as active for display and editing"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "active_render", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "active_rnd", 0); RNA_def_property_boolean_funcs(prop, "rna_MeshTextureFaceLayer_active_render_get", "rna_MeshTextureFaceLayer_active_render_set"); RNA_def_property_ui_text(prop, "Active Render", "Sets the layer as active for rendering"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_type(prop, "MeshTextureFace"); @@ -1020,75 +1022,93 @@ static void rna_def_mtexpoly(BlenderRNA *brna) RNA_def_property_pointer_funcs(prop, NULL, "rna_TextureFace_image_set", NULL); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Image", ""); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "tex", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_TEX); RNA_def_property_ui_text(prop, "Tex", "Render face with texture"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "light", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_LIGHT); RNA_def_property_ui_text(prop, "Light", "Use light for face"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "invisible", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_INVISIBLE); RNA_def_property_ui_text(prop, "Invisible", "Make face invisible"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "collision", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_DYNAMIC); RNA_def_property_ui_text(prop, "Collision", "Use face for collision and ray-sensor detection"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "shared", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_SHAREDCOL); RNA_def_property_ui_text(prop, "Shared", "Blend vertex colors across face when vertices are shared"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "twoside", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_TWOSIDE); RNA_def_property_ui_text(prop, "Twoside", "Render face twosided"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "object_color", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_OBCOL); RNA_def_property_ui_text(prop, "Object Color", "Use ObColor instead of vertex colors"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "halo", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_BILLBOARD); RNA_def_property_ui_text(prop, "Halo", "Screen aligned billboard"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "billboard", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_BILLBOARD2); RNA_def_property_ui_text(prop, "Billboard", "Billboard with Z-axis constraint"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "shadow", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_SHADOW); RNA_def_property_ui_text(prop, "Shadow", "Face is used for shadow"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "text", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_BMFONT); RNA_def_property_ui_text(prop, "Text", "Enable bitmap text on face"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "alpha_sort", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_ALPHASORT); RNA_def_property_ui_text(prop, "Alpha Sort", "Enable sorting of faces for correct alpha drawing (slow, use Clip Alpha instead when possible)"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "transp", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, transp_items); RNA_def_property_ui_text(prop, "Transparency", "Transparency blending mode"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "uv_selected", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", TF_SEL1); RNA_def_property_array(prop, 4); RNA_def_property_ui_text(prop, "UV Selected", ""); + RNA_def_property_update(prop, 0, "rna_Mesh_update_select"); prop= RNA_def_property(srna, "uv_pinned", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "unwrap", TF_PIN1); RNA_def_property_array(prop, 4); RNA_def_property_ui_text(prop, "UV Pinned", ""); + RNA_def_property_update(prop, 0, "rna_Mesh_update_select"); - prop= RNA_def_property(srna, "uv", PROP_FLOAT, PROP_XYZ); - RNA_def_property_multidimensional_array(prop, 4 * 2, 2, uv_dim); + prop= RNA_def_property(srna, "uv", PROP_FLOAT, PROP_NONE); + RNA_def_property_multi_array(prop, 2, uv_dim); RNA_def_property_flag(prop, PROP_DYNAMIC); - RNA_def_property_dynamic_array_funcs(prop, "rna_MeshTextureFace_uv_get_length", "rna_MeshTextureFace_uv_set_length"); + RNA_def_property_dynamic_array_funcs(prop, "rna_MeshTextureFace_uv_get_length"); RNA_def_property_float_funcs(prop, "rna_MeshTextureFace_uv_get", "rna_MeshTextureFace_uv_set", NULL); RNA_def_property_ui_text(prop, "UV", ""); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); } static void rna_def_msticky(BlenderRNA *brna) @@ -1103,6 +1123,7 @@ static void rna_def_msticky(BlenderRNA *brna) prop= RNA_def_property(srna, "co", PROP_FLOAT, PROP_XYZ); RNA_def_property_ui_text(prop, "Location", "Sticky texture coordinate location."); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); } static void rna_def_mloopcol(BlenderRNA *brna) @@ -1114,20 +1135,37 @@ static void rna_def_mloopcol(BlenderRNA *brna) RNA_def_struct_ui_text(srna, "Mesh Vertex Color Layer", "Layer of vertex colors in a Mesh datablock."); RNA_def_struct_sdna(srna, "CustomDataLayer"); RNA_def_struct_path_func(srna, "rna_MeshColorLayer_path"); + RNA_def_struct_ui_icon(srna, ICON_GROUP_VCOL); prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_struct_name_property(srna, prop); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_MeshColorLayer_name_set"); RNA_def_property_ui_text(prop, "Name", ""); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_MeshColorLayer_active_get", "rna_MeshColorLayer_active_set"); RNA_def_property_ui_text(prop, "Active", "Sets the layer as active for display and editing"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "active_render", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "active_rnd", 0); RNA_def_property_boolean_funcs(prop, "rna_MeshColorLayer_active_render_get", "rna_MeshColorLayer_active_render_set"); RNA_def_property_ui_text(prop, "Active Render", "Sets the layer as active for rendering"); + + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); + + prop= RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE); + RNA_def_property_struct_type(prop, "MeshColor"); + RNA_def_property_ui_text(prop, "Data", ""); + RNA_def_property_collection_funcs(prop, "rna_MeshColorLayer_data_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_MeshColorLayer_data_length", 0, 0, 0, 0); + + srna= RNA_def_struct(brna, "MeshColor", NULL); + RNA_def_struct_sdna(srna, "MCol"); + RNA_def_struct_ui_text(srna, "Mesh Vertex Color", "Vertex colors for a face in a Mesh."); + RNA_def_struct_path_func(srna, "rna_MeshColor_path"); + + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); } static void rna_def_mproperties(BlenderRNA *brna) @@ -1144,6 +1182,7 @@ static void rna_def_mproperties(BlenderRNA *brna) prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_struct_name_property(srna, prop); RNA_def_property_ui_text(prop, "Name", ""); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_type(prop, "MeshFloatProperty"); @@ -1158,6 +1197,7 @@ static void rna_def_mproperties(BlenderRNA *brna) prop= RNA_def_property(srna, "value", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "f"); RNA_def_property_ui_text(prop, "Value", ""); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); /* Int */ srna= RNA_def_struct(brna, "MeshIntPropertyLayer", NULL); @@ -1168,6 +1208,7 @@ static void rna_def_mproperties(BlenderRNA *brna) prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_struct_name_property(srna, prop); RNA_def_property_ui_text(prop, "Name", ""); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_type(prop, "MeshIntProperty"); @@ -1182,6 +1223,7 @@ static void rna_def_mproperties(BlenderRNA *brna) prop= RNA_def_property(srna, "value", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "i"); RNA_def_property_ui_text(prop, "Value", ""); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); /* String */ srna= RNA_def_struct(brna, "MeshStringPropertyLayer", NULL); @@ -1192,6 +1234,7 @@ static void rna_def_mproperties(BlenderRNA *brna) prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_struct_name_property(srna, prop); RNA_def_property_ui_text(prop, "Name", ""); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_type(prop, "MeshStringProperty"); @@ -1206,6 +1249,7 @@ static void rna_def_mproperties(BlenderRNA *brna) prop= RNA_def_property(srna, "value", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "s"); RNA_def_property_ui_text(prop, "Value", ""); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); } void rna_def_texmat_common(StructRNA *srna, const char *texspace_editable) @@ -1221,17 +1265,20 @@ void rna_def_texmat_common(StructRNA *srna, const char *texspace_editable) RNA_def_property_float_sdna(prop, NULL, "loc"); RNA_def_property_ui_text(prop, "Texure Space Location", "Texture space location."); RNA_def_property_editable_func(prop, texspace_editable); + RNA_def_property_update(prop, 0, "rna_Mesh_update_draw"); prop= RNA_def_property(srna, "texspace_size", PROP_FLOAT, PROP_XYZ); RNA_def_property_float_sdna(prop, NULL, "size"); RNA_def_property_ui_text(prop, "Texture Space Size", "Texture space size."); RNA_def_property_editable_func(prop, texspace_editable); + RNA_def_property_update(prop, 0, "rna_Mesh_update_draw"); /* not supported yet prop= RNA_def_property(srna, "texspace_rot", PROP_FLOAT, PROP_EULER); RNA_def_property_float(prop, NULL, "rot"); RNA_def_property_ui_text(prop, "Texture Space Rotation", "Texture space rotation"); - RNA_def_property_editable_func(prop, texspace_editable);*/ + RNA_def_property_editable_func(prop, texspace_editable); + RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");*/ /* materials */ prop= RNA_def_property(srna, "materials", PROP_COLLECTION, PROP_NONE); @@ -1359,58 +1406,58 @@ static void rna_def_mesh(BlenderRNA *brna) prop= RNA_def_property(srna, "draw_edges", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWEDGES); RNA_def_property_ui_text(prop, "Draw Edges", "Displays selected edges using hilights in the 3d view and UV editor"); - RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_draw"); prop= RNA_def_property(srna, "draw_faces", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWFACES); RNA_def_property_ui_text(prop, "Draw Faces", "Displays all faces as shades in the 3d view and UV editor"); - RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_draw"); prop= RNA_def_property(srna, "draw_normals", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWNORMALS); RNA_def_property_ui_text(prop, "Draw Normals", "Displays face normals as lines"); - RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_draw"); prop= RNA_def_property(srna, "draw_vertex_normals", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAW_VNORMALS); RNA_def_property_ui_text(prop, "Draw Vertex Normals", "Displays vertex normals as lines"); - RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_draw"); prop= RNA_def_property(srna, "draw_creases", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWCREASES); RNA_def_property_ui_text(prop, "Draw Creases", "Displays creases created for subsurf weighting"); - RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_draw"); prop= RNA_def_property(srna, "draw_bevel_weights", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWBWEIGHTS); RNA_def_property_ui_text(prop, "Draw Bevel Weights", "Displays weights created for the Bevel modifier"); - RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_draw"); prop= RNA_def_property(srna, "draw_seams", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWSEAMS); RNA_def_property_ui_text(prop, "Draw Seams", "Displays UV unwrapping seams"); - RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_draw"); prop= RNA_def_property(srna, "draw_sharp", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWSHARP); RNA_def_property_ui_text(prop, "Draw Sharp", "Displays sharp edges, used with the EdgeSplit modifier"); - RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_draw"); prop= RNA_def_property(srna, "draw_edge_lenght", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAW_EDGELEN); RNA_def_property_ui_text(prop, "Edge Length", "Displays selected edge lengths"); - RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_draw"); prop= RNA_def_property(srna, "draw_edge_angle", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAW_EDGEANG); RNA_def_property_ui_text(prop, "Edge Angles", "Displays the angles in the selected edges in degrees"); - RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_draw"); prop= RNA_def_property(srna, "draw_face_area", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAW_FACEAREA); RNA_def_property_ui_text(prop, "Face Area", "Displays the area of selected faces"); - RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_draw"); prop= RNA_def_property(srna, "draw_pins", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAW_PINS); diff --git a/source/blender/makesrna/intern/rna_mesh_api.c b/source/blender/makesrna/intern/rna_mesh_api.c index 0ec0b66f399..f5cf50da26f 100644 --- a/source/blender/makesrna/intern/rna_mesh_api.c +++ b/source/blender/makesrna/intern/rna_mesh_api.c @@ -102,20 +102,13 @@ static void rna_Mesh_calc_edges(Mesh *mesh) static void rna_Mesh_update(Mesh *mesh, bContext *C) { - Main *bmain= CTX_data_main(C); - Object *ob; - if(mesh->totface && mesh->totedge == 0) rna_Mesh_calc_edges(mesh); mesh_calc_normals(mesh->mvert, mesh->totvert, mesh->mface, mesh->totface, NULL); - for(ob=bmain->object.first; ob; ob=ob->id.next) { - if(ob->data == mesh) { - ob->recalc |= OB_RECALC_DATA; - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob); - } - } + DAG_id_flush_update(&mesh->id, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, mesh); } static void rna_Mesh_add_verts(Mesh *mesh, int len) diff --git a/source/blender/makesrna/intern/rna_meta.c b/source/blender/makesrna/intern/rna_meta.c index 7b14a7a4712..1a4e4da886b 100644 --- a/source/blender/makesrna/intern/rna_meta.c +++ b/source/blender/makesrna/intern/rna_meta.c @@ -57,19 +57,17 @@ static void rna_MetaBall_update_data(bContext *C, PointerRNA *ptr) MetaBall *mb= ptr->id.data; Object *ob; - for(ob=bmain->object.first; ob; ob= ob->id.next) { - if(ob->data == mb) { + for(ob=bmain->object.first; ob; ob= ob->id.next) + if(ob->data == mb) copy_mball_properties(scene, ob); - /* XXX this will loop over all objects again (slow) */ - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob); - } - } + + DAG_id_flush_update(&mb->id, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, mb); } #else -void rna_def_metaelement(BlenderRNA *brna) +static void rna_def_metaelement(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; @@ -145,7 +143,7 @@ void rna_def_metaelement(BlenderRNA *brna) RNA_def_property_update(prop, 0, "rna_MetaBall_update_data"); } -void rna_def_metaball(BlenderRNA *brna) +static void rna_def_metaball(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index bb073d19a46..32e34559f1f 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -40,6 +40,7 @@ #include "BKE_bmesh.h" /* For BevelModifierData */ #include "BKE_smoke.h" /* For smokeModifier_free & smokeModifier_createType */ +#include "WM_api.h" #include "WM_types.h" EnumPropertyItem modifier_type_items[] ={ @@ -74,7 +75,7 @@ EnumPropertyItem modifier_type_items[] ={ {eModifierType_Fluidsim, "FLUID_SIMULATION", ICON_MOD_FLUIDSIM, "Fluid Simulation", ""}, {eModifierType_ParticleInstance, "PARTICLE_INSTANCE", ICON_MOD_PARTICLES, "Particle Instance", ""}, {eModifierType_ParticleSystem, "PARTICLE_SYSTEM", ICON_MOD_PARTICLES, "Particle System", ""}, - {eModifierType_Smoke, "SMOKE", 0, "Smoke", ""}, + {eModifierType_Smoke, "SMOKE", ICON_MOD_SMOKE, "Smoke", ""}, {eModifierType_Softbody, "SOFT_BODY", ICON_MOD_SOFT, "Soft Body", ""}, {eModifierType_Surface, "SURFACE", ICON_MOD_PHYSICS, "Surface", ""}, {0, NULL, 0, NULL, NULL}}; @@ -170,7 +171,8 @@ static char *rna_Modifier_path(PointerRNA *ptr) static void rna_Modifier_update(bContext *C, PointerRNA *ptr) { - DAG_object_flush_update(CTX_data_scene(C), ptr->id.data, OB_RECALC_DATA); + DAG_id_flush_update(ptr->id.data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ptr->id.data); } static void rna_Modifier_dependency_update(bContext *C, PointerRNA *ptr) @@ -382,6 +384,11 @@ static void rna_ArrayModifier_curve_set(PointerRNA *ptr, PointerRNA value) modifier_object_set(&((ArrayModifierData*)ptr->data)->curve_ob, OB_CURVE, value); } +static int rna_MeshDeformModifier_is_bound_get(PointerRNA *ptr) +{ + return (((MeshDeformModifierData*)ptr->data)->bindcos != NULL); +} + static PointerRNA rna_SoftBodyModifier_settings_get(PointerRNA *ptr) { Object *ob= (Object*)ptr->id.data; @@ -441,7 +448,7 @@ static void rna_def_property_subdivision_common(StructRNA *srna, const char type RNA_def_property_enum_sdna(prop, NULL, type); RNA_def_property_enum_items(prop, prop_subdivision_type_items); RNA_def_property_ui_text(prop, "Subdivision Type", "Selects type of subdivision algorithm."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); } static void rna_def_modifier_subsurf(BlenderRNA *brna) @@ -461,7 +468,7 @@ static void rna_def_modifier_subsurf(BlenderRNA *brna) RNA_def_property_range(prop, 1, 6); RNA_def_property_ui_range(prop, 1, 6, 1, 0); RNA_def_property_ui_text(prop, "Levels", "Number of subdivisions to perform."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "render_levels", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "renderLevels"); @@ -472,12 +479,12 @@ static void rna_def_modifier_subsurf(BlenderRNA *brna) prop= RNA_def_property(srna, "optimal_draw", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", eSubsurfModifierFlag_ControlEdges); RNA_def_property_ui_text(prop, "Optimal Draw", "Skip drawing/rendering of interior subdivided edges"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "subsurf_uv", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", eSubsurfModifierFlag_SubsurfUv); RNA_def_property_ui_text(prop, "Subsurf UV", "Use subsurf to subdivide UVs."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); } static void rna_def_modifier_multires(BlenderRNA *brna) @@ -496,7 +503,7 @@ static void rna_def_modifier_multires(BlenderRNA *brna) RNA_def_property_int_sdna(prop, NULL, "lvl"); RNA_def_property_ui_text(prop, "Level", ""); RNA_def_property_int_funcs(prop, NULL, NULL, "rna_MultiresModifier_level_range"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); } static void rna_def_modifier_lattice(BlenderRNA *brna) @@ -513,13 +520,13 @@ static void rna_def_modifier_lattice(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Object", "Lattice object to deform with."); RNA_def_property_pointer_funcs(prop, NULL, "rna_LatticeModifier_object_set", NULL); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_dependency_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "name"); RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name."); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_LatticeModifier_vgroup_set"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); } static void rna_def_modifier_curve(BlenderRNA *brna) @@ -545,19 +552,19 @@ static void rna_def_modifier_curve(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Object", "Curve object to deform with."); RNA_def_property_pointer_funcs(prop, NULL, "rna_CurveModifier_object_set", NULL); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_dependency_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "name"); RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name."); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_CurveModifier_vgroup_set"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "deform_axis", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "defaxis"); RNA_def_property_enum_items(prop, prop_deform_axis_items); RNA_def_property_ui_text(prop, "Deform Axis", "The axis that the curve deforms along."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); } static void rna_def_modifier_build(BlenderRNA *brna) @@ -573,21 +580,21 @@ static void rna_def_modifier_build(BlenderRNA *brna) prop= RNA_def_property(srna, "start", PROP_FLOAT, PROP_TIME); RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF); RNA_def_property_ui_text(prop, "Start", "Specify the start frame of the effect."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "length", PROP_FLOAT, PROP_TIME); RNA_def_property_range(prop, 1, MAXFRAMEF); RNA_def_property_ui_text(prop, "Length", "Specify the total time the build effect requires"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "randomize", PROP_BOOLEAN, PROP_NONE); RNA_def_property_ui_text(prop, "Randomize", "Randomize the faces or edges during build."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "seed", PROP_INT, PROP_NONE); RNA_def_property_range(prop, 1, MAXFRAMEF); RNA_def_property_ui_text(prop, "Seed", "Specify the seed for random if used."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); } static void rna_def_modifier_mirror(BlenderRNA *brna) @@ -603,50 +610,50 @@ static void rna_def_modifier_mirror(BlenderRNA *brna) prop= RNA_def_property(srna, "x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MIR_AXIS_X); RNA_def_property_ui_text(prop, "X", "Enable X axis mirror."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "y", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MIR_AXIS_Y); RNA_def_property_ui_text(prop, "Y", "Enable Y axis mirror."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "z", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MIR_AXIS_Z); RNA_def_property_ui_text(prop, "Z", "Enable Z axis mirror."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "clip", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MIR_CLIPPING); RNA_def_property_ui_text(prop, "Clip", "Prevents vertices from going through the mirror during transform."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "mirror_vertex_groups", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MIR_VGROUP); RNA_def_property_ui_text(prop, "Mirror Vertex Groups", "Mirror vertex groups (e.g. .R->.L)."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "mirror_u", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MIR_MIRROR_U); RNA_def_property_ui_text(prop, "Mirror U", "Mirror the U texture coordinate around the 0.5 point."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "mirror_v", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MIR_MIRROR_V); RNA_def_property_ui_text(prop, "Mirror V", "Mirror the V texture coordinate around the 0.5 point."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "merge_limit", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "tolerance"); RNA_def_property_range(prop, 0, FLT_MAX); RNA_def_property_ui_range(prop, 0, 1, 10, 3); RNA_def_property_ui_text(prop, "Merge Limit", "Distance from axis within which mirrored vertices are merged."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "mirror_object", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "mirror_ob"); RNA_def_property_ui_text(prop, "Mirror Object", "Object to use as mirror."); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_dependency_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); } static void rna_def_modifier_decimate(BlenderRNA *brna) @@ -663,7 +670,7 @@ static void rna_def_modifier_decimate(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "percent"); RNA_def_property_range(prop, 0, 1); RNA_def_property_ui_text(prop, "Ratio", "Defines the ratio of triangles to reduce to."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "face_count", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "faceCount"); @@ -691,135 +698,135 @@ static void rna_def_modifier_wave(BlenderRNA *brna) prop= RNA_def_property(srna, "x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_WAVE_X); RNA_def_property_ui_text(prop, "X", "X axis motion."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "y", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_WAVE_Y); RNA_def_property_ui_text(prop, "Y", "Y axis motion."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "cyclic", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_WAVE_CYCL); RNA_def_property_ui_text(prop, "Cyclic", "Cyclic wave effect."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "normals", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_WAVE_NORM); RNA_def_property_ui_text(prop, "Normals", "Dispace along normals."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "x_normal", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_WAVE_NORM_X); RNA_def_property_ui_text(prop, "X Normal", "Enable displacement along the X normal"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "y_normal", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_WAVE_NORM_Y); RNA_def_property_ui_text(prop, "Y Normal", "Enable displacement along the Y normal"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "z_normal", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_WAVE_NORM_Z); RNA_def_property_ui_text(prop, "Z Normal", "Enable displacement along the Z normal"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "time_offset", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "timeoffs"); RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF); RNA_def_property_ui_text(prop, "Time Offset", "Either the starting frame (for positive speed) or ending frame (for negative speed.)"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "lifetime", PROP_FLOAT, PROP_TIME); RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF); RNA_def_property_ui_text(prop, "Lifetime", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "damping_time", PROP_FLOAT, PROP_TIME); RNA_def_property_float_sdna(prop, NULL, "damp"); RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF); RNA_def_property_ui_text(prop, "Damping Time", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "falloff_radius", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "falloff"); RNA_def_property_range(prop, 0, FLT_MAX); RNA_def_property_ui_range(prop, 0, 100, 100, 2); RNA_def_property_ui_text(prop, "Falloff Radius", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "start_position_x", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "startx"); RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); RNA_def_property_ui_range(prop, -100, 100, 100, 2); RNA_def_property_ui_text(prop, "Start Position X", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "start_position_y", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "starty"); RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); RNA_def_property_ui_range(prop, -100, 100, 100, 2); RNA_def_property_ui_text(prop, "Start Position Y", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "start_position_object", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "objectcenter"); RNA_def_property_ui_text(prop, "Start Position Object", ""); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_dependency_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "defgrp_name"); RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name for modulating the wave."); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_WaveModifier_vgroup_set"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "texture", PROP_POINTER, PROP_NONE); RNA_def_property_ui_text(prop, "Texture", "Texture for modulating the wave."); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "texture_coordinates", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "texmapping"); RNA_def_property_enum_items(prop, prop_texture_coordinates_items); RNA_def_property_ui_text(prop, "Texture Coordinates", "Texture coordinates used for modulating input."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "uv_layer", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "uvlayer_name"); RNA_def_property_ui_text(prop, "UV Layer", "UV layer name."); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_WaveModifier_uvlayer_set"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "texture_coordinates_object", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "map_object"); RNA_def_property_ui_text(prop, "Texture Coordinates Object", ""); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_dependency_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); prop= RNA_def_property(srna, "speed", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); RNA_def_property_ui_range(prop, -1, 1, 10, 2); RNA_def_property_ui_text(prop, "Speed", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "height", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); RNA_def_property_ui_range(prop, -2, 2, 10, 2); RNA_def_property_ui_text(prop, "Height", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "width", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0, FLT_MAX); RNA_def_property_ui_range(prop, 0, 5, 10, 2); RNA_def_property_ui_text(prop, "Width", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "narrowness", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "narrow"); RNA_def_property_range(prop, 0, FLT_MAX); RNA_def_property_ui_range(prop, 0, 10, 10, 2); RNA_def_property_ui_text(prop, "Narrowness", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); } static void rna_def_modifier_armature(BlenderRNA *brna) @@ -836,43 +843,43 @@ static void rna_def_modifier_armature(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Object", "Armature object to deform with."); RNA_def_property_pointer_funcs(prop, NULL, "rna_ArmatureModifier_object_set", NULL); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_dependency_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "defgrp_name"); RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name."); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_ArmatureModifier_vgroup_set"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "invert", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "deformflag", ARM_DEF_INVERT_VGROUP); RNA_def_property_ui_text(prop, "Invert", "Invert vertex group influence."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "use_vertex_groups", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "deformflag", ARM_DEF_VGROUP); RNA_def_property_ui_text(prop, "Use Vertex Groups", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "use_bone_envelopes", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "deformflag", ARM_DEF_ENVELOPE); RNA_def_property_ui_text(prop, "Use Bone Envelopes", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "quaternion", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "deformflag", ARM_DEF_QUATERNION); RNA_def_property_ui_text(prop, "Quaternion", "Deform rotation interpolation with quaternions."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "b_bone_rest", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "deformflag", ARM_DEF_B_BONE_REST); RNA_def_property_ui_text(prop, "B-Bone Rest", "Make B-Bones deform already in rest position"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "multi_modifier", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "multi", 0); RNA_def_property_ui_text(prop, "Multi Modifier", "Use same input as previous modifier, and mix results using overall vgroup"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); } static void rna_def_modifier_hook(BlenderRNA *brna) @@ -889,28 +896,28 @@ static void rna_def_modifier_hook(BlenderRNA *brna) RNA_def_property_range(prop, 0, FLT_MAX); RNA_def_property_ui_range(prop, 0, 100, 100, 2); RNA_def_property_ui_text(prop, "Falloff", "If not zero, the distance from the hook where influence ends."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "force", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0, 1); RNA_def_property_ui_text(prop, "Force", "Relative force of the hook."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE); RNA_def_property_ui_text(prop, "Object", "Parent Object for hook, also recalculates and clears offset"); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_dependency_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); prop= RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "subtarget"); RNA_def_property_ui_text(prop, "Sub-Target", "Name of Parent Bone for hook (if applicable), also recalculates and clears offset"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_dependency_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "name"); RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name."); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_HookModifier_vgroup_set"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); } static void rna_def_modifier_softbody(BlenderRNA *brna) @@ -954,12 +961,12 @@ static void rna_def_modifier_boolean(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Object", "Mesh object to use for boolean operation."); RNA_def_property_pointer_funcs(prop, NULL, "rna_BooleanModifier_object_set", NULL); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_dependency_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); prop= RNA_def_property(srna, "operation", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, prop_operation_items); RNA_def_property_ui_text(prop, "Operation", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); } static void rna_def_modifier_array(BlenderRNA *brna) @@ -982,90 +989,90 @@ static void rna_def_modifier_array(BlenderRNA *brna) prop= RNA_def_property(srna, "fit_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, prop_fit_type_items); RNA_def_property_ui_text(prop, "Fit Type", "Array length calculation method."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "count", PROP_INT, PROP_NONE); RNA_def_property_range(prop, 1, INT_MAX); RNA_def_property_ui_range(prop, 1, 1000, 1, 0); RNA_def_property_ui_text(prop, "Count", "Number of duplicates to make."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "length", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_range(prop, 0, INT_MAX); RNA_def_property_ui_range(prop, 0, 10000, 10, 2); RNA_def_property_ui_text(prop, "Length", "Length to fit array within."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "curve", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "curve_ob"); RNA_def_property_ui_text(prop, "Curve", "Curve object to fit array length to."); RNA_def_property_pointer_funcs(prop, NULL, "rna_ArrayModifier_curve_set", NULL); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_dependency_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); /* Offset parameters */ prop= RNA_def_property(srna, "constant_offset", PROP_BOOLEAN, PROP_TRANSLATION); RNA_def_property_boolean_sdna(prop, NULL, "offset_type", MOD_ARR_OFF_CONST); RNA_def_property_ui_text(prop, "Constant Offset", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "constant_offset_displacement", PROP_FLOAT, PROP_TRANSLATION); RNA_def_property_float_sdna(prop, NULL, "offset"); RNA_def_property_ui_text(prop, "Constant Offset Displacement", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "relative_offset", PROP_BOOLEAN, PROP_TRANSLATION); RNA_def_property_boolean_sdna(prop, NULL, "offset_type", MOD_ARR_OFF_RELATIVE); RNA_def_property_ui_text(prop, "Relative Offset", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "relative_offset_displacement", PROP_FLOAT, PROP_TRANSLATION); RNA_def_property_float_sdna(prop, NULL, "scale"); RNA_def_property_ui_text(prop, "Relative Offset Displacement", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); /* Vertex merging parameters */ prop= RNA_def_property(srna, "merge_adjacent_vertices", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_ARR_MERGE); RNA_def_property_ui_text(prop, "Merge Vertices", "Merge vertices in adjacent duplicates."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "merge_end_vertices", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_ARR_MERGEFINAL); RNA_def_property_ui_text(prop, "Merge Vertices", "Merge vertices in first and last duplicates."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "merge_distance", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "merge_dist"); RNA_def_property_range(prop, 0, FLT_MAX); RNA_def_property_ui_range(prop, 0, 1, 1, 4); RNA_def_property_ui_text(prop, "Merge Distance", "Limit below which to merge vertices."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); /* Offset object */ prop= RNA_def_property(srna, "add_offset_object", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "offset_type", MOD_ARR_OFF_OBJ); RNA_def_property_ui_text(prop, "Add Offset Object", "Add an object transformation to the total offset."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "offset_object", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "offset_ob"); RNA_def_property_ui_text(prop, "Offset Object", ""); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_dependency_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); /* Caps */ prop= RNA_def_property(srna, "start_cap", PROP_POINTER, PROP_NONE); RNA_def_property_ui_text(prop, "Start Cap", "Mesh object to use as a start cap."); RNA_def_property_pointer_funcs(prop, NULL, "rna_ArrayModifier_start_cap_set", NULL); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "end_cap", PROP_POINTER, PROP_NONE); RNA_def_property_ui_text(prop, "End Cap", "Mesh object to use as an end cap."); RNA_def_property_pointer_funcs(prop, NULL, "rna_ArrayModifier_end_cap_set", NULL); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_dependency_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); } static void rna_def_modifier_edgesplit(BlenderRNA *brna) @@ -1082,17 +1089,17 @@ static void rna_def_modifier_edgesplit(BlenderRNA *brna) RNA_def_property_range(prop, 0, 180); RNA_def_property_ui_range(prop, 0, 180, 100, 2); RNA_def_property_ui_text(prop, "Split Angle", "Angle above which to split edges."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "use_edge_angle", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_EDGESPLIT_FROMANGLE); RNA_def_property_ui_text(prop, "Use Edge Angle", "Split edges with high angle between faces."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "use_sharp", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_EDGESPLIT_FROMFLAG); RNA_def_property_ui_text(prop, "Use Sharp Edges", "Split edges that are marked as sharp."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); } static void rna_def_modifier_displace(BlenderRNA *brna) @@ -1124,47 +1131,47 @@ static void rna_def_modifier_displace(BlenderRNA *brna) RNA_def_property_string_sdna(prop, NULL, "defgrp_name"); RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name."); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_DisplaceModifier_vgroup_set"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "texture", PROP_POINTER, PROP_NONE); RNA_def_property_ui_text(prop, "Texture", ""); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "midlevel", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0, 1); RNA_def_property_ui_range(prop, 0, 1, 10, 3); RNA_def_property_ui_text(prop, "Midlevel", "Material value that gives no displacement."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); RNA_def_property_ui_range(prop, -100, 100, 10, 2); RNA_def_property_ui_text(prop, "Strength", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "direction", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, prop_direction_items); RNA_def_property_ui_text(prop, "Direction", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "texture_coordinates", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "texmapping"); RNA_def_property_enum_items(prop, prop_texture_coordinates_items); RNA_def_property_ui_text(prop, "Texture Coordinates", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "uv_layer", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "uvlayer_name"); RNA_def_property_ui_text(prop, "UV Layer", "UV layer name."); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_DisplaceModifier_uvlayer_set"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "texture_coordinate_object", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "map_object"); RNA_def_property_ui_text(prop, "Texture Coordinate Object", ""); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_dependency_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); } static void rna_def_modifier_uvproject(BlenderRNA *brna) @@ -1181,13 +1188,13 @@ static void rna_def_modifier_uvproject(BlenderRNA *brna) RNA_def_property_string_sdna(prop, NULL, "uvlayer_name"); RNA_def_property_ui_text(prop, "UV Layer", "UV layer name."); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_UVProjectModifier_uvlayer_set"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "num_projectors", PROP_INT, PROP_NONE); RNA_def_property_ui_text(prop, "Number of Projectors", "Number of projectors to use."); RNA_def_property_int_funcs(prop, NULL, "rna_UVProjectModifier_num_projectors_set", NULL); RNA_def_property_range(prop, 1, MOD_UVPROJECT_MAX); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "projectors", PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_type(prop, "UVProjector"); @@ -1197,26 +1204,26 @@ static void rna_def_modifier_uvproject(BlenderRNA *brna) prop= RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE); RNA_def_property_ui_text(prop, "Image", ""); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "horizontal_aspect_ratio", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "aspectx"); RNA_def_property_range(prop, 1, FLT_MAX); RNA_def_property_ui_range(prop, 1, 1000, 100, 2); RNA_def_property_ui_text(prop, "Horizontal Aspect Ratio", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "vertical_aspect_ratio", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "aspecty"); RNA_def_property_range(prop, 1, FLT_MAX); RNA_def_property_ui_range(prop, 1, 1000, 100, 2); RNA_def_property_ui_text(prop, "Vertical Aspect Ratio", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "override_image", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_UVPROJECT_OVERRIDEIMAGE); RNA_def_property_ui_text(prop, "Override Image", "Override faces' current images with the given image."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); srna= RNA_def_struct(brna, "UVProjector", NULL); RNA_def_struct_ui_text(srna, "UVProjector", "UV projector used by the UV project modifier."); @@ -1241,35 +1248,35 @@ static void rna_def_modifier_smooth(BlenderRNA *brna) prop= RNA_def_property(srna, "x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_SMOOTH_X); RNA_def_property_ui_text(prop, "X", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "y", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_SMOOTH_Y); RNA_def_property_ui_text(prop, "Y", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "z", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_SMOOTH_Z); RNA_def_property_ui_text(prop, "Z", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "fac"); RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); RNA_def_property_ui_range(prop, -10, 10, 0.5, 2); RNA_def_property_ui_text(prop, "Factor", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "repeat", PROP_INT, PROP_NONE); RNA_def_property_ui_range(prop, 0, 30, 1, 0); RNA_def_property_ui_text(prop, "Repeat", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "defgrp_name"); RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name."); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_SmoothModifier_vgroup_set"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); } static void rna_def_modifier_cast(BlenderRNA *brna) @@ -1292,63 +1299,63 @@ static void rna_def_modifier_cast(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "type"); RNA_def_property_enum_items(prop, prop_cast_type_items); RNA_def_property_ui_text(prop, "Cast Type", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE); RNA_def_property_ui_text(prop, "Object", "Control object: if available, its location determines the center of the effect"); RNA_def_property_pointer_funcs(prop, NULL, "rna_CastModifier_object_set", NULL); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_dependency_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); prop= RNA_def_property(srna, "x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_CAST_X); RNA_def_property_ui_text(prop, "X", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "y", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_CAST_Y); RNA_def_property_ui_text(prop, "Y", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "z", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_CAST_Z); RNA_def_property_ui_text(prop, "Z", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "from_radius", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_CAST_SIZE_FROM_RADIUS); RNA_def_property_ui_text(prop, "From Radius", "Use radius as size of projection shape (0 = auto)"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "use_transform", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_CAST_USE_OB_TRANSFORM); RNA_def_property_ui_text(prop, "Use transform", "Use object transform to control projection shape"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "fac"); RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); RNA_def_property_ui_range(prop, -10, 10, 5, 2); RNA_def_property_ui_text(prop, "Factor", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "radius", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_range(prop, 0, FLT_MAX); RNA_def_property_ui_range(prop, 0, 100, 10, 2); RNA_def_property_ui_text(prop, "Radius", "Only deform vertices within this distance from the center of the effect (leave as 0 for infinite.)"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0, FLT_MAX); RNA_def_property_ui_range(prop, 0, 100, 10, 2); RNA_def_property_ui_text(prop, "Size", "Size of projection shape (leave as 0 for auto.)"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "defgrp_name"); RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name."); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_CastModifier_vgroup_set"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); } static void rna_def_modifier_meshdeform(BlenderRNA *brna) @@ -1365,29 +1372,34 @@ static void rna_def_modifier_meshdeform(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Object", "Mesh object to deform with."); RNA_def_property_pointer_funcs(prop, NULL, "rna_MeshDeformModifier_object_set", NULL); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_dependency_update"); - + RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); + + prop= RNA_def_property(srna, "is_bound", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_funcs(prop, "rna_MeshDeformModifier_is_bound_get", NULL); + RNA_def_property_ui_text(prop, "Bound", "Whether geometry has been bound to control cage."); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + prop= RNA_def_property(srna, "invert", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MDEF_INVERT_VGROUP); RNA_def_property_ui_text(prop, "Invert", "Invert vertex group influence."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "defgrp_name"); RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name."); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_MeshDeformModifier_vgroup_set"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "precision", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "gridsize"); RNA_def_property_range(prop, 2, 10); RNA_def_property_ui_text(prop, "Precision", "The grid size for binding."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "dynamic", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MDEF_DYNAMIC_BIND); RNA_def_property_ui_text(prop, "Dynamic", "Recompute binding dynamically on top of other deformers (slower and more memory consuming.)"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); } @@ -1422,71 +1434,71 @@ static void rna_def_modifier_particleinstance(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "ob"); RNA_def_property_ui_text(prop, "Object", "Object that has the particle system."); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_dependency_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); prop= RNA_def_property(srna, "particle_system_number", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "psys"); RNA_def_property_range(prop, 1, 10); RNA_def_property_ui_text(prop, "Particle System Number", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "axis", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "axis"); RNA_def_property_enum_items(prop, particleinstance_axis); RNA_def_property_ui_text(prop, "Axis", "Pole axis for rotation"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "normal", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", eParticleInstanceFlag_Parents); RNA_def_property_ui_text(prop, "Normal", "Create instances from normal particles."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "children", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", eParticleInstanceFlag_Children); RNA_def_property_ui_text(prop, "Children", "Create instances from child particles."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "path", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", eParticleInstanceFlag_Path); RNA_def_property_ui_text(prop, "Path", "Create instances along particle paths."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "unborn", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", eParticleInstanceFlag_Unborn); RNA_def_property_ui_text(prop, "Unborn", "Show instances when particles are unborn."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "alive", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", eParticleInstanceFlag_Alive); RNA_def_property_ui_text(prop, "Alive", "Show instances when particles are alive."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "dead", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", eParticleInstanceFlag_Dead); RNA_def_property_ui_text(prop, "Dead", "Show instances when particles are dead."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "keep_shape", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", eParticleInstanceFlag_KeepShape); RNA_def_property_ui_text(prop, "Keep Shape", "Don't stretch the object."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "size", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", eParticleInstanceFlag_UseSize); RNA_def_property_ui_text(prop, "Size", "Use particle size to scale the instances."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "position", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "position"); RNA_def_property_range(prop, 0.0, 1.0); RNA_def_property_ui_text(prop, "Position", "Position along path."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "random_position", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "random_position"); RNA_def_property_range(prop, 0.0, 1.0); RNA_def_property_ui_text(prop, "Random Position", "Randomize position along path."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); } static void rna_def_modifier_explode(BlenderRNA *brna) @@ -1506,27 +1518,27 @@ static void rna_def_modifier_explode(BlenderRNA *brna) prop= RNA_def_property(srna, "protect", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0, 1); RNA_def_property_ui_text(prop, "Protect", "Clean vertex group edges"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "split_edges", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", eExplodeFlag_EdgeSplit); RNA_def_property_ui_text(prop, "Split Edges", "Split face edges for nicer shrapnel."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "unborn", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", eExplodeFlag_Unborn); RNA_def_property_ui_text(prop, "Unborn", "Show mesh when particles are unborn."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "alive", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", eExplodeFlag_Alive); RNA_def_property_ui_text(prop, "Alive", "Show mesh when particles are alive."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "dead", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", eExplodeFlag_Dead); RNA_def_property_ui_text(prop, "Dead", "Show mesh when particles are dead."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); } static void rna_def_modifier_cloth(BlenderRNA *brna) @@ -1566,6 +1578,7 @@ static void rna_def_modifier_smoke(BlenderRNA *brna) srna= RNA_def_struct(brna, "SmokeModifier", "Modifier"); RNA_def_struct_ui_text(srna, "Smoke Modifier", "Smoke simulation modifier."); RNA_def_struct_sdna(srna, "SmokeModifierData"); + RNA_def_struct_ui_icon(srna, ICON_MOD_SMOKE); prop= RNA_def_property(srna, "domain_settings", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "domain"); @@ -1583,7 +1596,7 @@ static void rna_def_modifier_smoke(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "type"); RNA_def_property_enum_items(prop, prop_smoke_type_items); RNA_def_property_ui_text(prop, "Type", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_set_type"); + RNA_def_property_update(prop, 0, "rna_Smoke_set_type"); } static void rna_def_modifier_collision(BlenderRNA *brna) @@ -1605,7 +1618,7 @@ static void rna_def_modifier_collision(BlenderRNA *brna) RNA_def_property_int_sdna(prop, NULL, "absorption"); RNA_def_property_ui_range(prop, 0, 100, 1, 2); RNA_def_property_ui_text(prop, "Absorption %", "How much of effector force gets lost during collision with this object (in percent)."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); } static void rna_def_modifier_bevel(BlenderRNA *brna) @@ -1634,31 +1647,31 @@ static void rna_def_modifier_bevel(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "value"); RNA_def_property_range(prop, 0, 0.5); RNA_def_property_ui_text(prop, "Width", "Bevel value/amount."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "only_vertices", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", BME_BEVEL_VERT); RNA_def_property_ui_text(prop, "Only Vertices", "Bevel verts/corners, not edges."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "limit_method", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "lim_flags"); RNA_def_property_enum_items(prop, prop_limit_method_items); RNA_def_property_ui_text(prop, "Limit Method", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "edge_weight_method", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "e_flags"); RNA_def_property_enum_items(prop, prop_edge_weight_method_items); RNA_def_property_ui_text(prop, "Edge Weight Method", "What edge weight to use for weighting a vertex."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "angle", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "bevel_angle"); RNA_def_property_range(prop, 0, 180); RNA_def_property_ui_range(prop, 0, 180, 100, 2); RNA_def_property_ui_text(prop, "Angle", "Angle above which to bevel edges."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); } static void rna_def_modifier_shrinkwrap(BlenderRNA *brna) @@ -1681,80 +1694,80 @@ static void rna_def_modifier_shrinkwrap(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "shrinkType"); RNA_def_property_enum_items(prop, prop_mode_items); RNA_def_property_ui_text(prop, "Mode", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE); RNA_def_property_ui_text(prop, "Target", "Mesh target to shrink to."); RNA_def_property_pointer_funcs(prop, NULL, "rna_ShrinkwrapModifier_target_set", NULL); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_dependency_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); prop= RNA_def_property(srna, "auxiliary_target", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "auxTarget"); RNA_def_property_ui_text(prop, "Auxiliary Target", "Additional mesh target to shrink to."); RNA_def_property_pointer_funcs(prop, NULL, "rna_ShrinkwrapModifier_auxiliary_target_set", NULL); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_dependency_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "vgroup_name"); RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name."); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_ShrinkwrapModifier_vgroup_set"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "offset", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "keepDist"); RNA_def_property_range(prop, 0, FLT_MAX); RNA_def_property_ui_range(prop, 0, 100, 1, 2); RNA_def_property_ui_text(prop, "Offset", "Distance to keep from the target."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "projAxis", MOD_SHRINKWRAP_PROJECT_OVER_X_AXIS); RNA_def_property_ui_text(prop, "X", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "y", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "projAxis", MOD_SHRINKWRAP_PROJECT_OVER_Y_AXIS); RNA_def_property_ui_text(prop, "Y", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "z", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "projAxis", MOD_SHRINKWRAP_PROJECT_OVER_Z_AXIS); RNA_def_property_ui_text(prop, "Z", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "subsurf_levels", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "subsurfLevels"); RNA_def_property_range(prop, 0, 6); RNA_def_property_ui_range(prop, 0, 6, 1, 0); RNA_def_property_ui_text(prop, "Subsurf Levels", "Number of subdivisions that must be performed before extracting vertices' positions and normals."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "negative", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "shrinkOpts", MOD_SHRINKWRAP_PROJECT_ALLOW_NEG_DIR); RNA_def_property_ui_text(prop, "Negative", "Allow vertices to move in the negative direction of axis."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "positive", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "shrinkOpts", MOD_SHRINKWRAP_PROJECT_ALLOW_POS_DIR); RNA_def_property_ui_text(prop, "Positive", "Allow vertices to move in the positive direction of axis."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "cull_front_faces", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "shrinkOpts", MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE); RNA_def_property_ui_text(prop, "Cull Front Faces", "Stop vertices from projecting to a front face on the target."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "cull_back_faces", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "shrinkOpts", MOD_SHRINKWRAP_CULL_TARGET_BACKFACE); RNA_def_property_ui_text(prop, "Cull Back Faces", "Stop vertices from projecting to a back face on the target."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "keep_above_surface", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "shrinkOpts", MOD_SHRINKWRAP_KEEP_ABOVE_SURFACE); RNA_def_property_ui_text(prop, "Keep Above Surface", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); } static void rna_def_modifier_fluidsim(BlenderRNA *brna) @@ -1790,25 +1803,25 @@ static void rna_def_modifier_mask(BlenderRNA *brna) prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, prop_mode_items); RNA_def_property_ui_text(prop, "Mode", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "armature", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "ob_arm"); RNA_def_property_ui_text(prop, "Armature", "Armature to use as source of bones to mask."); RNA_def_property_pointer_funcs(prop, NULL, "rna_MaskModifier_armature_set", NULL); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_dependency_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "vgroup"); RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name."); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_MaskModifier_vgroup_set"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "inverse", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MASK_INV); RNA_def_property_ui_text(prop, "Inverse", "Use vertices that are not part of region defined."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); } static void rna_def_modifier_simpledeform(BlenderRNA *brna) @@ -1831,29 +1844,29 @@ static void rna_def_modifier_simpledeform(BlenderRNA *brna) prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, prop_mode_items); RNA_def_property_ui_text(prop, "Mode", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "vgroup_name"); RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name."); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_SimpleDeformModifier_vgroup_set"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "origin", PROP_POINTER, PROP_NONE); RNA_def_property_ui_text(prop, "Origin", "Origin of modifier space coordinates."); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_dependency_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); prop= RNA_def_property(srna, "relative", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "originOpts", MOD_SIMPLEDEFORM_ORIGIN_LOCAL); RNA_def_property_ui_text(prop, "Relative", "Sets the origin of deform space to be relative to the object."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "factor", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); RNA_def_property_ui_range(prop, -10, 10, 0.5, 2); RNA_def_property_ui_text(prop, "Factor", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "limits", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "limit"); @@ -1861,17 +1874,17 @@ static void rna_def_modifier_simpledeform(BlenderRNA *brna) RNA_def_property_range(prop, 0, 1); RNA_def_property_ui_range(prop, 0, 1, 5, 2); RNA_def_property_ui_text(prop, "Limits", "Lower/Upper limits for deform."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "lock_x_axis", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "axis", MOD_SIMPLEDEFORM_LOCK_AXIS_X); RNA_def_property_ui_text(prop, "Lock X Axis", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "lock_y_axis", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "axis", MOD_SIMPLEDEFORM_LOCK_AXIS_Y); RNA_def_property_ui_text(prop, "Lock Y Axis", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); } static void rna_def_modifier_surface(BlenderRNA *brna) @@ -1911,7 +1924,7 @@ void RNA_def_modifier(BlenderRNA *brna) prop= RNA_def_property(srna, "realtime", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", eModifierMode_Realtime); RNA_def_property_ui_text(prop, "Realtime", "Realtime display of a modifier."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); RNA_def_property_ui_icon(prop, ICON_RESTRICT_VIEW_OFF, 0); prop= RNA_def_property(srna, "render", PROP_BOOLEAN, PROP_NONE); @@ -1922,13 +1935,13 @@ void RNA_def_modifier(BlenderRNA *brna) prop= RNA_def_property(srna, "editmode", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", eModifierMode_Editmode); RNA_def_property_ui_text(prop, "Editmode", "Use modifier while in the edit mode."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); RNA_def_property_ui_icon(prop, ICON_EDITMODE_HLT, 0); prop= RNA_def_property(srna, "on_cage", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", eModifierMode_OnCage); RNA_def_property_ui_text(prop, "On Cage", "Enable direct editing of modifier control cage."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "expanded", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", eModifierMode_Expanded); diff --git a/source/blender/makesrna/intern/rna_nla.c b/source/blender/makesrna/intern/rna_nla.c index 079d3db70aa..b70af62a556 100644 --- a/source/blender/makesrna/intern/rna_nla.c +++ b/source/blender/makesrna/intern/rna_nla.c @@ -47,7 +47,7 @@ /* temp constant defined for these funcs only... */ #define NLASTRIP_MIN_LEN_THRESH 0.1f -void rna_NlaStrip_name_set(PointerRNA *ptr, const char *value) +static void rna_NlaStrip_name_set(PointerRNA *ptr, const char *value) { NlaStrip *data= (NlaStrip *)ptr->data; @@ -61,6 +61,30 @@ void rna_NlaStrip_name_set(PointerRNA *ptr, const char *value) } } +static char *rna_NlaStrip_path(PointerRNA *ptr) +{ + NlaStrip *strip= (NlaStrip *)ptr->data; + AnimData *adt= BKE_animdata_from_id(ptr->id.data); + + /* if we're attached to AnimData, try to resolve path back to AnimData */ + if (adt) { + NlaTrack *nlt; + NlaStrip *nls; + + for (nlt= adt->nla_tracks.first; nlt; nlt= nlt->next) { + for (nls = nlt->strips.first; nls; nls = nls->next) { + if (nls == strip) { + // XXX but if we animate like this, the control will never work... + return BLI_sprintfN("animation_data.nla_tracks[\"%s\"].strips[\"%s\"]", nlt->name, strip->name); + } + } + } + } + + /* no path */ + return ""; +} + static void rna_NlaStrip_start_frame_set(PointerRNA *ptr, float value) { @@ -256,7 +280,7 @@ EnumPropertyItem nla_mode_extend_items[] = { {NLASTRIP_EXTEND_HOLD_FORWARD, "HOLD_FORWARD", 0, "Hold Forward", "Only hold last frame."}, {0, NULL, 0, NULL, NULL}}; -void rna_def_nlastrip(BlenderRNA *brna) +static void rna_def_nlastrip(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; @@ -271,6 +295,7 @@ void rna_def_nlastrip(BlenderRNA *brna) /* struct definition */ srna= RNA_def_struct(brna, "NlaStrip", NULL); RNA_def_struct_ui_text(srna, "NLA Strip", "A container referencing an existing Action."); + RNA_def_struct_path_func(srna, "rna_NlaStrip_path"); RNA_def_struct_ui_icon(srna, ICON_NLA); // XXX /* name property */ @@ -325,6 +350,7 @@ void rna_def_nlastrip(BlenderRNA *brna) /* Action */ prop= RNA_def_property(srna, "action", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "act"); + RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Action", "Action referenced by this strip."); /* Action extents */ @@ -407,7 +433,7 @@ void rna_def_nlastrip(BlenderRNA *brna) // - sync length } -void rna_def_nlatrack(BlenderRNA *brna) +static void rna_def_nlatrack(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index 23e79831292..99f61c7a724 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -39,7 +39,7 @@ #ifdef RNA_RUNTIME -StructRNA *rna_Node_refine(struct PointerRNA *ptr) +static StructRNA *rna_Node_refine(struct PointerRNA *ptr) { bNode *node = (bNode*)ptr->data; @@ -57,6 +57,15 @@ StructRNA *rna_Node_refine(struct PointerRNA *ptr) } } +static char *rna_Node_path(PointerRNA *ptr) +{ + bNodeTree *ntree= (bNodeTree*)ptr->id.data; + bNode *node= (bNode*)ptr->data; + int index = BLI_findindex(&ntree->nodes, node); + + return BLI_sprintfN("nodes[%d]", index); +} + #else #define MaxNodes 1000 @@ -387,6 +396,7 @@ static void def_cmp_alpha_over(StructRNA *srna) prop = RNA_def_property(srna, "premul", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "x"); + RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Premul", "Mix Factor"); } @@ -410,38 +420,46 @@ static void def_cmp_blur(StructRNA *srna) prop = RNA_def_property(srna, "sizex", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "sizex"); + RNA_def_property_range(prop, 0, 256); RNA_def_property_ui_text(prop, "Size X", ""); prop = RNA_def_property(srna, "sizey", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "sizey"); + RNA_def_property_range(prop, 1, 256); RNA_def_property_ui_text(prop, "Size Y", ""); prop = RNA_def_property(srna, "samples", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "samples"); + RNA_def_property_range(prop, 1, 256); RNA_def_property_ui_text(prop, "Samples", ""); prop = RNA_def_property(srna, "max_speed", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "maxspeed"); + RNA_def_property_range(prop, 1, 1024); RNA_def_property_ui_text(prop, "Max Speed", ""); prop = RNA_def_property(srna, "min_speed", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "minspeed"); + RNA_def_property_range(prop, 1, 1024); RNA_def_property_ui_text(prop, "Min Speed", ""); - + prop = RNA_def_property(srna, "relative", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "relative", 1); RNA_def_property_ui_text(prop, "Relative", ""); prop = RNA_def_property(srna, "factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "fac"); + RNA_def_property_range(prop, 0.0f, 2.0f); RNA_def_property_ui_text(prop, "Factor", ""); prop = RNA_def_property(srna, "factor_x", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "percentx"); + RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Relative Size X", ""); prop = RNA_def_property(srna, "factor_y", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "percenty"); + RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Relative Size Y", ""); prop = RNA_def_property(srna, "filter_type", PROP_ENUM, PROP_NONE); @@ -497,10 +515,12 @@ static void def_cmp_map_value(StructRNA *srna) prop = RNA_def_property(srna, "offset", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "loc"); + RNA_def_property_range(prop, -1000.0f, 1000.0f); RNA_def_property_ui_text(prop, "Offset", ""); prop = RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "size"); + RNA_def_property_range(prop, -1000.0f, 1000.0f); RNA_def_property_ui_text(prop, "Size", ""); prop = RNA_def_property(srna, "use_min", PROP_BOOLEAN, PROP_NONE); @@ -513,10 +533,12 @@ static void def_cmp_map_value(StructRNA *srna) prop = RNA_def_property(srna, "min", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "min"); + RNA_def_property_range(prop, -1000.0f, 1000.0f); RNA_def_property_ui_text(prop, "Minimum", ""); prop = RNA_def_property(srna, "max", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "max"); + RNA_def_property_range(prop, -1000.0f, 1000.0f); RNA_def_property_ui_text(prop, "Maximum", ""); } @@ -571,14 +593,17 @@ static void def_cmp_image(StructRNA *srna) prop = RNA_def_property(srna, "frames", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "frames"); + RNA_def_property_range(prop, 1, MAXFRAMEF); RNA_def_property_ui_text(prop, "Frames", "Number of images used in animation"); prop = RNA_def_property(srna, "start", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "sfra"); + RNA_def_property_range(prop, 1, MAXFRAMEF); RNA_def_property_ui_text(prop, "Start Frame", ""); prop = RNA_def_property(srna, "offset", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "offset"); + RNA_def_property_range(prop, -MAXFRAMEF, MAXFRAMEF); RNA_def_property_ui_text(prop, "Offset", "Offsets the number of the frame to use in the animation"); prop = RNA_def_property(srna, "cyclic", PROP_BOOLEAN, PROP_NONE); @@ -595,6 +620,7 @@ static void def_cmp_image(StructRNA *srna) prop = RNA_def_property(srna, "layer", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "layer"); + RNA_def_property_range(prop, 0, 10000); RNA_def_property_ui_text(prop, "Layer", ""); /* } */ @@ -683,10 +709,12 @@ static void def_cmp_output_file(StructRNA *srna) prop = RNA_def_property(srna, "start", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "sfra"); + RNA_def_property_range(prop, 1, MAXFRAMEF); RNA_def_property_ui_text(prop, "Start Frame", ""); prop = RNA_def_property(srna, "end", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "efra"); + RNA_def_property_range(prop, 1, MAXFRAMEF); RNA_def_property_ui_text(prop, "End Frame", ""); } @@ -719,39 +747,63 @@ static void def_cmp_scale(StructRNA *srna) static void def_cmp_diff_matte(StructRNA *srna) { PropertyRNA *prop; + + RNA_def_struct_sdna_from(srna, "NodeChroma", "storage"); + + /* TODO: nicer wrapping for tolerances */ - static EnumPropertyItem color_space_items[] = { - {1, "RGB", 0, "RGB", ""}, - {2, "HSV", 0, "HSV", ""}, - {3, "YUV", 0, "YUV", ""}, - {4, "YCC", 0, "YCbCr", ""}, - {0, NULL, 0, NULL, NULL} - }; + prop = RNA_def_property(srna, "tolerance", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "t1"); + RNA_def_property_range(prop, 0.0f, 1.0f); + RNA_def_property_ui_text(prop, "Tolerance", "Color distances below this threshold are keyed."); - prop = RNA_def_property(srna, "color_space", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "custom1"); - RNA_def_property_enum_items(prop, color_space_items); - RNA_def_property_ui_text(prop, "Color Space", ""); + prop = RNA_def_property(srna, "falloff", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "t2"); + RNA_def_property_range(prop, 0.0f, 1.0f); + RNA_def_property_ui_text(prop, "Falloff", "Color distances below this additional threshold are partially keyed."); +} + +static void def_cmp_color_matte(StructRNA *srna) +{ + PropertyRNA *prop; RNA_def_struct_sdna_from(srna, "NodeChroma", "storage"); /* TODO: nicer wrapping for tolerances */ - prop = RNA_def_property(srna, "tolerance1", PROP_FLOAT, PROP_NONE); + prop = RNA_def_property(srna, "h", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "t1"); - RNA_def_property_ui_text(prop, "Channel 1 Tolerance", ""); + RNA_def_property_range(prop, 0.0f, 1.0f); + RNA_def_property_ui_text(prop, "H", "Hue tolerance for colors to be considered a keying color"); - prop = RNA_def_property(srna, "tolerance2", PROP_FLOAT, PROP_NONE); + prop = RNA_def_property(srna, "s", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "t2"); - RNA_def_property_ui_text(prop, "Channel 2 Tolerance", ""); + RNA_def_property_range(prop, 0.0f, 1.0f); + RNA_def_property_ui_text(prop, "S", "Saturation Tolerance for the color"); - prop = RNA_def_property(srna, "tolerance3", PROP_FLOAT, PROP_NONE); + prop = RNA_def_property(srna, "v", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "t3"); - RNA_def_property_ui_text(prop, "Channel 3 Tolerance", ""); + RNA_def_property_range(prop, 0.0f, 1.0f); + RNA_def_property_ui_text(prop, "V", "Value Tolerance for the color"); +} + +static void def_cmp_distance_matte(StructRNA *srna) +{ + PropertyRNA *prop; + + RNA_def_struct_sdna_from(srna, "NodeChroma", "storage"); + + /* TODO: nicer wrapping for tolerances */ + + prop = RNA_def_property(srna, "tolerance", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "t1"); + RNA_def_property_range(prop, 0.0f, 1.0f); + RNA_def_property_ui_text(prop, "Tolerance", "Color distances below this threshold are keyed."); prop = RNA_def_property(srna, "falloff", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "fstrength"); - RNA_def_property_ui_text(prop, "Falloff", ""); + RNA_def_property_float_sdna(prop, NULL, "t2"); + RNA_def_property_range(prop, 0.0f, 1.0f); + RNA_def_property_ui_text(prop, "Falloff", "Color distances below this additional threshold are partially keyed."); } static void def_cmp_color_spill(StructRNA *srna) @@ -774,10 +826,11 @@ static void def_cmp_color_spill(StructRNA *srna) prop = RNA_def_property(srna, "factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "t1"); + RNA_def_property_range(prop, 0.0f, 0.5f); RNA_def_property_ui_text(prop, "Amount", "How much the selected channel is affected by"); } -static void def_cmp_chroma(StructRNA *srna) +static void def_cmp_chroma_matte(StructRNA *srna) { PropertyRNA *prop; @@ -785,22 +838,27 @@ static void def_cmp_chroma(StructRNA *srna) prop = RNA_def_property(srna, "acceptance", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "t1"); + RNA_def_property_range(prop, 1.0f, 80.0f); RNA_def_property_ui_text(prop, "Acceptance", "Tolerance for a color to be considered a keying color"); prop = RNA_def_property(srna, "cutoff", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "t2"); + RNA_def_property_range(prop, 0.0f, 30.0f); RNA_def_property_ui_text(prop, "Cutoff", "Tolerance below which colors will be considered as exact matches"); prop = RNA_def_property(srna, "lift", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "fsize"); + RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Lift", "Alpha lift"); prop = RNA_def_property(srna, "gain", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "fstrength"); + RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Gain", "Alpha gain"); prop = RNA_def_property(srna, "shadow_adjust", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "t3"); + RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Shadow Adjust", "Adjusts the brightness of any shadows captured"); /* TODO: @@ -835,10 +893,12 @@ static void def_cmp_channel_matte(StructRNA *srna) prop = RNA_def_property(srna, "high", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "t1"); + RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "High", "Values higher than this setting are 100% opaque"); prop = RNA_def_property(srna, "low", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "t2"); + RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Low", "Values lower than this setting are 100% keyed"); /* TODO: @@ -880,8 +940,9 @@ static void def_cmp_splitviewer(StructRNA *srna) RNA_def_property_ui_text(prop, "Axis", ""); /* TODO: percentage */ - prop = RNA_def_property(srna, "factor", PROP_FLOAT, PROP_NONE); + prop = RNA_def_property(srna, "factor", PROP_FLOAT, PROP_PERCENTAGE); RNA_def_property_float_sdna(prop, NULL, "custom1"); + RNA_def_property_range(prop, 0.0f, 100.0f); RNA_def_property_ui_text(prop, "Factor", ""); } @@ -891,6 +952,7 @@ static void def_cmp_id_mask(StructRNA *srna) prop = RNA_def_property(srna, "index", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "custom1"); + RNA_def_property_range(prop, 0, 10000); RNA_def_property_ui_text(prop, "Index", "Pass index number to convert to alpha"); } @@ -899,8 +961,9 @@ static void def_cmp_map_uv(StructRNA *srna) PropertyRNA *prop; /* TODO: percentage */ - prop = RNA_def_property(srna, "alpha", PROP_INT, PROP_NONE); + prop = RNA_def_property(srna, "alpha", PROP_INT, PROP_PERCENTAGE); RNA_def_property_int_sdna(prop, NULL, "custom1"); + RNA_def_property_range(prop, 0, 100); RNA_def_property_ui_text(prop, "Alpha", ""); } @@ -929,6 +992,7 @@ static void def_cmp_defocus(StructRNA *srna) /* TODO: angle in degrees */ prop = RNA_def_property(srna, "angle", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "rotation"); + RNA_def_property_range(prop, 0, 90); RNA_def_property_ui_text(prop, "Angle", "Bokeh shape rotation offset in degrees"); prop = RNA_def_property(srna, "gamma_correction", PROP_BOOLEAN, PROP_NONE); @@ -938,14 +1002,17 @@ static void def_cmp_defocus(StructRNA *srna) /* TODO */ prop = RNA_def_property(srna, "f_stop", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "fstop"); + RNA_def_property_range(prop, 0.0f, 128.0f); RNA_def_property_ui_text(prop, "fStop", "Amount of focal blur, 128=infinity=perfect focus, half the value doubles the blur radius"); prop = RNA_def_property(srna, "max_blur", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "maxblur"); + RNA_def_property_range(prop, 0.0f, 10000.0f); RNA_def_property_ui_text(prop, "Max Blur", "blur limit, maximum CoC radius, 0=no limit"); prop = RNA_def_property(srna, "threshold", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "bthresh"); + RNA_def_property_range(prop, 0.0f, 100.0f); RNA_def_property_ui_text(prop, "Threshold", "CoC radius threshold, prevents background bleed on in-focus midground, 0=off"); prop = RNA_def_property(srna, "preview", PROP_BOOLEAN, PROP_NONE); @@ -954,6 +1021,7 @@ static void def_cmp_defocus(StructRNA *srna) prop = RNA_def_property(srna, "samples", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "samples"); + RNA_def_property_range(prop, 16, 256); RNA_def_property_ui_text(prop, "Samples", "Number of samples (16=grainy, higher=less noise)"); prop = RNA_def_property(srna, "use_zbuffer", PROP_BOOLEAN, PROP_NONE); @@ -962,6 +1030,7 @@ static void def_cmp_defocus(StructRNA *srna) prop = RNA_def_property(srna, "z_scale", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "scale"); + RNA_def_property_range(prop, 0.0f, 1000.0f); RNA_def_property_ui_text(prop, "Z-Scale", "Scales the Z input when not using a zbuffer, controls maximum blur designated by the color white or input value 1"); } @@ -973,10 +1042,12 @@ static void def_cmp_luma_matte(StructRNA *srna) prop = RNA_def_property(srna, "high", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "t1"); + RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "High", "Values higher than this setting are 100% opaque"); prop = RNA_def_property(srna, "low", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "t2"); + RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Low", "Values lower than this setting are 100% keyed"); /* TODO: keep low less than high */ @@ -1008,18 +1079,22 @@ static void def_cmp_crop(StructRNA *srna) prop = RNA_def_property(srna, "x1", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "x1"); + RNA_def_property_range(prop, 0, 10000); RNA_def_property_ui_text(prop, "X1", ""); prop = RNA_def_property(srna, "x2", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "x2"); + RNA_def_property_range(prop, 0, 10000); RNA_def_property_ui_text(prop, "X2", ""); prop = RNA_def_property(srna, "y1", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "y1"); + RNA_def_property_range(prop, 0, 10000); RNA_def_property_ui_text(prop, "Y1", ""); prop = RNA_def_property(srna, "y2", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "y2"); + RNA_def_property_range(prop, 0, 10000); RNA_def_property_ui_text(prop, "Y2", ""); } @@ -1031,6 +1106,7 @@ static void def_cmp_dblur(StructRNA *srna) prop = RNA_def_property(srna, "iterations", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "iter"); + RNA_def_property_range(prop, 1, 128); RNA_def_property_ui_text(prop, "Iterations", ""); prop = RNA_def_property(srna, "wrap", PROP_BOOLEAN, PROP_NONE); @@ -1039,26 +1115,32 @@ static void def_cmp_dblur(StructRNA *srna) prop = RNA_def_property(srna, "center_x", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "center_x"); + RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Center X", ""); prop = RNA_def_property(srna, "center_y", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "center_y"); + RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Center Y", ""); prop = RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "distance"); + RNA_def_property_range(prop, -1.0f, 1.0f); RNA_def_property_ui_text(prop, "Distance", ""); prop = RNA_def_property(srna, "angle", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "angle"); + RNA_def_property_range(prop, 0.0f, 360.0f); RNA_def_property_ui_text(prop, "Angle", ""); prop = RNA_def_property(srna, "spin", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "spin"); + RNA_def_property_range(prop, -360.0f, 360.0f); RNA_def_property_ui_text(prop, "Spin", ""); prop = RNA_def_property(srna, "zoom", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "zoom"); + RNA_def_property_range(prop, 0.0f, 100.0f); RNA_def_property_ui_text(prop, "Zoom", ""); } @@ -1070,16 +1152,18 @@ static void def_cmp_bilateral_blur(StructRNA *srna) prop = RNA_def_property(srna, "iterations", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "iter"); + RNA_def_property_range(prop, 1, 128); RNA_def_property_ui_text(prop, "Iterations", ""); prop = RNA_def_property(srna, "sigma_color", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "sigma_color"); + RNA_def_property_range(prop, 0.01f, 3.0f); RNA_def_property_ui_text(prop, "Color Sigma", ""); prop = RNA_def_property(srna, "sigma_space", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "sigma_space"); - RNA_def_property_ui_text(prop, "Space Sigma", ""); - + RNA_def_property_range(prop, 0.01f, 30.0f); + RNA_def_property_ui_text(prop, "Space Sigma", ""); } static void def_cmp_premul_key(StructRNA *srna) @@ -1132,30 +1216,37 @@ static void def_cmp_glare(StructRNA *srna) prop = RNA_def_property(srna, "iterations", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "iter"); + RNA_def_property_range(prop, 2, 5); RNA_def_property_ui_text(prop, "Iterations", ""); prop = RNA_def_property(srna, "color_modulation", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "colmod"); + RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Color Modulation", ""); prop = RNA_def_property(srna, "mix", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "mix"); + RNA_def_property_range(prop, -1.0f, 1.0f); RNA_def_property_ui_text(prop, "Mix", "-1 is original image only, 0 is exact 50/50 mix, 1 is processed image only"); prop = RNA_def_property(srna, "threshold", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "threshold"); + RNA_def_property_range(prop, 0.0f, 1000.0f); RNA_def_property_ui_text(prop, "Threshold", "The glare filter will only be applied to pixels brighter than this value"); prop = RNA_def_property(srna, "streaks", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "angle"); + RNA_def_property_range(prop, 2, 16); RNA_def_property_ui_text(prop, "Streaks", "Total number of streaks"); prop = RNA_def_property(srna, "angle_offset", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "angle_ofs"); + RNA_def_property_range(prop, 0.0f, 180.0f); RNA_def_property_ui_text(prop, "Angle Offset", "Streak angle offset in degrees"); prop = RNA_def_property(srna, "fade", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "fade"); + RNA_def_property_range(prop, 0.75f, 1.0f); RNA_def_property_ui_text(prop, "Fade", "Streak fade-out factor"); prop = RNA_def_property(srna, "rotate_45", PROP_BOOLEAN, PROP_NONE); @@ -1164,6 +1255,7 @@ static void def_cmp_glare(StructRNA *srna) prop = RNA_def_property(srna, "size", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "size"); + RNA_def_property_range(prop, 6, 9); RNA_def_property_ui_text(prop, "Size", "Glow/glare size (not actual size; relative to initial size of bright area of pixels)"); /* TODO */ @@ -1190,32 +1282,39 @@ static void def_cmp_tonemap(StructRNA *srna) prop = RNA_def_property(srna, "key", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "key"); + RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Key", "The value the average luminance is mapped to"); prop = RNA_def_property(srna, "offset", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "offset"); + RNA_def_property_range(prop, 0.001f, 10.0f); RNA_def_property_ui_text(prop, "Offset", "Normally always 1, but can be used as an extra control to alter the brightness curve"); prop = RNA_def_property(srna, "gamma", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "gamma"); + RNA_def_property_range(prop, 0.001f, 3.0f); RNA_def_property_ui_text(prop, "Gamma", "If not used, set to 1"); /* TODO: } else { */ prop = RNA_def_property(srna, "intensity", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "f"); + RNA_def_property_range(prop, -8.0f, 8.0f); RNA_def_property_ui_text(prop, "Intensity", "If less than zero, darkens image; otherwise, makes it brighter"); prop = RNA_def_property(srna, "contrast", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "m"); + RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Contrast", "Set to 0 to use estimate from input image"); prop = RNA_def_property(srna, "adaptation", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "a"); + RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Adaptation", "If 0, global; if 1, based on pixel intensity"); prop = RNA_def_property(srna, "correction", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "c"); + RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Color Correction", "If 0, same for all channels; if 1, each independent"); } @@ -1271,18 +1370,22 @@ static void def_tex_bricks(StructRNA *srna) prop = RNA_def_property(srna, "offset", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "custom3"); + RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Offset Amount", ""); prop = RNA_def_property(srna, "offset_frequency", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "custom1"); + RNA_def_property_range(prop, 2, 99); RNA_def_property_ui_text(prop, "Offset Frequency", "Offset every N rows"); prop = RNA_def_property(srna, "squash", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "custom4"); + RNA_def_property_range(prop, 0.0f, 99.0f); RNA_def_property_ui_text(prop, "Squash Amount", ""); prop = RNA_def_property(srna, "squash_frequency", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "custom2"); + RNA_def_property_range(prop, 2, 99); RNA_def_property_ui_text(prop, "Squash Frequency", "Squash every N rows"); } @@ -1353,6 +1456,7 @@ static void rna_def_node(BlenderRNA *brna) RNA_def_struct_ui_text(srna, "Node", "Node in a node tree."); RNA_def_struct_sdna(srna, "bNode"); RNA_def_struct_refine_func(srna, "rna_Node_refine"); + RNA_def_struct_path_func(srna, "rna_Node_path"); prop = RNA_def_property(srna, "location", PROP_FLOAT, PROP_XYZ); RNA_def_property_float_sdna(prop, NULL, "locx"); diff --git a/source/blender/makesrna/intern/rna_nodetree_types.h b/source/blender/makesrna/intern/rna_nodetree_types.h index 47a7be163b1..be4f131a6d6 100644 --- a/source/blender/makesrna/intern/rna_nodetree_types.h +++ b/source/blender/makesrna/intern/rna_nodetree_types.h @@ -82,7 +82,7 @@ DefNode( CompositorNode, CMP_NODE_SEPYUVA, 0, "SEPYU DefNode( CompositorNode, CMP_NODE_COMBYUVA, 0, "COMBYUVA", CombYUVA, "Combine YUVA", "" ) DefNode( CompositorNode, CMP_NODE_DIFF_MATTE, def_cmp_diff_matte, "DIFF_MATTE", DiffMatte, "Difference Key", "" ) DefNode( CompositorNode, CMP_NODE_COLOR_SPILL, def_cmp_color_spill, "COLOR_SPILL", ColorSpill, "Color Spill", "" ) -DefNode( CompositorNode, CMP_NODE_CHROMA, def_cmp_chroma, "CHROMA", Chroma, "Chroma Key", "" ) +DefNode( CompositorNode, CMP_NODE_CHROMA_MATTE, def_cmp_chroma_matte, "CHROMA_MATTE", ChromaMatte, "Chroma Key", "" ) DefNode( CompositorNode, CMP_NODE_CHANNEL_MATTE, def_cmp_channel_matte, "CHANNEL_MATTE", ChannelMatte, "Channel Key", "" ) DefNode( CompositorNode, CMP_NODE_FLIP, def_cmp_flip, "FLIP", Flip, "Flip", "" ) DefNode( CompositorNode, CMP_NODE_SPLITVIEWER, def_cmp_splitviewer, "SPLITVIEWER", SplitViewer, "Split Viewer", "" ) @@ -104,6 +104,9 @@ DefNode( CompositorNode, CMP_NODE_PREMULKEY, def_cmp_premul_key, "PREMU DefNode( CompositorNode, CMP_NODE_GLARE, def_cmp_glare, "GLARE", Glare, "Glare", "" ) DefNode( CompositorNode, CMP_NODE_TONEMAP, def_cmp_tonemap, "TONEMAP", Tonemap, "Tonemap", "" ) DefNode( CompositorNode, CMP_NODE_LENSDIST, def_cmp_lensdist, "LENSDIST", Lensdist, "Lensdist", "" ) +DefNode( CompositorNode, CMP_NODE_VIEW_LEVELS, 0, "LEVELS", Levels, "Levels", "" ) +DefNode( CompositorNode, CMP_NODE_COLOR_MATTE, def_cmp_color_matte, "COLOR_MATTE", ColorMatte, "Color Matte", "" ) +DefNode( CompositorNode, CMP_NODE_DIST_MATTE, def_cmp_distance_matte, "DISTANCE_MATTE", DistanceMatte, "Distance Matte", "" ) DefNode( TextureNode, TEX_NODE_OUTPUT, def_tex_output, "OUTPUT", Output, "Output", "" ) DefNode( TextureNode, TEX_NODE_CHECKER, 0, "CHECKER", Checker, "Checker", "" ) diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index f0b055bd0e8..3d43dfdfc2c 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -39,9 +39,9 @@ #include "DNA_property_types.h" #include "DNA_scene_types.h" +#include "WM_api.h" #include "WM_types.h" - EnumPropertyItem object_mode_items[] = { {OB_MODE_OBJECT, "OBJECT", ICON_OBJECT_DATAMODE, "Object", ""}, {OB_MODE_EDIT, "EDIT", ICON_EDITMODE_HLT, "Edit", ""}, @@ -64,6 +64,22 @@ static EnumPropertyItem parent_type_items[] = { {PARBONE, "BONE", 0, "Bone", ""}, {0, NULL, 0, NULL, NULL}}; +EnumPropertyItem object_type_items[] = { + {OB_MESH, "MESH", 0, "Mesh", ""}, + {OB_CURVE, "CURVE", 0, "Curve", ""}, + {OB_SURF, "SURFACE", 0, "Surface", ""}, + {OB_MBALL, "META", 0, "Meta", ""}, + {OB_FONT, "TEXT", 0, "Text", ""}, + {0, "", 0, NULL, NULL}, + {OB_ARMATURE, "ARMATURE", 0, "Armature", ""}, + {OB_LATTICE, "LATTICE", 0, "Lattice", ""}, + {OB_EMPTY, "EMPTY", 0, "Empty", ""}, + {0, "", 0, NULL, NULL}, + {OB_CAMERA, "CAMERA", 0, "Camera", ""}, + {OB_LAMP, "LAMP", 0, "Lamp", ""}, + {0, NULL, 0, NULL, NULL} +}; + #ifdef RNA_RUNTIME #include "DNA_key_types.h" @@ -84,17 +100,18 @@ static EnumPropertyItem parent_type_items[] = { void rna_Object_update(bContext *C, PointerRNA *ptr) { - DAG_object_flush_update(CTX_data_scene(C), ptr->id.data, OB_RECALC_OB); + DAG_id_flush_update(ptr->id.data, OB_RECALC_OB); } void rna_Object_update_data(bContext *C, PointerRNA *ptr) { - DAG_object_flush_update(CTX_data_scene(C), ptr->id.data, OB_RECALC_DATA); + DAG_id_flush_update(ptr->id.data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ptr->id.data); } static void rna_Object_dependency_update(bContext *C, PointerRNA *ptr) { - DAG_object_flush_update(CTX_data_scene(C), ptr->id.data, OB_RECALC_OB); + DAG_id_flush_update(ptr->id.data, OB_RECALC_OB); DAG_scene_sort(CTX_data_scene(C)); } @@ -774,8 +791,8 @@ static void rna_def_object_game_settings(BlenderRNA *brna) {OB_BOUND_SPHERE, "SPHERE", 0, "Sphere", ""}, {OB_BOUND_CYLINDER, "CYLINDER", 0, "Cylinder", ""}, {OB_BOUND_CONE, "CONE", 0, "Cone", ""}, - {OB_BOUND_POLYH, "CONVEX_HULL", 0, "Convex Hull", ""}, - {OB_BOUND_POLYT, "TRIANGLE_MESH", 0, "Triangle Mesh", ""}, + {OB_BOUND_POLYT, "CONVEX_HULL", 0, "Convex Hull", ""}, + {OB_BOUND_POLYH, "TRIANGLE_MESH", 0, "Triangle Mesh", ""}, //{OB_DYN_MESH, "DYNAMIC_MESH", 0, "Dynamic Mesh", ""}, {0, NULL, 0, NULL, NULL}}; @@ -1029,7 +1046,7 @@ static void rna_def_object(BlenderRNA *brna) {OB_DUPLIGROUP, "GROUP", 0, "Group", "Enable group instancing."}, {0, NULL, 0, NULL, NULL}}; - unsigned short matrix_dimsize[]= {4}; + int matrix_dimsize[]= {4, 4}; srna= RNA_def_struct(brna, "Object", "ID"); RNA_def_struct_ui_text(srna, "Object", "Object datablock defining an object in a scene.."); @@ -1042,7 +1059,7 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_editable_func(prop, "rna_Object_data_editable"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Data", "Object data."); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_Object_update_data"); prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "type"); @@ -1056,7 +1073,7 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Mode", "Object interaction mode."); - prop= RNA_def_property(srna, "layers", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "layers", PROP_BOOLEAN, PROP_LAYER_MEMBER); RNA_def_property_boolean_sdna(prop, NULL, "lay", 1); RNA_def_property_array(prop, 20); RNA_def_property_ui_text(prop, "Layers", "Layers the object is on."); @@ -1141,7 +1158,8 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_int_sdna(prop, NULL, "actcol"); RNA_def_property_int_funcs(prop, "rna_Object_active_material_index_get", "rna_Object_active_material_index_set", "rna_Object_active_material_index_range"); RNA_def_property_ui_text(prop, "Active Material Index", "Index of active material slot."); - + RNA_def_property_update(prop, NC_OBJECT|ND_SHADING, NULL); + /* transform */ prop= RNA_def_property(srna, "location", PROP_FLOAT, PROP_TRANSLATION); @@ -1192,7 +1210,7 @@ static void rna_def_object(BlenderRNA *brna) /* matrix */ prop= RNA_def_property(srna, "matrix", PROP_FLOAT, PROP_MATRIX); RNA_def_property_float_sdna(prop, NULL, "obmat"); - RNA_def_property_multidimensional_array(prop, 16, 2, matrix_dimsize); + RNA_def_property_multi_array(prop, 2, matrix_dimsize); RNA_def_property_ui_text(prop, "Matrix", "Transformation matrix."); /* collections */ @@ -1222,13 +1240,13 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_struct_type(prop, "VertexGroup"); RNA_def_property_pointer_funcs(prop, "rna_Object_active_vertex_group_get", "rna_Object_active_vertex_group_set", NULL); RNA_def_property_ui_text(prop, "Active Vertex Group", "Vertex groups of the object."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_Object_update_data"); prop= RNA_def_property(srna, "active_vertex_group_index", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "actdef"); RNA_def_property_int_funcs(prop, "rna_Object_active_vertex_group_index_get", "rna_Object_active_vertex_group_index_set", "rna_Object_active_vertex_group_index_range"); RNA_def_property_ui_text(prop, "Active Vertex Group Index", "Active index in vertex group array."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_Object_update_data"); /* empty */ @@ -1464,6 +1482,13 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_ui_text(prop, "X-Ray", "Makes the object draw in front of others."); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); + /* Grease Pencil */ + prop= RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE); + RNA_def_property_pointer_sdna(prop, NULL, "gpd"); + RNA_def_property_flag(prop, PROP_EDITABLE); + RNA_def_property_struct_type(prop, "GreasePencil"); + RNA_def_property_ui_text(prop, "Grease Pencil Data", "Grease Pencil datablock"); + /* pose */ prop= RNA_def_property(srna, "pose_library", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "poselib"); @@ -1482,7 +1507,7 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_boolean_funcs(prop, NULL, "rna_Object_shape_key_lock_set"); RNA_def_property_ui_text(prop, "Shape Key Lock", "Always show the current Shape for this Object."); RNA_def_property_ui_icon(prop, ICON_UNPINNED, 1); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_Object_update_data"); prop= RNA_def_property(srna, "active_shape_key", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "ShapeKey"); @@ -1493,7 +1518,7 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_int_sdna(prop, NULL, "shapenr"); RNA_def_property_int_funcs(prop, "rna_Object_active_shape_key_index_get", "rna_Object_active_shape_key_index_set", "rna_Object_active_shape_key_index_range"); RNA_def_property_ui_text(prop, "Active Shape Key Index", "Current shape key index."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_Object_update_data"); RNA_api_object(srna); } diff --git a/source/blender/makesrna/intern/rna_object_api.c b/source/blender/makesrna/intern/rna_object_api.c index 1bb341b4c9d..88b6e6919e0 100644 --- a/source/blender/makesrna/intern/rna_object_api.c +++ b/source/blender/makesrna/intern/rna_object_api.c @@ -38,30 +38,92 @@ #include "BKE_customdata.h" #include "BKE_DerivedMesh.h" +#include "BKE_displist.h" +#include "BKE_object.h" +#include "BKE_main.h" #include "DNA_mesh_types.h" +#include "DNA_curve_types.h" #include "DNA_scene_types.h" /* copied from init_render_mesh (render code) */ -Mesh *rna_Object_create_render_mesh(Object *ob, Scene *scene) +static Mesh *rna_Object_create_render_mesh(Object *ob, bContext *C, Scene *scene) { CustomDataMask mask = CD_MASK_BAREMESH|CD_MASK_MTFACE|CD_MASK_MCOL; + Object *tmpobj = NULL; DerivedMesh *dm; Mesh *me; - /* TODO: other types */ - if(ob->type != OB_MESH) - return NULL; + switch(ob->type) { + case OB_FONT: + case OB_CURVE: + case OB_SURF: + { + int cage = 0; //XXX -todo + Curve *tmpcu = NULL; + + /* copies object and modifiers (but not the data) */ + tmpobj= copy_object( ob ); + tmpcu = (Curve *)tmpobj->data; + tmpcu->id.us--; + + /* if getting the original caged mesh, delete object modifiers */ + if( cage ) + object_free_modifiers(tmpobj); + + /* copies the data */ + tmpobj->data = copy_curve( (Curve *) ob->data ); + +#if 0 + /* copy_curve() sets disp.first null, so currently not need */ + { + Curve *cu; + cu = (Curve *)tmpobj->data; + if( cu->disp.first ) + MEM_freeN( cu->disp.first ); + cu->disp.first = NULL; + } - dm= mesh_create_derived_render(scene, ob, mask); +#endif - if(!dm) - return NULL; + /* get updated display list, and convert to a mesh */ + makeDispListCurveTypes( scene, tmpobj, 0 ); + nurbs_to_mesh( tmpobj ); - me= add_mesh("tmp_render_mesh"); - me->id.us--; /* we don't assign it to anything */ - DM_to_mesh(dm, me); - dm->release(dm); + /* nurbs_to_mesh changes the type tp a mesh, check it worked */ + if (tmpobj->type != OB_MESH) { + free_libblock_us( &(CTX_data_main(C)->object), tmpobj ); + printf("cant convert curve to mesh. Does the curve have any segments?" ); // XXX use report api + } + me = tmpobj->data; + free_libblock_us( &(CTX_data_main(C)->object), tmpobj ); + break; + } + case OB_MBALL: + /* metaballs don't have modifiers, so just convert to mesh */ + ob = find_basis_mball( ob ); + /* todo, re-generatre for render-res */ + // metaball_polygonize(scene, ob) + me = add_mesh("Mesh"); + mball_to_mesh( &ob->disp, me ); + break; + case OB_MESH: + { + dm= mesh_create_derived_render(scene, ob, mask); + // dm= mesh_create_derived_view(scene, ob, mask); + + if(!dm) + return NULL; + + me= add_mesh("tmp_render_mesh"); + me->id.us--; /* we don't assign it to anything */ + DM_to_mesh(dm, me); + dm->release(dm); + break; + } + default: + return NULL; + } { /* update the material */ @@ -94,6 +156,7 @@ void RNA_api_object(StructRNA *srna) func= RNA_def_function(srna, "create_render_mesh", "rna_Object_create_render_mesh"); RNA_def_function_ui_description(func, "Create a Mesh datablock with all modifiers applied."); + RNA_def_function_flag(func, FUNC_USE_CONTEXT); prop= RNA_def_pointer(func, "scene", "Scene", "", ""); RNA_def_property_flag(prop, PROP_REQUIRED); prop= RNA_def_pointer(func, "mesh", "Mesh", "", "Mesh created from object, remove it if it is only used for export."); diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c index 932bef9969d..3dfbfcccacf 100644 --- a/source/blender/makesrna/intern/rna_object_force.c +++ b/source/blender/makesrna/intern/rna_object_force.c @@ -54,7 +54,6 @@ static void rna_Cache_change(bContext *C, PointerRNA *ptr) { - Scene *scene = CTX_data_scene(C); Object *ob = CTX_data_active_object(C); PointCache *cache = (PointCache*)ptr->data; PTCacheID *pid = NULL; @@ -67,7 +66,7 @@ static void rna_Cache_change(bContext *C, PointerRNA *ptr) BKE_ptcache_ids_from_object(&pidlist, ob); - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); for(pid=pidlist.first; pid; pid=pid->next) { if(pid->cache==cache) @@ -105,7 +104,6 @@ static void rna_Cache_toggle_disk_cache(bContext *C, PointerRNA *ptr) static void rna_Cache_idname_change(bContext *C, PointerRNA *ptr) { - Scene *scene = CTX_data_scene(C); Object *ob = CTX_data_active_object(C); PointCache *cache = (PointCache*)ptr->data; PTCacheID *pid = NULL, *pid2= NULL; @@ -133,7 +131,7 @@ static void rna_Cache_idname_change(bContext *C, PointerRNA *ptr) cache->flag &= ~(PTCACHE_OUTDATED|PTCACHE_FRAMES_SKIPPED); BKE_ptcache_load_external(pid); - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); } else { for(pid=pidlist.first; pid; pid=pid->next) { @@ -362,7 +360,6 @@ static void rna_SoftBodySettings_goal_vgroup_set(PointerRNA *ptr, const char *va static void rna_FieldSettings_update(bContext *C, PointerRNA *ptr) { - Scene *scene= CTX_data_scene(C); Object *ob= (Object*)ptr->id.data; if(ob->pd->forcefield != PFIELD_TEXTURE && ob->pd->tex) { @@ -370,7 +367,7 @@ static void rna_FieldSettings_update(bContext *C, PointerRNA *ptr) ob->pd->tex= 0; } - DAG_object_flush_update(scene, ob, OB_RECALC_OB); + DAG_id_flush_update(&ob->id, OB_RECALC_OB); WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob); } @@ -413,9 +410,9 @@ static void rna_FieldSettings_dependency_update(bContext *C, PointerRNA *ptr) DAG_scene_sort(scene); if(ob->type == OB_CURVE && ob->pd->forcefield == PFIELD_GUIDE) - DAG_object_flush_update(scene, ob, OB_RECALC); + DAG_id_flush_update(&ob->id, OB_RECALC); else - DAG_object_flush_update(scene, ob, OB_RECALC_OB); + DAG_id_flush_update(&ob->id, OB_RECALC_OB); WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob); } @@ -437,13 +434,20 @@ static void rna_CollisionSettings_dependency_update(bContext *C, PointerRNA *ptr static void rna_CollisionSettings_update(bContext *C, PointerRNA *ptr) { - Scene *scene= CTX_data_scene(C); Object *ob= (Object*)ptr->id.data; - DAG_object_flush_update(scene, ob, OB_RECALC); + DAG_id_flush_update(&ob->id, OB_RECALC); WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob); } +static void rna_softbody_update(bContext *C, PointerRNA *ptr) +{ + Object *ob= (Object*)ptr->id.data; + + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob); +} + #else static void rna_def_pointcache(BlenderRNA *brna) @@ -896,25 +900,25 @@ static void rna_def_softbody(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "mediafrict"); RNA_def_property_range(prop, 0.0f, 50.0f); RNA_def_property_ui_text(prop, "Friction", "General media friction for point movements"); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_softbody_update"); prop= RNA_def_property(srna, "mass", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "nodemass"); RNA_def_property_range(prop, 0.0f, 50000.0f); RNA_def_property_ui_text(prop, "Mass", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_softbody_update"); prop= RNA_def_property(srna, "gravity", PROP_FLOAT, PROP_ACCELERATION); RNA_def_property_float_sdna(prop, NULL, "grav"); RNA_def_property_range(prop, -10.0f, 10.0f); RNA_def_property_ui_text(prop, "Gravitation", "Apply gravitation to point movement"); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_softbody_update"); prop= RNA_def_property(srna, "speed", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "physics_speed"); RNA_def_property_range(prop, 0.01f, 100.0f); RNA_def_property_ui_text(prop, "Speed", "Tweak timing for physics to control frequency and speed"); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_softbody_update"); /* Goal */ @@ -927,31 +931,31 @@ static void rna_def_softbody(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "mingoal"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Goal Minimum", "Goal minimum, vertex group weights are scaled to match this range."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_softbody_update"); prop= RNA_def_property(srna, "goal_max", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "maxgoal"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Goal Maximum", "Goal maximum, vertex group weights are scaled to match this range."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_softbody_update"); prop= RNA_def_property(srna, "goal_default", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "defgoal"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Goal Default", "Default Goal (vertex target position) value, when no Vertex Group used."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_softbody_update"); prop= RNA_def_property(srna, "goal_spring", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "goalspring"); RNA_def_property_range(prop, 0.0f, 0.999f); RNA_def_property_ui_text(prop, "Goal Stiffness", "Goal (vertex target position) spring stiffness."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_softbody_update"); prop= RNA_def_property(srna, "goal_friction", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "goalfrict"); RNA_def_property_range(prop, 0.0f, 50.0f); RNA_def_property_ui_text(prop, "Goal Damping", "Goal (vertex target position) friction."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_softbody_update"); /* Edge Spring Settings */ @@ -959,43 +963,43 @@ static void rna_def_softbody(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "inspring"); RNA_def_property_range(prop, 0.0f, 0.999f); RNA_def_property_ui_text(prop, "Pull", "Edge spring stiffness when longer than rest length"); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_softbody_update"); prop= RNA_def_property(srna, "push", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "inpush"); RNA_def_property_range(prop, 0.0f, 0.999f); RNA_def_property_ui_text(prop, "Push", "Edge spring stiffness when shorter than rest length"); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_softbody_update"); prop= RNA_def_property(srna, "damp", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "infrict"); RNA_def_property_range(prop, 0.0f, 50.0f); RNA_def_property_ui_text(prop, "Damp", "Edge spring friction"); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_softbody_update"); prop= RNA_def_property(srna, "spring_length", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "springpreload"); RNA_def_property_range(prop, 0.0f, 200.0f); RNA_def_property_ui_text(prop, "SL", "Alter spring length to shrink/blow up (unit %) 0 to disable"); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_softbody_update"); prop= RNA_def_property(srna, "aero", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "aeroedge"); RNA_def_property_range(prop, 0.0f, 30000.0f); RNA_def_property_ui_text(prop, "Aero", "Make edges 'sail'"); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_softbody_update"); prop= RNA_def_property(srna, "plastic", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "plastic"); RNA_def_property_range(prop, 0.0f, 100.0f); RNA_def_property_ui_text(prop, "Plastic", "Permanent deform"); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_softbody_update"); prop= RNA_def_property(srna, "bending", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "secondspring"); RNA_def_property_range(prop, 0.0f, 10.0f); RNA_def_property_ui_text(prop, "Bending", "Bending Stiffness"); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_softbody_update"); prop= RNA_def_property(srna, "shear", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "shearstiff"); @@ -1008,25 +1012,25 @@ static void rna_def_softbody(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "sbc_mode"); RNA_def_property_enum_items(prop, collision_type_items); RNA_def_property_ui_text(prop, "Collision Type", "Choose Collision Type"); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_softbody_update"); prop= RNA_def_property(srna, "ball_size", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "colball"); RNA_def_property_range(prop, -10.0f, 10.0f); RNA_def_property_ui_text(prop, "Ball Size", "Absolute ball size or factor if not manual adjusted"); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_softbody_update"); prop= RNA_def_property(srna, "ball_stiff", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "ballstiff"); RNA_def_property_range(prop, 0.001f, 100.0f); RNA_def_property_ui_text(prop, "Ball Size", "Ball inflating presure"); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_softbody_update"); prop= RNA_def_property(srna, "ball_damp", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "balldamp"); RNA_def_property_range(prop, 0.001f, 1.0f); RNA_def_property_ui_text(prop, "Ball Size", "Blending to inelastic collision"); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_softbody_update"); /* Solver */ @@ -1034,36 +1038,36 @@ static void rna_def_softbody(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "rklimit"); RNA_def_property_range(prop, 0.001f, 10.0f); RNA_def_property_ui_text(prop, "Error Limit", "The Runge-Kutta ODE solver error limit, low value gives more precision, high values speed"); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_softbody_update"); prop= RNA_def_property(srna, "minstep", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "minloops"); RNA_def_property_range(prop, 0, 30000); RNA_def_property_ui_text(prop, "Min Step", "Minimal # solver steps/frame"); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_softbody_update"); prop= RNA_def_property(srna, "maxstep", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "maxloops"); RNA_def_property_range(prop, 0, 30000); RNA_def_property_ui_text(prop, "Max Step", "Maximal # solver steps/frame"); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_softbody_update"); prop= RNA_def_property(srna, "choke", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "choke"); RNA_def_property_range(prop, 0, 100); RNA_def_property_ui_text(prop, "Choke", "'Viscosity' inside collision target"); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_softbody_update"); prop= RNA_def_property(srna, "fuzzy", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "fuzzyness"); RNA_def_property_range(prop, 1, 100); RNA_def_property_ui_text(prop, "Fuzzy", "Fuzzyness while on collision, high values make collsion handling faster but less stable"); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_softbody_update"); prop= RNA_def_property(srna, "auto_step", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "solverflags", SBSO_OLDERR); RNA_def_property_ui_text(prop, "V", "Use velocities for automagic step sizes"); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_softbody_update"); prop= RNA_def_property(srna, "diagnose", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "solverflags", SBSO_MONITOR); @@ -1074,37 +1078,37 @@ static void rna_def_softbody(BlenderRNA *brna) prop= RNA_def_property(srna, "use_goal", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_SoftBodySettings_use_goal_get", "rna_SoftBodySettings_use_goal_set"); RNA_def_property_ui_text(prop, "Use Goal", "Define forces for vertices to stick to animated position."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_softbody_update"); prop= RNA_def_property(srna, "use_edges", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_SoftBodySettings_use_edges_get", "rna_SoftBodySettings_use_edges_set"); RNA_def_property_ui_text(prop, "Use Edges", "Use Edges as springs"); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_softbody_update"); prop= RNA_def_property(srna, "stiff_quads", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_SoftBodySettings_stiff_quads_get", "rna_SoftBodySettings_stiff_quads_set"); RNA_def_property_ui_text(prop, "Stiff Quads", "Adds diagonal springs on 4-gons."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_softbody_update"); prop= RNA_def_property(srna, "edge_collision", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_SoftBodySettings_edge_collision_get", "rna_SoftBodySettings_edge_collision_set"); RNA_def_property_ui_text(prop, "Edge Collision", "Edges collide too."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_softbody_update"); prop= RNA_def_property(srna, "face_collision", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_SoftBodySettings_face_collision_get", "rna_SoftBodySettings_face_collision_set"); RNA_def_property_ui_text(prop, "Face Collision", "Faces collide too, SLOOOOOW warning."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_softbody_update"); prop= RNA_def_property(srna, "new_aero", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_SoftBodySettings_new_aero_get", "rna_SoftBodySettings_new_aero_set"); RNA_def_property_ui_text(prop, "N", "New aero(uses angle and length)."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_softbody_update"); prop= RNA_def_property(srna, "self_collision", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_SoftBodySettings_self_collision_get", "rna_SoftBodySettings_self_collision_set"); RNA_def_property_ui_text(prop, "Self Collision", "Enable naive vertex ball self collision."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_softbody_update"); } void RNA_def_object_force(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_packedfile.c b/source/blender/makesrna/intern/rna_packedfile.c index 6b9a708f555..85918bce05b 100644 --- a/source/blender/makesrna/intern/rna_packedfile.c +++ b/source/blender/makesrna/intern/rna_packedfile.c @@ -31,6 +31,13 @@ #include "DNA_packedFile_types.h" +EnumPropertyItem unpack_method_items[] = { + {PF_USE_LOCAL, "USE_LOCAL", 0, "Use Local File", ""}, + {PF_WRITE_LOCAL, "WRITE_LOCAL", 0, "Write Local File (overwrite existing)", ""}, + {PF_USE_ORIGINAL, "USE_ORIGINAL", 0, "Use Original File", ""}, + {PF_WRITE_ORIGINAL, "WRITE_ORIGINAL", 0, "Write Original File (overwrite existing)", ""}, + {0, NULL, 0, NULL, NULL}}; + #ifdef RNA_RUNTIME #else diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c index e0dbc232e06..bbbb13c6e97 100644 --- a/source/blender/makesrna/intern/rna_particle.c +++ b/source/blender/makesrna/intern/rna_particle.c @@ -33,6 +33,7 @@ #include "rna_internal.h" +#include "DNA_modifier_types.h" #include "DNA_particle_types.h" #include "DNA_object_force.h" #include "DNA_object_types.h" @@ -96,8 +97,11 @@ EnumPropertyItem part_hair_ren_as_items[] = { #ifdef RNA_RUNTIME #include "BKE_context.h" +#include "BKE_cloth.h" #include "BKE_depsgraph.h" +#include "BKE_modifier.h" #include "BKE_particle.h" +#include "BKE_pointcache.h" #include "BLI_arithb.h" @@ -113,12 +117,14 @@ static void rna_Particle_redo(bContext *C, PointerRNA *ptr) psys->recalc = PSYS_RECALC_REDO; if(ob) - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); } else { part = ptr->id.data; psys_flush_particle_settings(scene, part, PSYS_RECALC_REDO); } + + WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_DATA, NULL); } static void rna_Particle_reset(bContext *C, PointerRNA *ptr) @@ -133,13 +139,15 @@ static void rna_Particle_reset(bContext *C, PointerRNA *ptr) psys->recalc = PSYS_RECALC_RESET; if(ob) { - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); } } else { part = ptr->id.data; psys_flush_particle_settings(scene, part, PSYS_RECALC_RESET); } + + WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_DATA, NULL); } static void rna_Particle_target_reset(bContext *C, PointerRNA *ptr) @@ -171,22 +179,23 @@ static void rna_Particle_target_reset(bContext *C, PointerRNA *ptr) psys->recalc = PSYS_RECALC_RESET; - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); DAG_scene_sort(scene); } + + WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_DATA, NULL); } static void rna_Particle_target_redo(bContext *C, PointerRNA *ptr) { - Scene *scene = CTX_data_scene(C); - if(ptr->type==&RNA_ParticleTarget) { Object *ob = (Object*)ptr->id.data; ParticleSystem *psys = psys_get_current(ob); psys->recalc = PSYS_RECALC_REDO; - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_DATA, NULL); } } @@ -202,13 +211,15 @@ static void rna_Particle_change_type(bContext *C, PointerRNA *ptr) psys->recalc = PSYS_RECALC_RESET|PSYS_RECALC_TYPE; if(ob) { - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); } } else { part = ptr->id.data; psys_flush_particle_settings(scene, part, PSYS_RECALC_RESET|PSYS_RECALC_TYPE); } + + WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_DATA, NULL); } static void rna_Particle_change_physics(bContext *C, PointerRNA *ptr) @@ -216,6 +227,7 @@ static void rna_Particle_change_physics(bContext *C, PointerRNA *ptr) Scene *scene = CTX_data_scene(C); ParticleSettings *part = ptr->id.data; psys_flush_particle_settings(scene, part, PSYS_RECALC_RESET|PSYS_RECALC_PHYS); + WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_DATA, NULL); } static void rna_Particle_redo_child(bContext *C, PointerRNA *ptr) @@ -230,13 +242,30 @@ static void rna_Particle_redo_child(bContext *C, PointerRNA *ptr) psys->recalc = PSYS_RECALC_CHILD; if(ob) - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); } else { part = ptr->id.data; psys_flush_particle_settings(scene, part, PSYS_RECALC_CHILD); } + + WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_DATA, NULL); +} +static void rna_Particle_hair_dynamics(bContext *C, PointerRNA *ptr) +{ + /* Scene *scene = CTX_data_scene(C); */ + ParticleSystem *psys = (ParticleSystem*)ptr->data; + + if(psys && !psys->clmd) { + psys->clmd = (ClothModifierData*)modifier_new(eModifierType_Cloth); + psys->clmd->sim_parms->goalspring = 0.0f; + psys->clmd->sim_parms->flags |= CLOTH_SIMSETTINGS_FLAG_GOAL|CLOTH_SIMSETTINGS_FLAG_NO_SPRING_COMPRESS; + psys->clmd->coll_parms->flags &= ~CLOTH_COLLSETTINGS_FLAG_SELF; + rna_Particle_redo(C, ptr); + } + else + WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_DATA, NULL); } static PointerRNA rna_particle_settings_get(PointerRNA *ptr) { @@ -436,7 +465,30 @@ static void rna_ParticleTarget_name_get(PointerRNA *ptr, char *str) else strcpy(str, "Invalid target!"); } +static int rna_ParticleSystem_multiple_caches_get(PointerRNA *ptr) +{ + ParticleSystem *psys= (ParticleSystem*)ptr->data; + return (psys->ptcaches.first != psys->ptcaches.last); +} +static int rna_ParticleSystem_editable_get(PointerRNA *ptr) +{ + ParticleSystem *psys= (ParticleSystem*)ptr->data; + + if(psys->part && psys->part->type==PART_HAIR) + return (psys->flag & PSYS_HAIR_DONE); + else + return (psys->pointcache->flag & PTCACHE_BAKED); +} +static int rna_ParticleSystem_edited_get(PointerRNA *ptr) +{ + ParticleSystem *psys= (ParticleSystem*)ptr->data; + + if(psys->part && psys->part->type==PART_HAIR) + return (psys->flag & PSYS_EDITED || (psys->edit && psys->edit->edited)); + else + return (psys->pointcache->edit && psys->pointcache->edit->edited); +} EnumPropertyItem from_items[] = { {PART_FROM_VERT, "VERT", 0, "Vertexes", ""}, {PART_FROM_FACE, "FACE", 0, "Faces", ""}, @@ -609,12 +661,6 @@ static void rna_def_particle(BlenderRNA *brna) RNA_def_struct_sdna(srna, "ParticleData"); RNA_def_struct_ui_text(srna, "Particle", "Particle in a particle system."); - prop= RNA_def_property(srna, "stick_object", PROP_POINTER, PROP_NONE); - RNA_def_property_pointer_sdna(prop, NULL, "stick_ob"); - RNA_def_property_struct_type(prop, "Object"); - RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_ui_text(prop, "Stick Object", "Object that particle sticks to when dead"); - /* Particle State & Previous State */ prop= RNA_def_property(srna, "location", PROP_FLOAT, PROP_TRANSLATION); RNA_def_property_float_sdna(prop, NULL, "state.co"); @@ -659,24 +705,6 @@ static void rna_def_particle(BlenderRNA *brna) RNA_def_property_collection_sdna(prop, NULL, "keys", "totkey"); RNA_def_property_struct_type(prop, "ParticleKey"); RNA_def_property_ui_text(prop, "Keyed States", ""); - - /* Random variables */ - - prop= RNA_def_property(srna, "random_rotation", PROP_FLOAT, PROP_QUATERNION); - RNA_def_property_float_sdna(prop, NULL, "r_rot"); -// RNA_def_property_range(prop, lowerLimitf, upperLimitf); - RNA_def_property_ui_text(prop, "Random Rotation", ""); - - prop= RNA_def_property(srna, "random_a_velocity", PROP_FLOAT, PROP_VELOCITY); - RNA_def_property_float_sdna(prop, NULL, "r_ave"); -// RNA_def_property_range(prop, lowerLimitf, upperLimitf); - RNA_def_property_ui_text(prop, "Random Angular Velocity", ""); - - prop= RNA_def_property(srna, "random_velocity", PROP_FLOAT, PROP_VELOCITY); - RNA_def_property_float_sdna(prop, NULL, "r_ve"); -// RNA_def_property_range(prop, lowerLimitf, upperLimitf); - RNA_def_property_ui_text(prop, "Random Velocity", ""); - // // float fuv[4], foffset; /* coordinates on face/edge number "num" and depth along*/ // /* face normal for volume emission */ @@ -699,18 +727,12 @@ static void rna_def_particle(BlenderRNA *brna) // RNA_def_property_range(prop, lowerLimitf, upperLimitf); RNA_def_property_ui_text(prop, "Size", ""); - prop= RNA_def_property(srna, "size_multiplier", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "sizemul"); -// RNA_def_property_range(prop, lowerLimitf, upperLimitf); - RNA_def_property_ui_text(prop, "Size Multiplier", ""); - // // int num; /* index to vert/edge/face */ // int num_dmcache; /* index to derived mesh data (face) to avoid slow lookups */ // int pad; // // int totkey; -// int bpi; /* softbody body point start index */ /* flag */ prop= RNA_def_property(srna, "unexist", PROP_BOOLEAN, PROP_NONE); @@ -721,31 +743,10 @@ static void rna_def_particle(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", PARS_NO_DISP); RNA_def_property_ui_text(prop, "no_disp", ""); - prop= RNA_def_property(srna, "sticky", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", PARS_STICKY); - RNA_def_property_ui_text(prop, "sticky", ""); - - prop= RNA_def_property(srna, "transform", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", PARS_TRANSFORM); - RNA_def_property_ui_text(prop, "transform", ""); - - prop= RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", PARS_HIDE); - RNA_def_property_ui_text(prop, "hide", ""); - - prop= RNA_def_property(srna, "tag", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", PARS_TAG); - RNA_def_property_ui_text(prop, "tag", ""); - prop= RNA_def_property(srna, "rekey", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PARS_REKEY); RNA_def_property_ui_text(prop, "rekey", ""); - prop= RNA_def_property(srna, "edit_recalc", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", PARS_EDIT_RECALC); - RNA_def_property_ui_text(prop, "edit_recalc", ""); - - prop= RNA_def_property(srna, "alive_state", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "alive"); RNA_def_property_enum_items(prop, alive_items); @@ -885,19 +886,19 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_REACT_STA_END); RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); RNA_def_property_ui_text(prop, "Start/End", "Give birth to unreacted particles eventually."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "react_multiple", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_REACT_MULTIPLE); RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); RNA_def_property_ui_text(prop, "Multi React", "React multiple times."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "loop", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_LOOP); RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); RNA_def_property_ui_text(prop, "Loop", "Loop particle lives."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); /* TODO: used somewhere? */ prop= RNA_def_property(srna, "hair_geometry", PROP_BOOLEAN, PROP_NONE); @@ -907,94 +908,88 @@ static void rna_def_particle_settings(BlenderRNA *brna) prop= RNA_def_property(srna, "unborn", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_UNBORN); RNA_def_property_ui_text(prop, "Unborn", "Show particles before they are emitted."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "died", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_DIED); RNA_def_property_ui_text(prop, "Died", "Show particles after they have died"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "trand", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_TRAND); RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); RNA_def_property_ui_text(prop, "Random", "Emit in random order of elements"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "even_distribution", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_EDISTR); RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); RNA_def_property_ui_text(prop, "Even Distribution", "Use even distribution from faces based on face areas or edge lengths."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); - - prop= RNA_def_property(srna, "sticky", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_STICKY); - RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); - RNA_def_property_ui_text(prop, "Sticky", "Particles stick to collided objects if they die in the collision."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); - + RNA_def_property_update(prop, 0, "rna_Particle_reset"); + prop= RNA_def_property(srna, "die_on_collision", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_DIE_ON_COL); RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); RNA_def_property_ui_text(prop, "Die on hit", "Particles die when they collide with a deflector object."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "size_deflect", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_SIZE_DEFL); RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); RNA_def_property_ui_text(prop, "Size Deflect", "Use particle's size in deflection."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "rotation_dynamic", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_ROT_DYN); RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); RNA_def_property_ui_text(prop, "Dynamic", "Sets rotation to dynamic/constant"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "sizemass", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_SIZEMASS); RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); RNA_def_property_ui_text(prop, "Mass from Size", "Multiply mass with particle size."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "boids_2d", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_BOIDS_2D); RNA_def_property_ui_text(prop, "Boids 2D", "Constrain boids to a surface"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "branching", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_BRANCHING); RNA_def_property_ui_text(prop, "Branching", "Branch child paths from each other."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); prop= RNA_def_property(srna, "animate_branching", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_ANIM_BRANCHING); RNA_def_property_ui_text(prop, "Animated", "Animate branching"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); prop= RNA_def_property(srna, "symmetric_branching", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_SYMM_BRANCHING); RNA_def_property_ui_text(prop, "Symmetric", "Start and end points are the same."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); prop= RNA_def_property(srna, "hair_bspline", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_HAIR_BSPLINE); RNA_def_property_ui_text(prop, "B-Spline", "Interpolate hair using B-Splines."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "grid_invert", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_GRID_INVERT); RNA_def_property_ui_text(prop, "Invert", "Invert what is considered object and what is not."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "child_effector", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_CHILD_EFFECT); RNA_def_property_ui_text(prop, "Children", "Apply effectors to children."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "child_seams", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_CHILD_SEAMS); RNA_def_property_ui_text(prop, "Use seams", "Use seams to determine parents"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); /* TODO: used somewhere? */ prop= RNA_def_property(srna, "child_render", PROP_BOOLEAN, PROP_NONE); @@ -1004,19 +999,19 @@ static void rna_def_particle_settings(BlenderRNA *brna) prop= RNA_def_property(srna, "child_guide", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_CHILD_GUIDE); RNA_def_property_ui_text(prop, "child_guide", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "self_effect", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_SELF_EFFECT); RNA_def_property_ui_text(prop, "Self Effect", "Particle effectors effect themselves."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, type_items); RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); RNA_def_property_ui_text(prop, "Type", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_change_type"); + RNA_def_property_update(prop, 0, "rna_Particle_change_type"); prop= RNA_def_property(srna, "emit_from", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "from"); @@ -1024,14 +1019,14 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Particle_from_itemf"); RNA_def_property_ui_text(prop, "Emit From", "Where to emit particles from"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "distribution", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "distr"); RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); RNA_def_property_enum_items(prop, dist_items); RNA_def_property_ui_text(prop, "Distribution", "How to distribute particles on selected element"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); /* physics modes */ prop= RNA_def_property(srna, "physics_type", PROP_ENUM, PROP_NONE); @@ -1039,130 +1034,130 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); RNA_def_property_enum_items(prop, phys_type_items); RNA_def_property_ui_text(prop, "Physics Type", "Particle physics type"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_change_physics"); + RNA_def_property_update(prop, 0, "rna_Particle_change_physics"); prop= RNA_def_property(srna, "rotation_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "rotmode"); RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); RNA_def_property_enum_items(prop, rot_mode_items); RNA_def_property_ui_text(prop, "Rotation", "Particles initial rotation"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "angular_velocity_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "avemode"); RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); RNA_def_property_enum_items(prop, ave_mode_items); RNA_def_property_ui_text(prop, "Angular Velocity Mode", "Particle angular velocity mode."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "react_event", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "reactevent"); RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); RNA_def_property_enum_items(prop, react_event_items); RNA_def_property_ui_text(prop, "React On", "The event of target particles to react on."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); /*draw flag*/ prop= RNA_def_property(srna, "velocity", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_VEL); RNA_def_property_ui_text(prop, "Velocity", "Show particle velocity"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "show_size", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_SIZE); RNA_def_property_ui_text(prop, "Size", "Show particle size"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "emitter", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_EMITTER); RNA_def_property_ui_text(prop, "Emitter", "Render emitter Object also."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "draw_health", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_HEALTH); RNA_def_property_ui_text(prop, "Health", "Draw boid health"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "abs_path_time", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_ABS_PATH_TIME); RNA_def_property_ui_text(prop, "Absolute Path Time", "Path timing is in absolute frames"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_abspathtime_update"); + RNA_def_property_update(prop, 0, "rna_Particle_abspathtime_update"); prop= RNA_def_property(srna, "billboard_lock", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_BB_LOCK); RNA_def_property_ui_text(prop, "Lock Billboard", "Lock the billboards align axis"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "parent", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_PARENT); RNA_def_property_ui_text(prop, "Parents", "Render parent particles."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "num", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_NUM); RNA_def_property_ui_text(prop, "Number", "Show particle number"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "rand_group", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_RAND_GR); RNA_def_property_ui_text(prop, "Pick Random", "Pick objects from group randomly"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "render_adaptive", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_REN_ADAPT); RNA_def_property_ui_text(prop, "Adaptive render", "Draw steps of the particle path"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "velocity_length", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_VEL_LENGTH); RNA_def_property_ui_text(prop, "Speed", "Multiply line length by particle speed"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "material_color", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_MAT_COL); RNA_def_property_ui_text(prop, "Material Color", "Draw particles using material's diffuse color."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "whole_group", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_WHOLE_GR); RNA_def_property_ui_text(prop, "Whole Group", "Use whole group at once."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "render_strand", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_REN_STRAND); RNA_def_property_ui_text(prop, "Strand render", "Use the strand primitive for rendering"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "draw_as", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "draw_as"); RNA_def_property_enum_items(prop, part_draw_as_items); RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Particle_draw_as_itemf"); RNA_def_property_ui_text(prop, "Particle Drawing", "How particles are drawn in viewport"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "ren_as", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "ren_as"); RNA_def_property_enum_items(prop, part_ren_as_items); RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Particle_ren_as_itemf"); RNA_def_property_ui_text(prop, "Particle Rendering", "How particles are rendered"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "draw_size", PROP_INT, PROP_NONE); RNA_def_property_range(prop, 0, 10); RNA_def_property_ui_text(prop, "Draw Size", "Size of particles on viewport in pixels (0=default)"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "child_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "childtype"); RNA_def_property_enum_items(prop, child_type_items); RNA_def_property_ui_text(prop, "Children From", "Create child particles"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); prop= RNA_def_property(srna, "draw_step", PROP_INT, PROP_NONE); RNA_def_property_range(prop, 0, 7); RNA_def_property_ui_range(prop, 0, 10, 1, 0); RNA_def_property_ui_text(prop, "Steps", "How many steps paths are drawn with (power of 2)"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "render_step", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "ren_step"); @@ -1173,7 +1168,7 @@ static void rna_def_particle_settings(BlenderRNA *brna) prop= RNA_def_property(srna, "hair_step", PROP_INT, PROP_NONE); RNA_def_property_range(prop, 2, 50); RNA_def_property_ui_text(prop, "Segments", "Number of hair segments"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); //TODO: not found in UI, readonly? @@ -1196,13 +1191,13 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_int_sdna(prop, NULL, "disp"); RNA_def_property_range(prop, 0, 100); RNA_def_property_ui_text(prop, "Display", "Percentage of particles to display in 3d view"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "material", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "omat"); RNA_def_property_range(prop, 1, 16); RNA_def_property_ui_text(prop, "Material", "Specify material used for the particles"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); //TODO: is this read only/internal? @@ -1214,24 +1209,24 @@ static void rna_def_particle_settings(BlenderRNA *brna) prop= RNA_def_property(srna, "integrator", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, integrator_type_items); RNA_def_property_ui_text(prop, "Integration", "Select physics integrator type"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "kink", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, kink_type_items); RNA_def_property_ui_text(prop, "Kink", "Type of periodic offset on the path"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); prop= RNA_def_property(srna, "kink_axis", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, kink_axis_items); RNA_def_property_ui_text(prop, "Axis", "Which axis to use for offset"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); /* billboards */ prop= RNA_def_property(srna, "billboard_align", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "bb_align"); RNA_def_property_enum_items(prop, bb_align_items); RNA_def_property_ui_text(prop, "Align to", "In respect to what the billboards are aligned"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "billboard_uv_split", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "bb_uv_split"); @@ -1253,13 +1248,13 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "bb_tilt"); RNA_def_property_range(prop, -1.0f, 1.0f); RNA_def_property_ui_text(prop, "Tilt", "Tilt of the billboards"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "billboard_random_tilt", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "bb_rand_tilt"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Random Tilt", "Random tilt of the billboards"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "billboard_offset", PROP_FLOAT, PROP_TRANSLATION); RNA_def_property_float_sdna(prop, NULL, "bb_offset"); @@ -1267,7 +1262,7 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_range(prop, -100.0f, 100.0f); RNA_def_property_ui_range(prop, -1.0, 1.0, 0.1, 3); RNA_def_property_ui_text(prop, "Billboard Offset", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); /* simplification */ prop= RNA_def_property(srna, "enable_simplify", PROP_BOOLEAN, PROP_NONE); @@ -1302,7 +1297,7 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); RNA_def_property_float_funcs(prop, NULL, "rna_PartSettings_start_set", NULL); RNA_def_property_ui_text(prop, "Start", "Frame # to start emitting particles."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "end", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF); @@ -1310,37 +1305,37 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); RNA_def_property_float_funcs(prop, NULL, "rna_PartSettings_end_set", NULL); RNA_def_property_ui_text(prop, "End", "Frame # to stop emitting particles."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "lifetime", PROP_FLOAT, PROP_TIME); RNA_def_property_range(prop, 1.0f, MAXFRAMEF); RNA_def_property_ui_text(prop, "Lifetime", "Specify the life span of the particles"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "random_lifetime", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "randlife"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Random", "Give the particle life a random variation."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "time_tweak", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "timetweak"); RNA_def_property_range(prop, 0.0f, 10.0f); RNA_def_property_ui_text(prop, "Tweak", "A multiplier for physics timestep (1.0 means one frame = 1/25 seconds)"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "jitter_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); RNA_def_property_float_sdna(prop, NULL, "jitfac"); RNA_def_property_range(prop, 0.0f, 2.0f); RNA_def_property_ui_text(prop, "Amount", "Amount of jitter applied to the sampling."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "effect_hair", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "eff_hair"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Stiffnes", "Hair stiffness for effectors"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "amount", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "totpart"); @@ -1351,14 +1346,14 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_range(prop, 0, 10000000); RNA_def_property_ui_range(prop, 0, 100000, 1, 0); RNA_def_property_ui_text(prop, "Amount", "Total number of particles."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "userjit", PROP_INT, PROP_UNSIGNED);//TODO: can we get a better name for userjit? RNA_def_property_int_sdna(prop, NULL, "userjit"); RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); RNA_def_property_range(prop, 0, 1000); RNA_def_property_ui_text(prop, "P/F", "Emission locations / face (0 = automatic)."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "grid_resolution", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "grid_res"); @@ -1366,102 +1361,102 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_range(prop, 1, 46); /* ~100k particles in a cube */ RNA_def_property_ui_range(prop, 1, 215, 1, 0); /* ~10M particles in a cube */ RNA_def_property_ui_text(prop, "Resolution", "The resolution of the particle grid."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); /* initial velocity factors */ prop= RNA_def_property(srna, "normal_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "normfac");//optional if prop names are the same RNA_def_property_range(prop, -200.0f, 200.0f); RNA_def_property_ui_text(prop, "Normal", "Let the surface normal give the particle a starting speed."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "object_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "obfac"); RNA_def_property_range(prop, -200.0f, 200.0f); RNA_def_property_ui_range(prop, -1.0f, 1.0f, 0.1, 3); RNA_def_property_ui_text(prop, "Object", "Let the object give the particle a starting speed"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "random_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "randfac");//optional if prop names are the same RNA_def_property_range(prop, 0.0f, 200.0f); RNA_def_property_ui_text(prop, "Random", "Give the starting speed a random variation."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "particle_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "partfac"); RNA_def_property_range(prop, -200.0f, 200.0f); RNA_def_property_ui_range(prop, -1.0f, 1.0f, 0.1, 3); RNA_def_property_ui_text(prop, "Particle", "Let the target particle give the particle a starting speed."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "tangent_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "tanfac"); RNA_def_property_range(prop, -200.0f, 200.0f); RNA_def_property_ui_text(prop, "Tangent", "Let the surface tangent give the particle a starting speed."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "tangent_phase", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "tanphase"); RNA_def_property_range(prop, -1.0f, 1.0f); RNA_def_property_ui_text(prop, "Rot", "Rotate the surface tangent."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "reactor_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "reactfac"); RNA_def_property_range(prop, -10.0f, 10.0f); RNA_def_property_ui_text(prop, "Reactor", "Let the vector away from the target particles location give the particle a starting speed."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "angular_velocity_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "avefac"); RNA_def_property_range(prop, -200.0f, 200.0f); RNA_def_property_ui_text(prop, "Angular Velocity", "Angular velocity amount"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "phase_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "phasefac"); RNA_def_property_range(prop, -1.0f, 1.0f); RNA_def_property_ui_text(prop, "Phase", "Initial rotation phase"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "random_rotation_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "randrotfac"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Random Rotation", "Randomize rotation"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "random_phase_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "randphasefac"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Random Phase", "Randomize rotation phase"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); /* physical properties */ prop= RNA_def_property(srna, "mass", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.001f, 100000.0f); RNA_def_property_ui_range(prop, 0.01f, 100.0f, 0.1, 3); RNA_def_property_ui_text(prop, "Mass", "Specify the mass of the particles"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "particle_size", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "size"); RNA_def_property_range(prop, 0.001f, 100000.0f); RNA_def_property_ui_range(prop, 0.01f, 100.0f, 0.1, 3); RNA_def_property_ui_text(prop, "Size", "The size of the particles"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "random_size", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "randsize"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Random Size", "Give the particle size a random variation"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "reaction_shape", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "reactshape"); RNA_def_property_range(prop, 0.0f, 10.0f); RNA_def_property_ui_text(prop, "Shape", "Power of reaction strength dependence on distance to target."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); /* global physical properties */ @@ -1470,38 +1465,38 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_array(prop, 3); RNA_def_property_range(prop, -200.0f, 200.0f); RNA_def_property_ui_text(prop, "Acceleration", "Constant acceleration"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "gravity", PROP_FLOAT, PROP_ACCELERATION); RNA_def_property_float_sdna(prop, NULL, "acc[2]"); RNA_def_property_range(prop, -200.0f, 200.0f); RNA_def_property_ui_text(prop, "Gravity", "Constant acceleration in global Z axis direction"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "drag_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "dragfac"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Drag", "Specify the amount of air-drag."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "brownian_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "brownfac"); RNA_def_property_range(prop, 0.0f, 200.0f); RNA_def_property_ui_text(prop, "Brownian", "Specify the amount of brownian motion"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "damp_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "dampfac"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Damp", "Specify the amount of damping"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); /* random length */ prop= RNA_def_property(srna, "random_length", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "randlength"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Random Length", "Give path length a random variation."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); /* children */ prop= RNA_def_property(srna, "child_nbr", PROP_INT, PROP_NONE); @@ -1509,7 +1504,7 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_range(prop, 0, 100000); RNA_def_property_ui_range(prop, 0, 1000, 1, 0); RNA_def_property_ui_text(prop, "Children Per Parent", "Amount of children/parent"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); prop= RNA_def_property(srna, "rendered_child_nbr", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "ren_child_nbr"); @@ -1521,45 +1516,45 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "parents"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Virtual Parents", "Relative amount of virtual parents."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); prop= RNA_def_property(srna, "child_size", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "childsize"); RNA_def_property_range(prop, 0.001f, 100000.0f); RNA_def_property_ui_range(prop, 0.01f, 100.0f, 0.1, 3); RNA_def_property_ui_text(prop, "Child Size", "A multiplier for the child particle size."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); prop= RNA_def_property(srna, "child_random_size", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "childrandsize"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Random Child Size", "Random variation to the size of the child particles."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); prop= RNA_def_property(srna, "child_radius", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "childrad"); RNA_def_property_range(prop, 0.0f, 10.0f); RNA_def_property_ui_text(prop, "Child Radius", "Radius of children around parent."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); prop= RNA_def_property(srna, "child_roundness", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "childflat"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Child Roundness", "Roundness of children around parent."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); /* clumping */ prop= RNA_def_property(srna, "clump_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "clumpfac"); RNA_def_property_range(prop, -1.0f, 1.0f); RNA_def_property_ui_text(prop, "Clump", "Amount of clumping"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); prop= RNA_def_property(srna, "clumppow", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "clumppow"); RNA_def_property_range(prop, -0.999f, 0.999f); RNA_def_property_ui_text(prop, "Shape", "Shape of clumping"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); /* kink */ @@ -1568,19 +1563,19 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_range(prop, -100000.0f, 100000.0f); RNA_def_property_ui_range(prop, -10.0f, 10.0f, 0.1, 3); RNA_def_property_ui_text(prop, "Amplitude", "The amplitude of the offset."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); prop= RNA_def_property(srna, "kink_frequency", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "kink_freq"); RNA_def_property_range(prop, -100000.0f, 100000.0f); RNA_def_property_ui_range(prop, -10.0f, 10.0f, 0.1, 3); RNA_def_property_ui_text(prop, "Frequency", "The frequency of the offset (1/total length)"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); prop= RNA_def_property(srna, "kink_shape", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, -0.999f, 0.999f); RNA_def_property_ui_text(prop, "Shape", "Adjust the offset to the beginning/end"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); /* rough */ @@ -1588,64 +1583,64 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_range(prop, 0.0f, 100000.0f); RNA_def_property_ui_range(prop, 0.0f, 10.0f, 0.1, 3); RNA_def_property_ui_text(prop, "Rough1", "Amount of location dependent rough."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); prop= RNA_def_property(srna, "rough1_size", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.01f, 100000.0f); RNA_def_property_ui_range(prop, 0.01f, 10.0f, 0.1, 3); RNA_def_property_ui_text(prop, "Size1", "Size of location dependent rough."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); prop= RNA_def_property(srna, "rough2", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "rough2"); RNA_def_property_range(prop, 0.0f, 100000.0f); RNA_def_property_ui_range(prop, 0.0f, 10.0f, 0.1, 3); RNA_def_property_ui_text(prop, "Rough2", "Amount of random rough."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); prop= RNA_def_property(srna, "rough2_size", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "rough2_size"); RNA_def_property_range(prop, 0.01f, 100000.0f); RNA_def_property_ui_range(prop, 0.01f, 10.0f, 0.1, 3); RNA_def_property_ui_text(prop, "Size2", "Size of random rough."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); prop= RNA_def_property(srna, "rough2_thres", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "rough2_thres"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Threshold", "Amount of particles left untouched by random rough."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); prop= RNA_def_property(srna, "rough_endpoint", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "rough_end"); RNA_def_property_range(prop, 0.0f, 100000.0f); RNA_def_property_ui_range(prop, 0.0f, 10.0f, 0.1, 3); RNA_def_property_ui_text(prop, "Rough Endpoint", "Amount of end point rough."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); prop= RNA_def_property(srna, "rough_end_shape", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0f, 10.0f); RNA_def_property_ui_text(prop, "Shape", "Shape of end point rough"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); prop= RNA_def_property(srna, "child_length", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "clength"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Length", "Length of child paths"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); prop= RNA_def_property(srna, "child_length_thres", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "clength_thres"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Threshold", "Amount of particles left untouched by child path length."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); /* branching */ prop= RNA_def_property(srna, "branch_threshold", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "branch_thres"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Threshold", "Threshold of branching."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); /* drawing stuff */ prop= RNA_def_property(srna, "line_length_tail", PROP_FLOAT, PROP_NONE); @@ -1653,33 +1648,33 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_range(prop, 0.0f, 100000.0f); RNA_def_property_ui_range(prop, 0.0f, 10.0f, 0.1, 3); RNA_def_property_ui_text(prop, "Back", "Length of the line's tail"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "line_length_head", PROP_FLOAT, PROP_NONE); RNA_def_property_float_funcs(prop, "rna_PartSetting_linelenhead_get", "rna_PartSetting_linelenhead_set", NULL); RNA_def_property_range(prop, 0.0f, 100000.0f); RNA_def_property_ui_range(prop, 0.0f, 10.0f, 0.1, 3); RNA_def_property_ui_text(prop, "Head", "Length of the line's head"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "path_start", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "path_start"); RNA_def_property_float_funcs(prop, NULL, NULL, "rna_PartSetting_pathstartend_range"); RNA_def_property_ui_text(prop, "Path Start", "Starting time of drawn path."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "path_end", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "path_end"); RNA_def_property_float_funcs(prop, NULL, NULL, "rna_PartSetting_pathstartend_range"); RNA_def_property_ui_text(prop, "Path End", "End time of drawn path."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "trail_count", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "trail_count"); RNA_def_property_range(prop, 1, 100000); RNA_def_property_ui_range(prop, 1, 100, 1, 0); RNA_def_property_ui_text(prop, "Trail Count", "Number of trail particles."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); /* keyed particles */ prop= RNA_def_property(srna, "keyed_loops", PROP_INT, PROP_NONE); @@ -1687,7 +1682,7 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_range(prop, 1.0f, 10000.0f); RNA_def_property_ui_range(prop, 1.0f, 100.0f, 0.1, 3); RNA_def_property_ui_text(prop, "Loop count", "Number of times the keys are looped."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); /* boids */ prop= RNA_def_property(srna, "boids", PROP_POINTER, PROP_NONE); @@ -1702,21 +1697,21 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_struct_type(prop, "Group"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Dupli Group", "Show Objects in this Group in place of particles"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "dupli_object", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "dup_ob"); RNA_def_property_struct_type(prop, "Object"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Dupli Object", "Show this Object in place of particles."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "billboard_object", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "bb_ob"); RNA_def_property_struct_type(prop, "Object"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Billboard Object", "Billboards face this object (default is active camera)"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); /* effectors */ prop= RNA_def_property(srna, "effector_group", PROP_POINTER, PROP_NONE); @@ -1724,77 +1719,77 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_struct_type(prop, "Group"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Effector Group", "Limit effectors to this Group."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "eweight_all", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "effector_weight[0]"); RNA_def_property_range(prop, -200.0f, 200.0f); RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3); RNA_def_property_ui_text(prop, "All", "All effector's weight."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "eweight_spherical", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "effector_weight[1]"); RNA_def_property_range(prop, -200.0f, 200.0f); RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3); RNA_def_property_ui_text(prop, "Spherical", "Spherical effector weight."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "eweight_vortex", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "effector_weight[2]"); RNA_def_property_range(prop, -200.0f, 200.0f); RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3); RNA_def_property_ui_text(prop, "Vortex", "Vortex effector weight."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "eweight_magnetic", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "effector_weight[3]"); RNA_def_property_range(prop, -200.0f, 200.0f); RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3); RNA_def_property_ui_text(prop, "Magnetic", "Magnetic effector weight."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "eweight_wind", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "effector_weight[4]"); RNA_def_property_range(prop, -200.0f, 200.0f); RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3); RNA_def_property_ui_text(prop, "Wind", "Wind effector weight."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "eweight_curveguide", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "effector_weight[5]"); RNA_def_property_range(prop, -200.0f, 200.0f); RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3); RNA_def_property_ui_text(prop, "Curve Guide", "Curve guide effector weight."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "eweight_texture", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "effector_weight[6]"); RNA_def_property_range(prop, -200.0f, 200.0f); RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3); - RNA_def_property_ui_text(prop, "Magnetic", "Texture effector weight."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_ui_text(prop, "Texture", "Texture effector weight."); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "eweight_harmonic", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "effector_weight[7]"); RNA_def_property_range(prop, -200.0f, 200.0f); RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3); RNA_def_property_ui_text(prop, "Harmonic", "Harmonic effector weight."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "eweight_charge", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "effector_weight[8]"); RNA_def_property_range(prop, -200.0f, 200.0f); RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3); RNA_def_property_ui_text(prop, "Charge", "Charge effector weight."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "eweight_lennardjones", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "effector_weight[9]"); RNA_def_property_range(prop, -200.0f, 200.0f); RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3); RNA_def_property_ui_text(prop, "Lennard-Jones", "Lennard-Jones effector weight."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); /* animation here? */ rna_def_animdata_common(srna); @@ -1829,25 +1824,25 @@ static void rna_def_particle_target(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "ob"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Target Object", "The object that has the target particle system (empty if same object)."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_target_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_target_reset"); prop= RNA_def_property(srna, "system", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "psys"); RNA_def_property_range(prop, 1, INT_MAX); RNA_def_property_ui_text(prop, "Target Particle System", "The index of particle system on the target object."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_target_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_target_reset"); prop= RNA_def_property(srna, "time", PROP_FLOAT, PROP_TIME); RNA_def_property_float_sdna(prop, NULL, "time"); RNA_def_property_range(prop, 0.0, 30000.0f); //TODO: replace 30000 with MAXFRAMEF when available in 2.5 RNA_def_property_ui_text(prop, "Time", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_target_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_target_redo"); prop= RNA_def_property(srna, "duration", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "duration"); RNA_def_property_range(prop, 0.0, 30000.0f); //TODO: replace 30000 with MAXFRAMEF when available in 2.5 RNA_def_property_ui_text(prop, "Duration", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_target_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_target_redo"); prop= RNA_def_property(srna, "valid", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PTARGET_VALID); @@ -1858,7 +1853,7 @@ static void rna_def_particle_target(BlenderRNA *brna) RNA_def_property_enum_items(prop, mode_items); RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); RNA_def_property_ui_text(prop, "Mode", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_target_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_target_reset"); } static void rna_def_particle_system(BlenderRNA *brna) @@ -1882,7 +1877,7 @@ static void rna_def_particle_system(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_pointer_funcs(prop, "rna_particle_settings_get", "rna_particle_settings_set", NULL); RNA_def_property_ui_text(prop, "Settings", "Particle system settings."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "particles", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "particles", "totpart"); @@ -1896,41 +1891,44 @@ static void rna_def_particle_system(BlenderRNA *brna) prop= RNA_def_property(srna, "seed", PROP_INT, PROP_UNSIGNED); RNA_def_property_ui_text(prop, "Seed", "Offset in the random number table, to get a different randomized result."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); /* hair */ - prop= RNA_def_property(srna, "softbody", PROP_POINTER, PROP_NONE); - RNA_def_property_pointer_sdna(prop, NULL, "soft"); - RNA_def_property_ui_text(prop, "Soft Body", "Soft body settings for hair physics simulation."); + prop= RNA_def_property(srna, "global_hair", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", PSYS_GLOBAL_HAIR); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Global Hair", "Hair keys are in global coordinate space"); - prop= RNA_def_property(srna, "use_softbody", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "softflag", OB_SB_ENABLE); - RNA_def_property_ui_text(prop, "Use Soft Body", "Enable use of soft body for hair physics simulation."); + prop= RNA_def_property(srna, "hair_dynamics", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", PSYS_HAIR_DYNAMICS); + RNA_def_property_ui_text(prop, "Hair Dynamics", "Enable hair dynamics using cloth simulation."); + RNA_def_property_update(prop, 0, "rna_Particle_hair_dynamics"); - prop= RNA_def_property(srna, "editable", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", PSYS_EDITED); - RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* various checks needed */ - RNA_def_property_ui_text(prop, "Editable", "For hair particle systems, finalize the hair to enable editing."); + prop= RNA_def_property(srna, "cloth", PROP_POINTER, PROP_NEVER_NULL); + RNA_def_property_pointer_sdna(prop, NULL, "clmd"); + RNA_def_property_struct_type(prop, "ClothModifier"); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Cloth", "Cloth dynamics for hair"); /* reactor */ prop= RNA_def_property(srna, "reactor_target_object", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "target_ob"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Reactor Target Object", "For reactor systems, the object that has the target particle system (empty if same object)."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "reactor_target_particle_system", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "target_psys"); RNA_def_property_range(prop, 1, INT_MAX); RNA_def_property_ui_text(prop, "Reactor Target Particle System", "For reactor systems, index of particle system on the target object."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); /* keyed */ prop= RNA_def_property(srna, "keyed_timing", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PSYS_KEYED_TIMING); RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); RNA_def_property_ui_text(prop, "Keyed timing", "Use key times"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "targets", PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_type(prop, "ParticleTarget"); @@ -1966,122 +1964,122 @@ static void rna_def_particle_system(BlenderRNA *brna) prop= RNA_def_property(srna, "vertex_group_density", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "vgroup[0]"); RNA_def_property_ui_text(prop, "Vertex Group Density", "Vertex group to control density."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "vertex_group_density_negate", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_DENSITY)); RNA_def_property_ui_text(prop, "Vertex Group Density Negate", "Negate the effect of the density vertex group."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "vertex_group_velocity", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "vgroup[1]"); RNA_def_property_ui_text(prop, "Vertex Group Velocity", "Vertex group to control velocity."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "vertex_group_velocity_negate", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_VEL)); RNA_def_property_ui_text(prop, "Vertex Group Velocity Negate", "Negate the effect of the velocity vertex group."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "vertex_group_length", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "vgroup[2]"); RNA_def_property_ui_text(prop, "Vertex Group Length", "Vertex group to control length."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "vertex_group_length_negate", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_LENGTH)); RNA_def_property_ui_text(prop, "Vertex Group Length Negate", "Negate the effect of the length vertex group."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "vertex_group_clump", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "vgroup[3]"); RNA_def_property_ui_text(prop, "Vertex Group Clump", "Vertex group to control clump."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); prop= RNA_def_property(srna, "vertex_group_clump_negate", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_CLUMP)); RNA_def_property_ui_text(prop, "Vertex Group Clump Negate", "Negate the effect of the clump vertex group."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); prop= RNA_def_property(srna, "vertex_group_kink", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "vgroup[4]"); RNA_def_property_ui_text(prop, "Vertex Group Kink", "Vertex group to control kink."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); prop= RNA_def_property(srna, "vertex_group_kink_negate", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_KINK)); RNA_def_property_ui_text(prop, "Vertex Group Kink Negate", "Negate the effect of the kink vertex group."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); prop= RNA_def_property(srna, "vertex_group_roughness1", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "vgroup[5]"); RNA_def_property_ui_text(prop, "Vertex Group Roughness 1", "Vertex group to control roughness 1."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); prop= RNA_def_property(srna, "vertex_group_roughness1_negate", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_ROUGH1)); RNA_def_property_ui_text(prop, "Vertex Group Roughness 1 Negate", "Negate the effect of the roughness 1 vertex group."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); prop= RNA_def_property(srna, "vertex_group_roughness2", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "vgroup[6]"); RNA_def_property_ui_text(prop, "Vertex Group Roughness 2", "Vertex group to control roughness 2."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); prop= RNA_def_property(srna, "vertex_group_roughness2_negate", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_ROUGH2)); RNA_def_property_ui_text(prop, "Vertex Group Roughness 2 Negate", "Negate the effect of the roughness 2 vertex group."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); prop= RNA_def_property(srna, "vertex_group_roughness_end", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "vgroup[7]"); RNA_def_property_ui_text(prop, "Vertex Group Roughness End", "Vertex group to control roughness end."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); prop= RNA_def_property(srna, "vertex_group_roughness_end_negate", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_ROUGHE)); RNA_def_property_ui_text(prop, "Vertex Group Roughness End Negate", "Negate the effect of the roughness end vertex group."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); prop= RNA_def_property(srna, "vertex_group_size", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "vgroup[8]"); RNA_def_property_ui_text(prop, "Vertex Group Size", "Vertex group to control size."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "vertex_group_size_negate", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_SIZE)); RNA_def_property_ui_text(prop, "Vertex Group Size Negate", "Negate the effect of the size vertex group."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "vertex_group_tangent", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "vgroup[9]"); RNA_def_property_ui_text(prop, "Vertex Group Tangent", "Vertex group to control tangent."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "vertex_group_tangent_negate", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_TAN)); RNA_def_property_ui_text(prop, "Vertex Group Tangent Negate", "Negate the effect of the tangent vertex group."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "vertex_group_rotation", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "vgroup[10]"); RNA_def_property_ui_text(prop, "Vertex Group Rotation", "Vertex group to control rotation."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "vertex_group_rotation_negate", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_ROT)); RNA_def_property_ui_text(prop, "Vertex Group Rotation Negate", "Negate the effect of the rotation vertex group."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "vertex_group_field", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "vgroup[11]"); RNA_def_property_ui_text(prop, "Vertex Group Field", "Vertex group to control field."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "vertex_group_field_negate", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_EFFECTOR)); RNA_def_property_ui_text(prop, "Vertex Group Field Negate", "Negate the effect of the field vertex group."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); /* pointcache */ prop= RNA_def_property(srna, "point_cache", PROP_POINTER, PROP_NEVER_NULL); @@ -2089,12 +2087,28 @@ static void rna_def_particle_system(BlenderRNA *brna) RNA_def_property_struct_type(prop, "PointCache"); RNA_def_property_ui_text(prop, "Point Cache", ""); + prop= RNA_def_property(srna, "multiple_caches", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_funcs(prop, "rna_ParticleSystem_multiple_caches_get", NULL); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Multiple Caches", "Particle system has multiple point caches"); + /* offset ob */ prop= RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "parent"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Parent", "Use this object's coordinate system instead of global coordinate system."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); + + /* hair or cache editing */ + prop= RNA_def_property(srna, "editable", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_funcs(prop, "rna_ParticleSystem_editable_get", NULL); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Editable", "Particle system can be edited in particle mode"); + + prop= RNA_def_property(srna, "edited", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_funcs(prop, "rna_ParticleSystem_edited_get", NULL); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Edited", "Particle system has been edited in particle mode"); } void RNA_def_particle(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_pose.c b/source/blender/makesrna/intern/rna_pose.c index bfebc5ee49f..b568fb38dfb 100644 --- a/source/blender/makesrna/intern/rna_pose.c +++ b/source/blender/makesrna/intern/rna_pose.c @@ -55,7 +55,7 @@ static void rna_Pose_update(bContext *C, PointerRNA *ptr) { // XXX when to use this? ob->pose->flag |= (POSE_LOCKED|POSE_DO_UNLOCK); - DAG_object_flush_update(CTX_data_scene(C), ptr->id.data, OB_RECALC_DATA); + DAG_id_flush_update(ptr->id.data, OB_RECALC_DATA); } static char *rna_PoseChannel_path(PointerRNA *ptr) @@ -98,7 +98,7 @@ static void rna_BoneGroup_color_set_set(PointerRNA *ptr, int value) } } -IDProperty *rna_PoseChannel_idproperties(PointerRNA *ptr, int create) +static IDProperty *rna_PoseChannel_idproperties(PointerRNA *ptr, int create) { bPoseChannel *pchan= ptr->data; @@ -110,26 +110,111 @@ IDProperty *rna_PoseChannel_idproperties(PointerRNA *ptr, int create) return pchan->prop; } +/* rotation - euler angles */ static void rna_PoseChannel_euler_rotation_get(PointerRNA *ptr, float *value) { bPoseChannel *pchan= ptr->data; - - if(pchan->rotmode == PCHAN_ROT_QUAT) + + if(pchan->rotmode == PCHAN_ROT_AXISANGLE) /* default XYZ eulers */ + AxisAngleToEulO(&pchan->quat[1], pchan->quat[0], value, EULER_ORDER_DEFAULT); + else if(pchan->rotmode == PCHAN_ROT_QUAT) /* default XYZ eulers */ QuatToEul(pchan->quat, value); else VECCOPY(value, pchan->eul); } +/* rotation - euler angles */ static void rna_PoseChannel_euler_rotation_set(PointerRNA *ptr, const float *value) { bPoseChannel *pchan= ptr->data; - - if(pchan->rotmode == PCHAN_ROT_QUAT) + + if(pchan->rotmode == PCHAN_ROT_AXISANGLE) /* default XYZ eulers */ + EulOToAxisAngle((float *)value, EULER_ORDER_DEFAULT, &pchan->quat[1], &pchan->quat[0]); + else if(pchan->rotmode == PCHAN_ROT_QUAT) /* default XYZ eulers */ EulToQuat((float*)value, pchan->quat); else VECCOPY(pchan->eul, value); } +/* rotation - axis angle only */ +static void rna_PoseChannel_rotation_axis_get(PointerRNA *ptr, float *value) +{ + bPoseChannel *pchan= ptr->data; + + if (pchan->rotmode == PCHAN_ROT_AXISANGLE) { + /* axis is stord in quat for now */ + VecCopyf(value, &pchan->quat[1]); + } +} + +/* rotation - axis angle only */ +static void rna_PoseChannel_rotation_axis_set(PointerRNA *ptr, const float *value) +{ + bPoseChannel *pchan= ptr->data; + + if (pchan->rotmode == PCHAN_ROT_AXISANGLE) { + /* axis is stored in quat for now */ + VecCopyf(&pchan->quat[1], (float *)value); + } +} + +static void rna_PoseChannel_rotation_mode_set(PointerRNA *ptr, int value) +{ + bPoseChannel *pchan= ptr->data; + + /* check if any change - if so, need to convert data */ + // TODO: this needs to be generalised at some point to work for objects too... + if (value > 0) { /* to euler */ + if (pchan->rotmode == PCHAN_ROT_AXISANGLE) { + /* axis-angle to euler */ + AxisAngleToEulO(&pchan->quat[1], pchan->quat[0], pchan->eul, value); + } + else if (pchan->rotmode == PCHAN_ROT_QUAT) { + /* quat to euler */ + QuatToEulO(pchan->quat, pchan->eul, value); + } + /* else { no conversion needed } */ + } + else if (value == PCHAN_ROT_QUAT) { /* to quat */ + if (pchan->rotmode == PCHAN_ROT_AXISANGLE) { + /* axis angle to quat */ + float q[4]; + + /* copy to temp var first, since quats and axis-angle are stored in same place */ + QuatCopy(q, pchan->quat); + AxisAngleToQuat(q, &pchan->quat[1], pchan->quat[0]); + } + else if (pchan->rotmode > 0) { + /* euler to quat */ + EulOToQuat(pchan->eul, pchan->rotmode, pchan->quat); + } + /* else { no conversion needed } */ + } + else { /* to axis-angle */ + if (pchan->rotmode > 0) { + /* euler to axis angle */ + EulOToAxisAngle(pchan->eul, pchan->rotmode, &pchan->quat[1], &pchan->quat[0]); + } + else if (pchan->rotmode == PCHAN_ROT_QUAT) { + /* quat to axis angle */ + float q[4]; + + /* copy to temp var first, since quats and axis-angle are stored in same place */ + QuatCopy(q, pchan->quat); + QuatToAxisAngle(q, &pchan->quat[1], &pchan->quat[0]); + } + + /* when converting to axis-angle, we need a special exception for the case when there is no axis */ + if (IS_EQ(pchan->quat[1], pchan->quat[2]) && IS_EQ(pchan->quat[2], pchan->quat[3])) { + /* for now, rotate around y-axis then (so that it simply becomes the roll) */ + pchan->quat[2]= 1.0f; + } + } + + /* finally, set the new rotation type */ + pchan->rotmode= value; +} + static void rna_PoseChannel_name_set(PointerRNA *ptr, const char *value) { Object *ob= (Object*)ptr->id.data; @@ -238,7 +323,7 @@ static void rna_Pose_active_bone_group_index_range(PointerRNA *ptr, int *min, in *max= MAX2(0, *max); } -void rna_pose_bgroup_name_index_get(PointerRNA *ptr, char *value, int index) +static void rna_pose_bgroup_name_index_get(PointerRNA *ptr, char *value, int index) { bPose *pose= (bPose*)ptr->data; bActionGroup *grp; @@ -249,7 +334,7 @@ void rna_pose_bgroup_name_index_get(PointerRNA *ptr, char *value, int index) else BLI_strncpy(value, "", sizeof(grp->name)); // XXX if invalid pointer, won't this crash? } -int rna_pose_bgroup_name_index_length(PointerRNA *ptr, int index) +static int rna_pose_bgroup_name_index_length(PointerRNA *ptr, int index) { bPose *pose= (bPose*)ptr->data; bActionGroup *grp; @@ -258,7 +343,7 @@ int rna_pose_bgroup_name_index_length(PointerRNA *ptr, int index) return (grp)? strlen(grp->name): 0; } -void rna_pose_bgroup_name_index_set(PointerRNA *ptr, const char *value, short *index) +static void rna_pose_bgroup_name_index_set(PointerRNA *ptr, const char *value, short *index) { bPose *pose= (bPose*)ptr->data; bActionGroup *grp; @@ -274,7 +359,7 @@ void rna_pose_bgroup_name_index_set(PointerRNA *ptr, const char *value, short *i *index= 0; } -void rna_pose_pgroup_name_set(PointerRNA *ptr, const char *value, char *result, int maxlen) +static void rna_pose_pgroup_name_set(PointerRNA *ptr, const char *value, char *result, int maxlen) { bPose *pose= (bPose*)ptr->data; bActionGroup *grp; @@ -325,6 +410,7 @@ static void rna_def_bone_group(BlenderRNA *brna) srna= RNA_def_struct(brna, "BoneGroup", NULL); RNA_def_struct_sdna(srna, "bActionGroup"); RNA_def_struct_ui_text(srna, "Bone Group", "Groups of Pose Channels (Bones)."); + RNA_def_struct_ui_icon(srna, ICON_GROUP_BONE); /* name */ prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); @@ -353,7 +439,13 @@ static void rna_def_pose_channel(BlenderRNA *brna) { static EnumPropertyItem prop_rotmode_items[] = { {PCHAN_ROT_QUAT, "QUATERNION", 0, "Quaternion (WXYZ)", "No Gimbal Lock (default)"}, - {PCHAN_ROT_EUL, "EULER", 0, "Euler (XYZ)", "Prone to Gimbal Lock"}, + {PCHAN_ROT_XYZ, "XYZ", 0, "XYZ Euler", "XYZ Rotation Order. Prone to Gimbal Lock"}, + {PCHAN_ROT_XZY, "XZY", 0, "XZY Euler", "XZY Rotation Order. Prone to Gimbal Lock"}, + {PCHAN_ROT_YXZ, "YXZ", 0, "YXZ Euler", "YXZ Rotation Order. Prone to Gimbal Lock"}, + {PCHAN_ROT_YZX, "YZX", 0, "YZX Euler", "YZX Rotation Order. Prone to Gimbal Lock"}, + {PCHAN_ROT_ZXY, "ZXY", 0, "ZXY Euler", "ZXY Rotation Order. Prone to Gimbal Lock"}, + {PCHAN_ROT_ZYX, "ZYX", 0, "ZYX Euler", "ZYX Rotation Order. Prone to Gimbal Lock"}, + {PCHAN_ROT_AXISANGLE, "AXIS_ANGLE", 0, "Axis Angle", "Axis Angle (W+XYZ). Defines a rotation around some axis defined by 3D-Vector."}, {0, NULL, 0, NULL, NULL}}; StructRNA *srna; @@ -413,29 +505,42 @@ static void rna_def_pose_channel(BlenderRNA *brna) prop= RNA_def_property(srna, "location", PROP_FLOAT, PROP_TRANSLATION); RNA_def_property_float_sdna(prop, NULL, "loc"); RNA_def_property_ui_text(prop, "Location", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update"); + RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Pose_update"); prop= RNA_def_property(srna, "scale", PROP_FLOAT, PROP_XYZ); RNA_def_property_float_sdna(prop, NULL, "size"); RNA_def_property_ui_text(prop, "Scale", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update"); + RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Pose_update"); prop= RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_QUATERNION); RNA_def_property_float_sdna(prop, NULL, "quat"); RNA_def_property_ui_text(prop, "Rotation", "Rotation in Quaternions."); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update"); + RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Pose_update"); + + prop= RNA_def_property(srna, "rotation_angle", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "quat[0]"); + RNA_def_property_ui_text(prop, "Rotation Angle", "Angle of Rotation for Axis-Angle rotation representation."); + RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Pose_update"); + + prop= RNA_def_property(srna, "rotation_axis", PROP_FLOAT, PROP_XYZ); + RNA_def_property_float_sdna(prop, NULL, "quat"); + RNA_def_property_float_funcs(prop, "rna_PoseChannel_rotation_axis_get", "rna_PoseChannel_rotation_axis_set", NULL); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Rotation Axis", "Axis for Axis-Angle rotation representation."); + RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Pose_update"); prop= RNA_def_property(srna, "euler_rotation", PROP_FLOAT, PROP_EULER); RNA_def_property_float_sdna(prop, NULL, "eul"); RNA_def_property_float_funcs(prop, "rna_PoseChannel_euler_rotation_get", "rna_PoseChannel_euler_rotation_set", NULL); RNA_def_property_ui_text(prop, "Rotation (Euler)", "Rotation in Eulers."); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update"); + RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Pose_update"); prop= RNA_def_property(srna, "rotation_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "rotmode"); RNA_def_property_enum_items(prop, prop_rotmode_items); + RNA_def_property_enum_funcs(prop, NULL, "rna_PoseChannel_rotation_mode_set", NULL); RNA_def_property_ui_text(prop, "Rotation Mode", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update"); + RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update"); /* These three matrix properties await an implementation of the PROP_MATRIX subtype, which currently doesn't exist. */ /* prop= RNA_def_property(srna, "channel_matrix", PROP_FLOAT, PROP_MATRIX); @@ -468,97 +573,97 @@ static void rna_def_pose_channel(BlenderRNA *brna) RNA_def_property_boolean_funcs(prop, "rna_PoseChannel_has_ik_get", NULL); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Has IK", "Is part of an IK chain."); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update"); + RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update"); prop= RNA_def_property(srna, "ik_dof_x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "ikflag", BONE_IK_NO_XDOF); RNA_def_property_ui_text(prop, "IK X DoF", "Allow movement around the X axis."); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update"); + RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update"); prop= RNA_def_property(srna, "ik_dof_y", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "ikflag", BONE_IK_NO_YDOF); RNA_def_property_ui_text(prop, "IK Y DoF", "Allow movement around the Y axis."); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update"); + RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update"); prop= RNA_def_property(srna, "ik_dof_z", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "ikflag", BONE_IK_NO_ZDOF); RNA_def_property_ui_text(prop, "IK Z DoF", "Allow movement around the Z axis."); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update"); + RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update"); prop= RNA_def_property(srna, "ik_limit_x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "ikflag", BONE_IK_XLIMIT); RNA_def_property_ui_text(prop, "IK X Limit", "Limit movement around the X axis."); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update"); + RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update"); prop= RNA_def_property(srna, "ik_limit_y", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "ikflag", BONE_IK_YLIMIT); RNA_def_property_ui_text(prop, "IK Y Limit", "Limit movement around the Y axis."); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update"); + RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update"); prop= RNA_def_property(srna, "ik_limit_z", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "ikflag", BONE_IK_ZLIMIT); RNA_def_property_ui_text(prop, "IK Z Limit", "Limit movement around the Z axis."); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update"); + RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update"); prop= RNA_def_property(srna, "ik_min_x", PROP_FLOAT, PROP_ANGLE); RNA_def_property_float_sdna(prop, NULL, "limitmin[0]"); RNA_def_property_range(prop, -180.0f, 0.0f); RNA_def_property_ui_text(prop, "IK X Minimum", "Minimum angles for IK Limit"); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update"); + RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update"); prop= RNA_def_property(srna, "ik_max_x", PROP_FLOAT, PROP_ANGLE); RNA_def_property_float_sdna(prop, NULL, "limitmax[0]"); RNA_def_property_range(prop, 0.0f, 180.0f); RNA_def_property_ui_text(prop, "IK X Maximum", "Maximum angles for IK Limit"); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update"); + RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update"); prop= RNA_def_property(srna, "ik_min_y", PROP_FLOAT, PROP_ANGLE); RNA_def_property_float_sdna(prop, NULL, "limitmin[1]"); RNA_def_property_range(prop, -180.0f, 0.0f); RNA_def_property_ui_text(prop, "IK Y Minimum", "Minimum angles for IK Limit"); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update"); + RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update"); prop= RNA_def_property(srna, "ik_max_y", PROP_FLOAT, PROP_ANGLE); RNA_def_property_float_sdna(prop, NULL, "limitmax[1]"); RNA_def_property_range(prop, 0.0f, 180.0f); RNA_def_property_ui_text(prop, "IK Y Maximum", "Maximum angles for IK Limit"); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update"); + RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update"); prop= RNA_def_property(srna, "ik_min_z", PROP_FLOAT, PROP_ANGLE); RNA_def_property_float_sdna(prop, NULL, "limitmin[2]"); RNA_def_property_range(prop, -180.0f, 0.0f); RNA_def_property_ui_text(prop, "IK Z Minimum", "Minimum angles for IK Limit"); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update"); + RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update"); prop= RNA_def_property(srna, "ik_max_z", PROP_FLOAT, PROP_ANGLE); RNA_def_property_float_sdna(prop, NULL, "limitmax[2]"); RNA_def_property_range(prop, 0.0f, 180.0f); RNA_def_property_ui_text(prop, "IK Z Maximum", "Maximum angles for IK Limit"); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update"); + RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update"); prop= RNA_def_property(srna, "ik_stiffness_x", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "stiffness[0]"); RNA_def_property_range(prop, 0.0f, 0.99f); RNA_def_property_ui_text(prop, "IK X Stiffness", "IK stiffness around the X axis."); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update"); + RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update"); prop= RNA_def_property(srna, "ik_stiffness_y", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "stiffness[1]"); RNA_def_property_range(prop, 0.0f, 0.99f); RNA_def_property_ui_text(prop, "IK Y Stiffness", "IK stiffness around the Y axis."); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update"); + RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update"); prop= RNA_def_property(srna, "ik_stiffness_z", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "stiffness[2]"); RNA_def_property_range(prop, 0.0f, 0.99f); RNA_def_property_ui_text(prop, "IK Z Stiffness", "IK stiffness around the Z axis."); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update"); + RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update"); prop= RNA_def_property(srna, "ik_stretch", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "ikstretch"); RNA_def_property_range(prop, 0.0f,1.0f); RNA_def_property_ui_text(prop, "IK Stretch", "Allow scaling of the bone for IK."); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update"); + RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update"); /* custom bone shapes */ prop= RNA_def_property(srna, "custom_shape", PROP_POINTER, PROP_NONE); @@ -588,16 +693,30 @@ static void rna_def_pose_channel(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "protectflag", OB_LOCK_LOCX); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Lock Location", "Lock editing of location in the interface."); + RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update"); prop= RNA_def_property(srna, "lock_rotation", PROP_BOOLEAN, PROP_XYZ); RNA_def_property_boolean_sdna(prop, NULL, "protectflag", OB_LOCK_ROTX); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Lock Rotation", "Lock editing of rotation in the interface."); + RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update"); + + // XXX this is sub-optimal - it really should be included above, but due to technical reasons we can't do this! + prop= RNA_def_property(srna, "lock_rotation_w", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "protectflag", OB_LOCK_ROTW); + RNA_def_property_ui_text(prop, "Lock Rotation (4D Angle)", "Lock editing of 'angle' component of four-component rotations in the interface."); + RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update"); + // XXX this needs a better name + prop= RNA_def_property(srna, "lock_rotations_4d", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "protectflag", OB_LOCK_ROT4D); + RNA_def_property_ui_text(prop, "Lock Rotations (4D)", "Lock editing of four component rotations by components (instead of as Eulers)."); + RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update"); prop= RNA_def_property(srna, "lock_scale", PROP_BOOLEAN, PROP_XYZ); RNA_def_property_boolean_sdna(prop, NULL, "protectflag", OB_LOCK_SCALEX); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Lock Scale", "Lock editing of scale in the interface."); + RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update"); } static void rna_def_pose(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_render.c b/source/blender/makesrna/intern/rna_render.c index 9137e596da1..a67831715a2 100644 --- a/source/blender/makesrna/intern/rna_render.c +++ b/source/blender/makesrna/intern/rna_render.c @@ -170,40 +170,51 @@ static void rna_RenderLayer_passes_begin(CollectionPropertyIterator *iter, Point rna_iterator_listbase_begin(iter, &rl->passes, NULL); } -static float rna_RenderValue_value_get(PointerRNA *ptr) +static int rna_RenderLayer_rect_get_length(PointerRNA *ptr, int length[RNA_MAX_ARRAY_DIMENSION]) { - return *(float*)ptr->data; -} + RenderLayer *rl= (RenderLayer*)ptr->data; -static void rna_RenderValue_value_set(PointerRNA *ptr, float value) -{ - *(float*)ptr->data= value; + length[0]= rl->rectx*rl->recty; + length[1]= 4; + + return length[0]*length[1]; } -static void rna_RenderLayer_rect_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) +static void rna_RenderLayer_rect_get(PointerRNA *ptr, float *values) { RenderLayer *rl= (RenderLayer*)ptr->data; - rna_iterator_array_begin(iter, (void*)rl->rectf, sizeof(float), rl->rectx*rl->recty*4, 0, NULL); + memcpy(values, rl->rectf, sizeof(float)*rl->rectx*rl->recty*4); } -static int rna_RenderLayer_rect_length(PointerRNA *ptr) +static void rna_RenderLayer_rect_set(PointerRNA *ptr, const float *values) { RenderLayer *rl= (RenderLayer*)ptr->data; - return rl->rectx*rl->recty*4; + memcpy(rl->rectf, values, sizeof(float)*rl->rectx*rl->recty*4); } -static void rna_RenderPass_rect_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) +static int rna_RenderPass_rect_get_length(PointerRNA *ptr, int length[RNA_MAX_ARRAY_DIMENSION]) { RenderPass *rpass= (RenderPass*)ptr->data; - rna_iterator_array_begin(iter, (void*)rpass->rect, sizeof(float), rpass->rectx*rpass->recty*rpass->channels, 0, NULL); + + length[0]= rpass->rectx*rpass->recty; + length[1]= rpass->channels; + + return length[0]*length[1]; } -static int rna_RenderPass_rect_length(PointerRNA *ptr) +static void rna_RenderPass_rect_get(PointerRNA *ptr, float *values) { RenderPass *rpass= (RenderPass*)ptr->data; - return rpass->rectx*rpass->recty*rpass->channels; + printf("rect get\n"); + memcpy(values, rpass->rect, sizeof(float)*rpass->rectx*rpass->recty*rpass->channels); } +static void rna_RenderPass_rect_set(PointerRNA *ptr, const float *values) +{ + RenderPass *rpass= (RenderPass*)ptr->data; + printf("rect set\n"); + memcpy(rpass->rect, values, sizeof(float)*rpass->rectx*rpass->recty*rpass->channels); +} #else // RNA_RUNTIME @@ -324,16 +335,11 @@ static void rna_def_render_layer(BlenderRNA *brna) RNA_def_property_struct_type(prop, "RenderPass"); RNA_def_property_collection_funcs(prop, "rna_RenderLayer_passes_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0, 0, 0); - prop= RNA_def_property(srna, "rect", PROP_COLLECTION, PROP_NONE); - RNA_def_property_struct_type(prop, "RenderValue"); - RNA_def_property_collection_funcs(prop, "rna_RenderLayer_rect_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_RenderLayer_rect_length", 0, 0, 0, 0); - - /* value */ - srna= RNA_def_struct(brna, "RenderValue", NULL); - RNA_def_struct_ui_text(srna, "Render Value", ""); - - prop= RNA_def_property(srna, "value", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_funcs(prop, "rna_RenderValue_value_get", "rna_RenderValue_value_set", NULL); + prop= RNA_def_property(srna, "rect", PROP_FLOAT, PROP_NONE); + RNA_def_property_flag(prop, PROP_DYNAMIC); + RNA_def_property_multi_array(prop, 2, NULL); + RNA_def_property_dynamic_array_funcs(prop, "rna_RenderLayer_rect_get_length"); + RNA_def_property_float_funcs(prop, "rna_RenderLayer_rect_get", "rna_RenderLayer_rect_set", NULL); RNA_define_verify_sdna(1); } @@ -383,9 +389,11 @@ static void rna_def_render_pass(BlenderRNA *brna) RNA_def_property_enum_items(prop, pass_type_items); RNA_def_property_clear_flag(prop, PROP_EDITABLE); - prop= RNA_def_property(srna, "rect", PROP_COLLECTION, PROP_NONE); - RNA_def_property_struct_type(prop, "RenderValue"); - RNA_def_property_collection_funcs(prop, "rna_RenderPass_rect_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_RenderPass_rect_length", 0, 0, 0, 0); + prop= RNA_def_property(srna, "rect", PROP_FLOAT, PROP_NONE); + RNA_def_property_flag(prop, PROP_DYNAMIC); + RNA_def_property_multi_array(prop, 2, NULL); + RNA_def_property_dynamic_array_funcs(prop, "rna_RenderPass_rect_get_length"); + RNA_def_property_float_funcs(prop, "rna_RenderPass_rect_get", "rna_RenderPass_rect_set", NULL); RNA_define_verify_sdna(1); } diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c index 57ed5ccef39..196d25ada86 100644 --- a/source/blender/makesrna/intern/rna_rna.c +++ b/source/blender/makesrna/intern/rna_rna.c @@ -430,7 +430,7 @@ static int rna_Property_array_length_get(PointerRNA *ptr) { PropertyRNA *prop= (PropertyRNA*)ptr->data; rna_idproperty_check(&prop, ptr); - return prop->arraylength; + return prop->totarraylength; } static int rna_Property_registered_get(PointerRNA *ptr) @@ -458,6 +458,62 @@ static int rna_IntProperty_default_get(PointerRNA *ptr) rna_idproperty_check(&prop, ptr); return ((IntPropertyRNA*)prop)->defaultvalue; } +/* int/float/bool */ +static int rna_NumberProperty_default_array_get_length(PointerRNA *ptr, int length[RNA_MAX_ARRAY_DIMENSION]) +{ + PropertyRNA *prop= (PropertyRNA*)ptr->data; + rna_idproperty_check(&prop, ptr); + + length[0]= prop->totarraylength; + + return length[0]; +} +static void rna_IntProperty_default_array_get(PointerRNA *ptr, int *values) +{ + PropertyRNA *prop= (PropertyRNA*)ptr->data; + IntPropertyRNA *nprop= (IntPropertyRNA*)prop; + rna_idproperty_check(&prop, ptr); + + if(nprop->defaultarray) { + memcpy(values, nprop->defaultarray, prop->totarraylength * sizeof(int)); + } + else { + int i; + for(i=0; i < prop->totarraylength; i++) + values[i]= nprop->defaultvalue; + } +} +static void rna_BoolProperty_default_array_get(PointerRNA *ptr, int *values) +{ + PropertyRNA *prop= (PropertyRNA*)ptr->data; + BooleanPropertyRNA *nprop= (BooleanPropertyRNA*)prop; + rna_idproperty_check(&prop, ptr); + + if(nprop->defaultarray) { + memcpy(values, nprop->defaultarray, prop->totarraylength * sizeof(int)); + } + else { + int i; + for(i=0; i < prop->totarraylength; i++) + values[i]= nprop->defaultvalue; + } +} +static void rna_FloatProperty_default_array_get(PointerRNA *ptr, float *values) +{ + PropertyRNA *prop= (PropertyRNA*)ptr->data; + FloatPropertyRNA *nprop= (FloatPropertyRNA*)prop; + rna_idproperty_check(&prop, ptr); + + if(nprop->defaultarray) { + memcpy(values, nprop->defaultarray, prop->totarraylength * sizeof(float)); + } + else { + int i; + for(i=0; i < prop->totarraylength; i++) + values[i]= nprop->defaultvalue; + } +} + static int rna_IntProperty_hard_min_get(PointerRNA *ptr) { PropertyRNA *prop= (PropertyRNA*)ptr->data; @@ -798,6 +854,8 @@ static void rna_def_property(BlenderRNA *brna) {PROP_XYZ, "XYZ", 0, "XYZ", ""}, {PROP_RGB, "RGB", 0, "RGB", ""}, {PROP_NEVER_NULL, "NEVER_NULL", 0, "Never Null", ""}, + {PROP_LAYER, "LAYER", 0, "Layer", ""}, + {PROP_LAYER_MEMBER, "LAYER_MEMBERSHIP", 0, "Layer Membership", ""}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem unit_items[] = { {PROP_UNIT_NONE, "NONE", 0, "None", ""}, @@ -930,13 +988,27 @@ static void rna_def_number_property(StructRNA *srna, PropertyType type) } -#if 0 // XXX - Variable length arrays prop= RNA_def_property(srna, "default_array", type, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); - if(type == PROP_INT) RNA_def_property_int_funcs(prop, "rna_IntProperty_default_array_get", NULL, NULL); - else RNA_def_property_float_funcs(prop, "rna_FloatProperty_default_array_get", NULL, NULL); - RNA_def_property_ui_text(prop, "Default", "Default value for this number"); -#endif + RNA_def_property_array(prop, RNA_MAX_ARRAY_DIMENSION); /* no fixed default length, important its not 0 though */ + RNA_def_property_flag(prop, PROP_DYNAMIC); + RNA_def_property_dynamic_array_funcs(prop, "rna_NumberProperty_default_array_get_length"); /* same for all types */ + + switch(type) { + case PROP_BOOLEAN: + RNA_def_property_boolean_funcs(prop, "rna_BoolProperty_default_array_get", NULL); + break; + case PROP_INT: + RNA_def_property_int_funcs(prop, "rna_IntProperty_default_array_get", NULL, NULL); + break; + case PROP_FLOAT: + RNA_def_property_float_funcs(prop, "rna_FloatProperty_default_array_get", NULL, NULL); + break; + default: + break; + } + RNA_def_property_ui_text(prop, "Default Array", "Default value for this array"); + prop= RNA_def_property(srna, "array_length", PROP_INT, PROP_UNSIGNED); RNA_def_property_clear_flag(prop, PROP_EDITABLE); diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 209c771834d..15329b126d3 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -32,6 +32,9 @@ #include "DNA_scene_types.h" #include "DNA_userdef_types.h" +/* Include for Bake Options */ +#include "RE_pipeline.h" + #ifdef WITH_FFMPEG #include "BKE_writeffmpeg.h" #include <libavcodec/avcodec.h> @@ -67,7 +70,7 @@ EnumPropertyItem prop_mode_items[] ={ #include "RE_pipeline.h" -PointerRNA rna_Scene_objects_get(CollectionPropertyIterator *iter) +static PointerRNA rna_Scene_objects_get(CollectionPropertyIterator *iter) { ListBaseIterator *internal= iter->internal; @@ -360,12 +363,6 @@ static void rna_SceneRenderLayer_layer_set(PointerRNA *ptr, const int *values) rl->lay= layer_set(rl->lay, values); } -static void rna_SceneRenderLayer_zmask_layer_set(PointerRNA *ptr, const int *values) -{ - SceneRenderLayer *rl= (SceneRenderLayer*)ptr->data; - rl->lay_zmask= layer_set(rl->lay_zmask, values); -} - static void rna_SceneRenderLayer_pass_update(bContext *C, PointerRNA *ptr) { Scene *scene= (Scene*)ptr->id.data; @@ -374,7 +371,7 @@ static void rna_SceneRenderLayer_pass_update(bContext *C, PointerRNA *ptr) ntreeCompositForceHidden(scene->nodetree, scene); } -void rna_Scene_use_nodes_set(PointerRNA *ptr, int value) +static void rna_Scene_use_nodes_set(PointerRNA *ptr, int value) { Scene *scene= (Scene*)ptr->data; @@ -391,10 +388,10 @@ static void rna_def_tool_settings(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem uv_select_mode_items[] = { - {UV_SELECT_VERTEX, "VERTEX", ICON_VERTEXSEL, "Vertex", "Vertex selection mode."}, - {UV_SELECT_EDGE, "EDGE", ICON_EDGESEL, "Edge", "Edge selection mode."}, - {UV_SELECT_FACE, "FACE", ICON_FACESEL, "Face", "Face selection mode."}, - {UV_SELECT_ISLAND, "ISLAND", ICON_LINKEDSEL, "Island", "Island selection mode."}, + {UV_SELECT_VERTEX, "VERTEX", ICON_UV_VERTEXSEL, "Vertex", "Vertex selection mode."}, + {UV_SELECT_EDGE, "EDGE", ICON_UV_EDGESEL, "Edge", "Edge selection mode."}, + {UV_SELECT_FACE, "FACE", ICON_UV_FACESEL, "Face", "Face selection mode."}, + {UV_SELECT_ISLAND, "ISLAND", ICON_UV_ISLANDSEL, "Island", "Island selection mode."}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem mesh_select_mode_items[] = { @@ -455,6 +452,13 @@ static void rna_def_tool_settings(BlenderRNA *brna) RNA_def_property_enum_items(prop, prop_mode_items); RNA_def_property_ui_text(prop, "Proportional Editing Falloff", "Falloff type for proportional editing mode."); + prop= RNA_def_property(srna, "normal_size", PROP_FLOAT, PROP_DISTANCE); + RNA_def_property_float_sdna(prop, NULL, "normalsize"); + RNA_def_property_ui_text(prop, "Normal Size", "Display size for normals in the 3D view."); + RNA_def_property_range(prop, 0.00001, 1000.0); + RNA_def_property_ui_range(prop, 0.01, 10.0, 0.1, 2); + RNA_def_property_update(prop, NC_GEOM|ND_DATA, NULL); + prop= RNA_def_property(srna, "automerge_editing", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "automerge", 0); RNA_def_property_ui_text(prop, "AutoMerge Editing", "Automatically merge vertices moved to the same location."); @@ -587,7 +591,7 @@ void rna_def_render_layer_common(StructRNA *srna, int scene) else RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* layers */ - prop= RNA_def_property(srna, "visible_layers", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "visible_layers", PROP_BOOLEAN, PROP_LAYER_MEMBER); RNA_def_property_boolean_sdna(prop, NULL, "lay", 1); RNA_def_property_array(prop, 20); RNA_def_property_ui_text(prop, "Visible Layers", "Scene layers included in this render layer."); @@ -596,12 +600,10 @@ void rna_def_render_layer_common(StructRNA *srna, int scene) if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); else RNA_def_property_clear_flag(prop, PROP_EDITABLE); - prop= RNA_def_property(srna, "zmask_layers", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "zmask_layers", PROP_BOOLEAN, PROP_LAYER); RNA_def_property_boolean_sdna(prop, NULL, "lay_zmask", 1); RNA_def_property_array(prop, 20); RNA_def_property_ui_text(prop, "Zmask Layers", "Zmask scene layers."); - if(scene) RNA_def_property_boolean_funcs(prop, NULL, "rna_SceneRenderLayer_zmask_layer_set"); - else RNA_def_property_boolean_funcs(prop, NULL, "rna_RenderLayer_zmask_layer_set"); if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); else RNA_def_property_clear_flag(prop, PROP_EDITABLE); @@ -782,7 +784,7 @@ void rna_def_render_layer_common(StructRNA *srna, int scene) else RNA_def_property_clear_flag(prop, PROP_EDITABLE); } -void rna_def_scene_game_data(BlenderRNA *brna) +static void rna_def_scene_game_data(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; @@ -1110,6 +1112,30 @@ static void rna_def_scene_render_data(BlenderRNA *brna) {R_OUTPUT_WINDOW, "WINDOW", 0, "New Window", "Images are rendered in new Window"}, {0, NULL, 0, NULL, NULL}}; + /* Bake */ + static EnumPropertyItem bake_mode_items[] ={ + {RE_BAKE_ALL, "FULL", 0, "Full Render", ""}, + {RE_BAKE_AO, "AO", 0, "Ambient Occlusion", ""}, + {RE_BAKE_SHADOW, "SHADOW", 0, "Shadow", ""}, + {RE_BAKE_NORMALS, "NORMALS", 0, "Normals", ""}, + {RE_BAKE_TEXTURE, "TEXTURE", 0, "Textures", ""}, + {RE_BAKE_DISPLACEMENT, "DISPLACEMENT", 0, "Displacement", ""}, + {0, NULL, 0, NULL, NULL}}; + + static EnumPropertyItem bake_normal_space_items[] ={ + {R_BAKE_SPACE_CAMERA, "CAMERA", 0, "Camera", ""}, + {R_BAKE_SPACE_WORLD, "WORLD", 0, "World", ""}, + {R_BAKE_SPACE_OBJECT, "OBJECT", 0, "Object", ""}, + {R_BAKE_SPACE_TANGENT, "TANGENT", 0, "Tangent", ""}, + {0, NULL, 0, NULL, NULL}}; + + static EnumPropertyItem bake_aa_items[] ={ + {5, "AA_5", 0, "5", ""}, + {8, "AA_8", 0, "8", ""}, + {11, "AA_11", 0, "11", ""}, + {16, "AA_16", 0, "16", ""}, + {0, NULL, 0, NULL, NULL}}; + static EnumPropertyItem octree_resolution_items[] = { {64, "OCTREE_RES_64", 0, "64", ""}, {128, "OCTREE_RES_128", 0, "128", ""}, @@ -1141,8 +1167,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna) {0, "STAMP_FONT_LARGE", 0, "Large", ""}, {4, "STAMP_FONT_EXTRALARGE", 0, "Extra Large", ""}, {0, NULL, 0, NULL, NULL}}; - - + static EnumPropertyItem image_type_items[] = { {0, "", 0, "Image", NULL}, {R_PNG, "PNG", 0, "PNG", ""}, @@ -1595,10 +1620,10 @@ static void rna_def_scene_render_data(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Edge", "Create a toon outline around the edges of geometry"); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); - prop= RNA_def_property(srna, "edge_intensity", PROP_INT, PROP_NONE); + prop= RNA_def_property(srna, "edge_threshold", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "edgeint"); RNA_def_property_range(prop, 0, 255); - RNA_def_property_ui_text(prop, "Edge Intensity", "Threshold for drawing outlines on geometry edges"); + RNA_def_property_ui_text(prop, "Edge Threshold", "Threshold for drawing outlines on geometry edges"); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); prop= RNA_def_property(srna, "edge_color", PROP_FLOAT, PROP_COLOR); @@ -1624,7 +1649,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Motion Blur", "Use multi-sampled 3D scene motion blur (uses number of anti-aliasing samples)."); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); - prop= RNA_def_property(srna, "border", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "use_border", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", R_BORDER); RNA_def_property_ui_text(prop, "Border", "Render a user-defined border region, within the frame size."); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); @@ -1634,14 +1659,14 @@ static void rna_def_scene_render_data(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Crop to Border", "Crop the rendered frame to the defined border size."); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); - prop= RNA_def_property(srna, "placeholders", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "use_placeholder", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", R_TOUCH); RNA_def_property_ui_text(prop, "Placeholders", "Create empty placeholder files while rendering frames (similar to Unix 'touch')."); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); - prop= RNA_def_property(srna, "no_overwrite", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "mode", R_NO_OVERWRITE); - RNA_def_property_ui_text(prop, "No Overwrite", "Skip and don't overwrite existing files while rendering"); + prop= RNA_def_property(srna, "use_overwrite", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "mode", R_NO_OVERWRITE); + RNA_def_property_ui_text(prop, "Overwrite", "Overwrite existing files while rendering."); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); prop= RNA_def_property(srna, "use_compositing", PROP_BOOLEAN, PROP_NONE); @@ -1707,6 +1732,57 @@ static void rna_def_scene_render_data(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Output Path", "Directory/name to save animations, # characters defines the position and length of frame numbers."); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + /* Bake */ + + prop= RNA_def_property(srna, "bake_type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_bitflag_sdna(prop, NULL, "bake_mode"); + RNA_def_property_enum_items(prop, bake_mode_items); + RNA_def_property_ui_text(prop, "Bake Mode", ""); + + prop= RNA_def_property(srna, "bake_normal_space", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_bitflag_sdna(prop, NULL, "bake_normal_space"); + RNA_def_property_enum_items(prop, bake_normal_space_items); + RNA_def_property_ui_text(prop, "Normal Space", "Choose normal space for baking"); + + prop= RNA_def_property(srna, "bake_aa_mode", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_bitflag_sdna(prop, NULL, "bake_osa"); + RNA_def_property_enum_items(prop, bake_aa_items); + RNA_def_property_ui_text(prop, "Anti-Aliasing Level", ""); + + prop= RNA_def_property(srna, "bake_active", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_TO_ACTIVE); + RNA_def_property_ui_text(prop, "Selected to Active", "Bake shading on the surface of selected objects to the active object"); + + prop= RNA_def_property(srna, "bake_normalized", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_NORMALIZE); + RNA_def_property_ui_text(prop, "Normalized", ""); + //"Bake ambient occlusion normalized, without taking into acount material settings" + //"Normalized displacement value to fit the 'Dist' range" + // XXX: Need 1 tooltip here... + + prop= RNA_def_property(srna, "bake_clear", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_CLEAR); + RNA_def_property_ui_text(prop, "Clear", "Clear Images before baking"); + + prop= RNA_def_property(srna, "bake_enable_aa", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_OSA); + RNA_def_property_ui_text(prop, "Anti-Aliasing", "Enables Anti-aliasing"); + + prop= RNA_def_property(srna, "bake_margin", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "bake_filter"); + RNA_def_property_range(prop, 0, 32); + RNA_def_property_ui_text(prop, "Margin", "Amount of pixels to extend the baked result with, as post process filter"); + + prop= RNA_def_property(srna, "bake_distance", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "bake_maxdist"); + RNA_def_property_range(prop, 0.0, 1000.0); + RNA_def_property_ui_text(prop, "Distance", "Maximum distance from active object to other object (in blender units"); + + prop= RNA_def_property(srna, "bake_bias", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "bake_biasdist"); + RNA_def_property_range(prop, 0.0, 1000.0); + RNA_def_property_ui_text(prop, "Bias", "Bias towards faces further away from the object (in blender units)"); + /* stamp */ prop= RNA_def_property(srna, "stamp_time", PROP_BOOLEAN, PROP_NONE); @@ -1856,7 +1932,7 @@ void RNA_def_scene(BlenderRNA *brna) RNA_def_property_collection_funcs(prop, 0, 0, 0, "rna_Scene_objects_get", 0, 0, 0, 0, 0); /* Layers */ - prop= RNA_def_property(srna, "visible_layers", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "visible_layers", PROP_BOOLEAN, PROP_LAYER_MEMBER); RNA_def_property_boolean_sdna(prop, NULL, "lay", 1); RNA_def_property_array(prop, 20); RNA_def_property_ui_text(prop, "Visible Layers", "Layers visible when rendering the scene."); @@ -1990,6 +2066,14 @@ void RNA_def_scene(BlenderRNA *brna) prop= RNA_def_string(func, "statistics", "", 0, "Statistics", ""); RNA_def_function_return(func, prop); + /* Grease Pencil */ + prop= RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE); + RNA_def_property_pointer_sdna(prop, NULL, "gpd"); + RNA_def_property_flag(prop, PROP_EDITABLE); + RNA_def_property_struct_type(prop, "GreasePencil"); + RNA_def_property_ui_text(prop, "Grease Pencil Data", "Grease Pencil datablock"); + + /* Nestled Data */ rna_def_tool_settings(brna); rna_def_unit_settings(brna); rna_def_scene_render_data(brna); diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c index c2c906e38f2..ab4b27cea7b 100644 --- a/source/blender/makesrna/intern/rna_sculpt_paint.c +++ b/source/blender/makesrna/intern/rna_sculpt_paint.c @@ -33,8 +33,34 @@ #include "BKE_paint.h" +#include "WM_types.h" + +static EnumPropertyItem particle_edit_hair_brush_items[] = { + {PE_BRUSH_NONE, "NONE", 0, "None", "Don't use any brush."}, + {PE_BRUSH_COMB, "COMB", 0, "Comb", "Comb hairs."}, + {PE_BRUSH_SMOOTH, "SMOOTH", 0, "Smooth", "Smooth hairs."}, + {PE_BRUSH_ADD, "ADD", 0, "Add", "Add hairs."}, + {PE_BRUSH_LENGTH, "LENGTH", 0, "Length", "Make hairs longer or shorter."}, + {PE_BRUSH_PUFF, "PUFF", 0, "Puff", "Make hairs stand up."}, + {PE_BRUSH_CUT, "CUT", 0, "Cut", "Cut hairs."}, + {0, NULL, 0, NULL, NULL}}; + #ifdef RNA_RUNTIME +#include "BKE_context.h" +#include "BKE_pointcache.h" +#include "BKE_particle.h" +#include "BKE_depsgraph.h" + +#include "ED_particle.h" + +static EnumPropertyItem particle_edit_cache_brush_items[] = { + {PE_BRUSH_NONE, "NONE", 0, "None", "Don't use any brush."}, + {PE_BRUSH_COMB, "COMB", 0, "Comb", "Comb paths."}, + {PE_BRUSH_SMOOTH, "SMOOTH", 0, "Smooth", "Smooth paths."}, + {PE_BRUSH_LENGTH, "LENGTH", 0, "Length", "Make paths longer or shorter."}, + {0, NULL, 0, NULL, NULL}}; + static PointerRNA rna_ParticleEdit_brush_get(PointerRNA *ptr) { ParticleEditSettings *pset= (ParticleEditSettings*)ptr->data; @@ -74,6 +100,62 @@ static void rna_Paint_active_brush_set(PointerRNA *ptr, PointerRNA value) paint_brush_set(ptr->data, value.data); } +static void rna_ParticleEdit_redo(bContext *C, PointerRNA *ptr) +{ + PTCacheEdit *edit = PE_get_current(CTX_data_scene(C), CTX_data_active_object(C)); + + if(!edit) + return; + + psys_free_path_cache(edit->psys, edit); +} + +static void rna_ParticleEdit_update(bContext *C, PointerRNA *ptr) +{ + Object *ob = CTX_data_active_object(C); + + if(ob) DAG_id_flush_update(&ob->id, OB_RECALC_DATA); +} + +static EnumPropertyItem *rna_ParticleEdit_tool_itemf(bContext *C, PointerRNA *ptr, int *free) +{ + if(C==NULL) { + EnumPropertyItem *item= NULL; + int totitem= 0; + + /* needed for doc generation */ + RNA_enum_items_add(&item, &totitem, particle_edit_hair_brush_items); + RNA_enum_item_end(&item, &totitem); + + *free= 1; + + return item; + } + else { + Scene *scene= CTX_data_scene(C); + PTCacheEdit *edit = PE_get_current(scene, CTX_data_active_object(C)); + + if(edit && edit->psys) + return particle_edit_hair_brush_items; + + return particle_edit_cache_brush_items; + } +} + +static int rna_ParticleEdit_editable_get(PointerRNA *ptr) +{ + ParticleEditSettings *pset= (ParticleEditSettings*)ptr->data; + + return (pset->object && PE_get_current(pset->scene, pset->object)); +} +static int rna_ParticleEdit_hair_get(PointerRNA *ptr) +{ + ParticleEditSettings *pset= (ParticleEditSettings*)ptr->data; + + PTCacheEdit *edit = PE_get_current(pset->scene, pset->object); + + return (edit && edit->psys); +} #else static void rna_def_paint(BlenderRNA *brna) @@ -266,17 +348,6 @@ static void rna_def_particle_edit(BlenderRNA *brna) StructRNA *srna; PropertyRNA *prop; - static EnumPropertyItem tool_items[] = { - {PE_BRUSH_NONE, "NONE", 0, "None", "Don't use any brush."}, - {PE_BRUSH_COMB, "COMB", 0, "Comb", "Comb hairs."}, - {PE_BRUSH_SMOOTH, "SMOOTH", 0, "Smooth", "Smooth hairs."}, - {PE_BRUSH_WEIGHT, "WEIGHT", 0, "Weight", "Assign weight to hairs."}, - {PE_BRUSH_ADD, "ADD", 0, "Add", "Add hairs."}, - {PE_BRUSH_LENGTH, "LENGTH", 0, "Length", "Make hairs longer or shorter."}, - {PE_BRUSH_PUFF, "PUFF", 0, "Puff", "Make hairs stand up."}, - {PE_BRUSH_CUT, "CUT", 0, "Cut", "Cut hairs."}, - {0, NULL, 0, NULL, NULL}}; - static EnumPropertyItem select_mode_items[] = { {SCE_SELECT_PATH, "PATH", ICON_EDGESEL, "Path", ""}, // XXX icon {SCE_SELECT_POINT, "POINT", ICON_VERTEXSEL, "Point", ""}, // XXX icon @@ -293,6 +364,14 @@ static void rna_def_particle_edit(BlenderRNA *brna) {1, "SHRINK", 0, "Shrink", "Make hairs shorter."}, {0, NULL, 0, NULL, NULL}}; + static EnumPropertyItem edit_type_items[]= { + {PE_TYPE_PARTICLES, "PARTICLES", 0, "Particles", ""}, + {PE_TYPE_SOFTBODY, "SOFT_BODY", 0, "Soft body", ""}, + {PE_TYPE_CLOTH, "CLOTH", 0, "Cloth", ""}, + {0, NULL, 0, NULL, NULL} + }; + + /* edit */ srna= RNA_def_struct(brna, "ParticleEdit", NULL); @@ -301,13 +380,15 @@ static void rna_def_particle_edit(BlenderRNA *brna) prop= RNA_def_property(srna, "tool", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "brushtype"); - RNA_def_property_enum_items(prop, tool_items); + RNA_def_property_enum_items(prop, particle_edit_hair_brush_items); + RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_ParticleEdit_tool_itemf"); RNA_def_property_ui_text(prop, "Tool", ""); prop= RNA_def_property(srna, "selection_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "selectmode"); RNA_def_property_enum_items(prop, select_mode_items); RNA_def_property_ui_text(prop, "Selection Mode", "Particle select and display mode."); + RNA_def_property_update(prop, NC_OBJECT, "rna_ParticleEdit_update"); prop= RNA_def_property(srna, "keep_lengths", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_KEEP_LENGTHS); @@ -326,13 +407,19 @@ static void rna_def_particle_edit(BlenderRNA *brna) RNA_def_property_ui_range(prop, 0.0f, 10.0f, 10, 3); RNA_def_property_ui_text(prop, "Emitter Distance", "Distance to keep particles away from the emitter."); - prop= RNA_def_property(srna, "show_time", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_SHOW_TIME); - RNA_def_property_ui_text(prop, "Show Time", "Show time values of the baked keys."); + prop= RNA_def_property(srna, "fade_time", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_FADE_TIME); + RNA_def_property_ui_text(prop, "Fade Time", "Fade paths and keys further away from current frame."); + RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_ParticleEdit_update"); - prop= RNA_def_property(srna, "show_children", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_SHOW_CHILD); - RNA_def_property_ui_text(prop, "Show Children", "Show child particles."); + prop= RNA_def_property(srna, "auto_velocity", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_AUTO_VELOCITY); + RNA_def_property_ui_text(prop, "Auto Velocity", "Calculate point velocities automatically."); + + prop= RNA_def_property(srna, "draw_particles", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_DRAW_PART); + RNA_def_property_ui_text(prop, "Draw Particles", "Draw actual particles."); + RNA_def_property_update(prop, NC_OBJECT, NULL); prop= RNA_def_property(srna, "mirror_x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_X_MIRROR); @@ -353,6 +440,37 @@ static void rna_def_particle_edit(BlenderRNA *brna) RNA_def_property_pointer_funcs(prop, "rna_ParticleEdit_brush_get", NULL, NULL); RNA_def_property_ui_text(prop, "Brush", ""); + prop= RNA_def_property(srna, "draw_step", PROP_INT, PROP_NONE); + RNA_def_property_range(prop, 2, 10); + RNA_def_property_ui_text(prop, "Steps", "How many steps to draw the path with."); + RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_ParticleEdit_redo"); + + prop= RNA_def_property(srna, "fade_frames", PROP_INT, PROP_NONE); + RNA_def_property_range(prop, 2, 100); + RNA_def_property_ui_text(prop, "Frames", "How many frames to fade."); + RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_ParticleEdit_update"); + + prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "edittype"); + RNA_def_property_enum_items(prop, edit_type_items); + RNA_def_property_ui_text(prop, "Type", ""); + RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_ParticleEdit_redo"); + + prop= RNA_def_property(srna, "editable", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_funcs(prop, "rna_ParticleEdit_editable_get", NULL); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Editable", "A valid edit mode exists"); + + prop= RNA_def_property(srna, "hair", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_funcs(prop, "rna_ParticleEdit_hair_get", NULL); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Hair", "Editing hair"); + + prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Object", "The edited object"); + + /* brush */ srna= RNA_def_struct(brna, "ParticleBrush", NULL); diff --git a/source/blender/makesrna/intern/rna_sensor.c b/source/blender/makesrna/intern/rna_sensor.c index 53bd230870f..a5d76fdb039 100644 --- a/source/blender/makesrna/intern/rna_sensor.c +++ b/source/blender/makesrna/intern/rna_sensor.c @@ -73,7 +73,7 @@ static StructRNA* rna_Sensor_refine(struct PointerRNA *ptr) #else -void rna_def_sensor(BlenderRNA *brna) +static void rna_def_sensor(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; @@ -129,14 +129,14 @@ void rna_def_sensor(BlenderRNA *brna) RNA_def_property_range(prop, 0, 10000); } -void rna_def_always_sensor(BlenderRNA *brna) +static void rna_def_always_sensor(BlenderRNA *brna) { StructRNA *srna; srna= RNA_def_struct(brna, "AlwaysSensor", "Sensor"); RNA_def_struct_ui_text(srna, "Always Sensor", "Sensor to generate continuous pulses."); } -void rna_def_near_sensor(BlenderRNA *brna) +static void rna_def_near_sensor(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; @@ -160,7 +160,7 @@ void rna_def_near_sensor(BlenderRNA *brna) RNA_def_property_range(prop, 0.0f, 10000.0f); } -void rna_def_mouse_sensor(BlenderRNA *brna) +static void rna_def_mouse_sensor(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; @@ -186,7 +186,7 @@ void rna_def_mouse_sensor(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Mouse Event", "Specify the type of event this mouse sensor should trigger on."); } -void rna_def_touch_sensor(BlenderRNA *brna) +static void rna_def_touch_sensor(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; @@ -201,7 +201,7 @@ void rna_def_touch_sensor(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Material", "Only look for floors with this material."); } -void rna_def_keyboard_sensor(BlenderRNA *brna) +static void rna_def_keyboard_sensor(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; @@ -240,7 +240,7 @@ void rna_def_keyboard_sensor(BlenderRNA *brna) RNA_def_property_ui_text(prop, "All Keys", "Trigger this sensor on any keystroke."); } -void rna_def_property_sensor(BlenderRNA *brna) +static void rna_def_property_sensor(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; @@ -278,7 +278,7 @@ void rna_def_property_sensor(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Maximum Value", "Specify maximum value in Interval type."); } -void rna_def_actuator_sensor(BlenderRNA *brna) +static void rna_def_actuator_sensor(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; @@ -292,7 +292,7 @@ void rna_def_actuator_sensor(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Actuator", "Actuator name, actuator active state modifications will be detected."); } -void rna_def_delay_sensor(BlenderRNA *brna) +static void rna_def_delay_sensor(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; @@ -314,7 +314,7 @@ void rna_def_delay_sensor(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Repeat", "Toggle repeat option. If selected, the sensor restarts after Delay+Dur logic tics."); } -void rna_def_collision_sensor(BlenderRNA *brna) +static void rna_def_collision_sensor(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; @@ -341,7 +341,7 @@ void rna_def_collision_sensor(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Collision Type", "Toggle collision on material or property."); } -void rna_def_radar_sensor(BlenderRNA *brna) +static void rna_def_radar_sensor(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; @@ -376,7 +376,7 @@ void rna_def_radar_sensor(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Distance", "Depth of the radar cone."); } -void rna_def_random_sensor(BlenderRNA *brna) +static void rna_def_random_sensor(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; @@ -390,7 +390,7 @@ void rna_def_random_sensor(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Seed", "Initial seed of the generator. (Choose 0 for not random)."); } -void rna_def_ray_sensor(BlenderRNA *brna) +static void rna_def_ray_sensor(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; @@ -438,7 +438,7 @@ void rna_def_ray_sensor(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Axis", "Specify along which axis the ray is cast."); } -void rna_def_message_sensor(BlenderRNA *brna) +static void rna_def_message_sensor(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; @@ -451,7 +451,7 @@ void rna_def_message_sensor(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Subject", "Optional subject filter: only accept messages with this subject, or empty for all."); } -void rna_def_joystick_sensor(BlenderRNA *brna) +static void rna_def_joystick_sensor(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; diff --git a/source/blender/makesrna/intern/rna_sequence.c b/source/blender/makesrna/intern/rna_sequence.c index 470909f4eff..4e12aab853e 100644 --- a/source/blender/makesrna/intern/rna_sequence.c +++ b/source/blender/makesrna/intern/rna_sequence.c @@ -221,6 +221,16 @@ static StructRNA* rna_Sequence_refine(struct PointerRNA *ptr) } } +static char *rna_Sequence_path(PointerRNA *ptr) +{ + Sequence *seq= (Sequence*)ptr->data; + + /* sequencer data comes from scene... + * TODO: would be nice to make SequenceEditor data a datablock of its own (for shorter paths) + */ + return BLI_sprintfN("sequence_editor.sequences[\"%s\"]", seq->name+2); +} + static PointerRNA rna_SequenceEdtior_meta_stack_get(CollectionPropertyIterator *iter) { ListBaseIterator *internal= iter->internal; @@ -360,7 +370,7 @@ static void rna_def_sequence(BlenderRNA *brna) {SEQ_META, "META", 0, "Meta", ""}, {SEQ_SCENE, "SCENE", 0, "Scene", ""}, {SEQ_MOVIE, "MOVIE", 0, "Movie", ""}, - {SEQ_SOUND, "_SOUND", 0, "Sound", ""}, + {SEQ_SOUND, "SOUND", 0, "Sound", ""}, {SEQ_EFFECT, "REPLACE", 0, "Replace", ""}, {SEQ_CROSS, "CROSS", 0, "Cross", ""}, {SEQ_ADD, "ADD", 0, "Add", ""}, @@ -393,6 +403,7 @@ static void rna_def_sequence(BlenderRNA *brna) srna = RNA_def_struct(brna, "Sequence", NULL); RNA_def_struct_ui_text(srna, "Sequence", "Sequence strip in the sequence editor."); RNA_def_struct_refine_func(srna, "rna_Sequence_refine"); + RNA_def_struct_path_func(srna, "rna_Sequence_path"); prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_property_string_funcs(prop, "rna_Sequence_name_get", "rna_Sequence_name_length", "rna_Sequence_name_set"); @@ -503,7 +514,7 @@ static void rna_def_sequence(BlenderRNA *brna) RNA_def_function_return(func, RNA_def_pointer(func, "elem", "SequenceElement", "", "strip element of the current frame")); } -void rna_def_editor(BlenderRNA *brna) +static void rna_def_editor(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; diff --git a/source/blender/makesrna/intern/rna_smoke.c b/source/blender/makesrna/intern/rna_smoke.c index d7c70d8b9e9..943129c7169 100644 --- a/source/blender/makesrna/intern/rna_smoke.c +++ b/source/blender/makesrna/intern/rna_smoke.c @@ -46,13 +46,12 @@ #include "BKE_context.h" #include "BKE_depsgraph.h" #include "BKE_particle.h" -#include "BKE_pointcache.h" #include "ED_object.h" static void rna_Smoke_update(bContext *C, PointerRNA *ptr) { - DAG_object_flush_update(CTX_data_scene(C), ptr->id.data, OB_RECALC_DATA); + DAG_id_flush_update(ptr->id.data, OB_RECALC_DATA); } static void rna_Smoke_dependency_update(bContext *C, PointerRNA *ptr) @@ -79,15 +78,6 @@ static void rna_Smoke_reset_dependancy(bContext *C, PointerRNA *ptr) rna_Smoke_dependency_update(C, ptr); } -#if 0 -static void rna_Smoke_redraw(bContext *C, PointerRNA *ptr) -{ - SmokeDomainSettings *settings = (SmokeDomainSettings*)ptr->data; - - settings->flags |= MOD_SMOKE_VIEW_REDRAWNICE; -} -#endif - static char *rna_SmokeDomainSettings_path(PointerRNA *ptr) { SmokeDomainSettings *settings = (SmokeDomainSettings*)ptr->data; @@ -139,6 +129,29 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Max Res", "Maximal resolution used in the fluid domain."); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); + prop= RNA_def_property(srna, "amplify", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "amplify"); + RNA_def_property_range(prop, 1, 10); + RNA_def_property_ui_range(prop, 1, 10, 1, 0); + RNA_def_property_ui_text(prop, "Amplification", "Enhance the resolution of smoke by this factor using noise."); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); + + prop= RNA_def_property(srna, "highres", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_HIGHRES); + RNA_def_property_ui_text(prop, "High res", "Enable high resolution (using amplification)."); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); + + prop= RNA_def_property(srna, "viewhighres", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "viewsettings", MOD_SMOKE_VIEW_SHOWBIG); + RNA_def_property_ui_text(prop, "Show High Resolution", "Show high resolution (using amplification)."); + RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); + + prop= RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "noise"); + RNA_def_property_enum_items(prop, prop_noise_type_items); + RNA_def_property_ui_text(prop, "Noise Method", "Noise method which is used for creating the high resolution"); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); + prop= RNA_def_property(srna, "alpha", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "alpha"); RNA_def_property_range(prop, -5.0, 5.0); @@ -174,61 +187,36 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Effector Group", "Limit effectors to this group."); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset_dependancy"); + prop= RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "strength"); + RNA_def_property_range(prop, 1.0, 10.0); + RNA_def_property_ui_range(prop, 1.0, 10.0, 1, 2); + RNA_def_property_ui_text(prop, "Strength", "Strength of wavelet noise"); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); + prop= RNA_def_property(srna, "dissolve_speed", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "diss_speed"); RNA_def_property_range(prop, 1.0, 100.0); RNA_def_property_ui_range(prop, 1.0, 1000.0, 1, 0); RNA_def_property_ui_text(prop, "Dissolve Speed", "Dissolve Speed"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); - - prop= RNA_def_property(srna, "highres", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_HIGHRES); - RNA_def_property_ui_text(prop, "High Resolution Smoke", "Enable high resolution smoke"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, NULL); + RNA_def_property_update(prop, 0, NULL); prop= RNA_def_property(srna, "dissolve_smoke", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_DISSOLVE); RNA_def_property_ui_text(prop, "Dissolve Smoke", "Enable smoke to disappear over time."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); + RNA_def_property_update(prop, 0, NULL); prop= RNA_def_property(srna, "dissolve_smoke_log", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_DISSOLVE_LOG); RNA_def_property_ui_text(prop, "Logarithmic dissolve", "Using 1/x "); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); + RNA_def_property_update(prop, 0, NULL); - prop= RNA_def_property(srna, "point_cache", PROP_POINTER, PROP_NEVER_NULL); + prop= RNA_def_property(srna, "point_cache_low", PROP_POINTER, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "point_cache[0]"); - RNA_def_property_struct_type(prop, "PointCache"); RNA_def_property_ui_text(prop, "Point Cache", ""); - prop= RNA_def_property(srna, "show_highres", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "viewsettings", MOD_SMOKE_SHOWHIGHRES); - RNA_def_property_ui_text(prop, "High res", "Show high resolution (using amplification)."); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); - - prop= RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "noise"); - RNA_def_property_enum_items(prop, prop_noise_type_items); - RNA_def_property_ui_text(prop, "Noise Method", "Noise method which is used for creating the high resolution"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); - - prop= RNA_def_property(srna, "amplify", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "amplify"); - RNA_def_property_range(prop, 1, 10); - RNA_def_property_ui_range(prop, 1, 10, 1, 0); - RNA_def_property_ui_text(prop, "Amplification", "Enhance the resolution of smoke by this factor using noise."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); - - prop= RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "strength"); - RNA_def_property_range(prop, 1.0, 10.0); - RNA_def_property_ui_range(prop, 1.0, 10.0, 1, 2); - RNA_def_property_ui_text(prop, "Strength", "Strength of wavelet noise"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); - - prop= RNA_def_property(srna, "point_cache_turbulence", PROP_POINTER, PROP_NEVER_NULL); + prop= RNA_def_property(srna, "point_cache_high", PROP_POINTER, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "point_cache[1]"); - RNA_def_property_struct_type(prop, "PointCache"); RNA_def_property_ui_text(prop, "Point Cache", ""); } @@ -247,26 +235,26 @@ static void rna_def_smoke_flow_settings(BlenderRNA *brna) RNA_def_property_range(prop, 0.001, 1); RNA_def_property_ui_range(prop, 0.001, 1.0, 1.0, 4); RNA_def_property_ui_text(prop, "Density", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, NULL); + RNA_def_property_update(prop, 0, NULL); // NC_OBJECT|ND_MODIFIER prop= RNA_def_property(srna, "temperature", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "temp"); RNA_def_property_range(prop, -10, 10); RNA_def_property_ui_range(prop, -10, 10, 1, 1); RNA_def_property_ui_text(prop, "Temp. Diff.", "Temperature difference to ambientt temperature."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, NULL); + RNA_def_property_update(prop, 0, NULL); prop= RNA_def_property(srna, "psys", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "psys"); RNA_def_property_struct_type(prop, "ParticleSystem"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Particle Systems", "Particle systems emitted from the object."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset_dependancy"); + RNA_def_property_update(prop, 0, "rna_Smoke_reset_dependancy"); prop= RNA_def_property(srna, "outflow", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "type", MOD_SMOKE_FLOW_TYPE_OUTFLOW); RNA_def_property_ui_text(prop, "Outflow", "Deletes smoke from simulation"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, NULL); + RNA_def_property_update(prop, 0, NULL); } static void rna_def_smoke_coll_settings(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_sound.c b/source/blender/makesrna/intern/rna_sound.c index a029ef85544..38e4d850c68 100644 --- a/source/blender/makesrna/intern/rna_sound.c +++ b/source/blender/makesrna/intern/rna_sound.c @@ -34,6 +34,29 @@ #ifdef RNA_RUNTIME +#include "BKE_sound.h" +#include "BKE_context.h" + +static void rna_Sound_filename_update(bContext *C, PointerRNA *ptr) +{ + sound_load(CTX_data_main(C), (bSound*)ptr->data); +} + +static int rna_Sound_caching_get(PointerRNA *ptr) +{ + bSound *sound = (bSound*)(ptr->data); + return sound->cache != NULL; +} + +static void rna_Sound_caching_set(PointerRNA *ptr, const int value) +{ + bSound *sound = (bSound*)(ptr->data); + if(value) + sound_cache(sound, 0); + else + sound_delete_cache(sound); +} + #else static void rna_def_sound(BlenderRNA *brna) @@ -51,10 +74,16 @@ static void rna_def_sound(BlenderRNA *brna) prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILEPATH); RNA_def_property_string_sdna(prop, NULL, "name"); RNA_def_property_ui_text(prop, "Filename", "Sound sample file used by this Sound datablock."); + RNA_def_property_update(prop, 0, "rna_Sound_filename_update"); prop= RNA_def_property(srna, "packed_file", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "packedfile"); RNA_def_property_ui_text(prop, "Packed File", ""); + + prop= RNA_def_property(srna, "caching", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_funcs(prop, "rna_Sound_caching_get", "rna_Sound_caching_set"); + RNA_def_property_ui_text(prop, "Caching", "The sound file is decoded and loaded into RAM."); + RNA_def_property_update(prop, 0, "rna_Sound_filename_update"); } void RNA_def_sound(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index a754d619741..bb01ab9a9c7 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -211,7 +211,7 @@ static EnumPropertyItem *rna_SpaceImageEditor_draw_channels_itemf(bContext *C, P /* Space Text Editor */ -void rna_SpaceTextEditor_word_wrap_set(PointerRNA *ptr, int value) +static void rna_SpaceTextEditor_word_wrap_set(PointerRNA *ptr, int value) { SpaceText *st= (SpaceText*)(ptr->data); @@ -219,7 +219,7 @@ void rna_SpaceTextEditor_word_wrap_set(PointerRNA *ptr, int value) st->left= 0; } -void rna_SpaceTextEditor_text_set(PointerRNA *ptr, PointerRNA value) +static void rna_SpaceTextEditor_text_set(PointerRNA *ptr, PointerRNA value) { SpaceText *st= (SpaceText*)(ptr->data); @@ -227,7 +227,7 @@ void rna_SpaceTextEditor_text_set(PointerRNA *ptr, PointerRNA value) st->top= 0; } -void rna_SpaceFileBrowser_params_set(PointerRNA *ptr, PointerRNA value) +static void rna_SpaceFileBrowser_params_set(PointerRNA *ptr, PointerRNA value) { SpaceFile *sfile= (SpaceFile*)(ptr->data); @@ -236,7 +236,7 @@ void rna_SpaceFileBrowser_params_set(PointerRNA *ptr, PointerRNA value) /* Space Properties */ -StructRNA *rna_SpaceProperties_pin_id_typef(PointerRNA *ptr) +static StructRNA *rna_SpaceProperties_pin_id_typef(PointerRNA *ptr) { SpaceButs *sbuts= (SpaceButs*)(ptr->data); @@ -246,7 +246,7 @@ StructRNA *rna_SpaceProperties_pin_id_typef(PointerRNA *ptr) return &RNA_ID; } -void rna_SpaceProperties_align_set(PointerRNA *ptr, int value) +static void rna_SpaceProperties_align_set(PointerRNA *ptr, int value) { SpaceButs *sbuts= (SpaceButs*)(ptr->data); @@ -375,65 +375,68 @@ static void rna_def_space_image_uv(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "sticky"); RNA_def_property_enum_items(prop, sticky_mode_items); RNA_def_property_ui_text(prop, "Sticky Selection Mode", "Automatically select also UVs sharing the same vertex as the ones being selected."); - RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); /* drawing */ prop= RNA_def_property(srna, "edge_draw_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "dt_uv"); RNA_def_property_enum_items(prop, dt_uv_items); RNA_def_property_ui_text(prop, "Edge Draw Type", "Draw type for drawing UV edges."); - RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); prop= RNA_def_property(srna, "draw_smooth_edges", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_SMOOTH_UV); RNA_def_property_ui_text(prop, "Draw Smooth Edges", "Draw UV edges anti-aliased."); - RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); prop= RNA_def_property(srna, "draw_stretch", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAW_STRETCH); RNA_def_property_ui_text(prop, "Draw Stretch", "Draw faces colored according to the difference in shape between UVs and their 3D coordinates (blue for low distortion, red for high distortion)."); - RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); prop= RNA_def_property(srna, "draw_stretch_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "dt_uvstretch"); RNA_def_property_enum_items(prop, dt_uvstretch_items); RNA_def_property_ui_text(prop, "Draw Stretch Type", "Type of stretch to draw."); - RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); prop= RNA_def_property(srna, "draw_modified_edges", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAWSHADOW); RNA_def_property_ui_text(prop, "Draw Modified Edges", "Draw edges after modifiers are applied."); - RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); prop= RNA_def_property(srna, "draw_other_objects", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAW_OTHER); RNA_def_property_ui_text(prop, "Draw Other Objects", "Draw other selected objects that share the same image."); - RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); prop= RNA_def_property(srna, "normalized_coordinates", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_COORDFLOATS); RNA_def_property_ui_text(prop, "Normalized Coordinates", "Display UV coordinates from 0.0 to 1.0 rather than in pixels."); - RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); /* todo: move edge and face drawing options here from G.f */ prop= RNA_def_property(srna, "snap_to_pixels", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_PIXELSNAP); RNA_def_property_ui_text(prop, "Snap to Pixels", "Snap UVs to pixel locations while editing."); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); prop= RNA_def_property(srna, "constrain_to_image_bounds", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_CLIP_UV); RNA_def_property_ui_text(prop, "Constrain to Image Bounds", "Constraint to stay within the image bounds while editing."); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); prop= RNA_def_property(srna, "live_unwrap", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_LIVE_UNWRAP); RNA_def_property_ui_text(prop, "Live Unwrap", "Continuously unwrap the selected UV island while transforming pinned vertices."); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); prop= RNA_def_property(srna, "pivot", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "around"); RNA_def_property_enum_items(prop, pivot_items); RNA_def_property_ui_text(prop, "Pivot", "Rotation/Scaling Pivot."); - RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); } static void rna_def_space_outliner(BlenderRNA *brna) @@ -464,12 +467,12 @@ static void rna_def_space_outliner(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "outlinevis"); RNA_def_property_enum_items(prop, display_mode_items); RNA_def_property_ui_text(prop, "Display Mode", "Type of information to display"); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_OUTLINER, NULL); prop= RNA_def_property(srna, "show_restriction_columns", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SO_HIDE_RESTRICTCOLS); RNA_def_property_ui_text(prop, "Show Restriction Columns", "Show colum"); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_OUTLINER, NULL); } @@ -486,35 +489,34 @@ static void rna_def_background_image(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "ima"); RNA_def_property_ui_text(prop, "Image", "Image displayed and edited in this space."); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); prop= RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "iuser"); RNA_def_property_ui_text(prop, "Image User", "Parameters defining which layer, pass and frame of the image is displayed."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); - prop= RNA_def_property(srna, "x_offset", PROP_FLOAT, PROP_NONE); + prop= RNA_def_property(srna, "offset_x", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "xof"); RNA_def_property_ui_text(prop, "X Offset", "Offsets image horizontally from the view center"); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); - prop= RNA_def_property(srna, "y_offset", PROP_FLOAT, PROP_NONE); + prop= RNA_def_property(srna, "offset_y", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "yof"); RNA_def_property_ui_text(prop, "Y Offset", "Offsets image vertically from the view center"); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); prop= RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "size"); RNA_def_property_ui_text(prop, "Size", "Scaling factor for the background image."); RNA_def_property_range(prop, 0.0, FLT_MAX); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); prop= RNA_def_property(srna, "transparency", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "blend"); RNA_def_property_ui_text(prop, "Transparency", "Amount to blend the image against the background color."); RNA_def_property_range(prop, 0.0, 1.0); - RNA_def_property_update(prop, NC_WINDOW, NULL); - + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); } static void rna_def_space_3dview(BlenderRNA *brna) @@ -553,10 +555,12 @@ static void rna_def_space_3dview(BlenderRNA *brna) prop= RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "camera"); RNA_def_property_ui_text(prop, "Camera", "Active camera used in this view (when unlocked from the scene's active camera)."); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); prop= RNA_def_property(srna, "lock_object", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "ob_centre"); RNA_def_property_ui_text(prop, "Lock Object", "3D View center is locked to this object's position"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); prop= RNA_def_property(srna, "background_image", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "bgpic"); @@ -566,136 +570,142 @@ static void rna_def_space_3dview(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "drawtype"); RNA_def_property_enum_items(prop, viewport_shading_items); RNA_def_property_ui_text(prop, "Viewport Shading", "Method to display/shade objects in the 3D View."); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); prop= RNA_def_property(srna, "localview", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "localview", 0); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Local View", "Display an isolated sub-set of objects, apart from the scene visibility."); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); prop= RNA_def_property(srna, "lens", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "lens"); RNA_def_property_ui_text(prop, "Lens", "Lens angle (mm) in perspective view."); RNA_def_property_range(prop, 1.0f, 250.0f); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); prop= RNA_def_property(srna, "clip_start", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "near"); RNA_def_property_range(prop, 0.0f, FLT_MAX); RNA_def_property_ui_text(prop, "Clip Start", "3D View near clipping distance."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); prop= RNA_def_property(srna, "clip_end", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "far"); RNA_def_property_range(prop, 1.0f, FLT_MAX); RNA_def_property_ui_text(prop, "Clip End", "3D View far clipping distance."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); prop= RNA_def_property(srna, "grid_spacing", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "grid"); RNA_def_property_ui_text(prop, "Grid Spacing", "The distance between 3D View grid lines."); RNA_def_property_range(prop, 0.0f, FLT_MAX); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); prop= RNA_def_property(srna, "grid_lines", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "gridlines"); RNA_def_property_ui_text(prop, "Grid Lines", "The number of grid lines to display in perspective view."); RNA_def_property_range(prop, 0, 1024); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); prop= RNA_def_property(srna, "grid_subdivisions", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "gridsubdiv"); RNA_def_property_ui_text(prop, "Grid Subdivisions", "The number of subdivisions between grid lines."); RNA_def_property_range(prop, 1, 1024); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); prop= RNA_def_property(srna, "display_floor", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "gridflag", V3D_SHOW_FLOOR); RNA_def_property_ui_text(prop, "Display Grid Floor", "Show the ground plane grid in perspective view."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); prop= RNA_def_property(srna, "display_x_axis", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "gridflag", V3D_SHOW_X); RNA_def_property_ui_text(prop, "Display X Axis", "Show the X axis line in perspective view."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); prop= RNA_def_property(srna, "display_y_axis", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "gridflag", V3D_SHOW_Y); RNA_def_property_ui_text(prop, "Display Y Axis", "Show the Y axis line in perspective view."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); prop= RNA_def_property(srna, "display_z_axis", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "gridflag", V3D_SHOW_Z); RNA_def_property_ui_text(prop, "Display Z Axis", "Show the Z axis line in perspective view."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); prop= RNA_def_property(srna, "outline_selected", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_SELECT_OUTLINE); RNA_def_property_ui_text(prop, "Outline Selected", "Show an outline highlight around selected objects in non-wireframe views."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); prop= RNA_def_property(srna, "all_object_centers", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_DRAW_CENTERS); RNA_def_property_ui_text(prop, "All Object Centers", "Show the object center dot for all (selected and unselected) objects."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); prop= RNA_def_property(srna, "relationship_lines", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", V3D_HIDE_HELPLINES); RNA_def_property_ui_text(prop, "Relationship Lines", "Show dashed lines indicating parent or constraint relationships."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); prop= RNA_def_property(srna, "textured_solid", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_SOLID_TEX); RNA_def_property_ui_text(prop, "Textured Solid", "Display face-assigned textures in solid view"); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); prop= RNA_def_property(srna, "display_background_image", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, NULL, "rna_View3D_display_background_image_set"); RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_DISPBGPIC); RNA_def_property_ui_text(prop, "Display Background Image", "Display a reference image behind objects in the 3D View"); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); prop= RNA_def_property(srna, "pivot_point", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "around"); RNA_def_property_enum_items(prop, pivot_items); RNA_def_property_ui_text(prop, "Pivot Point", "Pivot center for rotation/scaling."); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); prop= RNA_def_property(srna, "manipulator", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "twflag", V3D_USE_MANIPULATOR); RNA_def_property_ui_text(prop, "Manipulator", "Use a 3D manipulator widget for controlling transforms."); - RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); prop= RNA_def_property(srna, "manipulator_translate", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "twtype", V3D_MANIP_TRANSLATE); RNA_def_property_ui_text(prop, "Manipulator Translate", "Use the manipulator for movement transformations."); - RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); prop= RNA_def_property(srna, "manipulator_rotate", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "twtype", V3D_MANIP_ROTATE); RNA_def_property_ui_text(prop, "Manipulator Rotate", "Use the manipulator for rotation transformations."); - RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); prop= RNA_def_property(srna, "manipulator_scale", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "twtype", V3D_MANIP_SCALE); RNA_def_property_ui_text(prop, "Manipulator Scale", "Use the manipulator for scale transformations."); - RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); prop= RNA_def_property(srna, "transform_orientation", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "twmode"); RNA_def_property_enum_items(prop, transform_orientation_items); RNA_def_property_ui_text(prop, "Transform Orientation", "The alignment of manipulator handles."); - RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); prop= RNA_def_property(srna, "lock_rotation", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, "RegionView3D", "viewlock", RV3D_LOCKED); RNA_def_property_ui_text(prop, "Lock", "Lock View Rotation"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); prop= RNA_def_property(srna, "box_preview", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, "RegionView3D", "viewlock", RV3D_BOXVIEW); RNA_def_property_ui_text(prop, "Box", ""); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); prop= RNA_def_property(srna, "box_clip", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, "RegionView3D", "viewlock", RV3D_BOXCLIP); RNA_def_property_ui_text(prop, "Clip", ""); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); } static void rna_def_space_buttons(BlenderRNA *brna) @@ -730,19 +740,19 @@ static void rna_def_space_buttons(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "mainb"); RNA_def_property_enum_items(prop, buttons_context_items); RNA_def_property_ui_text(prop, "Context", "Type of active data to display and edit."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_PROPERTIES, NULL); prop= RNA_def_property(srna, "align", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "align"); RNA_def_property_enum_items(prop, align_items); RNA_def_property_enum_funcs(prop, NULL, "rna_SpaceProperties_align_set", NULL); RNA_def_property_ui_text(prop, "Align", "Arrangement of the panels."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_PROPERTIES, NULL); prop= RNA_def_property(srna, "brush_texture", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SB_BRUSH_TEX); RNA_def_property_ui_text(prop, "Brush Texture", "Show brush textures."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_PROPERTIES, NULL); /* pinned data */ prop= RNA_def_property(srna, "pin_id", PROP_POINTER, PROP_NONE); @@ -750,6 +760,7 @@ static void rna_def_space_buttons(BlenderRNA *brna) RNA_def_property_struct_type(prop, "ID"); RNA_def_property_pointer_funcs(prop, NULL, NULL, "rna_SpaceProperties_pin_id_typef"); RNA_def_property_flag(prop, PROP_EDITABLE); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_PROPERTIES, NULL); } static void rna_def_space_image(BlenderRNA *brna) @@ -766,35 +777,35 @@ static void rna_def_space_image(BlenderRNA *brna) RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceImageEditor_image_set", NULL); RNA_def_property_ui_text(prop, "Image", "Image displayed and edited in this space."); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); prop= RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "iuser"); RNA_def_property_ui_text(prop, "Image User", "Parameters defining which layer, pass and frame of the image is displayed."); - RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); prop= RNA_def_property(srna, "curves", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "cumap"); RNA_def_property_ui_text(prop, "Curves", "Color curve mapping to use for displaying the image."); - RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); prop= RNA_def_property(srna, "image_pin", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "pin", 0); RNA_def_property_ui_text(prop, "Image Pin", "Display current image regardless of object selection."); - RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); /* image draw */ prop= RNA_def_property(srna, "draw_repeated", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAW_TILE); RNA_def_property_ui_text(prop, "Draw Repeated", "Draw the image repeated outside of the main view."); - RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); prop= RNA_def_property(srna, "draw_channels", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); RNA_def_property_enum_items(prop, dc_all_items); RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_SpaceImageEditor_draw_channels_itemf"); RNA_def_property_ui_text(prop, "Draw Channels", "Channels of the image to draw."); - RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); /* uv */ prop= RNA_def_property(srna, "uv_editor", PROP_POINTER, PROP_NEVER_NULL); @@ -807,7 +818,7 @@ static void rna_def_space_image(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAWTOOL); RNA_def_property_ui_text(prop, "Image Painting", "Enable image painting mode."); RNA_def_property_ui_icon(prop, ICON_TPAINT_HLT, 0); - RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_SpaceImageEditor_paint_update"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, "rna_SpaceImageEditor_paint_update"); /* grease pencil */ prop= RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE); @@ -866,64 +877,69 @@ static void rna_def_space_sequencer(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "mainb"); RNA_def_property_enum_items(prop, display_mode_items); RNA_def_property_ui_text(prop, "Display Mode", "The view mode to use for displaying sequencer output."); - RNA_def_property_update(prop, ND_SEQUENCER|NC_WINDOW, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL); /* flag's */ prop= RNA_def_property(srna, "draw_frames", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_DRAWFRAMES); RNA_def_property_ui_text(prop, "Draw Frames", "Draw frames rather then seconds."); - RNA_def_property_update(prop, ND_SEQUENCER|NC_WINDOW, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL); prop= RNA_def_property(srna, "transform_markers", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_MARKER_TRANS); RNA_def_property_ui_text(prop, "Transform Markers", "Transform markers as well as strips."); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL); prop= RNA_def_property(srna, "seperate_color_preview", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_DRAW_COLOR_SEPERATED); RNA_def_property_ui_text(prop, "Seperate Colors", "Seperate color channels in preview."); - RNA_def_property_update(prop, ND_SEQUENCER|NC_WINDOW, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL); prop= RNA_def_property(srna, "draw_safe_margin", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_DRAW_SAFE_MARGINS); RNA_def_property_ui_text(prop, "Safe Margin", "Draw title safe margins in preview."); - RNA_def_property_update(prop, ND_SEQUENCER|NC_WINDOW, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL); prop= RNA_def_property(srna, "use_grease_pencil", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_DRAW_GPENCIL); RNA_def_property_ui_text(prop, "Use Grease Pencil", "Display and edit the grease pencil freehand annotations overlay."); - RNA_def_property_update(prop, ND_SEQUENCER|NC_WINDOW, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL); /* grease pencil */ prop= RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "gpd"); RNA_def_property_struct_type(prop, "UnknownType"); RNA_def_property_ui_text(prop, "Grease Pencil", "Grease pencil data for this space."); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL); prop= RNA_def_property(srna, "display_channel", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "chanshown"); RNA_def_property_ui_text(prop, "Display Channel", "The channel number shown in the image preview. 0 is the result of all strips combined."); RNA_def_property_range(prop, 0, 32); // MAXSEQ --- todo, move from BKE_sequence.h - RNA_def_property_update(prop, ND_SEQUENCER|NC_WINDOW, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL); prop= RNA_def_property(srna, "draw_overexposed", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "zebra"); RNA_def_property_ui_text(prop, "Show Overexposed", "Show overexposed areas with zebra stripes."); RNA_def_property_range(prop, 0, 110); - RNA_def_property_update(prop, ND_SEQUENCER|NC_WINDOW, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL); /* not sure we need rna access to these but adding anyway */ - prop= RNA_def_property(srna, "x_offset", PROP_FLOAT, PROP_NONE); + prop= RNA_def_property(srna, "offset_x", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "xof"); RNA_def_property_ui_text(prop, "X Offset", "Offsets image horizontally from the view center"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL); - prop= RNA_def_property(srna, "y_offset", PROP_FLOAT, PROP_NONE); + prop= RNA_def_property(srna, "offset_y", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "yof"); RNA_def_property_ui_text(prop, "Y Offset", "Offsets image horizontally from the view center"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL); prop= RNA_def_property(srna, "zoom", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "zoom"); RNA_def_property_ui_text(prop, "Zoom", "Display zoom level"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL); } static void rna_def_space_text(BlenderRNA *brna) @@ -940,63 +956,68 @@ static void rna_def_space_text(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Text", "Text displayed and edited in this space."); RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceTextEditor_text_set", NULL); - RNA_def_property_update(prop, NC_TEXT|ND_DISPLAY, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL); /* display */ prop= RNA_def_property(srna, "syntax_highlight", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "showsyntax", 0); RNA_def_property_ui_text(prop, "Syntax Highlight", "Syntax highlight for scripting."); RNA_def_property_ui_icon(prop, ICON_SYNTAX_OFF, 1); - RNA_def_property_update(prop, NC_TEXT|ND_DISPLAY, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL); prop= RNA_def_property(srna, "word_wrap", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "wordwrap", 0); RNA_def_property_boolean_funcs(prop, NULL, "rna_SpaceTextEditor_word_wrap_set"); RNA_def_property_ui_text(prop, "Word Wrap", "Wrap words if there is not enough horizontal space."); RNA_def_property_ui_icon(prop, ICON_WORDWRAP_OFF, 1); - RNA_def_property_update(prop, NC_TEXT|ND_DISPLAY, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL); prop= RNA_def_property(srna, "line_numbers", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "showlinenrs", 0); RNA_def_property_ui_text(prop, "Line Numbers", "Show line numbers next to the text."); RNA_def_property_ui_icon(prop, ICON_LINENUMBERS_OFF, 1); - RNA_def_property_update(prop, NC_TEXT|ND_DISPLAY, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL); prop= RNA_def_property(srna, "overwrite", PROP_BOOLEAN, PROP_NONE); RNA_def_property_ui_text(prop, "Overwrite", "Overwrite characters when typing rather than inserting them."); - RNA_def_property_update(prop, NC_TEXT|ND_DISPLAY, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL); prop= RNA_def_property(srna, "live_edit", PROP_BOOLEAN, PROP_NONE); RNA_def_property_ui_text(prop, "Live Edit", "Run python while editing."); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL); prop= RNA_def_property(srna, "tab_width", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "tabnumber"); RNA_def_property_range(prop, 2, 8); RNA_def_property_ui_text(prop, "Tab Width", "Number of spaces to display tabs with."); - RNA_def_property_update(prop, NC_TEXT|ND_DISPLAY, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL); prop= RNA_def_property(srna, "font_size", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "lheight"); RNA_def_property_range(prop, 8, 32); RNA_def_property_ui_text(prop, "Font Size", "Font size to use for displaying the text."); - RNA_def_property_update(prop, NC_TEXT|ND_DISPLAY, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL); /* find */ prop= RNA_def_property(srna, "find_all", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", ST_FIND_ALL); RNA_def_property_ui_text(prop, "Find All", "Search in all text datablocks, instead of only the active one."); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL); prop= RNA_def_property(srna, "find_wrap", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", ST_FIND_WRAP); RNA_def_property_ui_text(prop, "Find Wrap", "Search again from the start of the file when reaching the end."); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL); prop= RNA_def_property(srna, "find_text", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "findstr"); RNA_def_property_ui_text(prop, "Find Text", "Text to search for with the find tool."); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL); prop= RNA_def_property(srna, "replace_text", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "replacestr"); RNA_def_property_ui_text(prop, "Replace Text", "Text to replace selected text with using the replace tool."); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL); } static void rna_def_space_dopesheet(BlenderRNA *brna) @@ -1021,25 +1042,30 @@ static void rna_def_space_dopesheet(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "mode"); RNA_def_property_enum_items(prop, mode_items); RNA_def_property_ui_text(prop, "Mode", "Editing context being displayed."); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, NULL); /* display */ prop= RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SACTION_DRAWTIME); RNA_def_property_clear_flag(prop, PROP_EDITABLE); // XXX for now, only set with operator RNA_def_property_ui_text(prop, "Show Seconds", "Show timing in seconds not frames."); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, NULL); prop= RNA_def_property(srna, "show_cframe_indicator", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SACTION_NODRAWCFRANUM); RNA_def_property_ui_text(prop, "Show Frame Number Indicator", "Show frame number beside the current frame indicator line."); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, NULL); prop= RNA_def_property(srna, "show_sliders", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SACTION_SLIDERS); RNA_def_property_ui_text(prop, "Show Sliders", "Show sliders beside F-Curve channels."); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, NULL); /* editing */ prop= RNA_def_property(srna, "automerge_keyframes", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SACTION_NOTRANSKEYCULL); RNA_def_property_ui_text(prop, "AutoMerge Keyframes", "Show handles of Bezier control points."); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, NULL); // TODO... autosnap, dopesheet? } @@ -1064,33 +1090,40 @@ static void rna_def_space_graph(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "mode"); RNA_def_property_enum_items(prop, mode_items); RNA_def_property_ui_text(prop, "Mode", "Editing context being displayed."); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL); /* display */ prop= RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_DRAWTIME); RNA_def_property_clear_flag(prop, PROP_EDITABLE); // XXX for now, only set with operator RNA_def_property_ui_text(prop, "Show Seconds", "Show timing in seconds not frames."); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL); prop= RNA_def_property(srna, "show_cframe_indicator", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_NODRAWCFRANUM); RNA_def_property_ui_text(prop, "Show Frame Number Indicator", "Show frame number beside the current frame indicator line."); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL); prop= RNA_def_property(srna, "show_sliders", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_SLIDERS); RNA_def_property_ui_text(prop, "Show Sliders", "Show sliders beside F-Curve channels."); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL); prop= RNA_def_property(srna, "show_handles", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_NOHANDLES); RNA_def_property_ui_text(prop, "Show Handles", "Show handles of Bezier control points."); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL); prop= RNA_def_property(srna, "only_selected_curves_handles", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_SELCUVERTSONLY); RNA_def_property_ui_text(prop, "Only Selected Curve Keyframes", "Only keyframes of selected F-Curves are visible and editable."); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL); /* editing */ prop= RNA_def_property(srna, "automerge_keyframes", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_NOTRANSKEYCULL); RNA_def_property_ui_text(prop, "AutoMerge Keyframes", "Show handles of Bezier control points."); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL); // TODO... autosnap, dopesheet? } @@ -1109,14 +1142,17 @@ static void rna_def_space_nla(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", SNLA_DRAWTIME); RNA_def_property_clear_flag(prop, PROP_EDITABLE); // XXX for now, only set with operator RNA_def_property_ui_text(prop, "Show Seconds", "Show timing in seconds not frames."); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NLA, NULL); prop= RNA_def_property(srna, "show_cframe_indicator", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SNLA_NODRAWCFRANUM); RNA_def_property_ui_text(prop, "Show Frame Number Indicator", "Show frame number beside the current frame indicator line."); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NLA, NULL); prop= RNA_def_property(srna, "show_strip_curves", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SNLA_NOSTRIPCURVES); RNA_def_property_ui_text(prop, "Show Control Curves", "Show influence curves on strips."); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NLA, NULL); /* editing */ // TODO... autosnap, dopesheet? @@ -1136,43 +1172,44 @@ static void rna_def_space_time(BlenderRNA *brna) prop= RNA_def_property(srna, "play_top_left", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "redraws", TIME_REGION); RNA_def_property_ui_text(prop, "Top-Left 3D Window", ""); - RNA_def_property_update(prop, 0, "rna_SpaceTime_redraw_update"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_SpaceTime_redraw_update"); prop= RNA_def_property(srna, "play_all_3d", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "redraws", TIME_ALL_3D_WIN); RNA_def_property_ui_text(prop, "All 3D Windows", ""); - RNA_def_property_update(prop, 0, "rna_SpaceTime_redraw_update"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_SpaceTime_redraw_update"); prop= RNA_def_property(srna, "play_anim", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "redraws", TIME_ALL_ANIM_WIN); RNA_def_property_ui_text(prop, "Animation Windows", ""); - RNA_def_property_update(prop, 0, "rna_SpaceTime_redraw_update"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_SpaceTime_redraw_update"); prop= RNA_def_property(srna, "play_buttons", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "redraws", TIME_ALL_BUTS_WIN); RNA_def_property_ui_text(prop, "Properties Windows", ""); - RNA_def_property_update(prop, 0, "rna_SpaceTime_redraw_update"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_SpaceTime_redraw_update"); prop= RNA_def_property(srna, "play_image", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "redraws", TIME_ALL_IMAGE_WIN); RNA_def_property_ui_text(prop, "Image Windows", ""); - RNA_def_property_update(prop, 0, "rna_SpaceTime_redraw_update"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_SpaceTime_redraw_update"); prop= RNA_def_property(srna, "play_sequencer", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "redraws", TIME_SEQ); RNA_def_property_ui_text(prop, "Sequencer Windows", ""); - RNA_def_property_update(prop, 0, "rna_SpaceTime_redraw_update"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_SpaceTime_redraw_update"); /* Other options */ prop= RNA_def_property(srna, "continue_physics", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "redraws", TIME_CONTINUE_PHYSICS); RNA_def_property_ui_text(prop, "Continue Physics", "During playblack, continue physics simulations regardless of the frame number"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, NULL); prop= RNA_def_property(srna, "only_selected", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", TIME_ONLYACTSEL); RNA_def_property_ui_text(prop, "Only Selected channels", "Show keyframes only from active/selected channels."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, NULL); } static void rna_def_console_line(BlenderRNA *brna) @@ -1182,15 +1219,17 @@ static void rna_def_console_line(BlenderRNA *brna) srna = RNA_def_struct(brna, "ConsoleLine", NULL); RNA_def_struct_ui_text(srna, "Console Input", "Input line for the interactive console."); + // XXX using non-inited "prop", uh? RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE, NULL); prop= RNA_def_property(srna, "line", PROP_STRING, PROP_NONE); RNA_def_property_string_funcs(prop, "rna_ConsoleLine_line_get", "rna_ConsoleLine_line_length", "rna_ConsoleLine_line_set"); RNA_def_property_ui_text(prop, "Line", "Text in the line."); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE, NULL); prop= RNA_def_property(srna, "current_character", PROP_INT, PROP_NONE); /* copied from text editor */ RNA_def_property_int_sdna(prop, NULL, "cursor"); RNA_def_property_int_funcs(prop, NULL, NULL, "rna_ConsoleLine_cursor_index_range"); - + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE, NULL); } static EnumPropertyItem console_type_items[] = { @@ -1212,39 +1251,39 @@ static void rna_def_space_console(BlenderRNA *brna) RNA_def_property_int_sdna(prop, NULL, "lheight"); RNA_def_property_range(prop, 8, 32); RNA_def_property_ui_text(prop, "Font Size", "Font size to use for displaying the text."); - RNA_def_property_update(prop, NC_CONSOLE | ND_CONSOLE, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE, NULL); prop= RNA_def_property(srna, "console_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "type"); RNA_def_property_enum_items(prop, console_type_items); RNA_def_property_ui_text(prop, "Type", "Console type."); - RNA_def_property_update(prop, NC_CONSOLE | ND_CONSOLE, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE, NULL); /* reporting display */ prop= RNA_def_property(srna, "show_report_debug", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "rpt_mask", CONSOLE_RPT_DEBUG); RNA_def_property_ui_text(prop, "Show Debug", "Display debug reporting info."); - RNA_def_property_update(prop, NC_CONSOLE | ND_CONSOLE_REPORT, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE_REPORT, NULL); prop= RNA_def_property(srna, "show_report_info", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "rpt_mask", CONSOLE_RPT_INFO); RNA_def_property_ui_text(prop, "Show Info", "Display general information."); - RNA_def_property_update(prop, NC_CONSOLE | ND_CONSOLE_REPORT, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE_REPORT, NULL); prop= RNA_def_property(srna, "show_report_operator", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "rpt_mask", CONSOLE_RPT_OP); RNA_def_property_ui_text(prop, "Show Operator", "Display the operator log."); - RNA_def_property_update(prop, NC_CONSOLE | ND_CONSOLE_REPORT, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE_REPORT, NULL); prop= RNA_def_property(srna, "show_report_warn", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "rpt_mask", CONSOLE_RPT_WARN); RNA_def_property_ui_text(prop, "Show Warn", "Display warnings."); - RNA_def_property_update(prop, NC_CONSOLE | ND_CONSOLE_REPORT, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE_REPORT, NULL); prop= RNA_def_property(srna, "show_report_error", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "rpt_mask", CONSOLE_RPT_ERR); RNA_def_property_ui_text(prop, "Show Error", "Display error text."); - RNA_def_property_update(prop, NC_CONSOLE | ND_CONSOLE_REPORT, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE_REPORT, NULL); @@ -1292,82 +1331,82 @@ static void rna_def_fileselect_params(BlenderRNA *brna) prop= RNA_def_property(srna, "directory", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "dir"); RNA_def_property_ui_text(prop, "Directory", "Directory displayed in the file browser."); - RNA_def_property_update(prop, NC_FILE | ND_PARAMS, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL); prop= RNA_def_property(srna, "file", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "file"); RNA_def_property_ui_text(prop, "File Name", "Active file in the file browser."); - RNA_def_property_update(prop, NC_FILE | ND_PARAMS, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL); prop= RNA_def_property(srna, "display", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "display"); RNA_def_property_enum_items(prop, file_display_items); RNA_def_property_ui_text(prop, "Display Mode", "Display mode for the file list"); - RNA_def_property_update(prop, NC_FILE | ND_PARAMS, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL); prop= RNA_def_property(srna, "do_filter", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", FILE_FILTER); RNA_def_property_ui_text(prop, "Filter Files", "Enable filtering of files."); - RNA_def_property_update(prop, NC_FILE | ND_FILELIST, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_LIST, NULL); prop= RNA_def_property(srna, "hide_dot", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", FILE_HIDE_DOT); RNA_def_property_ui_text(prop, "Hide Dot Files", "Hide hidden dot files."); - RNA_def_property_update(prop, NC_FILE | ND_FILELIST , NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_LIST , NULL); prop= RNA_def_property(srna, "sort", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "sort"); RNA_def_property_enum_items(prop, file_sort_items); RNA_def_property_ui_text(prop, "Sort", ""); - RNA_def_property_update(prop, NC_FILE | ND_PARAMS, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL); prop= RNA_def_property(srna, "filter_image", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "filter", IMAGEFILE); RNA_def_property_ui_text(prop, "Filter Images", "Show image files."); RNA_def_property_ui_icon(prop, ICON_FILE_IMAGE, 0); - RNA_def_property_update(prop, NC_FILE | ND_FILELIST, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_LIST, NULL); prop= RNA_def_property(srna, "filter_blender", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "filter", BLENDERFILE); RNA_def_property_ui_text(prop, "Filter Blender", "Show .blend files."); RNA_def_property_ui_icon(prop, ICON_FILE_BLEND, 0); - RNA_def_property_update(prop, NC_FILE | ND_FILELIST, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_LIST, NULL); prop= RNA_def_property(srna, "filter_movie", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "filter", MOVIEFILE); RNA_def_property_ui_text(prop, "Filter Movies", "Show movie files."); RNA_def_property_ui_icon(prop, ICON_FILE_MOVIE, 0); - RNA_def_property_update(prop, NC_FILE | ND_FILELIST, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_LIST, NULL); prop= RNA_def_property(srna, "filter_script", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "filter", PYSCRIPTFILE); RNA_def_property_ui_text(prop, "Filter Script", "Show script files."); RNA_def_property_ui_icon(prop, ICON_FILE_SCRIPT, 0); - RNA_def_property_update(prop, NC_FILE | ND_FILELIST, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_LIST, NULL); prop= RNA_def_property(srna, "filter_font", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "filter", FTFONTFILE); RNA_def_property_ui_text(prop, "Filter Fonts", "Show font files."); RNA_def_property_ui_icon(prop, ICON_FILE_FONT, 0); - RNA_def_property_update(prop, NC_FILE | ND_FILELIST, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_LIST, NULL); prop= RNA_def_property(srna, "filter_sound", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "filter", SOUNDFILE); RNA_def_property_ui_text(prop, "Filter Sound", "Show sound files."); RNA_def_property_ui_icon(prop, ICON_FILE_SOUND, 0); - RNA_def_property_update(prop, NC_FILE | ND_FILELIST, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_LIST, NULL); prop= RNA_def_property(srna, "filter_text", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "filter", TEXTFILE); RNA_def_property_ui_text(prop, "Filter Text", "Show text files."); RNA_def_property_ui_icon(prop, ICON_FILE_BLANK, 0); - RNA_def_property_update(prop, NC_FILE | ND_FILELIST, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_LIST, NULL); prop= RNA_def_property(srna, "filter_folder", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "filter", FOLDERFILE); RNA_def_property_ui_text(prop, "Filter Folder", "Show folders."); RNA_def_property_ui_icon(prop, ICON_FILE_FOLDER, 0); - RNA_def_property_update(prop, NC_FILE | ND_FILELIST, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_LIST, NULL); } @@ -1430,13 +1469,13 @@ static void rna_def_space_node(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "treetype"); RNA_def_property_enum_items(prop, tree_type_items); RNA_def_property_ui_text(prop, "Tree Type", "Node tree type to display and edit."); - RNA_def_property_update(prop, NC_NODE, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NODE, NULL); prop= RNA_def_property(srna, "texture_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "texfrom"); RNA_def_property_enum_items(prop, texture_type_items); RNA_def_property_ui_text(prop, "Texture Type", "Type of data to take texture from."); - RNA_def_property_update(prop, NC_NODE, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NODE, NULL); prop= RNA_def_property(srna, "id", PROP_POINTER, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); @@ -1454,7 +1493,7 @@ static void rna_def_space_node(BlenderRNA *brna) prop= RNA_def_property(srna, "backdrop", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SNODE_BACKDRAW); RNA_def_property_ui_text(prop, "Backdrop", "Use active Viewer Node output as backdrop for compositing nodes."); - RNA_def_property_update(prop, NC_NODE, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NODE, NULL); } static void rna_def_space_logic(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_test.c b/source/blender/makesrna/intern/rna_test.c new file mode 100644 index 00000000000..988c8f8a539 --- /dev/null +++ b/source/blender/makesrna/intern/rna_test.c @@ -0,0 +1,188 @@ +/** + * $Id$ + * + * ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * Contributor(s): Arystanbek Dyussenov + * + * ***** END GPL LICENSE BLOCK ***** + */ + +/* Defines a structure with properties used for array manipulation tests in BPY. */ + +#include <stdlib.h> +#include <string.h> + +#include "RNA_define.h" +#include "RNA_types.h" + +#include "rna_internal.h" + +#define ARRAY_SIZE 3 +#define DYNAMIC_ARRAY_SIZE 64 +#define MARRAY_DIM [3][4][5] +#define MARRAY_TOTDIM 3 +#define MARRAY_DIMSIZE 4, 5 +#define MARRAY_SIZE(type) (sizeof(type MARRAY_DIM) / sizeof(type)) +#define DYNAMIC_MARRAY_DIM [3][4][5] +#define DYNAMIC_MARRAY_SIZE(type) (sizeof(type DYNAMIC_MARRAY_DIM) / sizeof(type)) + +#ifdef RNA_RUNTIME + +#ifdef UNIT_TEST + +#define DEF_VARS(type, prefix) \ + static type prefix ## arr[ARRAY_SIZE]; \ + static type prefix ## darr[DYNAMIC_ARRAY_SIZE]; \ + static int prefix ## darr_len= ARRAY_SIZE; \ + static type prefix ## marr MARRAY_DIM; \ + static type prefix ## dmarr DYNAMIC_MARRAY_DIM; \ + static int prefix ## dmarr_len= sizeof(prefix ## dmarr); + +#define DEF_GET_SET(type, arr) \ + void rna_Test_ ## arr ## _get(PointerRNA *ptr, type *values) \ + { \ + memcpy(values, arr, sizeof(arr)); \ + } \ + \ + void rna_Test_ ## arr ## _set(PointerRNA *ptr, const type *values) \ + { \ + memcpy(arr, values, sizeof(arr)); \ + } + +#define DEF_GET_SET_LEN(arr, max) \ + static int rna_Test_ ## arr ## _get_length(PointerRNA *ptr) \ + { \ + return arr ## _len; \ + } \ + \ + static int rna_Test_ ## arr ## _set_length(PointerRNA *ptr, int length) \ + { \ + if (length > max) \ + return 0; \ + \ + arr ## _len= length; \ + \ + return 1; \ + } \ + +DEF_VARS(float, f) +DEF_VARS(int, i) +DEF_VARS(int, b) + +DEF_GET_SET(float, farr) +DEF_GET_SET(int, iarr) +DEF_GET_SET(int, barr) + +DEF_GET_SET(float, fmarr) +DEF_GET_SET(int, imarr) +DEF_GET_SET(int, bmarr) + +DEF_GET_SET(float, fdarr) +DEF_GET_SET_LEN(fdarr, DYNAMIC_ARRAY_SIZE) +DEF_GET_SET(int, idarr) +DEF_GET_SET_LEN(idarr, DYNAMIC_ARRAY_SIZE) +DEF_GET_SET(int, bdarr) +DEF_GET_SET_LEN(bdarr, DYNAMIC_ARRAY_SIZE) + +DEF_GET_SET(float, fdmarr) +DEF_GET_SET_LEN(fdmarr, DYNAMIC_MARRAY_SIZE(float)) +DEF_GET_SET(int, idmarr) +DEF_GET_SET_LEN(idmarr, DYNAMIC_MARRAY_SIZE(int)) +DEF_GET_SET(int, bdmarr) +DEF_GET_SET_LEN(bdmarr, DYNAMIC_MARRAY_SIZE(int)) + +#endif + +#else + +void RNA_def_test(BlenderRNA *brna) +{ +#ifdef UNIT_TEST + StructRNA *srna; + PropertyRNA *prop; + unsigned short dimsize[]= {MARRAY_DIMSIZE}; + + srna= RNA_def_struct(brna, "Test", NULL); + RNA_def_struct_sdna(srna, "Test"); + + prop= RNA_def_float_array(srna, "farr", ARRAY_SIZE, NULL, 0.0f, 0.0f, "farr", "float array", 0.0f, 0.0f); + RNA_def_property_float_funcs(prop, "rna_Test_farr_get", "rna_Test_farr_set", NULL); + + prop= RNA_def_int_array(srna, "iarr", ARRAY_SIZE, NULL, 0, 0, "iarr", "int array", 0, 0); + RNA_def_property_int_funcs(prop, "rna_Test_iarr_get", "rna_Test_iarr_set", NULL); + + prop= RNA_def_boolean_array(srna, "barr", ARRAY_SIZE, NULL, "barr", "boolean array"); + RNA_def_property_boolean_funcs(prop, "rna_Test_barr_get", "rna_Test_barr_set"); + + /* dynamic arrays */ + + prop= RNA_def_float_array(srna, "fdarr", DYNAMIC_ARRAY_SIZE, NULL, 0.0f, 0.0f, "fdarr", "dynamic float array", 0.0f, 0.0f); + RNA_def_property_flag(prop, PROP_DYNAMIC); + RNA_def_property_dynamic_array_funcs(prop, "rna_Test_fdarr_get_length", "rna_Test_fdarr_set_length"); + RNA_def_property_float_funcs(prop, "rna_Test_fdarr_get", "rna_Test_fdarr_set", NULL); + + prop= RNA_def_int_array(srna, "idarr", DYNAMIC_ARRAY_SIZE, NULL, 0, 0, "idarr", "int array", 0, 0); + RNA_def_property_flag(prop, PROP_DYNAMIC); + RNA_def_property_dynamic_array_funcs(prop, "rna_Test_idarr_get_length", "rna_Test_idarr_set_length"); + RNA_def_property_int_funcs(prop, "rna_Test_idarr_get", "rna_Test_idarr_set", NULL); + + prop= RNA_def_boolean_array(srna, "bdarr", DYNAMIC_ARRAY_SIZE, NULL, "bdarr", "boolean array"); + RNA_def_property_flag(prop, PROP_DYNAMIC); + RNA_def_property_dynamic_array_funcs(prop, "rna_Test_bdarr_get_length", "rna_Test_bdarr_set_length"); + RNA_def_property_boolean_funcs(prop, "rna_Test_bdarr_get", "rna_Test_bdarr_set"); + + /* multidimensional arrays */ + + prop= RNA_def_property(srna, "fmarr", PROP_FLOAT, PROP_NONE); + RNA_def_property_multidimensional_array(prop, MARRAY_SIZE(float), MARRAY_TOTDIM, dimsize); + RNA_def_property_float_funcs(prop, "rna_Test_fmarr_get", "rna_Test_fmarr_set", NULL); + + prop= RNA_def_property(srna, "imarr", PROP_INT, PROP_NONE); + RNA_def_property_multidimensional_array(prop, MARRAY_SIZE(int), MARRAY_TOTDIM, dimsize); + RNA_def_property_int_funcs(prop, "rna_Test_imarr_get", "rna_Test_imarr_set", NULL); + + prop= RNA_def_property(srna, "bmarr", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_multidimensional_array(prop, MARRAY_SIZE(int), MARRAY_TOTDIM, dimsize); + RNA_def_property_boolean_funcs(prop, "rna_Test_bmarr_get", "rna_Test_bmarr_set"); + + /* dynamic multidimensional arrays */ + + prop= RNA_def_property(srna, "fdmarr", PROP_FLOAT, PROP_NONE); + RNA_def_property_multidimensional_array(prop, DYNAMIC_MARRAY_SIZE(float), MARRAY_TOTDIM, dimsize); + RNA_def_property_flag(prop, PROP_DYNAMIC); + RNA_def_property_dynamic_array_funcs(prop, "rna_Test_fdmarr_get_length", "rna_Test_fdmarr_set_length"); + RNA_def_property_float_funcs(prop, "rna_Test_fdmarr_get", "rna_Test_fdmarr_set", NULL); + + prop= RNA_def_property(srna, "idmarr", PROP_INT, PROP_NONE); + RNA_def_property_multidimensional_array(prop, DYNAMIC_MARRAY_SIZE(int), MARRAY_TOTDIM, dimsize); + RNA_def_property_flag(prop, PROP_DYNAMIC); + RNA_def_property_dynamic_array_funcs(prop, "rna_Test_idmarr_get_length", "rna_Test_idmarr_set_length"); + RNA_def_property_int_funcs(prop, "rna_Test_idmarr_get", "rna_Test_idmarr_set", NULL); + + prop= RNA_def_property(srna, "bdmarr", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_multidimensional_array(prop, DYNAMIC_MARRAY_SIZE(int), MARRAY_TOTDIM, dimsize); + RNA_def_property_flag(prop, PROP_DYNAMIC); + RNA_def_property_dynamic_array_funcs(prop, "rna_Test_bdmarr_get_length", "rna_Test_bdmarr_set_length"); + RNA_def_property_boolean_funcs(prop, "rna_Test_bdmarr_get", "rna_Test_bdmarr_set"); + +#endif +} + +#endif /* RNA_RUNTIME */ + + diff --git a/source/blender/makesrna/intern/rna_text.c b/source/blender/makesrna/intern/rna_text.c index cd39c317bc5..22cf7e7aeae 100644 --- a/source/blender/makesrna/intern/rna_text.c +++ b/source/blender/makesrna/intern/rna_text.c @@ -223,6 +223,8 @@ static void rna_def_text(BlenderRNA *brna) prop= RNA_def_property(srna, "markers", PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_type(prop, "TextMarker"); RNA_def_property_ui_text(prop, "Markers", "Text markers highlighting part of the text."); + + RNA_api_text(srna); } void RNA_def_text(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_text_api.c b/source/blender/makesrna/intern/rna_text_api.c new file mode 100644 index 00000000000..b048a6b59d0 --- /dev/null +++ b/source/blender/makesrna/intern/rna_text_api.c @@ -0,0 +1,49 @@ +/** + * + * ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * Contributor(s): Campbell Barton + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include <stdlib.h> +#include <stdio.h> + + +#include "RNA_define.h" +#include "RNA_types.h" + +#ifdef RNA_RUNTIME + +#else + +void RNA_api_text(StructRNA *srna) +{ + FunctionRNA *func; + PropertyRNA *prop; + + func= RNA_def_function(srna, "clear", "clear_text"); + RNA_def_function_ui_description(func, "clear the text block."); + + func= RNA_def_function(srna, "write", "write_text"); + RNA_def_function_ui_description(func, "write text at the cursor location and advance to the end of the text block."); + prop= RNA_def_string(func, "text", "Text", 0, "", "New text for this datablock."); + RNA_def_property_flag(prop, PROP_REQUIRED); +} + +#endif diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c index a949d26f51a..7a81138a3be 100644 --- a/source/blender/makesrna/intern/rna_texture.c +++ b/source/blender/makesrna/intern/rna_texture.c @@ -55,7 +55,7 @@ static EnumPropertyItem texture_filter_items[] = { #include "BKE_texture.h" #include "ED_node.h" -StructRNA *rna_Texture_refine(struct PointerRNA *ptr) +static StructRNA *rna_Texture_refine(struct PointerRNA *ptr) { Tex *tex= (Tex*)ptr->data; @@ -202,7 +202,7 @@ static void rna_Texture_use_color_ramp_set(PointerRNA *ptr, int value) tex->coba= add_colorband(0); } -void rna_Texture_use_nodes_set(PointerRNA *ptr, int v) +static void rna_Texture_use_nodes_set(PointerRNA *ptr, int v) { Tex *tex= (Tex*)ptr->data; @@ -374,6 +374,8 @@ static void rna_def_mtex(BlenderRNA *brna) {MTEX_BLEND_SAT, "SATURATION", 0, "Saturation", ""}, {MTEX_BLEND_VAL, "VALUE", 0, "Value", ""}, {MTEX_BLEND_COLOR, "COLOR", 0, "Color", ""}, + {MTEX_SOFT_LIGHT, "SOFT LIGHT", 0, "Soft Light", ""}, + {MTEX_LIN_LIGHT , "LINEAR LIGHT", 0, "Linear Light", ""}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem prop_map_mode_items[] = { @@ -833,6 +835,11 @@ static void rna_def_texture_blend(BlenderRNA *brna) {TEX_RAD, "RADIAL", 0, "Radial", "Creates a radial progression"}, {0, NULL, 0, NULL, NULL}}; + static const EnumPropertyItem prop_flip_axis_items[]= { + {0, "HORIZONTAL", 0, "Horizontal", "Flips the texture's X and Y axis"}, + {TEX_FLIPBLEND, "VERTICAL", 0, "Vertical", "Flips the texture's X and Y axis"}, + {0, NULL, 0, NULL, NULL}}; + srna= RNA_def_struct(brna, "BlendTexture", "Texture"); RNA_def_struct_ui_text(srna, "Blend Texture", "Procedural color blending texture."); RNA_def_struct_sdna(srna, "Tex"); @@ -843,10 +850,12 @@ static void rna_def_texture_blend(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Progression", "Sets the style of the color blending"); RNA_def_property_update(prop, NC_TEXTURE, NULL); - prop= RNA_def_property(srna, "flip_axis", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_FLIPBLEND); + prop= RNA_def_property(srna, "flip_axis", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); + RNA_def_property_enum_items(prop, prop_flip_axis_items); RNA_def_property_ui_text(prop, "Flip Axis", "Flips the texture's X and Y axis"); RNA_def_property_update(prop, NC_TEXTURE, NULL); + } static void rna_def_texture_stucci(BlenderRNA *brna) @@ -1293,7 +1302,7 @@ static void rna_def_texture_distorted_noise(BlenderRNA *brna) RNA_def_struct_ui_text(srna, "Distorted Noise", "Procedural distorted noise texture."); RNA_def_struct_sdna(srna, "Tex"); - prop= RNA_def_property(srna, "distortion_amount", PROP_FLOAT, PROP_NONE); + prop= RNA_def_property(srna, "distortion", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "dist_amount"); RNA_def_property_range(prop, 0, 10); RNA_def_property_ui_text(prop, "Distortion Amount", ""); @@ -1333,8 +1342,21 @@ static void rna_def_texture_pointdensity(BlenderRNA *brna) static EnumPropertyItem point_source_items[] = { {TEX_PD_PSYS, "PARTICLE_SYSTEM", 0, "Particle System", "Generate point density from a particle system"}, {TEX_PD_OBJECT, "OBJECT", 0, "Object Vertices", "Generate point density from an object's vertices"}, + //{TEX_PD_FILE, "FILE", 0 , "File", ""}, {0, NULL, 0, NULL, NULL}}; + static EnumPropertyItem particle_cache_items[] = { + {TEX_PD_OBJECTLOC, "OBJECT_LOCATION", 0, "Emit Object Location", ""}, + {TEX_PD_OBJECTSPACE, "OBJECT_SPACE", 0, "Emit Object Space", ""}, + {TEX_PD_WORLDSPACE, "WORLD_SPACE", 0 , "Global Space", ""}, + {0, NULL, 0, NULL, NULL}}; + + static EnumPropertyItem vertice_cache_items[] = { + {TEX_PD_OBJECTLOC, "OBJECT_LOCATION", 0, "Object Location", ""}, + {TEX_PD_OBJECTSPACE, "OBJECT_SPACE", 0, "Object Space", ""}, + {TEX_PD_WORLDSPACE, "WORLD_SPACE", 0 , "Global Space", ""}, + {0, NULL, 0, NULL, NULL}}; + static EnumPropertyItem falloff_items[] = { {TEX_PD_FALLOFF_STD, "STANDARD", 0, "Standard", ""}, {TEX_PD_FALLOFF_SMOOTH, "SMOOTH", 0, "Smooth", ""}, @@ -1354,7 +1376,7 @@ static void rna_def_texture_pointdensity(BlenderRNA *brna) {TEX_PD_NOISE_STATIC, "STATIC", 0, "Static", "Noise patterns will remain unchanged, faster and suitable for stills"}, {TEX_PD_NOISE_VEL, "PARTICLE_VELOCITY", 0, "Particle Velocity", "Turbulent noise driven by particle velocity"}, {TEX_PD_NOISE_AGE, "PARTICLE_AGE", 0, "Particle Age", "Turbulent noise driven by the particle's age between birth and death"}, - {TEX_PD_NOISE_TIME, "GLOBAL_TIME", 0, "Global Time", "Turbulent noise driven by the global current frame"}, + {TEX_PD_NOISE_TIME, "GLOBAL_TIME", 0, "Global Time", "Turbulent noise driven by the global current frame"}, {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "PointDensity", NULL); @@ -1380,6 +1402,18 @@ static void rna_def_texture_pointdensity(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_update(prop, NC_TEXTURE, NULL); + prop= RNA_def_property(srna, "particle_cache", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "psys_cache_space"); + RNA_def_property_enum_items(prop, particle_cache_items); + RNA_def_property_ui_text(prop, "Particle Cache", "Co-ordinate system to cache particles in"); + RNA_def_property_update(prop, NC_TEXTURE, NULL); + + prop= RNA_def_property(srna, "vertices_cache", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "ob_cache_space"); + RNA_def_property_enum_items(prop, vertice_cache_items); + RNA_def_property_ui_text(prop, "Vertices Cache", "Co-ordinate system to cache vertices in"); + RNA_def_property_update(prop, NC_TEXTURE, NULL); + prop= RNA_def_property(srna, "radius", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "radius"); RNA_def_property_range(prop, 0.01, FLT_MAX); @@ -1404,6 +1438,19 @@ static void rna_def_texture_pointdensity(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Color Source", "Data to derive color results from"); RNA_def_property_update(prop, NC_TEXTURE, NULL); + prop= RNA_def_property(srna, "speed_scale", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "speed_scale"); + RNA_def_property_range(prop, 0.001, 100.0); + RNA_def_property_ui_text(prop, "Scale", "Multipler to bring particle speed within an acceptable range"); + RNA_def_property_update(prop, NC_TEXTURE, NULL); + + prop= RNA_def_property(srna, "color_ramp", PROP_POINTER, PROP_NEVER_NULL); + RNA_def_property_pointer_sdna(prop, NULL, "coba"); + RNA_def_property_struct_type(prop, "ColorRamp"); + RNA_def_property_ui_text(prop, "Color Ramp", ""); + RNA_def_property_update(prop, NC_TEXTURE, NULL); + + /* Turbulence */ prop= RNA_def_property(srna, "turbulence", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_PD_TURBULENCE); RNA_def_property_ui_text(prop, "Turbulence", "Add directed noise to the density at render-time"); @@ -1415,6 +1462,12 @@ static void rna_def_texture_pointdensity(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Size", "Scale of the added turbulent noise"); RNA_def_property_update(prop, NC_TEXTURE, NULL); + prop= RNA_def_property(srna, "turbulence_strength", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "noise_fac"); + RNA_def_property_range(prop, 0.01, FLT_MAX); + RNA_def_property_ui_text(prop, "Strength", ""); + RNA_def_property_update(prop, NC_TEXTURE, NULL); + prop= RNA_def_property(srna, "turbulence_depth", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "noise_depth"); RNA_def_property_range(prop, 0, INT_MAX); @@ -1426,9 +1479,14 @@ static void rna_def_texture_pointdensity(BlenderRNA *brna) RNA_def_property_enum_items(prop, turbulence_influence_items); RNA_def_property_ui_text(prop, "Turbulence Influence", "Method for driving added turbulent noise"); RNA_def_property_update(prop, NC_TEXTURE, NULL); - - + prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "noise_basis"); + RNA_def_property_enum_items(prop, prop_noise_basis_items); + RNA_def_property_ui_text(prop, "Noise Basis", "Noise formula used for tubulence"); + RNA_def_property_update(prop, NC_TEXTURE, NULL); + + srna= RNA_def_struct(brna, "PointDensityTexture", "Texture"); RNA_def_struct_sdna(srna, "Tex"); RNA_def_struct_ui_text(srna, "Point Density", "Settings for the Point Density texture"); @@ -1447,13 +1505,16 @@ static void rna_def_texture_voxeldata(BlenderRNA *brna) static EnumPropertyItem interpolation_type_items[] = { {TEX_VD_NEARESTNEIGHBOR, "NEREASTNEIGHBOR", 0, "Nearest Neighbor", "No interpolation, fast but blocky and low quality."}, - {TEX_VD_LINEAR, "TRILINEAR", 0, "Trilinear", "Good smoothness and speed"}, - {TEX_VD_TRICUBIC, "TRICUBIC", 0, "Tricubic", "High quality interpolation, but slow"}, + {TEX_VD_LINEAR, "TRILINEAR", 0, "Linear", "Good smoothness and speed"}, + {TEX_VD_QUADRATIC, "QUADRATIC", 0, "Quadratic", "Mid-range quality and speed"}, + {TEX_VD_TRICUBIC_CATROM, "TRICUBIC_CATROM", 0, "Cubic Catmull-Rom", "High quality interpolation, but slower"}, + {TEX_VD_TRICUBIC_BSPLINE, "TRICUBIC_BSPLINE", 0, "Cubic B-Spline", "Smoothed high quality interpolation, but slower"}, {0, NULL, 0, NULL, NULL}}; - + static EnumPropertyItem file_format_items[] = { {TEX_VD_BLENDERVOXEL, "BLENDER_VOXEL", 0, "Blender Voxel", "Default binary voxel file format"}, {TEX_VD_RAW_8BIT, "RAW_8BIT", 0, "8 bit RAW", "8 bit greyscale binary data"}, + //{TEX_VD_RAW_16BIT, "RAW_16BIT", 0, "16 bit RAW", ""}, {TEX_VD_IMAGE_SEQUENCE, "IMAGE_SEQUENCE", 0, "Image Sequence", "Generate voxels from a sequence of image slices"}, {TEX_VD_SMOKE, "SMOKE", 0, "Smoke", "Render voxels from a Blender smoke simulation"}, {0, NULL, 0, NULL, NULL}}; diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c index 7fc2d75a708..e3cae8ab453 100644 --- a/source/blender/makesrna/intern/rna_ui_api.c +++ b/source/blender/makesrna/intern/rna_ui_api.c @@ -37,14 +37,15 @@ #ifdef RNA_RUNTIME -static void rna_uiItemR(uiLayout *layout, char *name, int icon, PointerRNA *ptr, char *propname, int expand, int slider, int toggle) +static void rna_uiItemR(uiLayout *layout, char *name, int icon, PointerRNA *ptr, char *propname, int expand, int slider, int toggle, int icon_only) { int flag= 0; flag |= (slider)? UI_ITEM_R_SLIDER: 0; flag |= (expand)? UI_ITEM_R_EXPAND: 0; flag |= (toggle)? UI_ITEM_R_TOGGLE: 0; - + flag |= (icon_only)? UI_ITEM_R_ICON_ONLY: 0; + uiItemR(layout, name, icon, ptr, propname, flag); } @@ -145,6 +146,7 @@ void RNA_api_ui_layout(StructRNA *srna) RNA_def_boolean(func, "expand", 0, "", "Expand button to show more detail."); RNA_def_boolean(func, "slider", 0, "", "Use slider widget for numeric values."); RNA_def_boolean(func, "toggle", 0, "", "Use toggle widget for boolean values."); + RNA_def_boolean(func, "icon_only", 0, "", "Only show the property's icon, with no text"); func= RNA_def_function(srna, "items_enumR", "uiItemsEnumR"); api_ui_item_rna_common(func); @@ -247,6 +249,7 @@ void RNA_api_ui_layout(StructRNA *srna) RNA_def_function_flag(func, FUNC_USE_CONTEXT); api_ui_item_rna_common(func); RNA_def_string(func, "new", "", 0, "", "Operator identifier to create a new ID block."); + RNA_def_string(func, "open", "", 0, "", "Operator identifier to open a file for creating a new ID block."); RNA_def_string(func, "unlink", "", 0, "", "Operator identifier to unlink the ID block."); func= RNA_def_function(srna, "template_modifier", "uiTemplateModifier"); diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index d169edd65dd..fc66c04ee26 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -33,6 +33,7 @@ #include "DNA_space_types.h" #include "DNA_userdef_types.h" +#include "WM_api.h" #include "WM_types.h" #include "BKE_utildefines.h" @@ -41,7 +42,12 @@ #ifdef RNA_RUNTIME -static void rna_userdef_lmb_select_set(struct PointerRNA *ptr,int value) +static void rna_userdef_update(bContext *C, PointerRNA *ptr) +{ + WM_event_add_notifier(C, NC_WINDOW, NULL); +} + +static void rna_userdef_lmb_select_set(PointerRNA *ptr,int value) { UserDef *userdef = (UserDef*)ptr->data; @@ -53,12 +59,12 @@ static void rna_userdef_lmb_select_set(struct PointerRNA *ptr,int value) userdef->flag &= ~USER_LMOUSESELECT; } -static void rna_userdef_rmb_select_set(struct PointerRNA *ptr,int value) +static void rna_userdef_rmb_select_set(PointerRNA *ptr,int value) { rna_userdef_lmb_select_set(ptr, !value); } -static void rna_userdef_emulate_set(struct PointerRNA *ptr,int value) +static void rna_userdef_emulate_set(PointerRNA *ptr,int value) { UserDef *userdef = (UserDef*)ptr->data; @@ -68,7 +74,7 @@ static void rna_userdef_emulate_set(struct PointerRNA *ptr,int value) userdef->flag ^= USER_TWOBUTTONMOUSE; } -static int rna_userdef_autokeymode_get(struct PointerRNA *ptr) +static int rna_userdef_autokeymode_get(PointerRNA *ptr) { UserDef *userdef = (UserDef*)ptr->data; short retval = userdef->autokey_mode; @@ -79,7 +85,7 @@ static int rna_userdef_autokeymode_get(struct PointerRNA *ptr) return retval; } -static void rna_userdef_autokeymode_set(struct PointerRNA *ptr,int value) +static void rna_userdef_autokeymode_set(PointerRNA *ptr,int value) { UserDef *userdef = (UserDef*)ptr->data; @@ -142,38 +148,38 @@ static void rna_def_userdef_theme_ui_font_style(BlenderRNA *brna) prop= RNA_def_property(srna, "points", PROP_INT, PROP_NONE); RNA_def_property_range(prop, 6, 48); RNA_def_property_ui_text(prop, "Points", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "font_kerning_style", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "kerning"); RNA_def_property_enum_items(prop, font_kerning_style); RNA_def_property_ui_text(prop, "Kerning Style", "Which style to use for font kerning."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "shadow", PROP_INT, PROP_NONE); RNA_def_property_range(prop, 0, 5); RNA_def_property_ui_text(prop, "Shadow Size", "Shadow size in pixels (0, 3 and 5 supported)"); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "shadx", PROP_INT, PROP_NONE); RNA_def_property_range(prop, -10, 10); RNA_def_property_ui_text(prop, "Shadow X Offset", "Shadow offset in pixels"); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "shady", PROP_INT, PROP_NONE); RNA_def_property_range(prop, -10, 10); RNA_def_property_ui_text(prop, "Shadow Y Offset", "Shadow offset in pixels"); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "shadowalpha", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Shadow Alpha", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "shadowcolor", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Shadow Brightness", "Shadow color in grey value"); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); } static void rna_def_userdef_theme_ui_style(BlenderRNA *brna) @@ -195,25 +201,25 @@ static void rna_def_userdef_theme_ui_style(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "paneltitle"); RNA_def_property_struct_type(prop, "ThemeFontStyle"); RNA_def_property_ui_text(prop, "Panel Font", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "grouplabel", PROP_POINTER, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "grouplabel"); RNA_def_property_struct_type(prop, "ThemeFontStyle"); RNA_def_property_ui_text(prop, "Group Label Font", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "widgetlabel", PROP_POINTER, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "widgetlabel"); RNA_def_property_struct_type(prop, "ThemeFontStyle"); RNA_def_property_ui_text(prop, "Widget Label Font", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "widget", PROP_POINTER, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "widget"); RNA_def_property_struct_type(prop, "ThemeFontStyle"); RNA_def_property_ui_text(prop, "Widget Font", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); } @@ -229,47 +235,47 @@ static void rna_def_userdef_theme_ui_wcol(BlenderRNA *brna) prop= RNA_def_property(srna, "outline", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Outline", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "inner", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 4); RNA_def_property_ui_text(prop, "Inner", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "inner_sel", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 4); RNA_def_property_ui_text(prop, "Inner Selected", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "item", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 4); RNA_def_property_ui_text(prop, "Item", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "text", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Text", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "text_sel", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Text Selected", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "shaded", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "shaded", 1); RNA_def_property_ui_text(prop, "Shaded", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "shadetop", PROP_INT, PROP_NONE); RNA_def_property_range(prop, -100, 100); RNA_def_property_ui_text(prop, "Shade Top", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "shadedown", PROP_INT, PROP_NONE); RNA_def_property_range(prop, -100, 100); RNA_def_property_ui_text(prop, "Shade Down", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); } static void rna_def_userdef_theme_ui_wcol_state(BlenderRNA *brna) @@ -284,36 +290,36 @@ static void rna_def_userdef_theme_ui_wcol_state(BlenderRNA *brna) prop= RNA_def_property(srna, "inner_anim", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Animated", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "inner_anim_sel", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Animated Selected", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "inner_key", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Keyframe", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "inner_key_sel", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Keyframe Selected", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "inner_driven", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Driven", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "inner_driven_sel", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Driven Selected", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "blend", PROP_FLOAT, PROP_PERCENTAGE); RNA_def_property_ui_text(prop, "Blend", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); } static void rna_def_userdef_theme_ui(BlenderRNA *brna) @@ -332,102 +338,102 @@ static void rna_def_userdef_theme_ui(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "wcol_regular"); RNA_def_property_struct_type(prop, "ThemeWidgetColors"); RNA_def_property_ui_text(prop, "Regular Widget Colors", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "wcol_tool", PROP_POINTER, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "wcol_tool"); RNA_def_property_struct_type(prop, "ThemeWidgetColors"); RNA_def_property_ui_text(prop, "Tool Widget Colors", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "wcol_radio", PROP_POINTER, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "wcol_radio"); RNA_def_property_struct_type(prop, "ThemeWidgetColors"); RNA_def_property_ui_text(prop, "Radio Widget Colors", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "wcol_text", PROP_POINTER, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "wcol_text"); RNA_def_property_struct_type(prop, "ThemeWidgetColors"); RNA_def_property_ui_text(prop, "Text Widget Colors", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "wcol_option", PROP_POINTER, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "wcol_option"); RNA_def_property_struct_type(prop, "ThemeWidgetColors"); RNA_def_property_ui_text(prop, "Option Widget Colors", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "wcol_toggle", PROP_POINTER, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "wcol_toggle"); RNA_def_property_struct_type(prop, "ThemeWidgetColors"); RNA_def_property_ui_text(prop, "Toggle Widget Colors", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "wcol_num", PROP_POINTER, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "wcol_num"); RNA_def_property_struct_type(prop, "ThemeWidgetColors"); RNA_def_property_ui_text(prop, "Number Widget Colors", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "wcol_numslider", PROP_POINTER, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "wcol_numslider"); RNA_def_property_struct_type(prop, "ThemeWidgetColors"); RNA_def_property_ui_text(prop, "Slider Widget Colors", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "wcol_box", PROP_POINTER, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "wcol_box"); RNA_def_property_struct_type(prop, "ThemeWidgetColors"); RNA_def_property_ui_text(prop, "Box Backdrop Colors", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "wcol_menu", PROP_POINTER, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "wcol_menu"); RNA_def_property_struct_type(prop, "ThemeWidgetColors"); RNA_def_property_ui_text(prop, "Menu Widget Colors", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "wcol_pulldown", PROP_POINTER, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "wcol_pulldown"); RNA_def_property_struct_type(prop, "ThemeWidgetColors"); RNA_def_property_ui_text(prop, "Pulldown Widget Colors", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "wcol_menu_back", PROP_POINTER, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "wcol_menu_back"); RNA_def_property_struct_type(prop, "ThemeWidgetColors"); RNA_def_property_ui_text(prop, "Menu Backdrop Colors", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "wcol_menu_item", PROP_POINTER, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "wcol_menu_item"); RNA_def_property_struct_type(prop, "ThemeWidgetColors"); RNA_def_property_ui_text(prop, "Menu Item Colors", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "wcol_scroll", PROP_POINTER, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "wcol_scroll"); RNA_def_property_struct_type(prop, "ThemeWidgetColors"); RNA_def_property_ui_text(prop, "Scroll Widget Colors", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "wcol_list_item", PROP_POINTER, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "wcol_list_item"); RNA_def_property_struct_type(prop, "ThemeWidgetColors"); RNA_def_property_ui_text(prop, "List Item Colors", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "wcol_state", PROP_POINTER, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "wcol_state"); RNA_def_property_struct_type(prop, "ThemeWidgetStateColors"); RNA_def_property_ui_text(prop, "State Colors", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "icon_file", PROP_STRING, PROP_FILEPATH); RNA_def_property_string_sdna(prop, NULL, "iconfile"); RNA_def_property_ui_text(prop, "Icon File", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); } static void rna_def_userdef_theme_spaces_main(StructRNA *srna, int spacetype) @@ -438,60 +444,60 @@ static void rna_def_userdef_theme_spaces_main(StructRNA *srna, int spacetype) prop= RNA_def_property(srna, "back", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Window Back", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "title", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Window Title", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "text", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Window Text", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "text_hi", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Window Text Highlight", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); /* header */ prop= RNA_def_property(srna, "header", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Header", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "header_text", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Header Text", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "header_text_hi", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Header Text Highlight", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); /* buttons */ if(! ELEM(spacetype, SPACE_BUTS, SPACE_OUTLINER)) { prop= RNA_def_property(srna, "button", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Button Back", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "button_title", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Button Title", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "button_text", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Button Text", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "button_text_hi", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Button Text Highlight", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); } /* list/channels */ @@ -499,22 +505,22 @@ static void rna_def_userdef_theme_spaces_main(StructRNA *srna, int spacetype) prop= RNA_def_property(srna, "list", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "List Back", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "list_title", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "List Title", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "list_text", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "List Text", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "list_text_hi", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "List Text Highlight", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); } } @@ -525,17 +531,17 @@ static void rna_def_userdef_theme_spaces_vertex(StructRNA *srna) prop= RNA_def_property(srna, "vertex", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Vertex", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "vertex_select", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Vertex Select", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "vertex_size", PROP_INT, PROP_NONE); RNA_def_property_range(prop, 1, 10); RNA_def_property_ui_text(prop, "Vertex Size", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); } static void rna_def_userdef_theme_spaces_edge(StructRNA *srna) @@ -545,22 +551,22 @@ static void rna_def_userdef_theme_spaces_edge(StructRNA *srna) prop= RNA_def_property(srna, "edge_select", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "edge Select", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "edge_seam", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Edge Seam", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "edge_sharp", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Edge Sharp", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "edge_facesel", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Edge UV Face Select", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); } static void rna_def_userdef_theme_spaces_face(StructRNA *srna) @@ -570,22 +576,22 @@ static void rna_def_userdef_theme_spaces_face(StructRNA *srna) prop= RNA_def_property(srna, "face", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 4); RNA_def_property_ui_text(prop, "Face", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "face_select", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 4); RNA_def_property_ui_text(prop, "Face Selected", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "face_dot", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Face Dot Selected", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "facedot_size", PROP_INT, PROP_NONE); RNA_def_property_range(prop, 1, 10); RNA_def_property_ui_text(prop, "Face Dot Size", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); } static void rna_def_userdef_theme_space_view3d(BlenderRNA *brna) @@ -604,51 +610,51 @@ static void rna_def_userdef_theme_space_view3d(BlenderRNA *brna) prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Grid", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "panel", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 4); RNA_def_property_ui_text(prop, "Panel", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "wire", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Wire", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "lamp", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 4); RNA_def_property_ui_text(prop, "Lamp", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "object_selected", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "select"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Object Selected", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "object_active", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "active"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Active Object", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "object_grouped", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "group"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Object Grouped", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "object_grouped_active", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "group_active"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Object Grouped Active", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "transform", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Transform", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); rna_def_userdef_theme_spaces_vertex(srna); rna_def_userdef_theme_spaces_edge(srna); @@ -657,28 +663,28 @@ static void rna_def_userdef_theme_space_view3d(BlenderRNA *brna) prop= RNA_def_property(srna, "editmesh_active", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 4); RNA_def_property_ui_text(prop, "Active Vert/Edge/Face", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "normal", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Normal", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "bone_solid", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Bone Solid", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "bone_pose", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Bone Pose", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "current_frame", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "cframe"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Current Frame", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "pin", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); @@ -707,24 +713,24 @@ static void rna_def_userdef_theme_space_graph(BlenderRNA *brna) prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Grid", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "panel", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Panel", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "window_sliders", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "shade1"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Window Sliders", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "channels_region", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "shade2"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Channels Region", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); rna_def_userdef_theme_spaces_vertex(srna); @@ -732,46 +738,46 @@ static void rna_def_userdef_theme_space_graph(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "cframe"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Current Frame", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "handle_vertex", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Handle Vertex", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "handle_vertex_select", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Handle Vertex Select", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "handle_vertex_size", PROP_INT, PROP_NONE); RNA_def_property_range(prop, 0, 255); RNA_def_property_ui_text(prop, "Handle Vertex Size", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "channel_group", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "group"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Channel Group", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "active_channels_group", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "group_active"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Active Channel Group", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "dopesheet_channel", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "ds_channel"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "DopeSheet Channel", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "dopesheet_subchannel", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "ds_subchannel"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "DopeSheet Sub-Channel", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); } static void rna_def_userdef_theme_space_file(BlenderRNA *brna) @@ -791,37 +797,37 @@ static void rna_def_userdef_theme_space_file(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "hilite"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Selected File", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "tiles", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "panel"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Tiles", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "scrollbar", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "shade1"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Scrollbar", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "scroll_handle", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "shade2"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Scroll Handle", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "active_file", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "active"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Active File", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "active_file_text", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "grid"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Active File Text", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); } static void rna_def_userdef_theme_space_outliner(BlenderRNA *brna) @@ -881,55 +887,55 @@ static void rna_def_userdef_theme_space_text(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "grid"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Line Numbers Background", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "scroll_bar", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "shade1"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Scroll Bar", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "selected_text", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "shade2"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Selected Text", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "cursor", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "hilite"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Cursor", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "syntax_builtin", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "syntaxb"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Syntax Builtin", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "syntax_special", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "syntaxv"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Syntax Special", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "syntax_comment", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "syntaxc"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Syntax Comment", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "syntax_string", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "syntaxl"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Syntax String", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "syntax_numbers", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "syntaxn"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Syntax Numbers", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); } static void rna_def_userdef_theme_space_node(BlenderRNA *brna) @@ -949,49 +955,49 @@ static void rna_def_userdef_theme_space_node(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "wire"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Wires", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "wire_select", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "edge_select"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Wire Select", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "selected_text", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "shade2"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Selected Text", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "node_backdrop", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "syntaxl"); RNA_def_property_array(prop, 4); RNA_def_property_ui_text(prop, "Node Backdrop", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "in_out_node", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "syntaxn"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "In/Out Node", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "converter_node", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "syntaxv"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Converter Node", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "operator_node", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "syntaxb"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Operator Node", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "group_node", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "syntaxc"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Group Node", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); } static void rna_def_userdef_theme_space_logic(BlenderRNA *brna) @@ -1010,7 +1016,7 @@ static void rna_def_userdef_theme_space_logic(BlenderRNA *brna) prop= RNA_def_property(srna, "panel", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Panel", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); } @@ -1030,7 +1036,7 @@ static void rna_def_userdef_theme_space_buts(BlenderRNA *brna) prop= RNA_def_property(srna, "panel", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Panel", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); } static void rna_def_userdef_theme_space_time(BlenderRNA *brna) @@ -1049,13 +1055,13 @@ static void rna_def_userdef_theme_space_time(BlenderRNA *brna) prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Grid", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "current_frame", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "cframe"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Current Frame", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); } static void rna_def_userdef_theme_space_sound(BlenderRNA *brna) @@ -1074,19 +1080,19 @@ static void rna_def_userdef_theme_space_sound(BlenderRNA *brna) prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Grid", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "window_sliders", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "shade1"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Window Sliders", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "current_frame", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "cframe"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Current Frame", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); } static void rna_def_userdef_theme_space_image(BlenderRNA *brna) @@ -1107,7 +1113,7 @@ static void rna_def_userdef_theme_space_image(BlenderRNA *brna) prop= RNA_def_property(srna, "editmesh_active", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 4); RNA_def_property_ui_text(prop, "Active Vert/Edge/Face", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); } static void rna_def_userdef_theme_space_seq(BlenderRNA *brna) @@ -1124,79 +1130,79 @@ static void rna_def_userdef_theme_space_seq(BlenderRNA *brna) prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Grid", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "window_sliders", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "shade1"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Window Sliders", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "movie_strip", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "movie"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Movie Strip", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "image_strip", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "image"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Image Strip", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "scene_strip", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "scene"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Scene Strip", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "audio_strip", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "audio"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Audio Strip", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "effect_strip", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "effect"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Effect Strip", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "plugin_strip", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "plugin"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Plugin Strip", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "transition_strip", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "transition"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Transition Strip", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "meta_strip", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "meta"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Meta Strip", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "current_frame", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "cframe"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Current Frame", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "keyframe", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "vertex_select"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Keyframe", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "draw_action", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "bone_pose"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Draw Action", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); } static void rna_def_userdef_theme_space_action(BlenderRNA *brna) @@ -1215,73 +1221,73 @@ static void rna_def_userdef_theme_space_action(BlenderRNA *brna) prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Grid", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "value_sliders", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "face"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Value Sliders", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "view_sliders", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "shade1"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "View Sliders", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "channels", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "shade2"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Channels", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "channels_selected", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "hilite"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Channels Selected", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "channel_group", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "group"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Channel Group", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "active_channels_group", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "group_active"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Active Channel Group", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "long_key", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "strip"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Long Key", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "long_key_selected", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "strip_select"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Long Key Selected", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "current_frame", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "cframe"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Current Frame", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "dopesheet_channel", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "ds_channel"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "DopeSheet Channel", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "dopesheet_subchannel", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "ds_subchannel"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "DopeSheet Sub-Channel", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); } static void rna_def_userdef_theme_space_nla(BlenderRNA *brna) @@ -1300,43 +1306,43 @@ static void rna_def_userdef_theme_space_nla(BlenderRNA *brna) prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Grid", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "view_sliders", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "shade1"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "View Sliders", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "bars", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "shade2"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Bars", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "bars_selected", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "hilite"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Bars Selected", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "strips", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "strip"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "strips", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "strips_selected", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "strip_select"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Strips Selected", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "current_frame", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "cframe"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Current Frame", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); } static void rna_def_userdef_theme_colorset(BlenderRNA *brna) @@ -1352,23 +1358,23 @@ static void rna_def_userdef_theme_colorset(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "solid"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Normal", "Color used for the surface of bones."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "selected", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "select"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Selected", "Color used for selected bones."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "active", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Active", "Color used for active bones."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "colored_constraints", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", TH_WIRECOLOR_CONSTCOLS); RNA_def_property_ui_text(prop, "Colored Constraints", "Allow the use of colors indicating constraints/keyed status."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); } static void rna_def_userdef_themes(BlenderRNA *brna) @@ -1557,27 +1563,27 @@ static void rna_def_userdef_view(BlenderRNA *brna) prop= RNA_def_property(srna, "display_object_info", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_DRAWVIEWINFO); RNA_def_property_ui_text(prop, "Display Object Info", "Display objects name and frame number in 3d view."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "global_scene", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_SCENEGLOBAL); RNA_def_property_ui_text(prop, "Global Scene", "Forces the current Scene to be displayed in all Screens."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "use_large_cursors", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "curssize", 0); RNA_def_property_ui_text(prop, "Large Cursors", "Use large mouse cursors when available."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "show_view_name", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_SHOW_VIEWPORTNAME); RNA_def_property_ui_text(prop, "Show View Name", "Show the name of the view's direction in each 3D View."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "show_playback_fps", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_SHOW_FPS); RNA_def_property_ui_text(prop, "Show Playback FPS", "Show the frames per second screen refresh rate, while animation is played back."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); /* menus */ prop= RNA_def_property(srna, "open_mouse_over", PROP_BOOLEAN, PROP_NONE); @@ -1672,19 +1678,19 @@ static void rna_def_userdef_view(BlenderRNA *brna) prop= RNA_def_property(srna, "show_mini_axis", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_SHOW_ROTVIEWICON); RNA_def_property_ui_text(prop, "Show Mini Axis", "Show a small rotating 3D axis in the bottom left corner of the 3D View."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "mini_axis_size", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "rvisize"); RNA_def_property_range(prop, 10, 64); RNA_def_property_ui_text(prop, "Mini Axis Size", "The axis icon's size."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "mini_axis_brightness", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "rvibright"); RNA_def_property_range(prop, 0, 10); RNA_def_property_ui_text(prop, "Mini Axis Brightness", "The brightness of the icon."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); /* middle mouse button */ prop= RNA_def_property(srna, "middle_mouse_rotate", PROP_BOOLEAN, PROP_NONE); @@ -1718,19 +1724,19 @@ static void rna_def_userdef_view(BlenderRNA *brna) prop= RNA_def_property(srna, "use_manipulator", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "tw_flag", 1); RNA_def_property_ui_text(prop, "Manipulator", "Use 3d transform manipulator."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "manipulator_size", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "tw_size"); RNA_def_property_range(prop, 2, 40); RNA_def_property_ui_text(prop, "Manipulator Size", "Diameter of widget, in 10 pixel units."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "manipulator_handle_size", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "tw_handlesize"); RNA_def_property_range(prop, 2, 40); RNA_def_property_ui_text(prop, "Manipulator Handle Size", "Size of widget handles as percentage of widget radius."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "manipulator_hotspot", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "tw_hotspot"); @@ -1741,7 +1747,7 @@ static void rna_def_userdef_view(BlenderRNA *brna) RNA_def_property_int_sdna(prop, NULL, "obcenter_dia"); RNA_def_property_range(prop, 4, 10); RNA_def_property_ui_text(prop, "Object Center Size", "Diameter in Pixels for Object/Lamp center display."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "ndof_pan_speed", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "ndof_pan"); @@ -1770,28 +1776,38 @@ static void rna_def_userdef_edit(BlenderRNA *brna) {BEZT_IPO_BEZ, "BEZIER", 0, "Bezier", ""}, {0, NULL, 0, NULL, NULL}}; + static const EnumPropertyItem material_link_items[]= { + {0, "OBDATA", 0, "ObData", "Toggle whether the material is linked to object data or the object block."}, + {USER_MAT_ON_OB, "OBJECT", 0, "Object", "Toggle whether the material is linked to object data or the object block."}, + {0, NULL, 0, NULL, NULL}}; + + static const EnumPropertyItem object_align_items[]= { + {0, "WORLD", 0, "World", "Align newly added objects facing the 3D View direction"}, + {USER_ADD_VIEWALIGNED, "VIEW", 0, "View", "Align newly added objects to the world coordinates"}, + {0, NULL, 0, NULL, NULL}}; + + srna= RNA_def_struct(brna, "UserPreferencesEdit", NULL); RNA_def_struct_sdna(srna, "UserDef"); RNA_def_struct_nested(brna, srna, "UserPreferences"); RNA_def_struct_ui_text(srna, "Edit Methods", "Settings for interacting with Blender data."); /* Edit Methods */ - prop= RNA_def_property(srna, "material_linked_object", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_MAT_ON_OB); - RNA_def_property_ui_text(prop, "Material Linked Object", "Toggle whether the material is linked to object data or the object block."); - - prop= RNA_def_property(srna, "material_linked_obdata", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_MAT_ON_OB); - RNA_def_property_ui_text(prop, "Material Linked ObData", "Toggle whether the material is linked to object data or the object block."); + + prop= RNA_def_property(srna, "material_link", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); + RNA_def_property_enum_items(prop, material_link_items); + RNA_def_property_ui_text(prop, "Material Link To", "Toggle whether the material is linked to object data or the object block"); + + prop= RNA_def_property(srna, "object_align", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); + RNA_def_property_enum_items(prop, object_align_items); + RNA_def_property_ui_text(prop, "Align Object To", "Align newly added objects facing the 3D View direction or the world coordinates"); prop= RNA_def_property(srna, "enter_edit_mode", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_ADD_EDITMODE); RNA_def_property_ui_text(prop, "Enter Edit Mode", "Enter Edit Mode automatically after adding a new object."); - prop= RNA_def_property(srna, "align_to_view", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_ADD_VIEWALIGNED); - RNA_def_property_ui_text(prop, "Align To View", "Align newly added objects facing the 3D View direction."); - prop= RNA_def_property(srna, "drag_immediately", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_DRAGIMMEDIATE); RNA_def_property_ui_text(prop, "Drag Immediately", "Moving things with a mouse drag doesn't require a click to confirm (Best for tablet users)."); @@ -1874,47 +1890,51 @@ static void rna_def_userdef_edit(BlenderRNA *brna) prop= RNA_def_property(srna, "duplicate_mesh", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_MESH); - RNA_def_property_ui_text(prop, "Duplicate Mesh", "Causes mesh data to be duplicated with Shift+D."); + RNA_def_property_ui_text(prop, "Duplicate Mesh", "Causes mesh data to be duplicated with the object."); prop= RNA_def_property(srna, "duplicate_surface", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_SURF); - RNA_def_property_ui_text(prop, "Duplicate Surface", "Causes surface data to be duplicated with Shift+D."); + RNA_def_property_ui_text(prop, "Duplicate Surface", "Causes surface data to be duplicated with the object."); prop= RNA_def_property(srna, "duplicate_curve", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_CURVE); - RNA_def_property_ui_text(prop, "Duplicate Curve", "Causes curve data to be duplicated with Shift+D."); + RNA_def_property_ui_text(prop, "Duplicate Curve", "Causes curve data to be duplicated with the object."); prop= RNA_def_property(srna, "duplicate_text", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_FONT); - RNA_def_property_ui_text(prop, "Duplicate Text", "Causes text data to be duplicated with Shift+D."); + RNA_def_property_ui_text(prop, "Duplicate Text", "Causes text data to be duplicated with the object."); prop= RNA_def_property(srna, "duplicate_metaball", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_MBALL); - RNA_def_property_ui_text(prop, "Duplicate Metaball", "Causes metaball data to be duplicated with Shift+D."); + RNA_def_property_ui_text(prop, "Duplicate Metaball", "Causes metaball data to be duplicated with the object."); prop= RNA_def_property(srna, "duplicate_armature", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_ARM); - RNA_def_property_ui_text(prop, "Duplicate Armature", "Causes armature data to be duplicated with Shift+D."); + RNA_def_property_ui_text(prop, "Duplicate Armature", "Causes armature data to be duplicated with the object."); prop= RNA_def_property(srna, "duplicate_lamp", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_LAMP); - RNA_def_property_ui_text(prop, "Duplicate Lamp", "Causes lamp data to be duplicated with Shift+D."); + RNA_def_property_ui_text(prop, "Duplicate Lamp", "Causes lamp data to be duplicated with the object."); prop= RNA_def_property(srna, "duplicate_material", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_MAT); - RNA_def_property_ui_text(prop, "Duplicate Material", "Causes material data to be duplicated with Shift+D."); + RNA_def_property_ui_text(prop, "Duplicate Material", "Causes material data to be duplicated with the object."); prop= RNA_def_property(srna, "duplicate_texture", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_TEX); - RNA_def_property_ui_text(prop, "Duplicate Texture", "Causes texture data to be duplicated with Shift+D."); + RNA_def_property_ui_text(prop, "Duplicate Texture", "Causes texture data to be duplicated with the object."); prop= RNA_def_property(srna, "duplicate_ipo", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_IPO); - RNA_def_property_ui_text(prop, "Duplicate Ipo", "Causes ipo data to be duplicated with Shift+D."); + RNA_def_property_ui_text(prop, "Duplicate Ipo", "Causes ipo data to be duplicated with the object."); prop= RNA_def_property(srna, "duplicate_action", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_ACT); - RNA_def_property_ui_text(prop, "Duplicate Action", "Causes actions to be duplicated with Shift+D."); + RNA_def_property_ui_text(prop, "Duplicate Action", "Causes actions to be duplicated with the object."); + + prop= RNA_def_property(srna, "duplicate_particle", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_PSYS); + RNA_def_property_ui_text(prop, "Duplicate Particle", "Causes particle systems to be duplicated with the object."); } static void rna_def_userdef_language(BlenderRNA *brna) @@ -1957,13 +1977,13 @@ static void rna_def_userdef_language(BlenderRNA *brna) prop= RNA_def_property(srna, "international_fonts", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_DOTRANSLATE); RNA_def_property_ui_text(prop, "International Fonts", "Use international fonts."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "dpi", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "dpi"); RNA_def_property_range(prop, 48, 128); RNA_def_property_ui_text(prop, "DPI", "Font size and resolution for display."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "scrollback", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "scrollback"); @@ -1975,27 +1995,27 @@ static void rna_def_userdef_language(BlenderRNA *brna) prop= RNA_def_property(srna, "language", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, language_items); RNA_def_property_ui_text(prop, "Language", "Language use for translation."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "translate_tooltips", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_TR_TOOLTIPS); RNA_def_property_ui_text(prop, "Translate Tooltips", "Translate Tooltips."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "translate_buttons", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_TR_BUTTONS); RNA_def_property_ui_text(prop, "Translate Buttons", "Translate button labels."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "translate_toolbox", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_TR_MENUS); RNA_def_property_ui_text(prop, "Translate Toolbox", "Translate toolbox menu."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "use_textured_fonts", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_USETEXTUREFONT); RNA_def_property_ui_text(prop, "Textured Fonts", "Use textures for drawing international fonts."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); } static void rna_def_userdef_system(BlenderRNA *brna) @@ -2027,9 +2047,15 @@ static void rna_def_userdef_system(BlenderRNA *brna) static EnumPropertyItem audio_device_items[] = { {0, "AUDIO_DEVICE_NULL", 0, "No Audio", "Null device - there will be no audio output."}, +#ifdef WITH_SDL {1, "AUDIO_DEVICE_SDL", 0, "SDL", "SDL device - simple direct media layer, recommended for sequencer usage."}, +#endif +#ifdef WITH_OPENAL {2, "AUDIO_DEVICE_OPENAL", 0, "OpenAL", "OpenAL device - supports 3D audio, recommended for game engine usage."}, +#endif +#ifdef WITH_JACK {3, "AUDIO_DEVICE_JACK", 0, "Jack", "Jack device - open source pro audio, recommended for pro audio users."}, +#endif {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem audio_rate_items[] = { diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c index eaed0100386..53532e3f383 100644 --- a/source/blender/makesrna/intern/rna_wm.c +++ b/source/blender/makesrna/intern/rna_wm.c @@ -197,7 +197,7 @@ static StructRNA *rna_OperatorProperties_refine(PointerRNA *ptr) return ptr->type; } -IDProperty *rna_OperatorProperties_idproperties(PointerRNA *ptr, int create) +static IDProperty *rna_OperatorProperties_idproperties(PointerRNA *ptr, int create) { if(create && !ptr->data) { IDPropertyTemplate val = {0}; @@ -377,22 +377,22 @@ static void rna_def_event(BlenderRNA *brna) prop= RNA_def_property(srna, "shift", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "shift", 1); RNA_def_property_clear_flag(prop, PROP_EDITABLE); - RNA_def_property_ui_text(prop, "Shift", "True when the shift key is held."); + RNA_def_property_ui_text(prop, "Shift", "True when the Shift key is held."); prop= RNA_def_property(srna, "ctrl", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "ctrl", 1); RNA_def_property_clear_flag(prop, PROP_EDITABLE); - RNA_def_property_ui_text(prop, "Ctrl", "True when the shift key is held."); + RNA_def_property_ui_text(prop, "Ctrl", "True when the Ctrl key is held."); prop= RNA_def_property(srna, "alt", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "alt", 1); RNA_def_property_clear_flag(prop, PROP_EDITABLE); - RNA_def_property_ui_text(prop, "Alt", "True when the shift key is held."); + RNA_def_property_ui_text(prop, "Alt", "True when the Alt/Option key is held."); prop= RNA_def_property(srna, "oskey", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "oskey", 1); RNA_def_property_clear_flag(prop, PROP_EDITABLE); - RNA_def_property_ui_text(prop, "OS Key", "True when the shift key is held."); + RNA_def_property_ui_text(prop, "OS Key", "True when the Cmd key is held."); } static void rna_def_window(BlenderRNA *brna) @@ -419,6 +419,7 @@ static void rna_def_windowmanager(BlenderRNA *brna) srna= RNA_def_struct(brna, "WindowManager", "ID"); RNA_def_struct_ui_text(srna, "Window Manager", "Window manager datablock defining open windows and other user interface data."); + RNA_def_struct_clear_flag(srna, STRUCT_ID_REFCOUNT); RNA_def_struct_sdna(srna, "wmWindowManager"); prop= RNA_def_property(srna, "operators", PROP_COLLECTION, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_world.c b/source/blender/makesrna/intern/rna_world.c index 525a4446932..d2eebbc61aa 100644 --- a/source/blender/makesrna/intern/rna_world.c +++ b/source/blender/makesrna/intern/rna_world.c @@ -324,12 +324,14 @@ static void rna_def_world_mist(BlenderRNA *brna) RNA_def_property_range(prop, 0, FLT_MAX); RNA_def_property_ui_range(prop, 0, 10000, 10, 2); RNA_def_property_ui_text(prop, "Start", "Starting distance of the mist, measured from the camera"); + RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); prop= RNA_def_property(srna, "depth", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "mistdist"); RNA_def_property_range(prop, 0, FLT_MAX); RNA_def_property_ui_range(prop, 0, 10000, 10, 2); RNA_def_property_ui_text(prop, "Depth", "The distance over which the mist effect fades in"); + RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); prop= RNA_def_property(srna, "height", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "misthi"); @@ -429,6 +431,7 @@ void RNA_def_world(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "ambr"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Ambient Color", ""); + RNA_def_property_update(prop, NC_WORLD, NULL); /* exp, range */ prop= RNA_def_property(srna, "exposure", PROP_FLOAT, PROP_NONE); |