diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2011-11-21 01:02:12 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2011-11-21 01:02:12 +0400 |
commit | 2676f2d58f71f438008b413a86b873e7787d80ea (patch) | |
tree | eb541972cf32d5958b7c0f7f8ece525b78cfcbff /source/blender/makesrna | |
parent | bb9976f058ba2090812074e1b774213d20821a30 (diff) | |
parent | 4ab1dadf72a821b344a714fff59aed11d15ecb14 (diff) |
Merged changes in the trunk up to revision 42021.
Conflicts resolved:
source/blender/blenkernel/intern/scene.c
source/blender/blenloader/intern/readfile.c
source/blender/editors/interface/resources.c
source/blender/render/intern/source/pipeline.c
Diffstat (limited to 'source/blender/makesrna')
35 files changed, 1064 insertions, 398 deletions
diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index c34f319b0a1..a908833505a 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -381,6 +381,9 @@ extern StructRNA RNA_NorController; extern StructRNA RNA_Object; extern StructRNA RNA_ObjectBase; extern StructRNA RNA_ObstacleFluidSettings; +extern StructRNA RNA_OceanModifier; +extern StructRNA RNA_OceanTexData; +extern StructRNA RNA_OceanTexture; extern StructRNA RNA_Operator; extern StructRNA RNA_OperatorFileListElement; extern StructRNA RNA_OperatorMousePath; diff --git a/source/blender/makesrna/RNA_define.h b/source/blender/makesrna/RNA_define.h index 6dc7bf2abe3..b7ac5f394b0 100644 --- a/source/blender/makesrna/RNA_define.h +++ b/source/blender/makesrna/RNA_define.h @@ -208,6 +208,9 @@ const char *RNA_property_typename(PropertyType type); #define IS_DNATYPE_FLOAT_COMPAT(_str) (strcmp(_str, "float") == 0 || strcmp(_str, "double") == 0) #define IS_DNATYPE_INT_COMPAT(_str) (strcmp(_str, "int") == 0 || strcmp(_str, "short") == 0 || strcmp(_str, "char") == 0) +/* max size for dynamic defined type descriptors, + * this value is arbitrary */ +#define RNA_DYN_DESCR_MAX 240 #ifdef __cplusplus } diff --git a/source/blender/makesrna/RNA_types.h b/source/blender/makesrna/RNA_types.h index 1655665efe3..85869115e79 100644 --- a/source/blender/makesrna/RNA_types.h +++ b/source/blender/makesrna/RNA_types.h @@ -108,7 +108,9 @@ typedef enum PropertySubType { PROP_FILEPATH = 1, PROP_DIRPATH = 2, PROP_FILENAME = 3, - PROP_TRANSLATE = 4, /* a string which should be translated */ + PROP_BYTESTRING = 4, /* a string which should be represented as bytes + * in python, still NULL terminated though. */ + PROP_TRANSLATE = 5, /* a string which should be translated */ /* numbers */ PROP_UNSIGNED = 13, @@ -301,13 +303,14 @@ typedef struct ParameterDynAlloc { typedef enum FunctionFlag { FUNC_NO_SELF = 1, /* for static functions */ - FUNC_USE_CONTEXT = 2, - FUNC_USE_REPORTS = 4, + FUNC_USE_MAIN = 2, + FUNC_USE_CONTEXT = 4, + FUNC_USE_REPORTS = 8, FUNC_USE_SELF_ID = 2048, /* registering */ - FUNC_REGISTER = 8, - FUNC_REGISTER_OPTIONAL = 8|16, + FUNC_REGISTER = 16, + FUNC_REGISTER_OPTIONAL = 16|32, /* internal flags */ FUNC_BUILTIN = 128, diff --git a/source/blender/makesrna/SConscript b/source/blender/makesrna/SConscript index c4b3f204b23..72c2f9a1caf 100644 --- a/source/blender/makesrna/SConscript +++ b/source/blender/makesrna/SConscript @@ -56,6 +56,9 @@ if env['WITH_BF_PYTHON']: if env['WITH_BF_COLLADA']: defs.append('WITH_COLLADA') +if env['WITH_BF_OCEANSIM']: + defs.append('WITH_OCEANSIM') + if env['OURPLATFORM'] == 'linux': cflags='-pthread' incs += ' ../../../extern/binreloc/include' diff --git a/source/blender/makesrna/intern/CMakeLists.txt b/source/blender/makesrna/intern/CMakeLists.txt index f61db894263..24db4e80c2b 100644 --- a/source/blender/makesrna/intern/CMakeLists.txt +++ b/source/blender/makesrna/intern/CMakeLists.txt @@ -207,6 +207,10 @@ if(WITH_FFTW3) add_definitions(-DWITH_FFTW3) endif() +if(WITH_MOD_OCEANSIM) + add_definitions(-DWITH_OCEANSIM) +endif() + if(WITH_SDL) add_definitions(-DWITH_SDL) endif() diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index b6ddfe39e9d..e837725a75b 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -524,7 +524,11 @@ static char *rna_def_property_get_func(FILE *f, StructRNA *srna, PropertyRNA *pr } else { const PropertySubType subtype= prop->subtype; - const char *string_copy_func= (subtype==PROP_FILEPATH || subtype==PROP_DIRPATH || subtype==PROP_FILENAME) ? "BLI_strncpy" : "BLI_strncpy_utf8"; + const char *string_copy_func= (subtype==PROP_FILEPATH || + subtype==PROP_DIRPATH || + subtype==PROP_FILENAME || + subtype==PROP_BYTESTRING) ? + "BLI_strncpy" : "BLI_strncpy_utf8"; rna_print_data_get(f, dp); if(sprop->maxlength) @@ -739,7 +743,11 @@ static char *rna_def_property_set_func(FILE *f, StructRNA *srna, PropertyRNA *pr } else { const PropertySubType subtype= prop->subtype; - const char *string_copy_func= (subtype==PROP_FILEPATH || subtype==PROP_DIRPATH || subtype==PROP_FILENAME) ? "BLI_strncpy" : "BLI_strncpy_utf8"; + const char *string_copy_func= (subtype==PROP_FILEPATH || + subtype==PROP_DIRPATH || + subtype==PROP_FILENAME || + subtype==PROP_BYTESTRING) ? + "BLI_strncpy" : "BLI_strncpy_utf8"; rna_print_data_get(f, dp); if(sprop->maxlength) @@ -1426,21 +1434,21 @@ static void rna_def_property_funcs_header_cpp(FILE *f, StructRNA *srna, Property case PROP_BOOLEAN: { if(!prop->arraydimension) fprintf(f, "\tinline bool %s(void);", rna_safe_id(prop->identifier)); - else + else if(prop->totarraylength) fprintf(f, "\tinline Array<int, %u> %s(void);", prop->totarraylength, rna_safe_id(prop->identifier)); break; } case PROP_INT: { if(!prop->arraydimension) fprintf(f, "\tinline int %s(void);", rna_safe_id(prop->identifier)); - else + else if(prop->totarraylength) fprintf(f, "\tinline Array<int, %u> %s(void);", prop->totarraylength, rna_safe_id(prop->identifier)); break; } case PROP_FLOAT: { if(!prop->arraydimension) fprintf(f, "\tinline float %s(void);", rna_safe_id(prop->identifier)); - else + else if(prop->totarraylength) fprintf(f, "\tinline Array<float, %u> %s(void);", prop->totarraylength, rna_safe_id(prop->identifier)); break; } @@ -1501,21 +1509,21 @@ static void rna_def_property_funcs_impl_cpp(FILE *f, StructRNA *srna, PropertyDe case PROP_BOOLEAN: { if(!prop->arraydimension) fprintf(f, "\tBOOLEAN_PROPERTY(%s, %s)", srna->identifier, rna_safe_id(prop->identifier)); - else + else if(prop->totarraylength) fprintf(f, "\tBOOLEAN_ARRAY_PROPERTY(%s, %u, %s)", srna->identifier, prop->totarraylength, rna_safe_id(prop->identifier)); break; } case PROP_INT: { if(!prop->arraydimension) fprintf(f, "\tINT_PROPERTY(%s, %s)", srna->identifier, rna_safe_id(prop->identifier)); - else + else if(prop->totarraylength) fprintf(f, "\tINT_ARRAY_PROPERTY(%s, %u, %s)", srna->identifier, prop->totarraylength, rna_safe_id(prop->identifier)); break; } case PROP_FLOAT: { if(!prop->arraydimension) fprintf(f, "\tFLOAT_PROPERTY(%s, %s)", srna->identifier, rna_safe_id(prop->identifier)); - else + else if(prop->totarraylength) fprintf(f, "\tFLOAT_ARRAY_PROPERTY(%s, %u, %s)", srna->identifier, prop->totarraylength, rna_safe_id(prop->identifier)); break; } @@ -1701,6 +1709,12 @@ static void rna_def_function_funcs(FILE *f, StructDefRNA *dsrna, FunctionDefRNA first= 0; } + if(func->flag & FUNC_USE_MAIN) { + if(!first) fprintf(f, ", "); + first= 0; + fprintf(f, "CTX_data_main(C)"); /* may have direct access later */ + } + if(func->flag & FUNC_USE_CONTEXT) { if(!first) fprintf(f, ", "); first= 0; @@ -1816,6 +1830,7 @@ static const char *rna_property_subtypename(PropertySubType type) case PROP_FILEPATH: return "PROP_FILEPATH"; case PROP_FILENAME: return "PROP_FILENAME"; case PROP_DIRPATH: return "PROP_DIRPATH"; + case PROP_BYTESTRING: return "PROP_BYTESTRING"; case PROP_TRANSLATE: return "PROP_TRANSLATE"; case PROP_UNSIGNED: return "PROP_UNSIGNED"; case PROP_PERCENTAGE: return "PROP_PERCENTAGE"; @@ -1998,6 +2013,12 @@ static void rna_generate_static_parameter_prototypes(BlenderRNA *brna, StructRNA first= 0; } + if(func->flag & FUNC_USE_MAIN) { + if(!first) fprintf(f, ", "); + first= 0; + fprintf(f, "Main *bmain"); + } + if(func->flag & FUNC_USE_CONTEXT) { if(!first) fprintf(f, ", "); first= 0; @@ -2473,7 +2494,7 @@ static RNAProcessItem PROCESS_ITEMS[]= { {"rna_space.c", NULL, RNA_def_space}, {"rna_speaker.c", NULL, RNA_def_speaker}, {"rna_test.c", NULL, RNA_def_test}, - {"rna_text.c", NULL, RNA_def_text}, + {"rna_text.c", "rna_text_api.c", RNA_def_text}, {"rna_timeline.c", NULL, RNA_def_timeline_marker}, {"rna_sound.c", NULL, RNA_def_sound}, {"rna_ui.c", "rna_ui_api.c", RNA_def_ui}, diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index 6f9c7a8f19b..d3666e28338 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -1617,7 +1617,7 @@ void RNA_property_boolean_set(PointerRNA *ptr, PropertyRNA *prop, int value) group= RNA_struct_idprops(ptr, 1); if(group) - IDP_AddToGroup(group, IDP_New(IDP_INT, val, prop->identifier)); + IDP_AddToGroup(group, IDP_New(IDP_INT, &val, prop->identifier)); } } @@ -1696,7 +1696,7 @@ void RNA_property_boolean_set_array(PointerRNA *ptr, PropertyRNA *prop, const in group= RNA_struct_idprops(ptr, 1); if(group) { - idprop= IDP_New(IDP_ARRAY, val, prop->identifier); + idprop= IDP_New(IDP_ARRAY, &val, prop->identifier); IDP_AddToGroup(group, idprop); memcpy(IDP_Array(idprop), values, sizeof(int)*idprop->len); } @@ -1814,7 +1814,7 @@ void RNA_property_int_set(PointerRNA *ptr, PropertyRNA *prop, int value) group= RNA_struct_idprops(ptr, 1); if(group) - IDP_AddToGroup(group, IDP_New(IDP_INT, val, prop->identifier)); + IDP_AddToGroup(group, IDP_New(IDP_INT, &val, prop->identifier)); } } @@ -1930,7 +1930,7 @@ void RNA_property_int_set_array(PointerRNA *ptr, PropertyRNA *prop, const int *v group= RNA_struct_idprops(ptr, 1); if(group) { - idprop= IDP_New(IDP_ARRAY, val, prop->identifier); + idprop= IDP_New(IDP_ARRAY, &val, prop->identifier); IDP_AddToGroup(group, idprop); memcpy(IDP_Array(idprop), values, sizeof(int)*idprop->len); } @@ -2050,7 +2050,7 @@ void RNA_property_float_set(PointerRNA *ptr, PropertyRNA *prop, float value) group= RNA_struct_idprops(ptr, 1); if(group) - IDP_AddToGroup(group, IDP_New(IDP_FLOAT, val, prop->identifier)); + IDP_AddToGroup(group, IDP_New(IDP_FLOAT, &val, prop->identifier)); } } @@ -2184,7 +2184,7 @@ void RNA_property_float_set_array(PointerRNA *ptr, PropertyRNA *prop, const floa group= RNA_struct_idprops(ptr, 1); if(group) { - idprop= IDP_New(IDP_ARRAY, val, prop->identifier); + idprop= IDP_New(IDP_ARRAY, &val, prop->identifier); IDP_AddToGroup(group, idprop); memcpy(IDP_Array(idprop), values, sizeof(float)*idprop->len); } @@ -2271,12 +2271,23 @@ void RNA_property_string_get(PointerRNA *ptr, PropertyRNA *prop, char *value) BLI_assert(RNA_property_type(prop) == PROP_STRING); - if((idprop=rna_idproperty_check(&prop, ptr))) - strcpy(value, IDP_String(idprop)); - else if(sprop->get) + if((idprop=rna_idproperty_check(&prop, ptr))) { + /* editing bytes is not 100% supported + * since they can contain NIL chars */ + if (idprop->subtype == IDP_STRING_SUB_BYTE) { + memcpy(value, IDP_String(idprop), idprop->len); + value[idprop->len]= '\0'; + } + else { + memcpy(value, IDP_String(idprop), idprop->len); + } + } + else if(sprop->get) { sprop->get(ptr, value); - else + } + else { strcpy(value, sprop->defaultvalue); + } } char *RNA_property_string_get_alloc(PointerRNA *ptr, PropertyRNA *prop, @@ -2320,8 +2331,18 @@ int RNA_property_string_length(PointerRNA *ptr, PropertyRNA *prop) BLI_assert(RNA_property_type(prop) == PROP_STRING); - if((idprop=rna_idproperty_check(&prop, ptr))) - return strlen(IDP_String(idprop)); + if((idprop=rna_idproperty_check(&prop, ptr))) { + if (idprop->subtype == IDP_STRING_SUB_BYTE) { + return idprop->len; + } + else { +#ifndef NDEBUG + /* these _must_ stay in sync */ + BLI_assert(strlen(IDP_String(idprop)) == idprop->len - 1); +#endif + return idprop->len - 1; + } + } else if(sprop->length) return sprop->length(ptr); else @@ -2336,6 +2357,7 @@ void RNA_property_string_set(PointerRNA *ptr, PropertyRNA *prop, const char *val BLI_assert(RNA_property_type(prop) == PROP_STRING); if((idprop=rna_idproperty_check(&prop, ptr))) + /* both IDP_STRING_SUB_BYTE / IDP_STRING_SUB_UTF8 */ IDP_AssignString(idprop, value, RNA_property_string_maxlength(prop) - 1); else if(sprop->set) sprop->set(ptr, value); /* set function needs to clamp its self */ @@ -2421,7 +2443,7 @@ void RNA_property_enum_set(PointerRNA *ptr, PropertyRNA *prop, int value) group= RNA_struct_idprops(ptr, 1); if(group) - IDP_AddToGroup(group, IDP_New(IDP_INT, val, prop->identifier)); + IDP_AddToGroup(group, IDP_New(IDP_INT, &val, prop->identifier)); } } @@ -2517,7 +2539,7 @@ void RNA_property_pointer_add(PointerRNA *ptr, PropertyRNA *prop) group= RNA_struct_idprops(ptr, 1); if(group) - IDP_AddToGroup(group, IDP_New(IDP_GROUP, val, prop->identifier)); + IDP_AddToGroup(group, IDP_New(IDP_GROUP, &val, prop->identifier)); } else printf("%s %s.%s: only supported for id properties.\n", __func__, ptr->type->identifier, prop->identifier); @@ -2640,7 +2662,7 @@ void RNA_property_collection_add(PointerRNA *ptr, PropertyRNA *prop, PointerRNA IDPropertyTemplate val = {0}; IDProperty *item; - item= IDP_New(IDP_GROUP, val, ""); + item= IDP_New(IDP_GROUP, &val, ""); IDP_AppendArray(idprop, item); // IDP_FreeProperty(item); // IDP_AppendArray does a shallow copy (memcpy), only free memory MEM_freeN(item); @@ -2654,7 +2676,7 @@ void RNA_property_collection_add(PointerRNA *ptr, PropertyRNA *prop, PointerRNA idprop= IDP_NewIDPArray(prop->identifier); IDP_AddToGroup(group, idprop); - item= IDP_New(IDP_GROUP, val, ""); + item= IDP_New(IDP_GROUP, &val, ""); IDP_AppendArray(idprop, item); // IDP_FreeProperty(item); // IDP_AppendArray does a shallow copy (memcpy), only free memory MEM_freeN(item); diff --git a/source/blender/makesrna/intern/rna_actuator.c b/source/blender/makesrna/intern/rna_actuator.c index db71dee26ce..392aa6a7f5a 100644 --- a/source/blender/makesrna/intern/rna_actuator.c +++ b/source/blender/makesrna/intern/rna_actuator.c @@ -626,7 +626,7 @@ static void rna_def_action_actuator(BlenderRNA *brna) prop= RNA_def_property(srna, "priority", PROP_INT, PROP_NONE); RNA_def_property_range(prop, 0, 100); - RNA_def_property_ui_text(prop, "Priority", "Execution priority - lower numbers will override actions with higher numbers. With 2 or more actions at once, the overriding channels must be lower in the stack"); + RNA_def_property_ui_text(prop, "Priority", "Execution priority - lower numbers will override actions with higher numbers (with 2 or more actions at once, the overriding channels must be lower in the stack)"); RNA_def_property_update(prop, NC_LOGIC, NULL); prop= RNA_def_property(srna, "layer", PROP_INT, PROP_NONE); @@ -733,37 +733,37 @@ static void rna_def_object_actuator(BlenderRNA *brna) prop= RNA_def_property(srna, "force_max_x", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "dloc[0]"); RNA_def_property_ui_range(prop, -100.0, 100.0, 1, 2); - RNA_def_property_ui_text(prop, "Max", "Set the upper limit for force"); + RNA_def_property_ui_text(prop, "Max", "Upper limit for X force"); RNA_def_property_update(prop, NC_LOGIC, NULL); prop= RNA_def_property(srna, "force_min_x", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "drot[0]"); RNA_def_property_ui_range(prop, -100.0, 100.0, 1, 2); - RNA_def_property_ui_text(prop, "Min", "Set the lower limit for force"); + RNA_def_property_ui_text(prop, "Min", "Lower limit for X force"); RNA_def_property_update(prop, NC_LOGIC, NULL); prop= RNA_def_property(srna, "force_max_y", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "dloc[1]"); RNA_def_property_ui_range(prop, -100.0, 100.0, 1, 2); - RNA_def_property_ui_text(prop, "Max", "Set the upper limit for force"); + RNA_def_property_ui_text(prop, "Max", "Upper limit for Y force"); RNA_def_property_update(prop, NC_LOGIC, NULL); prop= RNA_def_property(srna, "force_min_y", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "drot[1]"); RNA_def_property_ui_range(prop, -100.0, 100.0, 1, 2); - RNA_def_property_ui_text(prop, "Min", "Set the lower limit for force"); + RNA_def_property_ui_text(prop, "Min", "Lower limit for Y force"); RNA_def_property_update(prop, NC_LOGIC, NULL); prop= RNA_def_property(srna, "force_max_z", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "dloc[2]"); RNA_def_property_ui_range(prop, -100.0, 100.0, 1, 2); - RNA_def_property_ui_text(prop, "Max", "Set the upper limit for force"); + RNA_def_property_ui_text(prop, "Max", "Upper limit for Z force"); RNA_def_property_update(prop, NC_LOGIC, NULL); prop= RNA_def_property(srna, "force_min_z", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "drot[2]"); RNA_def_property_ui_range(prop, -100.0, 100.0, 1, 2); - RNA_def_property_ui_text(prop, "Min", "Set the lower limit for force"); + RNA_def_property_ui_text(prop, "Min", "Lower limit for Z force"); RNA_def_property_update(prop, NC_LOGIC, NULL); /* floats 3 Arrays*/ @@ -771,42 +771,42 @@ static void rna_def_object_actuator(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "dloc"); RNA_def_property_array(prop, 3); RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 2); - RNA_def_property_ui_text(prop, "Loc", "Sets the location"); + RNA_def_property_ui_text(prop, "Loc", "Location"); RNA_def_property_update(prop, NC_LOGIC, NULL); prop= RNA_def_property(srna, "offset_rotation", PROP_FLOAT, PROP_EULER); RNA_def_property_float_sdna(prop, NULL, "drot"); RNA_def_property_array(prop, 3); RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 2); - RNA_def_property_ui_text(prop, "Rot", "Sets the rotation"); + RNA_def_property_ui_text(prop, "Rot", "Rotation"); RNA_def_property_update(prop, NC_LOGIC, NULL); prop= RNA_def_property(srna, "force", PROP_FLOAT, PROP_XYZ); RNA_def_property_float_sdna(prop, NULL, "forceloc"); RNA_def_property_array(prop, 3); RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 2); - RNA_def_property_ui_text(prop, "Force", "Sets the force"); + RNA_def_property_ui_text(prop, "Force", "Force"); RNA_def_property_update(prop, NC_LOGIC, NULL); prop= RNA_def_property(srna, "torque", PROP_FLOAT, PROP_XYZ); RNA_def_property_float_sdna(prop, NULL, "forcerot"); RNA_def_property_array(prop, 3); RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 2); - RNA_def_property_ui_text(prop, "Torque", "Sets the torque"); + RNA_def_property_ui_text(prop, "Torque", "Torque"); RNA_def_property_update(prop, NC_LOGIC, NULL); prop= RNA_def_property(srna, "linear_velocity", PROP_FLOAT, PROP_XYZ); RNA_def_property_float_sdna(prop, NULL, "linearvelocity"); RNA_def_property_array(prop, 3); RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 2); - RNA_def_property_ui_text(prop, "Linear Velocity", "Sets the linear velocity (in Servo mode it sets the target relative linear velocity, it will be achieved by automatic application of force. Null velocity is a valid target)"); + RNA_def_property_ui_text(prop, "Linear Velocity", "Linear velocity (in Servo mode it sets the target relative linear velocity, it will be achieved by automatic application of force - Null velocity is a valid target)"); RNA_def_property_update(prop, NC_LOGIC, NULL); prop= RNA_def_property(srna, "angular_velocity", PROP_FLOAT, PROP_XYZ); RNA_def_property_float_sdna(prop, NULL, "angularvelocity"); RNA_def_property_array(prop, 3); RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 2); - RNA_def_property_ui_text(prop, "Angular Velocity", "Sets the angular velocity"); + RNA_def_property_ui_text(prop, "Angular Velocity", "Angular velocity"); RNA_def_property_update(prop, NC_LOGIC, NULL); /* booleans */ @@ -902,14 +902,14 @@ static void rna_def_camera_actuator(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "damping"); RNA_def_property_range(prop, 0, 10.0); RNA_def_property_ui_range(prop, 0, 5.0, 1, 2); - RNA_def_property_ui_text(prop, "Damping", "Specify the strength of the constraint that drive the camera behind the target"); + RNA_def_property_ui_text(prop, "Damping", "Strength of the constraint that drives the camera behind the target"); RNA_def_property_update(prop, NC_LOGIC, NULL); /* x/y */ prop= RNA_def_property(srna, "axis", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "axis"); RNA_def_property_enum_items(prop, prop_axis_items); - RNA_def_property_ui_text(prop, "Axis", "Specify the axis the Camera will try to get behind"); + RNA_def_property_ui_text(prop, "Axis", "Axis the Camera will try to get behind"); RNA_def_property_update(prop, NC_LOGIC, NULL); } @@ -947,12 +947,12 @@ static void rna_def_sound_actuator(BlenderRNA *brna) prop= RNA_def_property(srna, "volume", PROP_FLOAT, PROP_NONE); RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 2); RNA_def_property_range(prop, 0.0, 2.0); - RNA_def_property_ui_text(prop, "Volume", "Sets the initial volume of the sound"); + RNA_def_property_ui_text(prop, "Volume", "Initial volume of the sound"); RNA_def_property_update(prop, NC_LOGIC, NULL); prop= RNA_def_property(srna, "pitch", PROP_FLOAT, PROP_NONE); RNA_def_property_ui_range(prop, -12.0, 12.0, 1, 2); - RNA_def_property_ui_text(prop, "Pitch", "Sets the pitch of the sound"); + RNA_def_property_ui_text(prop, "Pitch", "Pitch of the sound"); RNA_def_property_update(prop, NC_LOGIC, NULL); /* floats - 3D Parameters */ @@ -989,7 +989,7 @@ static void rna_def_sound_actuator(BlenderRNA *brna) prop= RNA_def_property(srna, "cone_outer_gain_3d", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "sound3D.cone_outer_gain"); RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 2); - RNA_def_property_ui_text(prop, "Cone Outer Gain", "The gain outside the outer cone. The gain in the outer cone will be interpolated between this value and the normal gain in the inner cone"); + RNA_def_property_ui_text(prop, "Cone Outer Gain", "The gain outside the outer cone (the gain in the outer cone will be interpolated between this value and the normal gain in the inner cone)"); RNA_def_property_update(prop, NC_LOGIC, NULL); prop= RNA_def_property(srna, "cone_outer_angle_3d", PROP_FLOAT, PROP_NONE); @@ -1118,7 +1118,7 @@ static void rna_def_constraint_actuator(BlenderRNA *brna) prop= RNA_def_property(srna, "direction", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "mode"); RNA_def_property_enum_items(prop, prop_direction_items); - RNA_def_property_ui_text(prop, "Direction", "Set the direction of the ray"); + RNA_def_property_ui_text(prop, "Direction", "Direction of the ray"); RNA_def_property_update(prop, NC_LOGIC, NULL); prop= RNA_def_property(srna, "direction_axis", PROP_ENUM, PROP_NONE); @@ -1150,7 +1150,7 @@ static void rna_def_constraint_actuator(BlenderRNA *brna) prop= RNA_def_property(srna, "range", PROP_FLOAT, PROP_NONE); RNA_def_property_float_funcs(prop, "rna_ConstraintActuator_range_get", "rna_ConstraintActuator_range_set", NULL); RNA_def_property_ui_range(prop, 0.f, 2000.f, 1, 2); - RNA_def_property_ui_text(prop, "Range", "Set the maximum length of ray"); + RNA_def_property_ui_text(prop, "Range", "Maximum length of ray"); RNA_def_property_update(prop, NC_LOGIC, NULL); prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE); @@ -1169,7 +1169,7 @@ static void rna_def_constraint_actuator(BlenderRNA *brna) //XXX add magic property lookup prop= RNA_def_property(srna, "property", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "matprop"); - RNA_def_property_ui_text(prop, "Property", "Ray detect only Objects with this property"); + RNA_def_property_ui_text(prop, "Property", "Ray detects only Objects with this property"); RNA_def_property_update(prop, NC_LOGIC, NULL); prop= RNA_def_property(srna, "time", PROP_INT, PROP_NONE); @@ -1201,14 +1201,14 @@ static void rna_def_constraint_actuator(BlenderRNA *brna) prop= RNA_def_property(srna, "angle_min", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "minloc[0]"); RNA_def_property_range(prop, 0.0, 180.0); - RNA_def_property_ui_text(prop, "Min Angle", "Minimum angle (in degree) to maintain with target direction. No correction is done if angle with target direction is between min and max"); + RNA_def_property_ui_text(prop, "Min Angle", "Minimum angle (in degree) to maintain with target direction (no correction is done if angle with target direction is between min and max)"); RNA_def_property_update(prop, NC_LOGIC, NULL); //XXX TODO - use radians internally then change to PROP_ANGLE prop= RNA_def_property(srna, "angle_max", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "maxloc[0]"); RNA_def_property_range(prop, 0.0, 180.0); - RNA_def_property_ui_text(prop, "Max Angle", "Maximum angle (in degree) allowed with target direction. No correction is done if angle with target direction is between min and max"); + RNA_def_property_ui_text(prop, "Max Angle", "Maximum angle (in degree) allowed with target direction (no correction is done if angle with target direction is between min and max)"); RNA_def_property_update(prop, NC_LOGIC, NULL); /* ACT_CONST_TYPE_FH */ @@ -1310,7 +1310,7 @@ static void rna_def_edit_object_actuator(BlenderRNA *brna) RNA_def_property_struct_type(prop, "Object"); RNA_def_property_pointer_sdna(prop, NULL, "ob"); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_ui_text(prop, "Object", "Add this Object and all its children (cant be on an visible layer)"); + RNA_def_property_ui_text(prop, "Object", "Add this Object and all its children (can't be on a visible layer)"); RNA_def_property_update(prop, NC_LOGIC, NULL); prop= RNA_def_property(srna, "track_object", PROP_POINTER, PROP_NONE); @@ -1411,13 +1411,13 @@ static void rna_def_scene_actuator(BlenderRNA *brna) prop= RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "Object"); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_ui_text(prop, "Camera Object", "Set this Camera. Leave empty to refer to self object"); + RNA_def_property_ui_text(prop, "Camera Object", "Set this Camera (leave empty to refer to self object)"); RNA_def_property_update(prop, NC_LOGIC, NULL); prop= RNA_def_property(srna, "scene", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "Scene"); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_ui_text(prop, "Scene", "Set the Scene to be added/removed/paused/resumed"); + RNA_def_property_ui_text(prop, "Scene", "Scene to be added/removed/paused/resumed"); RNA_def_property_update(prop, NC_LOGIC, NULL); /* XXX no need for those tooltips. to remove soon @@ -1462,7 +1462,7 @@ static void rna_def_random_actuator(BlenderRNA *brna) prop= RNA_def_property(srna, "seed", PROP_INT, PROP_NONE); RNA_def_property_ui_range(prop, 0, 1000, 1, 1); RNA_def_property_range(prop, 0, MAXFRAME); - RNA_def_property_ui_text(prop, "Seed", "Initial seed of the random generator. Use Python for more freedom (choose 0 for not random)"); + RNA_def_property_ui_text(prop, "Seed", "Initial seed of the random generator, use Python for more freedom (choose 0 for not random)"); RNA_def_property_update(prop, NC_LOGIC, NULL); prop= RNA_def_property(srna, "property", PROP_STRING, PROP_NONE); @@ -1491,7 +1491,7 @@ static void rna_def_random_actuator(BlenderRNA *brna) prop= RNA_def_property(srna, "chance", PROP_FLOAT, PROP_PERCENTAGE); RNA_def_property_float_sdna(prop, NULL, "float_arg_1"); RNA_def_property_range(prop, 0.0, 1.0); - RNA_def_property_ui_text(prop, "Chance", "Pick a number between 0 and 1. Success if you stay below this value"); + RNA_def_property_ui_text(prop, "Chance", "Pick a number between 0 and 1, success if it's below this value"); RNA_def_property_update(prop, NC_LOGIC, NULL); /* ACT_RANDOM_INT_CONST */ @@ -1505,13 +1505,13 @@ static void rna_def_random_actuator(BlenderRNA *brna) prop= RNA_def_property(srna, "int_min", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "int_arg_1"); RNA_def_property_range(prop, -1000, 1000); - RNA_def_property_ui_text(prop, "Min", "Choose a number from a range. Lower boundary of the range"); + RNA_def_property_ui_text(prop, "Min", "Choose a number from a range: lower boundary of the range"); RNA_def_property_update(prop, NC_LOGIC, NULL); prop= RNA_def_property(srna, "int_max", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "int_arg_2"); RNA_def_property_range(prop, -1000, 1000); - RNA_def_property_ui_text(prop, "Max", "Choose a number from a range. Upper boundary of the range"); + RNA_def_property_ui_text(prop, "Max", "Choose a number from a range: upper boundary of the range"); RNA_def_property_update(prop, NC_LOGIC, NULL); /* ACT_RANDOM_INT_POISSON */ @@ -1532,26 +1532,26 @@ static void rna_def_random_actuator(BlenderRNA *brna) prop= RNA_def_property(srna, "float_min", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "float_arg_1"); RNA_def_property_range(prop, -1000.0, 1000.0); - RNA_def_property_ui_text(prop, "Min", "Choose a number from a range. Lower boundary of the range"); + RNA_def_property_ui_text(prop, "Min", "Choose a number from a range: lower boundary of the range"); RNA_def_property_update(prop, NC_LOGIC, NULL); prop= RNA_def_property(srna, "float_max", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "float_arg_2"); RNA_def_property_range(prop, -1000.0, 1000.0); - RNA_def_property_ui_text(prop, "Max", "Choose a number from a range. Upper boundary of the range"); + RNA_def_property_ui_text(prop, "Max", "Choose a number from a range: upper boundary of the range"); RNA_def_property_update(prop, NC_LOGIC, NULL); /* ACT_RANDOM_FLOAT_NORMAL */ prop= RNA_def_property(srna, "float_mean", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "float_arg_1"); RNA_def_property_range(prop, -1000.0, 1000.0); - RNA_def_property_ui_text(prop, "Mean", "A normal distribution. Mean of the distribution"); + RNA_def_property_ui_text(prop, "Mean", "A normal distribution: mean of the distribution"); RNA_def_property_update(prop, NC_LOGIC, NULL); prop= RNA_def_property(srna, "standard_derivation", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "float_arg_2"); RNA_def_property_range(prop, -1000.0, 1000.0); - RNA_def_property_ui_text(prop, "SD", "A normal distribution. Standard deviation of the distribution"); + RNA_def_property_ui_text(prop, "SD", "A normal distribution: standard deviation of the distribution"); RNA_def_property_update(prop, NC_LOGIC, NULL); /* ACT_RANDOM_FLOAT_NEGATIVE_EXPONENTIAL */ @@ -1578,11 +1578,11 @@ static void rna_def_message_actuator(BlenderRNA *brna) prop= RNA_def_property(srna, "to_property", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "toPropName"); - RNA_def_property_ui_text(prop, "To", "Optional send message to objects with this name only, or empty to broadcast"); + RNA_def_property_ui_text(prop, "To", "Optional, send message to objects with this name only, or empty to broadcast"); RNA_def_property_update(prop, NC_LOGIC, NULL); prop= RNA_def_property(srna, "subject", PROP_STRING, PROP_NONE); - RNA_def_property_ui_text(prop, "Subject", "Optional message subject. This is what can be filtered on"); + RNA_def_property_ui_text(prop, "Subject", "Optional, message subject (this is what can be filtered on)"); RNA_def_property_update(prop, NC_LOGIC, NULL); prop= RNA_def_property(srna, "body_type", PROP_ENUM, PROP_NONE); @@ -1593,7 +1593,7 @@ static void rna_def_message_actuator(BlenderRNA *brna) /* ACT_MESG_MESG */ prop= RNA_def_property(srna, "body_message", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "body"); - RNA_def_property_ui_text(prop, "Body", "Optional message body Text"); + RNA_def_property_ui_text(prop, "Body", "Optional, message body Text"); RNA_def_property_update(prop, NC_LOGIC, NULL); /* ACT_MESG_PROP */ @@ -1649,12 +1649,12 @@ static void rna_def_visibility_actuator(BlenderRNA *brna) prop= RNA_def_property(srna, "use_visible", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", ACT_VISIBILITY_INVISIBLE); - RNA_def_property_ui_text(prop, "Visible", "Set the objects visible. Initialized from the object render restriction toggle in physics button"); + RNA_def_property_ui_text(prop, "Visible", "Set the objects visible (initialized from the object render restriction toggle in physics button)"); RNA_def_property_update(prop, NC_LOGIC, NULL); prop= RNA_def_property(srna, "use_occlusion", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_VISIBILITY_OCCLUSION); - RNA_def_property_ui_text(prop, "Occlusion", "Set the object to occlude objects behind it. Initialized from the object type in physics button"); + RNA_def_property_ui_text(prop, "Occlusion", "Set the object to occlude objects behind it (initialized from the object type in physics button)"); RNA_def_property_update(prop, NC_LOGIC, NULL); prop= RNA_def_property(srna, "apply_to_children", PROP_BOOLEAN, PROP_NONE); @@ -1712,7 +1712,7 @@ static void rna_def_twodfilter_actuator(BlenderRNA *brna) prop= RNA_def_property(srna, "motion_blur_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "float_arg"); - RNA_def_property_ui_text(prop, "Value", "Set motion blur factor"); + RNA_def_property_ui_text(prop, "Value", "Motion blur factor"); RNA_def_property_range(prop, 0.0, 1.0); RNA_def_property_update(prop, NC_LOGIC, NULL); @@ -1828,7 +1828,7 @@ static void rna_def_shape_action_actuator(BlenderRNA *brna) prop= RNA_def_property(srna, "priority", PROP_INT, PROP_NONE); RNA_def_property_range(prop, 0, 100); - RNA_def_property_ui_text(prop, "Priority", "Execution priority - lower numbers will override actions with higher numbers. With 2 or more actions at once, the overriding channels must be lower in the stack"); + RNA_def_property_ui_text(prop, "Priority", "Execution priority - lower numbers will override actions with higher numbers (with 2 or more actions at once, the overriding channels must be lower in the stack)"); RNA_def_property_update(prop, NC_LOGIC, NULL); prop= RNA_def_property(srna, "frame_property", PROP_STRING, PROP_NONE); @@ -1904,7 +1904,7 @@ static void rna_def_armature_actuator(BlenderRNA *brna) prop= RNA_def_property(srna, "constraint", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "constraint"); - RNA_def_property_ui_text(prop, "Constraint", "Name of the constraint you want to control"); + RNA_def_property_ui_text(prop, "Constraint", "Name of the constraint to control"); RNA_def_property_update(prop, NC_LOGIC, "rna_Actuator_Armature_update"); prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE); @@ -1923,7 +1923,7 @@ static void rna_def_armature_actuator(BlenderRNA *brna) prop= RNA_def_property(srna, "weight", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "weight"); RNA_def_property_range(prop, 0.0, 1.0); - RNA_def_property_ui_text(prop, "Weight", "Set weight of this constraint"); + RNA_def_property_ui_text(prop, "Weight", "Weight of this constraint"); RNA_def_property_update(prop, NC_LOGIC, NULL); } @@ -1985,7 +1985,7 @@ static void rna_def_steering_actuator(BlenderRNA *brna) RNA_def_property_struct_type(prop, "Object"); RNA_def_property_pointer_sdna(prop, NULL, "target"); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_ui_text(prop, "Target Object", "Set target object"); + RNA_def_property_ui_text(prop, "Target Object", "Target object"); RNA_def_property_update(prop, NC_LOGIC, NULL); prop= RNA_def_property(srna, "self_terminated", PROP_BOOLEAN, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_armature.c b/source/blender/makesrna/intern/rna_armature.c index 1ea1a4e3e7b..6785f1f4caf 100644 --- a/source/blender/makesrna/intern/rna_armature.c +++ b/source/blender/makesrna/intern/rna_armature.c @@ -169,7 +169,7 @@ static IDProperty *rna_Bone_idprops(PointerRNA *ptr, int create) if(create && !bone->prop) { IDPropertyTemplate val = {0}; - bone->prop= IDP_New(IDP_GROUP, val, "RNA_Bone ID properties"); + bone->prop= IDP_New(IDP_GROUP, &val, "RNA_Bone ID properties"); } return bone->prop; @@ -181,7 +181,7 @@ static IDProperty *rna_EditBone_idprops(PointerRNA *ptr, int create) if(create && !ebone->prop) { IDPropertyTemplate val = {0}; - ebone->prop= IDP_New(IDP_GROUP, val, "RNA_EditBone ID properties"); + ebone->prop= IDP_New(IDP_GROUP, &val, "RNA_EditBone ID properties"); } return ebone->prop; diff --git a/source/blender/makesrna/intern/rna_camera.c b/source/blender/makesrna/intern/rna_camera.c index 1e7a969caaa..6f6a4baec92 100644 --- a/source/blender/makesrna/intern/rna_camera.c +++ b/source/blender/makesrna/intern/rna_camera.c @@ -39,34 +39,21 @@ #ifdef RNA_RUNTIME +#include "BKE_camera.h" #include "BKE_object.h" #include "BKE_depsgraph.h" -/* only for rad/deg conversion! can remove later */ -static float get_camera_sensor(Camera *cam) -{ - if(cam->sensor_fit==CAMERA_SENSOR_FIT_AUTO) { - return cam->sensor_x; - } - else if(cam->sensor_fit==CAMERA_SENSOR_FIT_HOR) { - return cam->sensor_x; - } - else { - return cam->sensor_y; - } -} - static float rna_Camera_angle_get(PointerRNA *ptr) { Camera *cam= ptr->id.data; - float sensor= get_camera_sensor(cam); + float sensor= camera_sensor_size(cam->sensor_fit, cam->sensor_x, cam->sensor_y); return focallength_to_fov(cam->lens, sensor); } static void rna_Camera_angle_set(PointerRNA *ptr, float value) { Camera *cam= ptr->id.data; - float sensor= get_camera_sensor(cam); + float sensor= camera_sensor_size(cam->sensor_fit, cam->sensor_x, cam->sensor_y); cam->lens= fov_to_focallength(value, sensor); } @@ -126,9 +113,9 @@ void RNA_def_camera(BlenderRNA *brna) {CAM_ANGLETOGGLE, "DEGREES", 0, "Degrees", ""}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem sensor_fit_items[] = { - {CAMERA_SENSOR_FIT_AUTO, "AUTO", 0, "Auto", "Calculate field of view using sensor size, with direction depending on image resolution"}, - {CAMERA_SENSOR_FIT_HOR, "HORIZONTAL", 0, "Horizontal", "Calculate field of view using sensor width"}, - {CAMERA_SENSOR_FIT_VERT, "VERTICAL", 0, "Vertical", "Calculate field of view using sensor height"}, + {CAMERA_SENSOR_FIT_AUTO, "AUTO", 0, "Auto", "Fit to the sensor width or height depending on image resolution"}, + {CAMERA_SENSOR_FIT_HOR, "HORIZONTAL", 0, "Horizontal", "Fit to the sensor width"}, + {CAMERA_SENSOR_FIT_VERT, "VERTICAL", 0, "Vertical", "Fit to the sensor height"}, {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "Camera", "ID"); @@ -151,7 +138,7 @@ void RNA_def_camera(BlenderRNA *brna) prop= RNA_def_property(srna, "sensor_fit", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "sensor_fit"); RNA_def_property_enum_items(prop, sensor_fit_items); - RNA_def_property_ui_text(prop, "Sensor Fit", "Mode of calculating field of view from sensor dimensions and focal length"); + RNA_def_property_ui_text(prop, "Sensor Fit", "Method to fit image and field of view angle inside the sensor"); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_update"); /* Number values */ diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c index e1e4f3929b2..4ab14550fd1 100644 --- a/source/blender/makesrna/intern/rna_constraint.c +++ b/source/blender/makesrna/intern/rna_constraint.c @@ -43,6 +43,9 @@ #include "WM_types.h" EnumPropertyItem constraint_type_items[] ={ + {0, "", 0, "Motion Tracking", ""}, + {CONSTRAINT_TYPE_CAMERASOLVER, "CAMERA_SOLVER", ICON_CONSTRAINT_DATA, "Camera Solver", ""}, + {CONSTRAINT_TYPE_FOLLOWTRACK, "FOLLOW_TRACK", ICON_CONSTRAINT_DATA, "Follow Track", ""}, {0, "", 0, "Transform", ""}, {CONSTRAINT_TYPE_LOCLIKE, "COPY_LOCATION", ICON_CONSTRAINT_DATA, "Copy Location", ""}, {CONSTRAINT_TYPE_ROTLIKE, "COPY_ROTATION", ICON_CONSTRAINT_DATA, "Copy Rotation", ""}, @@ -64,11 +67,9 @@ EnumPropertyItem constraint_type_items[] ={ {CONSTRAINT_TYPE_TRACKTO, "TRACK_TO", ICON_CONSTRAINT_DATA, "Track To", "Legacy tracking constraint prone to twisting artifacts"}, {0, "", 0, "Relationship", ""}, {CONSTRAINT_TYPE_ACTION, "ACTION", ICON_CONSTRAINT_DATA, "Action", ""}, - {CONSTRAINT_TYPE_CAMERASOLVER, "CAMERA_SOLVER", ICON_CONSTRAINT_DATA, "Camera Solver", ""}, {CONSTRAINT_TYPE_CHILDOF, "CHILD_OF", ICON_CONSTRAINT_DATA, "Child Of", ""}, {CONSTRAINT_TYPE_MINMAX, "FLOOR", ICON_CONSTRAINT_DATA, "Floor", ""}, {CONSTRAINT_TYPE_FOLLOWPATH, "FOLLOW_PATH", ICON_CONSTRAINT_DATA, "Follow Path", ""}, - {CONSTRAINT_TYPE_FOLLOWTRACK, "FOLLOW_TRACK", ICON_CONSTRAINT_DATA, "Follow Track", ""}, {CONSTRAINT_TYPE_PIVOT, "PIVOT", ICON_CONSTRAINT_DATA, "Pivot", ""}, {CONSTRAINT_TYPE_RIGIDBODYJOINT, "RIGID_BODY_JOINT", ICON_CONSTRAINT_DATA, "Rigid Body Joint", ""}, {CONSTRAINT_TYPE_PYTHON, "SCRIPT", ICON_CONSTRAINT_DATA, "Script", ""}, @@ -366,7 +367,7 @@ static void rna_def_constraint_childof(BlenderRNA *brna) PropertyRNA *prop; srna= RNA_def_struct(brna, "ChildOfConstraint", "Constraint"); - RNA_def_struct_ui_text(srna, "Child Of Constraint", "Creates constraint-based parent-child relationship"); + RNA_def_struct_ui_text(srna, "Child Of Constraint", "Create constraint-based parent-child relationship"); RNA_def_struct_sdna_from(srna, "bChildOfConstraint", "data"); prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE); @@ -439,7 +440,7 @@ static void rna_def_constraint_python(BlenderRNA *brna) PropertyRNA *prop; srna= RNA_def_struct(brna, "PythonConstraint", "Constraint"); - RNA_def_struct_ui_text(srna, "Python Constraint", "Uses Python script for constraint evaluation"); + RNA_def_struct_ui_text(srna, "Python Constraint", "Use Python script for constraint evaluation"); RNA_def_struct_sdna_from(srna, "bPythonConstraint", "data"); prop= RNA_def_property(srna, "targets", PROP_COLLECTION, PROP_NONE); @@ -640,7 +641,7 @@ static void rna_def_constraint_track_to(BlenderRNA *brna) {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "TrackToConstraint", "Constraint"); - RNA_def_struct_ui_text(srna, "Track To Constraint", "Aims the constrained object toward the target"); + RNA_def_struct_ui_text(srna, "Track To Constraint", "Aim the constrained object toward the target"); prop= RNA_def_property(srna, "head_tail", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, "bConstraint", "headtail"); @@ -684,7 +685,7 @@ static void rna_def_constraint_locate_like(BlenderRNA *brna) PropertyRNA *prop; srna= RNA_def_struct(brna, "CopyLocationConstraint", "Constraint"); - RNA_def_struct_ui_text(srna, "Copy Location Constraint", "Copies the location of the target"); + RNA_def_struct_ui_text(srna, "Copy Location Constraint", "Copy the location of the target"); prop= RNA_def_property(srna, "head_tail", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, "bConstraint", "headtail"); @@ -747,7 +748,7 @@ static void rna_def_constraint_rotate_like(BlenderRNA *brna) PropertyRNA *prop; srna= RNA_def_struct(brna, "CopyRotationConstraint", "Constraint"); - RNA_def_struct_ui_text(srna, "Copy Rotation Constraint", "Copies the rotation of the target"); + RNA_def_struct_ui_text(srna, "Copy Rotation Constraint", "Copy the rotation of the target"); RNA_def_struct_sdna_from(srna, "bRotateLikeConstraint", "data"); prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE); @@ -803,7 +804,7 @@ static void rna_def_constraint_size_like(BlenderRNA *brna) PropertyRNA *prop; srna= RNA_def_struct(brna, "CopyScaleConstraint", "Constraint"); - RNA_def_struct_ui_text(srna, "Copy Scale Constraint", "Copies the scale of the target"); + RNA_def_struct_ui_text(srna, "Copy Scale Constraint", "Copy the scale of the target"); RNA_def_struct_sdna_from(srna, "bSizeLikeConstraint", "data"); prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE); @@ -851,7 +852,7 @@ static void rna_def_constraint_same_volume(BlenderRNA *brna) {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "MaintainVolumeConstraint", "Constraint"); - RNA_def_struct_ui_text(srna, "Maintain Volume Constraint", "Maintains a constant volume along a single scaling axis"); + RNA_def_struct_ui_text(srna, "Maintain Volume Constraint", "Maintain a constant volume along a single scaling axis"); RNA_def_struct_sdna_from(srna, "bSameVolumeConstraint", "data"); prop= RNA_def_property(srna, "free_axis", PROP_ENUM, PROP_NONE); @@ -873,7 +874,7 @@ static void rna_def_constraint_transform_like(BlenderRNA *brna) PropertyRNA *prop; srna= RNA_def_struct(brna, "CopyTransformsConstraint", "Constraint"); - RNA_def_struct_ui_text(srna, "Copy Transforms Constraint", "Copies all the transforms of the target"); + RNA_def_struct_ui_text(srna, "Copy Transforms Constraint", "Copy all the transforms of the target"); prop= RNA_def_property(srna, "head_tail", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, "bConstraint", "headtail"); @@ -909,7 +910,7 @@ static void rna_def_constraint_minmax(BlenderRNA *brna) {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "FloorConstraint", "Constraint"); - RNA_def_struct_ui_text(srna, "Floor Constraint", "Uses the target object for location limitation"); + RNA_def_struct_ui_text(srna, "Floor Constraint", "Use the target object for location limitation"); RNA_def_struct_sdna_from(srna, "bMinMaxConstraint","data"); prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE); @@ -1037,7 +1038,7 @@ static void rna_def_constraint_locked_track(BlenderRNA *brna) {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "LockedTrackConstraint", "Constraint"); - RNA_def_struct_ui_text(srna, "Locked Track Constraint", "Points toward the target along the track axis, while locking the other axis"); + RNA_def_struct_ui_text(srna, "Locked Track Constraint", "Point toward the target along the track axis, while locking the other axis"); prop= RNA_def_property(srna, "head_tail", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, "bConstraint", "headtail"); @@ -1091,7 +1092,7 @@ static void rna_def_constraint_follow_path(BlenderRNA *brna) {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "FollowPathConstraint", "Constraint"); - RNA_def_struct_ui_text(srna, "Follow Path Constraint", "Locks motion to the target path"); + RNA_def_struct_ui_text(srna, "Follow Path Constraint", "Lock motion to the target path"); RNA_def_struct_sdna_from(srna, "bFollowPathConstraint", "data"); prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE); @@ -1136,7 +1137,7 @@ static void rna_def_constraint_follow_path(BlenderRNA *brna) 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_ui_text(prop, "Curve Radius", "Object is scaled by the curve radius"); RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); } @@ -1158,7 +1159,7 @@ static void rna_def_constraint_stretch_to(BlenderRNA *brna) {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "StretchToConstraint", "Constraint"); - RNA_def_struct_ui_text(srna, "Stretch To Constraint", "Stretches to meet the target object"); + RNA_def_struct_ui_text(srna, "Stretch To Constraint", "Stretch to meet the target object"); prop= RNA_def_property(srna, "head_tail", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, "bConstraint", "headtail"); @@ -1208,9 +1209,9 @@ static void rna_def_constraint_rigid_body_joint(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem pivot_items[] = { - {CONSTRAINT_RB_BALL, "BALL", 0, "Ball", "Allows rotations around all axes"}, - {CONSTRAINT_RB_HINGE, "HINGE", 0, "Hinge", "Works in one plane, allows rotations around one axis only"}, - {CONSTRAINT_RB_CONETWIST, "CONE_TWIST", 0, "Cone Twist", "Allows rotations around all axes with limits for the cone and twist axes"}, + {CONSTRAINT_RB_BALL, "BALL", 0, "Ball", "Allow rotations around all axes"}, + {CONSTRAINT_RB_HINGE, "HINGE", 0, "Hinge", "Work in one plane, allow rotations around one axis only"}, + {CONSTRAINT_RB_CONETWIST, "CONE_TWIST", 0, "Cone Twist", "Allow rotations around all axes with limits for the cone and twist axes"}, {CONSTRAINT_RB_GENERIC6DOF, "GENERIC_6_DOF", 0, "Generic 6 DoF", "No constraints by default, limits can be set individually"}, {0, NULL, 0, NULL, NULL}}; @@ -1342,7 +1343,7 @@ static void rna_def_constraint_rigid_body_joint(BlenderRNA *brna) /* Limit Booleans */ prop= RNA_def_property(srna, "use_limit_x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", 1); - RNA_def_property_ui_text(prop, "Limit X", "Use minimum/maximum x limit"); + RNA_def_property_ui_text(prop, "Limit X", "Use minimum/maximum X limit"); RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); prop= RNA_def_property(srna, "use_limit_y", PROP_BOOLEAN, PROP_NONE); @@ -1357,17 +1358,17 @@ static void rna_def_constraint_rigid_body_joint(BlenderRNA *brna) prop= RNA_def_property(srna, "use_angular_limit_x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", 8); - RNA_def_property_ui_text(prop, "Angular X Limit", "Use minimum/maximum x angular limit"); + RNA_def_property_ui_text(prop, "Angular X Limit", "Use minimum/maximum X angular limit"); RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); prop= RNA_def_property(srna, "use_angular_limit_y", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", 16); - RNA_def_property_ui_text(prop, "Angular Y Limit", "Use minimum/maximum y angular limit"); + RNA_def_property_ui_text(prop, "Angular Y Limit", "Use minimum/maximum Y angular limit"); RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); prop= RNA_def_property(srna, "use_angular_limit_z", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", 32); - RNA_def_property_ui_text(prop, "Angular Z Limit", "Use minimum/maximum z angular limit"); + RNA_def_property_ui_text(prop, "Angular Z Limit", "Use minimum/maximum Z angular limit"); RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); } @@ -1402,7 +1403,7 @@ static void rna_def_constraint_clamp_to(BlenderRNA *brna) prop= RNA_def_property(srna, "use_cyclic", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag2", CLAMPTO_CYCLIC); - RNA_def_property_ui_text(prop, "Cyclic", "Treat curve as cyclic curve (no clamping to curve bounding box"); + RNA_def_property_ui_text(prop, "Cyclic", "Treat curve as cyclic curve (no clamping to curve bounding box)"); RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); } @@ -1552,7 +1553,7 @@ static void rna_def_constraint_location_limit(BlenderRNA *brna) PropertyRNA *prop; srna= RNA_def_struct(brna, "LimitLocationConstraint", "Constraint"); - RNA_def_struct_ui_text(srna, "Limit Location Constraint", "Limits the location of the constrained object"); + RNA_def_struct_ui_text(srna, "Limit Location Constraint", "Limit the location of the constrained object"); RNA_def_struct_sdna_from(srna, "bLocLimitConstraint", "data"); prop= RNA_def_property(srna, "use_min_x", PROP_BOOLEAN, PROP_NONE); @@ -1633,7 +1634,7 @@ static void rna_def_constraint_rotation_limit(BlenderRNA *brna) PropertyRNA *prop; srna= RNA_def_struct(brna, "LimitRotationConstraint", "Constraint"); - RNA_def_struct_ui_text(srna, "Limit Rotation Constraint", "Limits the rotation of the constrained object"); + RNA_def_struct_ui_text(srna, "Limit Rotation Constraint", "Limit the rotation of the constrained object"); RNA_def_struct_sdna_from(srna, "bRotLimitConstraint", "data"); prop= RNA_def_property(srna, "use_limit_x", PROP_BOOLEAN, PROP_NONE); @@ -1699,7 +1700,7 @@ static void rna_def_constraint_size_limit(BlenderRNA *brna) PropertyRNA *prop; srna= RNA_def_struct(brna, "LimitScaleConstraint", "Constraint"); - RNA_def_struct_ui_text(srna, "Limit Size Constraint", "Limits the scaling of the constrained object"); + RNA_def_struct_ui_text(srna, "Limit Size Constraint", "Limit the scaling of the constrained object"); RNA_def_struct_sdna_from(srna, "bSizeLimitConstraint", "data"); prop= RNA_def_property(srna, "use_min_x", PROP_BOOLEAN, PROP_NONE); @@ -1780,7 +1781,7 @@ static void rna_def_constraint_distance_limit(BlenderRNA *brna) PropertyRNA *prop; srna= RNA_def_struct(brna, "LimitDistanceConstraint", "Constraint"); - RNA_def_struct_ui_text(srna, "Limit Distance Constraint", "Limits the distance from target object"); + RNA_def_struct_ui_text(srna, "Limit Distance Constraint", "Limit the distance from target object"); prop= RNA_def_property(srna, "head_tail", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, "bConstraint", "headtail"); @@ -1824,13 +1825,13 @@ static void rna_def_constraint_shrinkwrap(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem type_items[] = { - {MOD_SHRINKWRAP_NEAREST_SURFACE, "NEAREST_SURFACE", 0, "Nearest Surface Point", "Shrinks the location to the nearest target surface"}, - {MOD_SHRINKWRAP_PROJECT, "PROJECT", 0, "Project", "Shrinks the location to the nearest target surface along a given axis"}, - {MOD_SHRINKWRAP_NEAREST_VERTEX, "NEAREST_VERTEX", 0, "Nearest Vertex", "Shrinks the location to the nearest target vertex"}, + {MOD_SHRINKWRAP_NEAREST_SURFACE, "NEAREST_SURFACE", 0, "Nearest Surface Point", "Shrink the location to the nearest target surface"}, + {MOD_SHRINKWRAP_PROJECT, "PROJECT", 0, "Project", "Shrink the location to the nearest target surface along a given axis"}, + {MOD_SHRINKWRAP_NEAREST_VERTEX, "NEAREST_VERTEX", 0, "Nearest Vertex", "Shrink the location to the nearest target vertex"}, {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "ShrinkwrapConstraint", "Constraint"); - RNA_def_struct_ui_text(srna, "Shrinkwrap Constraint", "Creates constraint-based shrinkwrap relationship"); + RNA_def_struct_ui_text(srna, "Shrinkwrap Constraint", "Create constraint-based shrinkwrap relationship"); RNA_def_struct_sdna_from(srna, "bShrinkwrapConstraint", "data"); prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE); @@ -1843,7 +1844,7 @@ static void rna_def_constraint_shrinkwrap(BlenderRNA *brna) prop= RNA_def_property(srna, "shrinkwrap_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "shrinkType"); RNA_def_property_enum_items(prop, type_items); - RNA_def_property_ui_text(prop, "Shrinkwrap Type", "Selects type of shrinkwrap algorithm for target position"); + RNA_def_property_ui_text(prop, "Shrinkwrap Type", "Select type of shrinkwrap algorithm for target position"); RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_DISTANCE); @@ -1883,7 +1884,7 @@ static void rna_def_constraint_damped_track(BlenderRNA *brna) {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "DampedTrackConstraint", "Constraint"); - RNA_def_struct_ui_text(srna, "Damped Track Constraint", "Points toward target by taking the shortest rotation path"); + RNA_def_struct_ui_text(srna, "Damped Track Constraint", "Point toward target by taking the shortest rotation path"); prop= RNA_def_property(srna, "head_tail", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, "bConstraint", "headtail"); @@ -2037,13 +2038,8 @@ static void rna_def_constraint_follow_track(BlenderRNA *brna) StructRNA *srna; PropertyRNA *prop; - static EnumPropertyItem reference_items[] = { - {FOLLOWTRACK_TRACK, "TRACK", 0, "Track", "Use 2D track position as reference"}, - {FOLLOWTRACK_BUNDLE, "BUNDLE", 0, "Bundle", "Use 3D reconstructed bundle position as reference"}, - {0, NULL, 0, NULL, NULL}}; - srna= RNA_def_struct(brna, "FollowTrackConstraint", "Constraint"); - RNA_def_struct_ui_text(srna, "Follow Track Constraint", "Locks motion to the target motion track"); + RNA_def_struct_ui_text(srna, "Follow Track Constraint", "Lock motion to the target motion track"); RNA_def_struct_sdna_from(srna, "bFollowTrackConstraint", "data"); /* movie clip */ @@ -2059,18 +2055,17 @@ static void rna_def_constraint_follow_track(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Track", "Movie tracking track to follow"); RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); - /* reference */ - prop= RNA_def_property(srna, "reference", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "reference"); - RNA_def_property_enum_items(prop, reference_items); - RNA_def_property_ui_text(prop, "Reference", "Reference source to follow"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); - /* use default clip */ prop= RNA_def_property(srna, "use_active_clip", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", FOLLOWTRACK_ACTIVECLIP); RNA_def_property_ui_text(prop, "Active Clip", "Use active clip defined in scene"); RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + + /* use 3d position */ + prop= RNA_def_property(srna, "use_3d_position", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", FOLLOWTRACK_USE_3D_POSITION); + RNA_def_property_ui_text(prop, "3D Position", "Use 3D position of track to parent to"); + RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); } static void rna_def_constraint_camera_solver(BlenderRNA *brna) @@ -2079,7 +2074,7 @@ static void rna_def_constraint_camera_solver(BlenderRNA *brna) PropertyRNA *prop; srna= RNA_def_struct(brna, "CameraSolverConstraint", "Constraint"); - RNA_def_struct_ui_text(srna, "Follow Track Constraint", "Locks motion to the reconstructed camera movenment"); + RNA_def_struct_ui_text(srna, "Follow Track Constraint", "Lock motion to the reconstructed camera movement"); RNA_def_struct_sdna_from(srna, "bCameraSolverConstraint", "data"); /* movie clip */ diff --git a/source/blender/makesrna/intern/rna_context.c b/source/blender/makesrna/intern/rna_context.c index f041d3efde4..043645aaf57 100644 --- a/source/blender/makesrna/intern/rna_context.c +++ b/source/blender/makesrna/intern/rna_context.c @@ -35,6 +35,8 @@ #include "BKE_context.h" +#include "rna_internal.h" /* own include */ + #ifdef RNA_RUNTIME static PointerRNA rna_Context_manager_get(PointerRNA *ptr) diff --git a/source/blender/makesrna/intern/rna_controller.c b/source/blender/makesrna/intern/rna_controller.c index 89239c10ffd..5278c1e3532 100644 --- a/source/blender/makesrna/intern/rna_controller.c +++ b/source/blender/makesrna/intern/rna_controller.c @@ -258,7 +258,7 @@ void RNA_def_controller(BlenderRNA *brna) RNA_def_property_update(prop, NC_LOGIC, NULL); prop= RNA_def_property(srna, "module", PROP_STRING, PROP_NONE); - RNA_def_property_ui_text(prop, "Module", "Module name and function to run e.g. \"someModule.main\". Internal texts and external python files can be used"); + RNA_def_property_ui_text(prop, "Module", "Module name and function to run, e.g. \"someModule.main\" (internal texts and external python files can be used)"); RNA_def_property_update(prop, NC_LOGIC, NULL); prop= RNA_def_property(srna, "use_debug", PROP_BOOLEAN, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c index d4756ecfefa..48274ffbd7a 100644 --- a/source/blender/makesrna/intern/rna_define.c +++ b/source/blender/makesrna/intern/rna_define.c @@ -2409,9 +2409,15 @@ PropertyRNA *RNA_def_float_rotation(StructOrFunctionRNA *cont_, const char *iden ContainerRNA *cont= cont_; PropertyRNA *prop; - prop= RNA_def_property(cont, identifier, PROP_FLOAT, PROP_EULER); // XXX - if(len != 0) RNA_def_property_array(prop, len); - if(default_value) RNA_def_property_float_array_default(prop, default_value); + prop= RNA_def_property(cont, identifier, PROP_FLOAT, (len != 0) ? PROP_EULER : PROP_ANGLE); + if(len != 0) { + RNA_def_property_array(prop, len); + if(default_value) RNA_def_property_float_array_default(prop, default_value); + } + else { + /* RNA_def_property_float_default must be called outside */ + BLI_assert(default_value == NULL); + } if(hardmin != hardmax) RNA_def_property_range(prop, hardmin, hardmax); RNA_def_property_ui_text(prop, ui_name, ui_description); RNA_def_property_ui_range(prop, softmin, softmax, 1, 3); diff --git a/source/blender/makesrna/intern/rna_dynamicpaint.c b/source/blender/makesrna/intern/rna_dynamicpaint.c index 00a73afb789..893993794ba 100644 --- a/source/blender/makesrna/intern/rna_dynamicpaint.c +++ b/source/blender/makesrna/intern/rna_dynamicpaint.c @@ -197,17 +197,13 @@ static void rna_DynamicPaint_uvlayer_set(PointerRNA *ptr, const char *value) } /* is point cache used */ -static int rna_DynamicPaint_uses_cache_get(PointerRNA *ptr) +static int rna_DynamicPaint_is_cache_user_get(PointerRNA *ptr) { DynamicPaintSurface *surface= (DynamicPaintSurface*)ptr->data; return (surface->format != MOD_DPAINT_SURFACE_F_IMAGESEQ) ? 1 : 0; } -static void rna_DynamicPaint_uses_cache_set(PointerRNA *ptr, int value) -{ -} - /* does output layer exist*/ static int rna_DynamicPaint_is_output_exists(DynamicPaintSurface *surface, Object *ob, int index) { @@ -481,16 +477,16 @@ static void rna_def_canvas_surface(BlenderRNA *brna) prop= RNA_def_property(srna, "use_dry_log", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_DRY_LOG); - RNA_def_property_ui_text(prop, "Slow", "Use logarithmic drying. Makes high values to fade faster than low values"); + RNA_def_property_ui_text(prop, "Slow", "Use logarithmic drying (makes high values to fade faster than low values)"); prop= RNA_def_property(srna, "use_dissolve_log", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_DISSOLVE_LOG); - RNA_def_property_ui_text(prop, "Slow", "Use logarithmic dissolve. Makes high values to fade faster than low values"); + RNA_def_property_ui_text(prop, "Slow", "Use logarithmic dissolve (makes high values to fade faster than low values)"); prop= RNA_def_property(srna, "use_spread", PROP_BOOLEAN, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_boolean_sdna(prop, NULL, "effect", MOD_DPAINT_EFFECT_DO_SPREAD); - RNA_def_property_ui_text(prop, "Use Spread", "Processes spread effect. Spreads wet paint around surface"); + RNA_def_property_ui_text(prop, "Use Spread", "Process spread effect (spread wet paint around surface)"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaintSurface_reset"); prop= RNA_def_property(srna, "spread_speed", PROP_FLOAT, PROP_NONE); @@ -508,13 +504,13 @@ static void rna_def_canvas_surface(BlenderRNA *brna) prop= RNA_def_property(srna, "use_drip", PROP_BOOLEAN, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_boolean_sdna(prop, NULL, "effect", MOD_DPAINT_EFFECT_DO_DRIP); - RNA_def_property_ui_text(prop, "Use Drip", "Processes drip effect. Drips wet paint to gravity direction"); + RNA_def_property_ui_text(prop, "Use Drip", "Process drip effect (drip wet paint to gravity direction)"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaintSurface_reset"); prop= RNA_def_property(srna, "use_shrink", PROP_BOOLEAN, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_boolean_sdna(prop, NULL, "effect", MOD_DPAINT_EFFECT_DO_SHRINK); - RNA_def_property_ui_text(prop, "Use Shrink", "Processes shrink effect. Shrinks paint areas"); + RNA_def_property_ui_text(prop, "Use Shrink", "Process shrink effect (shrink paint areas)"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaintSurface_reset"); prop= RNA_def_property(srna, "shrink_speed", PROP_FLOAT, PROP_NONE); @@ -532,41 +528,41 @@ static void rna_def_canvas_surface(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "drip_vel"); 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, "Velocity", "Defines how much surface velocity affects dripping"); + RNA_def_property_ui_text(prop, "Velocity", "How much surface velocity affects dripping"); prop= RNA_def_property(srna, "drip_acceleration", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "drip_acc"); 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, "Acceleration", "Defines how much surface acceleration affects dripping"); + RNA_def_property_ui_text(prop, "Acceleration", "How much surface acceleration affects dripping"); /* * Output settings */ - prop= RNA_def_property(srna, "premultiply", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "use_premultiply", PROP_BOOLEAN, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_MULALPHA); - RNA_def_property_ui_text(prop, "Premultiply alpha", "Multiplies color by alpha. (Recommended for Blender input)"); + RNA_def_property_ui_text(prop, "Premultiply alpha", "Multiply color by alpha (recommended for Blender input)"); prop= RNA_def_property(srna, "image_output_path", PROP_STRING, PROP_DIRPATH); RNA_def_property_string_sdna(prop, NULL, "image_output_path"); RNA_def_property_ui_text(prop, "Output Path", "Directory to save the textures"); /* output for primary surface data */ - prop= RNA_def_property(srna, "output_name", PROP_STRING, PROP_NONE); + prop= RNA_def_property(srna, "output_name_a", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "output_name"); RNA_def_property_ui_text(prop, "Output name", ""); - prop= RNA_def_property(srna, "do_output1", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "use_output_a", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_OUT1); RNA_def_property_ui_text(prop, "Save layer", "Output name"); /* output for secondary sufrace data */ - prop= RNA_def_property(srna, "output_name2", PROP_STRING, PROP_NONE); + prop= RNA_def_property(srna, "output_name_b", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "output_name2"); RNA_def_property_ui_text(prop, "Output name", "Output name"); - prop= RNA_def_property(srna, "do_output2", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "use_output_b", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_OUT2); RNA_def_property_ui_text(prop, "Save layer", ""); @@ -592,7 +588,7 @@ static void rna_def_canvas_surface(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_range(prop, 0.00, 50.0); RNA_def_property_ui_range(prop, 0.00, 5.0, 1, 2); - RNA_def_property_ui_text(prop, "Max Displace", "Maximum level of depth intersection in object space. Use 0.0 to disable"); + RNA_def_property_ui_text(prop, "Max Displace", "Maximum level of depth intersection in object space (use 0.0 to disable)"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); prop= RNA_def_property(srna, "displace_factor", PROP_FLOAT, PROP_NONE); @@ -627,8 +623,8 @@ static void rna_def_canvas_surface(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Damping", "Wave damping factor"); prop= RNA_def_property(srna, "wave_speed", PROP_FLOAT, PROP_NONE); - RNA_def_property_range(prop, 0.01, 3.0); - RNA_def_property_ui_range(prop, 0.01, 1.5, 1, 2); + RNA_def_property_range(prop, 0.01, 5.0); + RNA_def_property_ui_range(prop, 0.20, 4.0, 1, 2); RNA_def_property_ui_text(prop, "Speed", "Wave propogation speed"); prop= RNA_def_property(srna, "wave_timescale", PROP_FLOAT, PROP_NONE); @@ -641,9 +637,9 @@ static void rna_def_canvas_surface(BlenderRNA *brna) RNA_def_property_ui_range(prop, 0.01, 1.0, 1, 2); RNA_def_property_ui_text(prop, "Spring", "Spring force that pulls water level back to zero"); - prop= RNA_def_property(srna, "wave_open_borders", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "use_wave_open_border", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_WAVE_OPEN_BORDERS); - RNA_def_property_ui_text(prop, "Open Borders", "Passes waves through mesh edges"); + RNA_def_property_ui_text(prop, "Open Borders", "Pass waves through mesh edges"); /* cache */ @@ -653,10 +649,10 @@ static void rna_def_canvas_surface(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Point Cache", ""); /* is cache used */ - prop= RNA_def_property(srna, "uses_cache", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_funcs(prop, "rna_DynamicPaint_uses_cache_get", "rna_DynamicPaint_uses_cache_set"); - RNA_def_property_ui_text(prop, "Uses Cache", ""); - RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + prop= RNA_def_property(srna, "is_cache_user", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_funcs(prop, "rna_DynamicPaint_is_cache_user_get", NULL); + RNA_def_property_ui_text(prop, "Use Cache", ""); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE|PROP_EDITABLE); } static void rna_def_dynamic_paint_canvas_settings(BlenderRNA *brna) @@ -700,6 +696,7 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna) {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem prop_dynamicpaint_brush_wave_type[] = { + {MOD_DPAINT_WAVEB_CHANGE, "CHANGE", 0, "Depth Change", ""}, {MOD_DPAINT_WAVEB_DEPTH, "DEPTH", 0, "Obstacle", ""}, {MOD_DPAINT_WAVEB_FORCE, "FORCE", 0, "Force", ""}, {MOD_DPAINT_WAVEB_REFLECT, "REFLECT", 0, "Reflect Only", ""}, @@ -739,11 +736,11 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna) prop= RNA_def_property(srna, "material", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "mat"); - RNA_def_property_ui_text(prop, "Material", "Material to use. If not defined, material linked to the mesh is used"); + RNA_def_property_ui_text(prop, "Material", "Material to use (if not defined, material linked to the mesh is used)"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); - prop= RNA_def_property(srna, "absolute_alpha", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "use_absolute_alpha", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_ABS_ALPHA); RNA_def_property_ui_text(prop, "Absolute Alpha", "Only increase alpha value if paint alpha is higher than existing"); @@ -751,10 +748,10 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "wetness"); RNA_def_property_range(prop, 0.0, 1.0); RNA_def_property_ui_range(prop, 0.0, 1.0, 5, 2); - RNA_def_property_ui_text(prop, "Paint Wetness", "Paint wetness. Visible in wetmap. Some effects only affect wet paint"); + RNA_def_property_ui_text(prop, "Paint Wetness", "Paint wetness, visible in wetmap (some effects only affect wet paint)"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); - prop= RNA_def_property(srna, "paint_erase", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "use_paint_erase", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_ERASE); RNA_def_property_ui_text(prop, "Erase Paint", "Erase / remove paint instead of adding it"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); @@ -762,7 +759,7 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna) prop= RNA_def_property(srna, "wave_type", PROP_ENUM, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_enum_items(prop, prop_dynamicpaint_brush_wave_type); - RNA_def_property_ui_text(prop, "Brush Effect", ""); + RNA_def_property_ui_text(prop, "Wave Type", ""); prop= RNA_def_property(srna, "wave_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, -2.0, 2.0); @@ -772,33 +769,34 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna) prop= RNA_def_property(srna, "wave_clamp", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.00, 50.0); RNA_def_property_ui_range(prop, 0.00, 5.0, 1, 2); - RNA_def_property_ui_text(prop, "Clamp Waves", "Maximum level of surface intersection used to influence waves. Use 0.0 to disable"); + RNA_def_property_ui_text(prop, "Clamp Waves", "Maximum level of surface intersection used to influence waves (use 0.0 to disable)"); - prop= RNA_def_property(srna, "do_smudge", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "use_smudge", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_DO_SMUDGE); - RNA_def_property_ui_text(prop, "Do Smudge", "Makes this brush to smudge existing paint as it moves"); + RNA_def_property_ui_text(prop, "Do Smudge", "Make this brush to smudge existing paint as it moves"); prop= RNA_def_property(srna, "smudge_strength", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0, 1.0); RNA_def_property_ui_range(prop, 0.0, 1.0, 5, 2); RNA_def_property_ui_text(prop, "Smudge Strength", "Smudge effect strength"); - prop= RNA_def_property(srna, "max_velocity", PROP_FLOAT, PROP_NONE); + prop= RNA_def_property(srna, "velocity_max", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "max_velocity"); RNA_def_property_range(prop, 0.0001, 10.0); RNA_def_property_ui_range(prop, 0.1, 2.0, 5, 2); - RNA_def_property_ui_text(prop, "Max Velocity", "Velocity considered as maximum influence. (Blender units per frame)"); + RNA_def_property_ui_text(prop, "Max Velocity", "Velocity considered as maximum influence (Blender units per frame)"); - prop= RNA_def_property(srna, "velocity_alpha", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "use_velocity_alpha", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_VELOCITY_ALPHA); RNA_def_property_ui_text(prop, "Multiply Alpha", "Multiply brush influence by velocity color ramp alpha"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); - prop= RNA_def_property(srna, "velocity_depth", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "use_velocity_depth", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_VELOCITY_DEPTH); RNA_def_property_ui_text(prop, "Multiply Depth", "Multiply brush intersection depth (displace, waves) by velocity ramp alpha"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); - prop= RNA_def_property(srna, "velocity_color", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "use_velocity_color", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_VELOCITY_COLOR); RNA_def_property_ui_text(prop, "Replace Color", "Replace brush color by velocity color ramp"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); @@ -820,9 +818,9 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Proximity Distance", "Maximum distance from brush to mesh surface to affect paint"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); - prop= RNA_def_property(srna, "proximity_ramp_alpha", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "use_proximity_ramp_alpha", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_RAMP_ALPHA); - RNA_def_property_ui_text(prop, "Only Use Alpha", "Only reads color ramp alpha"); + RNA_def_property_ui_text(prop, "Only Use Alpha", "Only read color ramp alpha"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); prop= RNA_def_property(srna, "proximity_falloff", PROP_ENUM, PROP_NONE); @@ -832,7 +830,7 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Falloff", "Proximity falloff type"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); - prop= RNA_def_property(srna, "proximity_project", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "use_proximity_project", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_PROX_PROJECT); RNA_def_property_ui_text(prop, "Project", "Brush is projected to canvas from defined direction within brush proximity"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); @@ -840,15 +838,15 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna) prop= RNA_def_property(srna, "ray_direction", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "ray_dir"); RNA_def_property_enum_items(prop, prop_dynamicpaint_brush_ray_dir); - RNA_def_property_ui_text(prop, "Ray Direction", "Defines ray direction to use for projection. If brush object is located in that direction it's painted"); + RNA_def_property_ui_text(prop, "Ray Direction", "Ray direction to use for projection (if brush object is located in that direction it's painted)"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); - prop= RNA_def_property(srna, "proximity_inverse", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "invert_proximity", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_INVERSE_PROX); RNA_def_property_ui_text(prop, "Inner Proximity", "Proximity falloff is applied inside the volume"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); - prop= RNA_def_property(srna, "negate_volume", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "use_negative_volume", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_NEGATE_VOLUME); RNA_def_property_ui_text(prop, "Negate Volume", "Negate influence inside the volume"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); @@ -867,7 +865,7 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna) prop= RNA_def_property(srna, "use_particle_radius", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_PART_RAD); - RNA_def_property_ui_text(prop, "Use Particle Radius", "Uses radius from particle settings"); + RNA_def_property_ui_text(prop, "Use Particle Radius", "Use radius from particle settings"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); prop= RNA_def_property(srna, "solid_radius", PROP_FLOAT, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_fcurve.c b/source/blender/makesrna/intern/rna_fcurve.c index c651dca4b31..56f1efe3fed 100644 --- a/source/blender/makesrna/intern/rna_fcurve.c +++ b/source/blender/makesrna/intern/rna_fcurve.c @@ -637,7 +637,7 @@ static void rna_def_fmodifier_generator(BlenderRNA *brna) {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "FModifierGenerator", "FModifier"); - RNA_def_struct_ui_text(srna, "Generator F-Curve Modifier", "Deterministically generates values for the modified F-Curve"); + RNA_def_struct_ui_text(srna, "Generator F-Modifier", "Deterministically generate values for the modified F-Curve"); RNA_def_struct_sdna_from(srna, "FMod_Generator", "data"); /* define common props */ @@ -659,7 +659,7 @@ static void rna_def_fmodifier_generator(BlenderRNA *brna) // 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)"); + "The highest power of 'x' for this polynomial (number of coefficients - 1)"); RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL); /* coefficients array */ @@ -689,7 +689,7 @@ static void rna_def_fmodifier_function_generator(BlenderRNA *brna) {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "FModifierFunctionGenerator", "FModifier"); - RNA_def_struct_ui_text(srna, "Built-In Function F-Modifier", "Generates values using a Built-In Function"); + RNA_def_struct_ui_text(srna, "Built-In Function F-Modifier", "Generate values using a Built-In Function"); RNA_def_struct_sdna_from(srna, "FMod_FunctionGenerator", "data"); /* coefficients */ @@ -765,7 +765,7 @@ static void rna_def_fmodifier_envelope(BlenderRNA *brna) PropertyRNA *prop; srna= RNA_def_struct(brna, "FModifierEnvelope", "FModifier"); - RNA_def_struct_ui_text(srna, "Envelope F-Modifier", "Scales the values of the modified F-Curve"); + RNA_def_struct_ui_text(srna, "Envelope F-Modifier", "Scale the values of the modified F-Curve"); RNA_def_struct_sdna_from(srna, "FMod_Envelope", "data"); /* Collections */ @@ -802,13 +802,13 @@ static void rna_def_fmodifier_cycles(BlenderRNA *brna) {FCM_EXTRAPOLATE_NONE, "NONE", 0, "No Cycles", "Don't do anything"}, {FCM_EXTRAPOLATE_CYCLIC, "REPEAT", 0, "Repeat Motion", "Repeat keyframe range as-is"}, {FCM_EXTRAPOLATE_CYCLIC_OFFSET, "REPEAT_OFFSET", 0, "Repeat with Offset", - "Repeat keyframe range, but with offset based on gradient between values"}, + "Repeat keyframe range, but with offset based on gradient between start and end values"}, {FCM_EXTRAPOLATE_MIRROR, "MIRROR", 0, "Repeat Mirrored", "Alternate between forward and reverse playback of keyframe range"}, {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "FModifierCycles", "FModifier"); - RNA_def_struct_ui_text(srna, "Cycles F-Modifier", "Repeats the values of the modified F-Curve"); + RNA_def_struct_ui_text(srna, "Cycles F-Modifier", "Repeat the values of the modified F-Curve"); RNA_def_struct_sdna_from(srna, "FMod_Cycles", "data"); /* before */ @@ -820,7 +820,7 @@ static void rna_def_fmodifier_cycles(BlenderRNA *brna) prop= RNA_def_property(srna, "cycles_before", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "before_cycles"); - RNA_def_property_ui_text(prop, "Before Cycles", "Maximum number of cycles to allow before first keyframe. (0 = infinite)"); + 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|NA_EDITED, NULL); /* after */ @@ -832,7 +832,7 @@ static void rna_def_fmodifier_cycles(BlenderRNA *brna) prop= RNA_def_property(srna, "cycles_after", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "after_cycles"); - RNA_def_property_ui_text(prop, "After Cycles", "Maximum number of cycles to allow after last keyframe. (0 = infinite)"); + 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|NA_EDITED, NULL); } @@ -844,7 +844,7 @@ static void rna_def_fmodifier_python(BlenderRNA *brna) //PropertyRNA *prop; srna= RNA_def_struct(brna, "FModifierPython", "FModifier"); - RNA_def_struct_ui_text(srna, "Python F-Modifier", "Performs user-defined operation on the modified F-Curve"); + RNA_def_struct_ui_text(srna, "Python F-Modifier", "Perform user-defined operation on the modified F-Curve"); RNA_def_struct_sdna_from(srna, "FMod_Python", "data"); } @@ -856,7 +856,7 @@ static void rna_def_fmodifier_limits(BlenderRNA *brna) PropertyRNA *prop; srna= RNA_def_struct(brna, "FModifierLimits", "FModifier"); - RNA_def_struct_ui_text(srna, "Limits F-Modifier", "Limits the time/value ranges of the modified F-Curve"); + RNA_def_struct_ui_text(srna, "Limit F-Modifier", "Limit the time/value ranges of the modified F-Curve"); RNA_def_struct_sdna_from(srna, "FMod_Limits", "data"); prop= RNA_def_property(srna, "use_min_x", PROP_BOOLEAN, PROP_NONE); @@ -919,7 +919,7 @@ static void rna_def_fmodifier_noise(BlenderRNA *brna) {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "FModifierNoise", "FModifier"); - RNA_def_struct_ui_text(srna, "Noise F-Modifier", "Gives randomness to the modified F-Curve"); + RNA_def_struct_ui_text(srna, "Noise F-Modifier", "Give randomness to the modified F-Curve"); RNA_def_struct_sdna_from(srna, "FMod_Noise", "data"); prop= RNA_def_property(srna, "blend_type", PROP_ENUM, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_fluidsim.c b/source/blender/makesrna/intern/rna_fluidsim.c index a7eedf5f062..09f339fa7db 100644 --- a/source/blender/makesrna/intern/rna_fluidsim.c +++ b/source/blender/makesrna/intern/rna_fluidsim.c @@ -83,18 +83,19 @@ static void rna_fluid_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerR WM_main_add_notifier(NC_OBJECT|ND_MODIFIER, ob); } -static int fluidsim_find_lastframe(FluidsimSettings *fss) +static int fluidsim_find_lastframe(Object *ob, FluidsimSettings *fss) { - char targetDir[FILE_MAXFILE+FILE_MAXDIR], targetFile[FILE_MAXFILE+FILE_MAXDIR]; + char targetFileTest[FILE_MAX]; + char targetFile[FILE_MAX]; int curFrame = 1; - BLI_snprintf(targetDir, sizeof(targetDir), "%sfluidsurface_final_####.bobj.gz", fss->surfdataPath); - BLI_path_abs(targetDir, G.main->name); + BLI_join_dirfile(targetFile, sizeof(targetFile), fss->surfdataPath, OB_FLUIDSIM_SURF_FINAL_OBJ_FNAME); + BLI_path_abs(targetFile, modifier_path_relbase(ob)); do { - BLI_strncpy(targetFile, targetDir, sizeof(targetFile)); - BLI_path_frame(targetFile, curFrame++, 0); - } while(BLI_exists(targetFile)); + BLI_strncpy(targetFileTest, targetFile, sizeof(targetFileTest)); + BLI_path_frame(targetFileTest, curFrame++, 0); + } while(BLI_exists(targetFileTest)); return curFrame - 1; } @@ -105,7 +106,7 @@ static void rna_fluid_find_enframe(Main *bmain, Scene *scene, PointerRNA *ptr) FluidsimModifierData *fluidmd= (FluidsimModifierData*)modifiers_findByType(ob, eModifierType_Fluidsim); if(fluidmd->fss->flag & OB_FLUIDSIM_REVERSE) { - fluidmd->fss->lastgoodframe = fluidsim_find_lastframe(fluidmd->fss); + fluidmd->fss->lastgoodframe = fluidsim_find_lastframe(ob, fluidmd->fss); } else { fluidmd->fss->lastgoodframe = -1; diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c index fe2cfbd3bc0..47de66dd560 100644 --- a/source/blender/makesrna/intern/rna_mesh.c +++ b/source/blender/makesrna/intern/rna_mesh.c @@ -1146,6 +1146,45 @@ static CustomDataLayer *rna_Mesh_vertex_color_new(struct Mesh *me, struct bConte return cdl; } +static CustomDataLayer *rna_Mesh_int_property_new(struct Mesh *me, struct bContext *C, const char *name) +{ + CustomDataLayer *cdl = NULL; + int index; + + CustomData_add_layer_named(&me->fdata, CD_PROP_INT, CD_DEFAULT, NULL, me->totface, name); + index = CustomData_get_named_layer_index(&me->fdata, CD_PROP_INT, name); + + cdl = (index == -1) ? NULL : &(me->fdata.layers[index]); + + return cdl; +} + +static CustomDataLayer *rna_Mesh_float_property_new(struct Mesh *me, struct bContext *C, const char *name) +{ + CustomDataLayer *cdl = NULL; + int index; + + CustomData_add_layer_named(&me->fdata, CD_PROP_FLT, CD_DEFAULT, NULL, me->totface, name); + index = CustomData_get_named_layer_index(&me->fdata, CD_PROP_FLT, name); + + cdl = (index == -1) ? NULL : &(me->fdata.layers[index]); + + return cdl; +} + +static CustomDataLayer *rna_Mesh_string_property_new(struct Mesh *me, struct bContext *C, const char *name) +{ + CustomDataLayer *cdl = NULL; + int index; + + CustomData_add_layer_named(&me->fdata, CD_PROP_STR, CD_DEFAULT, NULL, me->totface, name); + index = CustomData_get_named_layer_index(&me->fdata, CD_PROP_STR, name); + + cdl = (index == -1) ? NULL : &(me->fdata.layers[index]); + + return cdl; +} + static CustomDataLayer *rna_Mesh_uv_texture_new(struct Mesh *me, struct bContext *C, const char *name) { CustomData *fdata; @@ -1646,7 +1685,8 @@ static void rna_def_mproperties(BlenderRNA *brna) RNA_def_struct_ui_text(srna, "Mesh String Property", "User defined string text value in a string properties layer"); RNA_def_struct_path_func(srna, "rna_MeshStringProperty_path"); - prop= RNA_def_property(srna, "value", PROP_STRING, PROP_NONE); + /* low level mesh data access, treat as bytes */ + prop= RNA_def_property(srna, "value", PROP_STRING, PROP_BYTESTRING); 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"); @@ -1760,6 +1800,69 @@ static void rna_def_vertex_colors(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); } +/* mesh int layers */ +static void rna_def_int_layers(BlenderRNA *brna, PropertyRNA *cprop) +{ + StructRNA *srna; + + FunctionRNA *func; + PropertyRNA *parm; + + RNA_def_property_srna(cprop, "IntProperties"); + srna= RNA_def_struct(brna, "IntProperties", NULL); + RNA_def_struct_sdna(srna, "Mesh"); + RNA_def_struct_ui_text(srna, "Int Properties", "Collection of int properties"); + + func= RNA_def_function(srna, "new", "rna_Mesh_int_property_new"); + RNA_def_function_flag(func, FUNC_USE_CONTEXT); + RNA_def_function_ui_description(func, "Add a integer property layer to Mesh"); + RNA_def_string(func, "name", "Int Prop", 0, "", "Int property name"); + parm= RNA_def_pointer(func, "layer", "MeshIntPropertyLayer", "", "The newly created layer"); + RNA_def_function_return(func, parm); +} + +/* mesh float layers */ +static void rna_def_float_layers(BlenderRNA *brna, PropertyRNA *cprop) +{ + StructRNA *srna; + + FunctionRNA *func; + PropertyRNA *parm; + + RNA_def_property_srna(cprop, "FloatProperties"); + srna= RNA_def_struct(brna, "FloatProperties", NULL); + RNA_def_struct_sdna(srna, "Mesh"); + RNA_def_struct_ui_text(srna, "Float Properties", "Collection of float properties"); + + func= RNA_def_function(srna, "new", "rna_Mesh_float_property_new"); + RNA_def_function_flag(func, FUNC_USE_CONTEXT); + RNA_def_function_ui_description(func, "Add a float property layer to Mesh"); + RNA_def_string(func, "name", "Float Prop", 0, "", "Float property name"); + parm= RNA_def_pointer(func, "layer", "MeshFloatPropertyLayer", "", "The newly created layer"); + RNA_def_function_return(func, parm); +} + +/* mesh string layers */ +static void rna_def_string_layers(BlenderRNA *brna, PropertyRNA *cprop) +{ + StructRNA *srna; + + FunctionRNA *func; + PropertyRNA *parm; + + RNA_def_property_srna(cprop, "StringProperties"); + srna= RNA_def_struct(brna, "StringProperties", NULL); + RNA_def_struct_sdna(srna, "Mesh"); + RNA_def_struct_ui_text(srna, "String Properties", "Collection of string properties"); + + func= RNA_def_function(srna, "new", "rna_Mesh_string_property_new"); + RNA_def_function_flag(func, FUNC_USE_CONTEXT); + RNA_def_function_ui_description(func, "Add a string property layer to Mesh"); + RNA_def_string(func, "name", "String Prop", 0, "", "String property name"); + parm= RNA_def_pointer(func, "layer", "MeshStringPropertyLayer", "", "The newly created layer"); + RNA_def_function_return(func, parm); +} + /* mesh.uv_layers */ static void rna_def_uv_textures(BlenderRNA *brna, PropertyRNA *cprop) { @@ -1886,6 +1989,7 @@ static void rna_def_mesh(BlenderRNA *brna) "rna_Mesh_float_layers_length", NULL, NULL, NULL); RNA_def_property_struct_type(prop, "MeshFloatPropertyLayer"); RNA_def_property_ui_text(prop, "Float Property Layers", ""); + rna_def_float_layers(brna, prop); prop= RNA_def_property(srna, "layers_int", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "fdata.layers", "fdata.totlayer"); @@ -1893,6 +1997,7 @@ static void rna_def_mesh(BlenderRNA *brna) "rna_Mesh_int_layers_length", NULL, NULL, NULL); RNA_def_property_struct_type(prop, "MeshIntPropertyLayer"); RNA_def_property_ui_text(prop, "Int Property Layers", ""); + rna_def_int_layers(brna, prop); prop= RNA_def_property(srna, "layers_string", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "fdata.layers", "fdata.totlayer"); @@ -1900,6 +2005,7 @@ static void rna_def_mesh(BlenderRNA *brna) "rna_Mesh_string_layers_length", NULL, NULL, NULL); RNA_def_property_struct_type(prop, "MeshStringPropertyLayer"); RNA_def_property_ui_text(prop, "String Property Layers", ""); + rna_def_string_layers(brna, prop); prop= RNA_def_property(srna, "use_auto_smooth", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_AUTOSMOOTH); diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index 32665bef065..6885000ce18 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -88,14 +88,15 @@ EnumPropertyItem modifier_type_items[] ={ {0, "", 0, "Simulate", ""}, {eModifierType_Cloth, "CLOTH", ICON_MOD_CLOTH, "Cloth", ""}, {eModifierType_Collision, "COLLISION", ICON_MOD_PHYSICS, "Collision", ""}, + {eModifierType_DynamicPaint, "DYNAMIC_PAINT", ICON_MOD_DYNAMICPAINT, "Dynamic Paint", ""}, {eModifierType_Explode, "EXPLODE", ICON_MOD_EXPLODE, "Explode", ""}, {eModifierType_Fluidsim, "FLUID_SIMULATION", ICON_MOD_FLUIDSIM, "Fluid Simulation", ""}, + {eModifierType_Ocean, "OCEAN", ICON_MOD_WAVE, "Ocean", ""}, {eModifierType_ParticleInstance, "PARTICLE_INSTANCE", ICON_MOD_PARTICLES, "Particle Instance", ""}, {eModifierType_ParticleSystem, "PARTICLE_SYSTEM", ICON_MOD_PARTICLES, "Particle System", ""}, {eModifierType_Smoke, "SMOKE", ICON_MOD_SMOKE, "Smoke", ""}, {eModifierType_Softbody, "SOFT_BODY", ICON_MOD_SOFT, "Soft Body", ""}, {eModifierType_Surface, "SURFACE", ICON_MOD_PHYSICS, "Surface", ""}, - {eModifierType_DynamicPaint, "DYNAMIC_PAINT", ICON_MOD_DYNAMICPAINT, "Dynamic Paint", ""}, {0, NULL, 0, NULL, NULL}}; #ifdef RNA_RUNTIME @@ -186,6 +187,8 @@ static StructRNA* rna_Modifier_refine(struct PointerRNA *ptr) return &RNA_SolidifyModifier; case eModifierType_Screw: return &RNA_ScrewModifier; + case eModifierType_Ocean: + return &RNA_OceanModifier; case eModifierType_Warp: return &RNA_WarpModifier; case eModifierType_WeightVGEdit: @@ -649,6 +652,57 @@ static void rna_UVProjectModifier_num_projectors_set(PointerRNA *ptr, int value) md->projectors[a]= NULL; } +static int rna_OceanModifier_is_build_enabled_get(PointerRNA *UNUSED(ptr)) +{ +#ifdef WITH_OCEANSIM + return 1; +#else // WITH_OCEANSIM + return 0; +#endif // WITH_OCEANSIM +} + +static void rna_OceanModifier_init_update(Main *bmain, Scene *scene, PointerRNA *ptr) +{ + OceanModifierData *omd= (OceanModifierData*)ptr->data; + + omd->refresh |= (MOD_OCEAN_REFRESH_RESET|MOD_OCEAN_REFRESH_SIM|MOD_OCEAN_REFRESH_CLEAR_CACHE); + + rna_Modifier_update(bmain, scene, ptr); +} + +static void rna_OceanModifier_sim_update(Main *bmain, Scene *scene, PointerRNA *ptr) +{ + OceanModifierData *omd= (OceanModifierData*)ptr->data; + + omd->refresh |= MOD_OCEAN_REFRESH_SIM; + + rna_Modifier_update(bmain, scene, ptr); +} + +static void rna_OceanModifier_topology_update(Main *bmain, Scene *scene, PointerRNA *ptr) +{ + OceanModifierData *omd= (OceanModifierData*)ptr->data; + + omd->refresh |= MOD_OCEAN_REFRESH_TOPOLOGY; + + rna_Modifier_update(bmain, scene, ptr); +} + +static void rna_OceanModifier_ocean_chop_set(PointerRNA *ptr, float value) +{ + OceanModifierData *omd= (OceanModifierData*)ptr->data; + float old_value = omd->chop_amount; + + omd->chop_amount = value; + + if ((old_value == 0.0f && value > 0.0f) || + (old_value > 0.0f && value == 0.0f)) + { + omd->refresh |= MOD_OCEAN_REFRESH_RESET; + omd->refresh |= MOD_OCEAN_REFRESH_CLEAR_CACHE; + } +} + static float rna_EdgeSplitModifier_split_angle_get(PointerRNA *ptr) { EdgeSplitModifierData *md= (EdgeSplitModifierData*)ptr->data; @@ -2809,6 +2863,185 @@ static void rna_def_modifier_weightvgproximity(BlenderRNA *brna) rna_def_modifier_weightvg_mask(brna, srna); } +static void rna_def_modifier_ocean(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + static EnumPropertyItem geometry_items[]= { + {MOD_OCEAN_GEOM_GENERATE, "GENERATE", 0, "Generate", "Generates ocean surface geometry at the specified resolution"}, + {MOD_OCEAN_GEOM_DISPLACE, "DISPLACE", 0, "Displace", "Displaces existing geometry according to simulation"}, + //{MOD_OCEAN_GEOM_SIM_ONLY, "SIM_ONLY", 0, "Sim Only", "Leaves geometry unchanged, but still runs simulation (to be used from texture)"}, + {0, NULL, 0, NULL, NULL}}; + + srna= RNA_def_struct(brna, "OceanModifier", "Modifier"); + RNA_def_struct_ui_text(srna, "Ocean Modifier", "Simulate an ocean surface"); + RNA_def_struct_sdna(srna, "OceanModifierData"); + RNA_def_struct_ui_icon(srna, ICON_MOD_FLUIDSIM); + + /* General check if blender was built with OceanSim modifier support */ + prop= RNA_def_property(srna, "is_build_enabled", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_funcs(prop, "rna_OceanModifier_is_build_enabled_get", NULL); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Build Enabled", "True if the OceanSim modifier is enabled in this build"); + + prop= RNA_def_property(srna, "geometry_mode", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "geometry_mode"); + RNA_def_property_enum_items(prop, geometry_items); + RNA_def_property_ui_text(prop, "Geometry", "Method of modifying geometry"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + prop= RNA_def_property(srna, "size", PROP_FLOAT, PROP_UNSIGNED); + RNA_def_property_float_sdna(prop, NULL, "size"); + RNA_def_property_ui_text(prop, "Size", ""); + RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, 0); + RNA_def_property_update(prop, 0, "rna_OceanModifier_topology_update"); + + prop= RNA_def_property(srna, "repeat_x", PROP_INT, PROP_UNSIGNED); + RNA_def_property_int_sdna(prop, NULL, "repeat_x"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_range(prop, 1, 1024); + RNA_def_property_ui_range(prop, 1, 100, 1, 0); + RNA_def_property_ui_text(prop, "Repeat X", "Repetitions of the generated surface in X"); + RNA_def_property_update(prop, 0, "rna_OceanModifier_topology_update"); + + prop= RNA_def_property(srna, "repeat_y", PROP_INT, PROP_UNSIGNED); + RNA_def_property_int_sdna(prop, NULL, "repeat_y"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_range(prop, 1, 1024); + RNA_def_property_ui_range(prop, 1, 100, 1, 0); + RNA_def_property_ui_text(prop, "Repeat Y", "Repetitions of the generated surface in Y"); + RNA_def_property_update(prop, 0, "rna_OceanModifier_topology_update"); + + prop= RNA_def_property(srna, "use_normals", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_OCEAN_GENERATE_NORMALS); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_ui_text(prop, "Generate Normals", "Outputs normals for bump mapping - disabling can speed up performance if its not needed"); + RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update"); + + prop= RNA_def_property(srna, "use_foam", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_OCEAN_GENERATE_FOAM); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_ui_text(prop, "Generate Foam", "Generates foam mask as a vertex color channel"); + RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update"); + + prop= RNA_def_property(srna, "resolution", PROP_INT, PROP_UNSIGNED); + RNA_def_property_int_sdna(prop, NULL, "resolution"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_range(prop, 1, 1024); + RNA_def_property_ui_range(prop, 1, 32, 1, 0); + RNA_def_property_ui_text(prop, "Resolution", "Resolution of the generated surface"); + RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update"); + + prop= RNA_def_property(srna, "spatial_size", PROP_INT, PROP_DISTANCE); + RNA_def_property_int_sdna(prop, NULL, "spatial_size"); + RNA_def_property_ui_range(prop, 1, 512, 2, 0); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_ui_text(prop, "Spatial Size", "Physical size of the simulation domain (m)"); + RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update"); + + prop= RNA_def_property(srna, "wind_velocity", PROP_FLOAT, PROP_VELOCITY); + RNA_def_property_float_sdna(prop, NULL, "wind_velocity"); + RNA_def_property_ui_text(prop, "Wind Velocity", "Wind speed (m/s)"); + RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update"); + + prop= RNA_def_property(srna, "damping", PROP_FLOAT, PROP_FACTOR); + RNA_def_property_float_sdna(prop, NULL, "damp"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_ui_text(prop, "Damping", "Damp reflected waves going in opposite direction to the wind"); + RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update"); + + prop= RNA_def_property(srna, "wave_scale_min", PROP_FLOAT, PROP_DISTANCE); + RNA_def_property_float_sdna(prop, NULL, "smallest_wave"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_range(prop, 0.0, FLT_MAX); + RNA_def_property_ui_text(prop, "Smallest Wave", "Shortest allowed wavelength (m)"); + RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update"); + + prop= RNA_def_property(srna, "wave_alignment", PROP_FLOAT, PROP_UNSIGNED); + RNA_def_property_float_sdna(prop, NULL, "wave_alignment"); + RNA_def_property_range(prop, 0.0, 10.0); + RNA_def_property_ui_text(prop, "Wave Alignment", ""); + RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update"); + + prop= RNA_def_property(srna, "wave_direction", PROP_FLOAT, PROP_ANGLE); + RNA_def_property_float_sdna(prop, NULL, "wave_direction"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_ui_text(prop, "Wave Direction", ""); + RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update"); + + prop= RNA_def_property(srna, "wave_scale", PROP_FLOAT, PROP_UNSIGNED); + RNA_def_property_float_sdna(prop, NULL, "wave_scale"); + RNA_def_property_ui_text(prop, "Wave Scale", ""); + RNA_def_property_update(prop, 0, "rna_OceanModifier_sim_update"); + + prop= RNA_def_property(srna, "depth", PROP_FLOAT, PROP_UNSIGNED); + RNA_def_property_float_sdna(prop, NULL, "depth"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_ui_text(prop, "Depth", ""); + RNA_def_property_ui_range(prop, 0, 250, 1, 0); + RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update"); + + prop= RNA_def_property(srna, "foam_coverage", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "foam_coverage"); + RNA_def_property_ui_text(prop, "Foam Coverage", ""); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + prop= RNA_def_property(srna, "bake_foam_fade", PROP_FLOAT, PROP_UNSIGNED); + RNA_def_property_float_sdna(prop, NULL, "foam_fade"); + RNA_def_property_ui_text(prop, "Foam Fade", ""); + RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, 0); + RNA_def_property_update(prop, 0, NULL); + + prop= RNA_def_property(srna, "foam_layer_name", PROP_STRING, PROP_NONE); + RNA_def_property_string_sdna(prop, NULL, "foamlayername"); + RNA_def_property_ui_text(prop, "Foam Layer Name", "Name of the vertex color layer used for foam"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + prop= RNA_def_property(srna, "choppiness", PROP_FLOAT, PROP_UNSIGNED); + RNA_def_property_float_sdna(prop, NULL, "chop_amount"); + RNA_def_property_ui_text(prop, "Choppiness", ""); + RNA_def_property_ui_range(prop, 0.0, 4.0, 3, 0); + RNA_def_property_float_funcs(prop, NULL, "rna_OceanModifier_ocean_chop_set", NULL); + RNA_def_property_update(prop, 0, "rna_OceanModifier_sim_update"); + + prop= RNA_def_property(srna, "time", PROP_FLOAT, PROP_UNSIGNED); + RNA_def_property_float_sdna(prop, NULL, "time"); + RNA_def_property_ui_text(prop, "Time", ""); + RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, 0); + RNA_def_property_update(prop, 0, "rna_OceanModifier_sim_update"); + + prop= RNA_def_property(srna, "random_seed", PROP_INT, PROP_UNSIGNED); + RNA_def_property_int_sdna(prop, NULL, "seed"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_ui_text(prop, "Random Seed", ""); + RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update"); + + prop= RNA_def_property(srna, "frame_start", PROP_INT, PROP_UNSIGNED); + RNA_def_property_int_sdna(prop, NULL, "bakestart"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_ui_text(prop, "Bake Start", ""); + RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update"); + + prop= RNA_def_property(srna, "frame_end", PROP_INT, PROP_UNSIGNED); + RNA_def_property_int_sdna(prop, NULL, "bakeend"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_ui_text(prop, "Bake End", ""); + RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update"); + + prop= RNA_def_property(srna, "is_cached", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "cached", 1); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Ocean is Cached", "Whether the ocean is useing cached data or simulating"); + + prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_DIRPATH); + RNA_def_property_string_sdna(prop, NULL, "cachepath"); + RNA_def_property_ui_text(prop, "Cache Path", "Path to a folder to store external baked images"); + //RNA_def_property_update(prop, 0, "rna_Modifier_update"); + // XXX how to update? +} + + void RNA_def_modifier(BlenderRNA *brna) { StructRNA *srna; @@ -2910,6 +3143,7 @@ void RNA_def_modifier(BlenderRNA *brna) rna_def_modifier_weightvgmix(brna); rna_def_modifier_weightvgproximity(brna); rna_def_modifier_dynamic_paint(brna); + rna_def_modifier_ocean(brna); } #endif diff --git a/source/blender/makesrna/intern/rna_movieclip.c b/source/blender/makesrna/intern/rna_movieclip.c index 91e082cdeae..3b1ac8f22c3 100644 --- a/source/blender/makesrna/intern/rna_movieclip.c +++ b/source/blender/makesrna/intern/rna_movieclip.c @@ -87,19 +87,19 @@ static void rna_def_movieclip_proxy(BlenderRNA *brna) /* build proxy sized */ prop= RNA_def_property(srna, "build_25", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "build_size_flag", IMB_PROXY_25); - RNA_def_property_ui_text(prop, "25%", "Build 25% proxy resolution"); + RNA_def_property_ui_text(prop, "25%", "Build proxy resolution 25% of the original footage dimension"); prop= RNA_def_property(srna, "build_50", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "build_size_flag", IMB_PROXY_50); - RNA_def_property_ui_text(prop, "50%", "Build 50% proxy resolution"); + RNA_def_property_ui_text(prop, "50%", "Build proxy resolution 50% of the original footage dimension"); prop= RNA_def_property(srna, "build_75", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "build_size_flag", IMB_PROXY_75); - RNA_def_property_ui_text(prop, "75%", "Build 75% proxy resolution"); + RNA_def_property_ui_text(prop, "75%", "Build proxy resolution 75% of the original footage dimension"); prop= RNA_def_property(srna, "build_100", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "build_size_flag", IMB_PROXY_100); - RNA_def_property_ui_text(prop, "100%", "Build 100% proxy resolution"); + RNA_def_property_ui_text(prop, "100%", "Build proxy resolution 100% of the original footage dimension"); prop= RNA_def_property(srna, "build_undistorted", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "build_flag", MCLIP_PROXY_BUILD_UNDISTORT); @@ -121,7 +121,7 @@ static void rna_def_movieclip_proxy(BlenderRNA *brna) /* quality of proxied image */ prop= RNA_def_property(srna, "quality", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "quality"); - RNA_def_property_ui_text(prop, "Quality", "JPEG Quality of proxies to build"); + RNA_def_property_ui_text(prop, "Quality", "JPEG quality of proxy images"); RNA_def_property_ui_range(prop, 1, 100, 1, 0); prop= RNA_def_property(srna, "timecode", PROP_ENUM, PROP_NONE); @@ -169,7 +169,7 @@ static void rna_def_moviecliUser(BlenderRNA *brna) /* render undistorted */ prop= RNA_def_property(srna, "use_render_undistorted", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "render_flag", MCLIP_PROXY_RENDER_UNDISTORT); - RNA_def_property_ui_text(prop, "Render Undistorted", "Draw preview using undistorted proxy"); + RNA_def_property_ui_text(prop, "Render Undistorted", "Render preview using undistorted proxy"); RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL); } @@ -198,7 +198,7 @@ static void rna_def_movieclip(BlenderRNA *brna) prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH); RNA_def_property_string_sdna(prop, NULL, "name"); - RNA_def_property_ui_text(prop, "File Path", "Filename of the text file"); + RNA_def_property_ui_text(prop, "File Path", "Filename of the movie or sequence file"); RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, "rna_MovieClip_reload_update"); prop= RNA_def_property(srna, "tracking", PROP_POINTER, PROP_NONE); @@ -234,7 +234,7 @@ static void rna_def_movieclip(BlenderRNA *brna) /* custom proxy directory */ prop= RNA_def_property(srna, "use_proxy_custom_directory", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MCLIP_USE_PROXY_CUSTOM_DIR); - RNA_def_property_ui_text(prop, "Proxy Custom Directory", "Use a custom directory to store data"); + RNA_def_property_ui_text(prop, "Proxy Custom Directory", "Create proxy images in a custom directory (default is movie location)"); RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, "rna_MovieClip_reload_update"); /* grease pencil */ diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index 55693f8e53f..30889bb25f6 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -70,43 +70,43 @@ EnumPropertyItem node_socket_type_items[] = { {0, NULL, 0, NULL, NULL}}; EnumPropertyItem node_math_items[] = { -{ 0, "ADD", 0, "Add", ""}, -{ 1, "SUBTRACT", 0, "Subtract", ""}, -{ 2, "MULTIPLY", 0, "Multiply", ""}, -{ 3, "DIVIDE", 0, "Divide", ""}, -{ 4, "SINE", 0, "Sine", ""}, -{ 5, "COSINE", 0, "Cosine", ""}, -{ 6, "TANGENT", 0, "Tangent", ""}, -{ 7, "ARCSINE", 0, "Arcsine", ""}, -{ 8, "ARCCOSINE", 0, "Arccosine", ""}, -{ 9, "ARCTANGENT", 0, "Arctangent", ""}, -{10, "POWER", 0, "Power", ""}, -{11, "LOGARITHM", 0, "Logarithm", ""}, -{12, "MINIMUM", 0, "Minimum", ""}, -{13, "MAXIMUM", 0, "Maximum", ""}, -{14, "ROUND", 0, "Round", ""}, -{15, "LESS_THAN", 0, "Less Than", ""}, -{16, "GREATER_THAN", 0, "Greater Than", ""}, -{0, NULL, 0, NULL, NULL}}; + { 0, "ADD", 0, "Add", ""}, + { 1, "SUBTRACT", 0, "Subtract", ""}, + { 2, "MULTIPLY", 0, "Multiply", ""}, + { 3, "DIVIDE", 0, "Divide", ""}, + { 4, "SINE", 0, "Sine", ""}, + { 5, "COSINE", 0, "Cosine", ""}, + { 6, "TANGENT", 0, "Tangent", ""}, + { 7, "ARCSINE", 0, "Arcsine", ""}, + { 8, "ARCCOSINE", 0, "Arccosine", ""}, + { 9, "ARCTANGENT", 0, "Arctangent", ""}, + {10, "POWER", 0, "Power", ""}, + {11, "LOGARITHM", 0, "Logarithm", ""}, + {12, "MINIMUM", 0, "Minimum", ""}, + {13, "MAXIMUM", 0, "Maximum", ""}, + {14, "ROUND", 0, "Round", ""}, + {15, "LESS_THAN", 0, "Less Than", ""}, + {16, "GREATER_THAN", 0, "Greater Than", ""}, + {0, NULL, 0, NULL, NULL}}; EnumPropertyItem node_vec_math_items[] = { -{0, "ADD", 0, "Add", ""}, -{1, "SUBTRACT", 0, "Subtract", ""}, -{2, "AVERAGE", 0, "Average", ""}, -{3, "DOT_PRODUCT", 0, "Dot Product", ""}, -{4, "CROSS_PRODUCT", 0, "Cross Product", ""}, -{5, "NORMALIZE", 0, "Normalize", ""}, -{0, NULL, 0, NULL, NULL}}; + {0, "ADD", 0, "Add", ""}, + {1, "SUBTRACT", 0, "Subtract", ""}, + {2, "AVERAGE", 0, "Average", ""}, + {3, "DOT_PRODUCT", 0, "Dot Product", ""}, + {4, "CROSS_PRODUCT", 0, "Cross Product", ""}, + {5, "NORMALIZE", 0, "Normalize", ""}, + {0, NULL, 0, NULL, NULL}}; EnumPropertyItem node_filter_items[] = { -{0, "SOFTEN", 0, "Soften", ""}, -{1, "SHARPEN", 0, "Sharpen", ""}, -{2, "LAPLACE", 0, "Laplace", ""}, -{3, "SOBEL", 0, "Sobel", ""}, -{4, "PREWITT", 0, "Prewitt", ""}, -{5, "KIRSCH", 0, "Kirsch", ""}, -{6, "SHADOW", 0, "Shadow", ""}, -{0, NULL, 0, NULL, NULL}}; + {0, "SOFTEN", 0, "Soften", ""}, + {1, "SHARPEN", 0, "Sharpen", ""}, + {2, "LAPLACE", 0, "Laplace", ""}, + {3, "SOBEL", 0, "Sobel", ""}, + {4, "PREWITT", 0, "Prewitt", ""}, + {5, "KIRSCH", 0, "Kirsch", ""}, + {6, "SHADOW", 0, "Shadow", ""}, + {0, NULL, 0, NULL, NULL}}; EnumPropertyItem prop_noise_basis_items[] = { {SHD_NOISE_PERLIN, "PERLIN", 0, "Perlin", ""}, @@ -124,11 +124,13 @@ EnumPropertyItem prop_noise_type_items[] = { {SHD_NOISE_HARD, "HARD", 0, "Hard", ""}, {0, NULL, 0, NULL, NULL}}; +#if 0 EnumPropertyItem prop_wave_items[] = { {SHD_WAVE_SINE, "SINE", 0, "Sine", "Uses a sine wave to produce bands"}, {SHD_WAVE_SAW, "SAW", 0, "Saw", "Uses a saw wave to produce bands"}, {SHD_WAVE_TRI, "TRI", 0, "Tri", "Uses a triangle wave to produce bands"}, {0, NULL, 0, NULL, NULL}}; +#endif /* Add any new socket value subtype here. * When adding a new subtype here, make sure you also add it @@ -755,6 +757,13 @@ static bNodeSocket *rna_NodeTree_output_expose(bNodeTree *ntree, ReportList *rep return NULL; } +static void rna_Mapping_Node_update(Main *bmain, Scene *scene, PointerRNA *ptr) +{ + bNode *node = ptr->data; + init_tex_mapping(node->storage); + rna_Node_update(bmain, scene, ptr); +} + #else static EnumPropertyItem prop_image_layer_items[] = { @@ -1095,12 +1104,43 @@ static void def_sh_material(StructRNA *srna) static void def_sh_mapping(StructRNA *srna) { PropertyRNA *prop; + + RNA_def_struct_sdna_from(srna, "TexMapping", "storage"); - prop= RNA_def_property(srna, "mapping", PROP_POINTER, PROP_NONE); - RNA_def_property_pointer_sdna(prop, NULL, "storage"); - RNA_def_property_struct_type(prop, "TexMapping"); - RNA_def_property_flag(prop, PROP_NEVER_NULL); - RNA_def_property_ui_text(prop, "Mapping", "Texture coordinate mapping settings"); + 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, 0, "rna_Mapping_Node_update"); + + prop= RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_EULER); /* Not PROP_XYZ, this is now in radians, no more degrees */ + RNA_def_property_float_sdna(prop, NULL, "rot"); + RNA_def_property_ui_text(prop, "Rotation", ""); + RNA_def_property_update(prop, 0, "rna_Mapping_Node_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, 0, "rna_Mapping_Node_update"); + + prop= RNA_def_property(srna, "min", PROP_FLOAT, PROP_XYZ); + RNA_def_property_float_sdna(prop, NULL, "min"); + RNA_def_property_ui_text(prop, "Minimum", "Minimum value for clipping"); + RNA_def_property_update(prop, 0, "rna_Mapping_Node_update"); + + prop= RNA_def_property(srna, "max", PROP_FLOAT, PROP_XYZ); + RNA_def_property_float_sdna(prop, NULL, "max"); + RNA_def_property_ui_text(prop, "Maximum", "Maximum value for clipping"); + RNA_def_property_update(prop, 0, "rna_Mapping_Node_update"); + + prop= RNA_def_property(srna, "use_min", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", TEXMAP_CLIP_MIN); + RNA_def_property_ui_text(prop, "Has Minimum", "Whether to use minimum clipping value"); + RNA_def_property_update(prop, 0, "rna_Mapping_Node_update"); + + prop= RNA_def_property(srna, "use_max", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", TEXMAP_CLIP_MAX); + RNA_def_property_ui_text(prop, "Has Maximum", "Whether to use maximum clipping value"); + RNA_def_property_update(prop, 0, "rna_Mapping_Node_update"); } static void def_sh_geometry(StructRNA *srna) @@ -1928,17 +1968,17 @@ static void def_cmp_chroma_matte(StructRNA *srna) RNA_def_struct_sdna_from(srna, "NodeChroma", "storage"); - prop = RNA_def_property(srna, "tolerance", PROP_FLOAT, PROP_NONE); + prop = RNA_def_property(srna, "tolerance", PROP_FLOAT, PROP_ANGLE); RNA_def_property_float_sdna(prop, NULL, "t1"); RNA_def_property_float_funcs(prop, NULL, "rna_Matte_t1_set", NULL); - RNA_def_property_range(prop, 1.0f, 80.0f); + RNA_def_property_range(prop, DEG2RADF(1.0f), DEG2RADF(80.0f)); RNA_def_property_ui_text(prop, "Acceptance", "Tolerance for a color to be considered a keying color"); RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); - prop = RNA_def_property(srna, "threshold", PROP_FLOAT, PROP_NONE); + prop = RNA_def_property(srna, "threshold", PROP_FLOAT, PROP_ANGLE); RNA_def_property_float_sdna(prop, NULL, "t2"); RNA_def_property_float_funcs(prop, NULL, "rna_Matte_t2_set", NULL); - RNA_def_property_range(prop, 0.0f, 30.0f); + RNA_def_property_range(prop, 0.0f, DEG2RADF(30.0f)); RNA_def_property_ui_text(prop, "Cutoff", "Tolerance below which colors will be considered as exact matches"); RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); @@ -2103,9 +2143,9 @@ static void def_cmp_defocus(StructRNA *srna) RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); /* 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); + prop = RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE); + RNA_def_property_float_sdna(prop, NULL, "rotation"); + RNA_def_property_range(prop, 0.0f, DEG2RADF(90.0f)); RNA_def_property_ui_text(prop, "Angle", "Bokeh shape rotation offset in degrees"); RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); @@ -2271,15 +2311,15 @@ static void def_cmp_dblur(StructRNA *srna) RNA_def_property_ui_text(prop, "Distance", ""); RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); - prop = RNA_def_property(srna, "angle", PROP_FLOAT, PROP_NONE); + prop = RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE); RNA_def_property_float_sdna(prop, NULL, "angle"); - RNA_def_property_range(prop, 0.0f, 360.0f); + RNA_def_property_range(prop, 0.0f, DEG2RADF(360.0f)); RNA_def_property_ui_text(prop, "Angle", ""); RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); - prop = RNA_def_property(srna, "spin", PROP_FLOAT, PROP_NONE); + prop = RNA_def_property(srna, "spin", PROP_FLOAT, PROP_ANGLE); RNA_def_property_float_sdna(prop, NULL, "spin"); - RNA_def_property_range(prop, -360.0f, 360.0f); + RNA_def_property_range(prop, DEG2RADF(-360.0f), DEG2RADF(360.0f)); RNA_def_property_ui_text(prop, "Spin", ""); RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); @@ -2393,10 +2433,10 @@ static void def_cmp_glare(StructRNA *srna) RNA_def_property_ui_text(prop, "Streaks", "Total number of streaks"); RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); - prop = RNA_def_property(srna, "angle_offset", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "angle_ofs"); - RNA_def_property_range(prop, 0, 180); - RNA_def_property_ui_text(prop, "Angle Offset", "Streak angle offset in degrees"); + prop = RNA_def_property(srna, "angle_offset", PROP_FLOAT, PROP_ANGLE); + RNA_def_property_float_sdna(prop, NULL, "angle_ofs"); + RNA_def_property_range(prop, 0.0f, DEG2RADF(180.0f)); + RNA_def_property_ui_text(prop, "Angle Offset", "Streak angle offset"); RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); prop = RNA_def_property(srna, "fade", PROP_FLOAT, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_object_api.c b/source/blender/makesrna/intern/rna_object_api.c index c4508c718e5..5b8b9d9a6b2 100644 --- a/source/blender/makesrna/intern/rna_object_api.c +++ b/source/blender/makesrna/intern/rna_object_api.c @@ -128,16 +128,20 @@ Mesh *rna_Object_to_mesh(Object *ob, ReportList *reports, Scene *sce, int apply_ free_libblock_us( &G.main->object, tmpobj ); break; - case OB_MBALL: + case OB_MBALL: { /* metaballs don't have modifiers, so just convert to mesh */ - ob = find_basis_mball( sce, ob ); + Object *basis_ob = find_basis_mball( sce, ob ); /* todo, re-generatre for render-res */ /* metaball_polygonize(scene, ob) */ + if(ob != basis_ob) + return NULL; /* only do basis metaball */ + tmpmesh = add_mesh("Mesh"); mball_to_mesh( &ob->disp, tmpmesh ); break; + } case OB_MESH: /* copies object and modifiers (but not the data) */ if (cage) { diff --git a/source/blender/makesrna/intern/rna_pose.c b/source/blender/makesrna/intern/rna_pose.c index d224bd0d4e5..6290c01f992 100644 --- a/source/blender/makesrna/intern/rna_pose.c +++ b/source/blender/makesrna/intern/rna_pose.c @@ -157,7 +157,7 @@ static IDProperty *rna_PoseBone_idprops(PointerRNA *ptr, int create) if(create && !pchan->prop) { IDPropertyTemplate val = {0}; - pchan->prop= IDP_New(IDP_GROUP, val, "RNA_PoseBone group"); + pchan->prop= IDP_New(IDP_GROUP, &val, "RNA_PoseBone group"); } return pchan->prop; diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 9c4a0984596..b08bdd7d223 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -737,6 +737,28 @@ static void rna_RenderSettings_active_layer_set(PointerRNA *ptr, PointerRNA valu if (index != -1) rd->actlay= index; } +static SceneRenderLayer *rna_RenderLayer_new(ID *id, RenderData *UNUSED(rd), const char *name) +{ + Scene *scene= (Scene *)id; + SceneRenderLayer *srl= scene_add_render_layer(scene, name); + + WM_main_add_notifier(NC_SCENE|ND_RENDER_OPTIONS, NULL); + + return srl; +} + +static void rna_RenderLayer_remove(ID *id, RenderData *UNUSED(rd), Main *bmain, ReportList *reports, SceneRenderLayer *srl) +{ + Scene *scene= (Scene *)id; + + if (!scene_remove_render_layer(bmain, scene, srl)) { + BKE_reportf(reports, RPT_ERROR, "RenderLayer '%s' could not be removed from scene '%s'", srl->name, scene->id.name+2); + } + else { + WM_main_add_notifier(NC_SCENE|ND_RENDER_OPTIONS, NULL); + } +} + static void rna_RenderSettings_engine_set(PointerRNA *ptr, int value) { RenderData *rd= (RenderData*)ptr->data; @@ -1147,8 +1169,8 @@ static void rna_def_transform_orientation(BlenderRNA *brna) RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); - RNA_def_property_string_sdna(prop, NULL, "name"); RNA_def_struct_name_property(srna, prop); + RNA_def_property_ui_text(prop, "Name", "Name of the custom transform orientation"); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); } @@ -2624,8 +2646,8 @@ static void rna_def_render_layers(BlenderRNA *brna, PropertyRNA *cprop) StructRNA *srna; PropertyRNA *prop; - // FunctionRNA *func; - // PropertyRNA *parm; + FunctionRNA *func; + PropertyRNA *parm; RNA_def_property_srna(cprop, "RenderLayers"); srna= RNA_def_struct(brna, "RenderLayers", NULL); @@ -2647,6 +2669,19 @@ static void rna_def_render_layers(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_property_ui_text(prop, "Active Render Layer", "Active Render Layer"); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + func= RNA_def_function(srna, "new", "rna_RenderLayer_new"); + RNA_def_function_ui_description(func, "Add a render layer to scene"); + RNA_def_function_flag(func, FUNC_USE_SELF_ID); + parm= RNA_def_string(func, "name", "RenderLayer", 0, "", "New name for the marker (not unique)"); + RNA_def_property_flag(parm, PROP_REQUIRED); + parm= RNA_def_pointer(func, "result", "SceneRenderLayer", "", "Newly created render layer"); + RNA_def_function_return(func, parm); + + func= RNA_def_function(srna, "remove", "rna_RenderLayer_remove"); + RNA_def_function_ui_description(func, "Remove a render layer"); + RNA_def_function_flag(func, FUNC_USE_MAIN|FUNC_USE_REPORTS|FUNC_USE_SELF_ID); + parm= RNA_def_pointer(func, "layer", "SceneRenderLayer", "", "Timeline marker to remove"); + RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); } static void rna_def_scene_render_data(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_scene_api.c b/source/blender/makesrna/intern/rna_scene_api.c index 250c61ed5f4..6816903090d 100644 --- a/source/blender/makesrna/intern/rna_scene_api.c +++ b/source/blender/makesrna/intern/rna_scene_api.c @@ -77,7 +77,7 @@ static void rna_SceneRender_get_frame_path(RenderData *rd, int frame, char *name if(BKE_imtype_is_movie(rd->imtype)) BKE_makeanimstring(name, rd); else - BKE_makepicstring(name, rd->pic, (frame==INT_MIN) ? rd->cfra : frame, rd->imtype, rd->scemode & R_EXTENSION, TRUE); + BKE_makepicstring(name, rd->pic, G.main->name, (frame==INT_MIN) ? rd->cfra : frame, rd->imtype, rd->scemode & R_EXTENSION, TRUE); } #ifdef WITH_COLLADA diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c index f3b158f84fe..4db23443895 100644 --- a/source/blender/makesrna/intern/rna_sequencer.c +++ b/source/blender/makesrna/intern/rna_sequencer.c @@ -191,6 +191,13 @@ static int rna_Sequence_frame_length_get(PointerRNA *ptr) return seq_tx_get_final_right(seq, 0)-seq_tx_get_final_left(seq, 0); } +static int rna_Sequence_frame_editable(PointerRNA *ptr) +{ + Sequence *seq = (Sequence*)ptr->data; + /* Effect sequences' start frame and length must be readonly! */ + return (get_sequence_effect_num_inputs(seq->type))? 0: PROP_EDITABLE; +} + static void rna_Sequence_channel_set(PointerRNA *ptr, int value) { Sequence *seq= (Sequence*)ptr->data; @@ -1025,8 +1032,9 @@ static void rna_def_sequence(BlenderRNA *brna) prop= RNA_def_property(srna, "frame_final_duration", PROP_INT, PROP_TIME); RNA_def_property_range(prop, 1, MAXFRAME); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); - RNA_def_property_ui_text(prop, "Length", "The length of the contents of this strip before the handles are applied"); + RNA_def_property_ui_text(prop, "Length", "The length of the contents of this strip after the handles are applied"); RNA_def_property_int_funcs(prop, "rna_Sequence_frame_length_get", "rna_Sequence_frame_length_set",NULL); + RNA_def_property_editable_func(prop, "rna_Sequence_frame_editable"); RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); prop= RNA_def_property(srna, "frame_duration", PROP_INT, PROP_TIME); @@ -1040,6 +1048,7 @@ static void rna_def_sequence(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Start Frame", ""); RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_start_frame_set",NULL); // overlap tests and calc_seq_disp + RNA_def_property_editable_func(prop, "rna_Sequence_frame_editable"); RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); prop= RNA_def_property(srna, "frame_final_start", PROP_INT, PROP_TIME); @@ -1047,6 +1056,7 @@ static void rna_def_sequence(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Start Frame", "Start frame displayed in the sequence editor after offsets are applied, setting this is equivalent to moving the handle, not the actual start frame"); RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_start_frame_final_set", NULL); // overlap tests and calc_seq_disp + RNA_def_property_editable_func(prop, "rna_Sequence_frame_editable"); RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); prop= RNA_def_property(srna, "frame_final_end", PROP_INT, PROP_TIME); @@ -1054,6 +1064,7 @@ static void rna_def_sequence(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "End Frame", "End frame displayed in the sequence editor after offsets are applied"); RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_end_frame_final_set", NULL); // overlap tests and calc_seq_disp + RNA_def_property_editable_func(prop, "rna_Sequence_frame_editable"); RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); prop= RNA_def_property(srna, "frame_offset_start", PROP_INT, PROP_TIME); diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 31f3d59e643..a33622cf8a1 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -891,15 +891,26 @@ static void rna_BackgroundImage_opacity_set(PointerRNA *ptr, float value) bgpic->blend = 1.0f - value; } -static BGpic *rna_BackgroundImage_add(View3D *v3d) +static BGpic *rna_BackgroundImage_new(View3D *v3d) { - BGpic *bgpic= ED_view3D_background_image_add(v3d);; + BGpic *bgpic= ED_view3D_background_image_new(v3d); - WM_main_add_notifier(NC_SPACE|ND_SPACE_VIEW3D, NULL); + WM_main_add_notifier(NC_SPACE|ND_SPACE_VIEW3D, v3d); return bgpic; } +static void rna_BackgroundImage_remove(View3D *v3d, ReportList *reports, BGpic *bgpic) +{ + if (BLI_findindex(&v3d->bgpicbase, bgpic) == -1) { + BKE_report(reports, RPT_ERROR, "BackgroundImage can't be removed"); + } + else { + ED_view3D_background_image_remove(v3d, bgpic); + WM_main_add_notifier(NC_SPACE|ND_SPACE_VIEW3D, v3d); + } +} + /* Space Node Editor */ static int rna_SpaceNodeEditor_node_tree_poll(PointerRNA *ptr, PointerRNA value) @@ -1307,11 +1318,16 @@ static void rna_def_backgroundImages(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_struct_sdna(srna, "View3D"); RNA_def_struct_ui_text(srna, "Background Images", "Collection of background images"); - func= RNA_def_function(srna, "add", "rna_BackgroundImage_add"); + func= RNA_def_function(srna, "new", "rna_BackgroundImage_new"); RNA_def_function_ui_description(func, "Add new background image"); - parm= RNA_def_pointer(func, "image", "BackgroundImage", "", "Image displayed as viewport background"); RNA_def_function_return(func, parm); + + func= RNA_def_function(srna, "remove", "rna_BackgroundImage_remove"); + RNA_def_function_ui_description(func, "Remove background image"); + RNA_def_function_flag(func, FUNC_USE_REPORTS); + parm= RNA_def_pointer(func, "image", "BackgroundImage", "", "Image displayed as viewport background"); + RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); } static void rna_def_space_view3d(BlenderRNA *brna) @@ -1579,26 +1595,26 @@ static void rna_def_space_view3d(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Show Reconstruction", "Display reconstruction data from active movie clip"); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); - prop= RNA_def_property(srna, "bundle_draw_size", PROP_FLOAT, PROP_NONE); + prop= RNA_def_property(srna, "tracks_draw_size", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0, FLT_MAX); RNA_def_property_float_sdna(prop, NULL, "bundle_size"); - RNA_def_property_ui_text(prop, "Bundle Size", "Display size of bundles from reconstructed data"); + RNA_def_property_ui_text(prop, "Tracks Size", "Display size of tracks from reconstructed data"); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); - prop= RNA_def_property(srna, "bundle_draw_type", PROP_ENUM, PROP_NONE); + prop= RNA_def_property(srna, "tracks_draw_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "bundle_drawtype"); RNA_def_property_enum_items(prop, bundle_drawtype_items); - RNA_def_property_ui_text(prop, "Bundle Display Type", "Viewport display style for bundles"); + RNA_def_property_ui_text(prop, "Tracks Display Type", "Viewport display style for tracks"); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); prop= RNA_def_property(srna, "show_camera_path", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_SHOW_CAMERAPATH); - RNA_def_property_ui_text(prop, "Show Camera Path", "Show reconstructed path of camera"); + RNA_def_property_ui_text(prop, "Show Camera Path", "Show reconstructed camera path"); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); - prop= RNA_def_property(srna, "show_bundle_name", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "show_tracks_name", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_SHOW_BUNDLENAME); - RNA_def_property_ui_text(prop, "Show Bundle Name", "Show names for bundle objects"); + RNA_def_property_ui_text(prop, "Show Track Names", "Show names for tracks objects"); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* region */ @@ -2893,7 +2909,7 @@ static void rna_def_space_clip(BlenderRNA *brna) /* show tiny markers */ prop= RNA_def_property(srna, "show_tiny_markers", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_ui_text(prop, "Show Tiny Markers", "Show markers tiny"); + RNA_def_property_ui_text(prop, "Show Tiny Markers", "Show markers in a more compact manner"); RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_SHOW_TINY_MARKER); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL); @@ -2960,13 +2976,13 @@ static void rna_def_space_clip(BlenderRNA *brna) /* show graph_frames */ prop= RNA_def_property(srna, "show_graph_frames", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_SHOW_GRAPH_FRAMES); - RNA_def_property_ui_text(prop, "Show Frames", "Show curves for frames in graph editor"); + RNA_def_property_ui_text(prop, "Show Frames", "Show curve for per-frame average error (camera motion should be solved first)"); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL); /* show graph_tracks */ prop= RNA_def_property(srna, "show_graph_tracks", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_SHOW_GRAPH_TRACKS); - RNA_def_property_ui_text(prop, "Show Tracks", "Show curves for tracks in graph editor"); + RNA_def_property_ui_text(prop, "Show Tracks", "Display the speed curves (in \"x\" direction red, in \"y\" direction green) for the selected tracks"); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL); } diff --git a/source/blender/makesrna/intern/rna_text.c b/source/blender/makesrna/intern/rna_text.c index a0d0bc088f7..9e3611b4cc5 100644 --- a/source/blender/makesrna/intern/rna_text.c +++ b/source/blender/makesrna/intern/rna_text.c @@ -42,7 +42,7 @@ #ifdef RNA_RUNTIME -int text_file_modified(Text *text); +int text_file_modified(Text *text); /* XXX bad level call */ static void rna_Text_filename_get(PointerRNA *ptr, char *value) { diff --git a/source/blender/makesrna/intern/rna_text_api.c b/source/blender/makesrna/intern/rna_text_api.c index ec669b28918..acfcad80f19 100644 --- a/source/blender/makesrna/intern/rna_text_api.c +++ b/source/blender/makesrna/intern/rna_text_api.c @@ -28,11 +28,25 @@ #include <stdlib.h> #include <stdio.h> - #include "RNA_define.h" #ifdef RNA_RUNTIME +#include "WM_api.h" +#include "WM_types.h" + +static void rna_Text_clear(Text *text) +{ + clear_text(text); + WM_main_add_notifier(NC_TEXT|NA_EDITED, text); +} + +static void rna_Text_write(Text *text, const char *str) +{ + write_text(text, str); + WM_main_add_notifier(NC_TEXT|NA_EDITED, text); +} + #else void RNA_api_text(StructRNA *srna) @@ -40,10 +54,10 @@ void RNA_api_text(StructRNA *srna) FunctionRNA *func; PropertyRNA *prop; - func= RNA_def_function(srna, "clear", "clear_text"); + func= RNA_def_function(srna, "clear", "rna_Text_clear"); RNA_def_function_ui_description(func, "clear the text block"); - func= RNA_def_function(srna, "write", "write_text"); + func= RNA_def_function(srna, "write", "rna_Text_write"); 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); diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c index aac4da9e6f6..e2c105e9ba8 100644 --- a/source/blender/makesrna/intern/rna_texture.c +++ b/source/blender/makesrna/intern/rna_texture.c @@ -73,6 +73,7 @@ EnumPropertyItem texture_type_items[] = { {TEX_VORONOI, "VORONOI", ICON_TEXTURE, "Voronoi", "Procedural - Create cell-like patterns based on Worley noise"}, {TEX_VOXELDATA, "VOXEL_DATA", ICON_TEXTURE, "Voxel Data", "Create a 3d texture based on volumetric data"}, {TEX_WOOD, "WOOD", ICON_TEXTURE, "Wood", "Procedural - Wave generated bands or rings, with optional noise"}, + {TEX_OCEAN, "OCEAN", ICON_TEXTURE, "Ocean", ""}, {0, NULL, 0, NULL, NULL}}; EnumPropertyItem blend_type_items[] = { @@ -145,6 +146,8 @@ static StructRNA *rna_Texture_refine(struct PointerRNA *ptr) return &RNA_VoxelDataTexture; case TEX_WOOD: return &RNA_WoodTexture; + case TEX_OCEAN: + return &RNA_OceanTexture; default: return &RNA_Texture; } @@ -435,6 +438,11 @@ static char *rna_VoxelData_path(PointerRNA *UNUSED(ptr)) return BLI_sprintfN("voxel_data"); } +static char *rna_OceanTex_path(PointerRNA *ptr) +{ + return BLI_sprintfN("ocean"); +} + #else static void rna_def_texmapping(BlenderRNA *brna) @@ -464,7 +472,7 @@ static void rna_def_texmapping(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Location", ""); RNA_def_property_update(prop, 0, "rna_Texture_mapping_update"); - prop= RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_XYZ); /* Not PROP_EUL, this is already in degrees, not radians */ + prop= RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_EULER); /* Not PROP_XYZ, this is now in radians, no more degrees */ RNA_def_property_float_sdna(prop, NULL, "rot"); RNA_def_property_ui_text(prop, "Rotation", ""); RNA_def_property_update(prop, 0, "rna_Texture_mapping_update"); @@ -1860,6 +1868,49 @@ static void rna_def_texture_voxeldata(BlenderRNA *brna) RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_update"); } +static void rna_def_texture_ocean(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + static EnumPropertyItem ocean_output_items[] = { + {TEX_OCN_DISPLACEMENT, "DISPLACEMENT", 0, "Displacement", "Output XYZ displacement in RGB channels"}, + //{TEX_OCN_NORMALS, "NORMALS", 0, "Normals", "Outputs wave normals"}, // these are in nor channel now + {TEX_OCN_FOAM, "FOAM", 0, "Foam", "Output Foam (wave overlap) amount in single channel"}, + {TEX_OCN_JPLUS, "JPLUS", 0, "Eigenvalues", "Positive Eigenvalues"}, + {TEX_OCN_EMINUS, "EMINUS", 0, "Eigenvectors (-)", "Negative Eigenvectors"}, + {TEX_OCN_EPLUS, "EPLUS", 0, "Eigenvectors (+)", "Positive Eigenvectors"}, + {0, NULL, 0, NULL, NULL}}; + + srna= RNA_def_struct(brna, "OceanTexData", NULL); + RNA_def_struct_sdna(srna, "OceanTex"); + RNA_def_struct_ui_text(srna, "Ocean", "Ocean Texture settings"); + RNA_def_struct_path_func(srna, "rna_OceanTex_path"); + + prop= RNA_def_property(srna, "output", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "output"); + RNA_def_property_enum_items(prop, ocean_output_items); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_ui_text(prop, "Output", "The data that is output by the texture"); + RNA_def_property_update(prop, 0, "rna_Texture_update"); + + prop= RNA_def_property(srna, "ocean_object", PROP_POINTER, PROP_NONE); + RNA_def_property_pointer_sdna(prop, NULL, "object"); + RNA_def_property_ui_text(prop, "Modifier Object", "Object containing the ocean modifier"); + RNA_def_property_flag(prop, PROP_EDITABLE); + RNA_def_property_update(prop, 0, "rna_Texture_update"); + + srna= RNA_def_struct(brna, "OceanTexture", "Texture"); + RNA_def_struct_sdna(srna, "Tex"); + RNA_def_struct_ui_text(srna, "Ocean", "Settings for the Ocean texture"); + + prop= RNA_def_property(srna, "ocean", PROP_POINTER, PROP_NONE); + RNA_def_property_pointer_sdna(prop, NULL, "ot"); + RNA_def_property_struct_type(prop, "OceanTexData"); + RNA_def_property_ui_text(prop, "Ocean", "The ocean data associated with this texture"); + RNA_def_property_update(prop, 0, "rna_Texture_update"); +} + static void rna_def_texture(BlenderRNA *brna) { StructRNA *srna; @@ -1962,6 +2013,7 @@ static void rna_def_texture(BlenderRNA *brna) rna_def_texture_distorted_noise(brna); rna_def_texture_pointdensity(brna); rna_def_texture_voxeldata(brna); + rna_def_texture_ocean(brna); /* XXX add more types here .. */ RNA_api_texture(srna); diff --git a/source/blender/makesrna/intern/rna_tracking.c b/source/blender/makesrna/intern/rna_tracking.c index 2c6384c75d8..269860e1d7e 100644 --- a/source/blender/makesrna/intern/rna_tracking.c +++ b/source/blender/makesrna/intern/rna_tracking.c @@ -39,6 +39,7 @@ #include "rna_internal.h" #include "DNA_movieclip_types.h" +#include "DNA_object_types.h" /* SELECT */ #include "DNA_scene_types.h" #include "WM_types.h" @@ -94,6 +95,29 @@ void rna_trackingTrack_name_set(PointerRNA *ptr, const char *value) BKE_track_unique_name(&clip->tracking, track); } +static int rna_trackingTrack_select_get(PointerRNA *ptr) +{ + MovieTrackingTrack *track= (MovieTrackingTrack *)ptr->data; + + return TRACK_SELECTED(track); +} + +static void rna_trackingTrack_select_set(PointerRNA *ptr, int value) +{ + MovieTrackingTrack *track= (MovieTrackingTrack *)ptr->data; + + if(value) { + track->flag|= SELECT; + track->pat_flag|= SELECT; + track->search_flag|= SELECT; + } + else { + track->flag&= ~SELECT; + track->pat_flag&= ~SELECT; + track->search_flag&= ~SELECT; + } +} + static void rna_tracking_trackerPattern_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { MovieTrackingTrack *track= (MovieTrackingTrack *)ptr->data; @@ -145,7 +169,8 @@ static void rna_trackingCamera_focal_mm_set(PointerRNA *ptr, float value) if(clip->lastsize[0]) value= clip->lastsize[0]*value/camera->sensor_width; - camera->focal= value; + if(value>=0.0001) + camera->focal= value; } static int rna_track_2d_stabilization(CollectionPropertyIterator *UNUSED(iter), void *data) @@ -229,6 +254,23 @@ static void rna_def_trackingSettings(BlenderRNA *brna) {0, NULL, 0, NULL, NULL} }; + static EnumPropertyItem refine_items[] = { + {0, "NONE", 0, "Nothing", "Do not refine camera intrinsics"}, + {REFINE_FOCAL_LENGTH, "FOCAL_LENGTH", 0, "Focal Length", "Refine focal length"}, + {REFINE_FOCAL_LENGTH| + REFINE_PRINCIPAL_POINT, "FOCAL_LENGTH_PRINCIPAL_POINT", 0, "Focal Length, Optical Center", "Refine focal length and optical center"}, + {REFINE_FOCAL_LENGTH| + REFINE_PRINCIPAL_POINT| + REFINE_RADIAL_DISTORTION_K1| + REFINE_RADIAL_DISTORTION_K2, + "FOCAL_LENGTH_PRINCIPAL_POINT_RADIAL_K1_K2", 0, "Focal Length, Optical Center, K1, K2", "Refine focal length, optical center and radial distortion K1 and K2"}, + {REFINE_FOCAL_LENGTH| + REFINE_RADIAL_DISTORTION_K1| + REFINE_RADIAL_DISTORTION_K2, "FOCAL_LENGTH_RADIAL_K1_K2", 0, "Focal length, K1. K2", "Refine focal length and radial distortion K1 and K2"}, + {REFINE_FOCAL_LENGTH|REFINE_RADIAL_DISTORTION_K1, "FOCAL_LENGTH_RADIAL_K1", 0, "Focal length, K1", "Refine focal length and radial distortion K1"}, + {0, NULL, 0, NULL, NULL} + }; + srna= RNA_def_struct(brna, "MovieTrackingSettings", NULL); RNA_def_struct_ui_text(srna, "Movie tracking settings", "Match moving settings"); @@ -236,14 +278,14 @@ static void rna_def_trackingSettings(BlenderRNA *brna) prop= RNA_def_property(srna, "speed", PROP_ENUM, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_enum_items(prop, speed_items); - RNA_def_property_ui_text(prop, "Speed", "Speed to make tracking with"); + RNA_def_property_ui_text(prop, "Speed", "Limit speed of tracking to make visual feedback easier (this does not affect the tracking quality)"); /* limit frames */ prop= RNA_def_property(srna, "frames_limit", PROP_INT, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_int_sdna(prop, NULL, "frames_limit"); RNA_def_property_range(prop, 0, SHRT_MAX); - RNA_def_property_ui_text(prop, "Frames Limit", "Amount of frames to be tracked during single tracking operation"); + RNA_def_property_ui_text(prop, "Frames Limit", "Every tracking cycle, this amount of frames are tracked"); /* adjust frames */ prop= RNA_def_property(srna, "frames_adjust", PROP_INT, PROP_NONE); @@ -257,7 +299,7 @@ static void rna_def_trackingSettings(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_int_sdna(prop, NULL, "margin"); RNA_def_property_range(prop, 0, 300); - RNA_def_property_ui_text(prop, "Margin", "Margin for markers from image boundary"); + RNA_def_property_ui_text(prop, "Margin", "Distance from image boudary at which marker stops tracking"); /* keyframe_a */ prop= RNA_def_property(srna, "keyframe_a", PROP_INT, PROP_NONE); @@ -271,6 +313,13 @@ static void rna_def_trackingSettings(BlenderRNA *brna) RNA_def_property_int_sdna(prop, NULL, "keyframe2"); RNA_def_property_ui_text(prop, "Keyframe B", "Second keyframe used for reconstruction initialization"); + /* intrinsics refinement during bundle adjustment */ + prop= RNA_def_property(srna, "refine_intrinsics", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "refine_camera_intrinsics"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_enum_items(prop, refine_items); + RNA_def_property_ui_text(prop, "Refine", "Refine intrinsics during camera solving"); + /* tool settings */ /* distance */ @@ -324,7 +373,7 @@ static void rna_def_trackingCamera(BlenderRNA *brna) /* Focal Length */ prop= RNA_def_property(srna, "focal_length", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "focal"); - RNA_def_property_range(prop, 0.0f, 5000.0f); + RNA_def_property_range(prop, 0.0001f, 5000.0f); RNA_def_property_float_funcs(prop, "rna_trackingCamera_focal_mm_get", "rna_trackingCamera_focal_mm_set", NULL); RNA_def_property_ui_text(prop, "Focal Length", "Camera's focal length"); RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, NULL); @@ -374,7 +423,7 @@ static void rna_def_trackingCamera(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "pixel_aspect"); RNA_def_property_range(prop, 0.1f, 5000.0f); RNA_def_property_ui_range(prop, 0.1f, 5000.0f, 1, 2); - RNA_def_property_ui_text(prop, "Pixel Aspect", "Pixel aspect ratio"); + RNA_def_property_ui_text(prop, "Pixel Aspect Ratio", "Pixel aspect ratio"); RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, "rna_tracking_flushUpdate"); } @@ -402,9 +451,9 @@ static void rna_def_trackingMarker(BlenderRNA *brna) RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, NULL); /* enable */ - prop= RNA_def_property(srna, "enable", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", MARKER_DISABLED); - RNA_def_property_ui_text(prop, "Enable", "Is marker enabled for current frame"); + prop= RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", MARKER_DISABLED); + RNA_def_property_ui_text(prop, "Mode", "Is marker muted for current frame"); RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, NULL); } @@ -417,8 +466,8 @@ static void rna_def_trackingTrack(BlenderRNA *brna) PropertyRNA *parm; static EnumPropertyItem tracker_items[] = { - {TRACKER_SAD, "SAD", 0, "SAD", "Sum of Absolute Differences tracker"}, - {TRACKER_KLT, "KLT", 0, "KLT", "Kanade–Lucas–Tomasi tracker"}, + {TRACKER_KLT, "KLT", 0, "KLT", "Kanade–Lucas–Tomasi tracker which works with most of video clips, a bit slower than SAD"}, + {TRACKER_SAD, "SAD", 0, "SAD", "Sum of Absolute Differences tracker which can be used when MLT tracker fails"}, {0, NULL, 0, NULL, NULL}}; rna_def_trackingMarker(brna); @@ -477,7 +526,7 @@ static void rna_def_trackingTrack(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_int_sdna(prop, NULL, "pyramid_levels"); RNA_def_property_range(prop, 1, 16); - RNA_def_property_ui_text(prop, "Pyramid levels", "Number of pyramid levels for KLT tracking"); + RNA_def_property_ui_text(prop, "Pyramid levels", "Number of pyramid levels (increase on blurry footage)"); RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, "rna_tracking_trackerPyramid_update"); /* minmal correlation - only used for SAD tracker */ @@ -533,6 +582,30 @@ static void rna_def_trackingTrack(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Hide", "Track is hidden"); RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL); + /* select */ + prop= RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_funcs(prop, "rna_trackingTrack_select_get", "rna_trackingTrack_select_set"); + RNA_def_property_ui_text(prop, "Select", "Track is selected"); + RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL); + + /* select_anchor */ + prop= RNA_def_property(srna, "select_anchor", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", SELECT); + RNA_def_property_ui_text(prop, "Select Anchor", "Track's anchor point is selected"); + RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL); + + /* select_pattern */ + prop= RNA_def_property(srna, "select_pattern", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "pat_flag", SELECT); + RNA_def_property_ui_text(prop, "Select Pattern", "Track's pattern area is selected"); + RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL); + + /* select_search */ + prop= RNA_def_property(srna, "select_search", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "search_flag", SELECT); + RNA_def_property_ui_text(prop, "Select Search", "Track's search area is selected"); + RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL); + /* locked */ prop= RNA_def_property(srna, "lock", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", TRACK_LOCKED); @@ -549,7 +622,7 @@ static void rna_def_trackingTrack(BlenderRNA *brna) prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_range(prop, 0.0f, 1.0f); - RNA_def_property_ui_text(prop, "Color", "Color of the track in the Clip Editor"); + RNA_def_property_ui_text(prop, "Color", "Color of the track in the Movie Track Editor and the 3D viewport after a solve"); RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL); /* average error */ @@ -612,7 +685,7 @@ static void rna_def_trackingStabilization(BlenderRNA *brna) prop= RNA_def_property(srna, "scale_max", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "maxscale"); RNA_def_property_range(prop, 0.0f, 10.0f); - RNA_def_property_ui_text(prop, "Miximal Scale", "Maximal value for scale factor"); + RNA_def_property_ui_text(prop, "Maximal Scale", "Limits the amount of automatic scaling"); RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, "rna_tracking_flushUpdate"); /* influence_location */ @@ -629,6 +702,12 @@ static void rna_def_trackingStabilization(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Scale Influence", "Influence of stabilization algorithm on footage scale"); RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, "rna_tracking_flushUpdate"); + /* use_stabilize_rotation */ + prop= RNA_def_property(srna, "use_stabilize_rotation", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", TRACKING_STABILIZE_ROTATION); + RNA_def_property_ui_text(prop, "Stabilize Rotation", "Stabilize horizon line on the shot"); + RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, "rna_tracking_flushUpdate"); + /* influence_rotation */ prop= RNA_def_property(srna, "influence_rotation", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "rotinf"); diff --git a/source/blender/makesrna/intern/rna_ui.c b/source/blender/makesrna/intern/rna_ui.c index 58d6911cf17..be0fec41aa1 100644 --- a/source/blender/makesrna/intern/rna_ui.c +++ b/source/blender/makesrna/intern/rna_ui.c @@ -56,6 +56,8 @@ EnumPropertyItem operator_context_items[] = { #ifdef RNA_RUNTIME +#include <assert.h> + #include "MEM_guardedalloc.h" #include "RNA_access.h" @@ -411,6 +413,7 @@ static void rna_Menu_unregister(Main *UNUSED(bmain), StructRNA *type) WM_main_add_notifier(NC_SCREEN|NA_EDITED, NULL); } +static char _menu_descr[RNA_DYN_DESCR_MAX]; static StructRNA *rna_Menu_register(Main *bmain, ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free) { @@ -418,11 +421,17 @@ static StructRNA *rna_Menu_register(Main *bmain, ReportList *reports, void *data Menu dummymenu= {NULL}; PointerRNA dummymtr; int have_function[2]; + size_t over_alloc= 0; /* warning, if this becomes a bess, we better do another alloc */ + size_t description_size= 0; /* setup dummy menu & menu type to store static properties in */ dummymenu.type= &dummymt; + dummymenu.type->description= _menu_descr; RNA_pointer_create(NULL, &RNA_Menu, &dummymenu, &dummymtr); + /* clear incase they are left unset */ + _menu_descr[0]= '\0'; + /* validate the python class */ if(validate(&dummymtr, data, have_function) != 0) return NULL; @@ -439,9 +448,20 @@ static StructRNA *rna_Menu_register(Main *bmain, ReportList *reports, void *data rna_Menu_unregister(bmain, mt->ext.srna); /* create a new menu type */ - mt= MEM_callocN(sizeof(MenuType), "python buttons menu"); + if (_menu_descr[0]) { + description_size= strlen(_menu_descr) + 1; + over_alloc += description_size; + } + + mt= MEM_callocN(sizeof(MenuType) + over_alloc, "python buttons menu"); memcpy(mt, &dummymt, sizeof(dummymt)); + if (_menu_descr[0]) { + char *buf= (char *)(mt + 1); + memcpy(buf, _menu_descr, description_size); + mt->description= buf; + } + mt->ext.srna= RNA_def_struct(&BLENDER_RNA, mt->idname, "Menu"); mt->ext.data= data; mt->ext.call= call; @@ -466,6 +486,14 @@ static StructRNA* rna_Menu_refine(PointerRNA *mtr) return (hdr->type && hdr->type->ext.srna)? hdr->type->ext.srna: &RNA_Menu; } +static void rna_Menu_bl_description_set(PointerRNA *ptr, const char *value) +{ + Menu *data= (Menu*)(ptr->data); + char *str= (char *)data->type->description; + if(!str[0]) BLI_strncpy(str, value, RNA_DYN_DESCR_MAX); /* utf8 already ensured */ + else assert(!"setting the bl_description on a non-builtin menu"); +} + static int rna_UILayout_active_get(PointerRNA *ptr) { return uiLayoutGetActive(ptr->data); @@ -800,6 +828,13 @@ static void rna_def_menu(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_REGISTER); RNA_def_property_ui_text(prop, "Label", "The menu label"); + prop= RNA_def_property(srna, "bl_description", PROP_STRING, PROP_TRANSLATE); + RNA_def_property_string_sdna(prop, NULL, "type->description"); + RNA_def_property_string_maxlength(prop, RNA_DYN_DESCR_MAX); /* else it uses the pointer size! */ + RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Menu_bl_description_set"); + // RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL); + RNA_define_verify_sdna(1); } diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c index 366ba1daf85..4c97a926513 100644 --- a/source/blender/makesrna/intern/rna_ui_api.c +++ b/source/blender/makesrna/intern/rna_ui_api.c @@ -429,7 +429,8 @@ void RNA_api_ui_layout(StructRNA *srna) RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_string(func, "prop_list", "", 0, "", "Identifier of a string property in each data member, specifying which " - "of its properties should have a widget displayed in its row"); + "of its properties should have a widget displayed in its row " + "(format: \"propname1:propname2:propname3:...\")"); RNA_def_int(func, "rows", 5, 0, INT_MAX, "", "Number of rows to display", 0, INT_MAX); RNA_def_int(func, "maxrows", 5, 0, INT_MAX, "", "Maximum number of rows to display", 0, INT_MAX); RNA_def_enum(func, "type", list_type_items, 0, "Type", "Type of list to use"); diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 8406f232653..ad2b49e5d41 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -506,6 +506,25 @@ static void rna_def_userdef_theme_ui_wcol_state(BlenderRNA *brna) RNA_def_property_update(prop, 0, "rna_userdef_update"); } +static void rna_def_userdef_theme_ui_panel(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + srna= RNA_def_struct(brna, "ThemePanelColors", NULL); + RNA_def_struct_sdna(srna, "uiPanelColors"); + RNA_def_struct_clear_flag(srna, STRUCT_UNDO); + RNA_def_struct_ui_text(srna, "Theme Panel Color", "Theme settings for panel colors"); + + prop= RNA_def_property(srna, "header", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_ui_text(prop, "Header", ""); + RNA_def_property_update(prop, 0, "rna_userdef_update"); + + prop= RNA_def_property(srna, "show_header", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_ui_text(prop, "Show Header", ""); + RNA_def_property_update(prop, 0, "rna_userdef_update"); +} + static void rna_def_userdef_theme_ui(BlenderRNA *brna) { StructRNA *srna; @@ -513,6 +532,7 @@ static void rna_def_userdef_theme_ui(BlenderRNA *brna) rna_def_userdef_theme_ui_wcol(brna); rna_def_userdef_theme_ui_wcol_state(brna); + rna_def_userdef_theme_ui_panel(brna); srna= RNA_def_struct(brna, "ThemeUserInterface", NULL); RNA_def_struct_sdna(srna, "ThemeUI"); @@ -521,127 +541,102 @@ static void rna_def_userdef_theme_ui(BlenderRNA *brna) prop= RNA_def_property(srna, "wcol_regular", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); - 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, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "wcol_tool", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, 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, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "wcol_radio", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, 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, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "wcol_text", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, 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, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "wcol_option", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, 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, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "wcol_toggle", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, 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, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "wcol_num", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, 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, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "wcol_numslider", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, 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, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "wcol_box", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, 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, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "wcol_menu", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, 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, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "wcol_pulldown", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, 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, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "wcol_menu_back", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, 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, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "wcol_menu_item", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, 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, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "wcol_scroll", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, 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, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "wcol_progress", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); - RNA_def_property_pointer_sdna(prop, NULL, "wcol_progress"); - RNA_def_property_struct_type(prop, "ThemeWidgetColors"); RNA_def_property_ui_text(prop, "Progress Bar Widget Colors", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "wcol_list_item", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, 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, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "wcol_state", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, 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, 0, "rna_userdef_update"); + + prop= RNA_def_property(srna, "panel", PROP_POINTER, PROP_NONE); + RNA_def_property_flag(prop, PROP_NEVER_NULL); + RNA_def_property_ui_text(prop, "Panel Colors", ""); + 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, 0, "rna_userdef_update"); + + prop= RNA_def_property(srna, "icon_alpha", PROP_FLOAT, PROP_FACTOR); + RNA_def_property_ui_text(prop, "Icon Alpha", "Transparency of icons in the interface, to reduce contrast"); + RNA_def_property_update(prop, 0, "rna_userdef_update"); } static void rna_def_userdef_theme_spaces_main(StructRNA *srna, int spacetype) @@ -2630,7 +2625,7 @@ static void rna_def_userdef_system(BlenderRNA *brna) {4, "ITALIAN", 0, "Italian (Italiano)", "it_IT"}, {15, "RUSSIAN", 0, "Russian (Русский)", "ru_RU"}, {13, "SIMPLIFIED_CHINESE", 0, "Simplified Chinese (简体中文)", "zh_CN"}, - {9, "SPANISH", 0, "Spanish (Español)", "es_ES"}, + {9, "SPANISH", 0, "Spanish (Español)", "es"}, {0, "", 0, "In progress", ""}, {2, "JAPANESE", 0, "Japanese (日本語)", "ja_JP"}, {3, "DUTCH", 0, "Dutch (Nederlandse taal)", "nl_NL"}, @@ -2964,12 +2959,6 @@ static void rna_def_userdef_input(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Show Navigation Guide", "Display the center and axis during rotation"); /* TODO: update description when fly-mode visuals are in place ("projected position in fly mode")*/ - /* 3D view: orbit */ - prop= RNA_def_property(srna, "ndof_orbit_invert_axes", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_ORBIT_INVERT_AXES); - RNA_def_property_ui_text(prop, "Invert Axes", "Toggle between moving the viewpoint or moving the scene being viewed"); - /* in 3Dx docs, this is called 'object mode' vs. 'target camera mode' */ - /* 3D view: roll */ prop= RNA_def_property(srna, "ndof_roll_invert_axis", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_ROLL_INVERT_AXIS); diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c index dfbdafd7d18..8e05e43b48f 100644 --- a/source/blender/makesrna/intern/rna_wm.c +++ b/source/blender/makesrna/intern/rna_wm.c @@ -338,41 +338,43 @@ EnumPropertyItem keymap_propvalue_items[] = { {0, "NONE", 0, "", ""}, {0, NULL, 0, NULL, NULL}}; -EnumPropertyItem keymap_modifiers_items[] = { - {KM_ANY, "ANY", 0, "Any", ""}, - {0, "NONE", 0, "None", ""}, - {1, "FIRST", 0, "First", ""}, - {2, "SECOND", 0, "Second", ""}, - {0, NULL, 0, NULL, NULL}}; +#if 0 +static EnumPropertyItem keymap_modifiers_items[] = { + {KM_ANY, "ANY", 0, "Any", ""}, + {0, "NONE", 0, "None", ""}, + {1, "FIRST", 0, "First", ""}, + {2, "SECOND", 0, "Second", ""}, + {0, NULL, 0, NULL, NULL}}; +#endif EnumPropertyItem operator_flag_items[] = { - {OPTYPE_REGISTER, "REGISTER", 0, "Register", "Display in the info window and support the redo toolbar panel"}, - {OPTYPE_UNDO, "UNDO", 0, "Undo", "Push an undo event (needed for operator redo)"}, - {OPTYPE_BLOCKING, "BLOCKING", 0, "Blocking", "Block anything else from using the cursor"}, - {OPTYPE_MACRO, "MACRO", 0, "Macro", "Use to check if an operator is a macro"}, - {OPTYPE_GRAB_POINTER, "GRAB_POINTER", 0, "Grab Pointer", "Use so the operator grabs the mouse focus, enables wrapping when continuous grab is enabled"}, - {OPTYPE_PRESET, "PRESET", 0, "Preset", "Display a preset button with the operators settings"}, - {OPTYPE_INTERNAL, "INTERNAL", 0, "Internal", "Removes the operator from search results"}, - {0, NULL, 0, NULL, NULL}}; + {OPTYPE_REGISTER, "REGISTER", 0, "Register", "Display in the info window and support the redo toolbar panel"}, + {OPTYPE_UNDO, "UNDO", 0, "Undo", "Push an undo event (needed for operator redo)"}, + {OPTYPE_BLOCKING, "BLOCKING", 0, "Blocking", "Block anything else from using the cursor"}, + {OPTYPE_MACRO, "MACRO", 0, "Macro", "Use to check if an operator is a macro"}, + {OPTYPE_GRAB_POINTER, "GRAB_POINTER", 0, "Grab Pointer", "Use so the operator grabs the mouse focus, enables wrapping when continuous grab is enabled"}, + {OPTYPE_PRESET, "PRESET", 0, "Preset", "Display a preset button with the operators settings"}, + {OPTYPE_INTERNAL, "INTERNAL", 0, "Internal", "Removes the operator from search results"}, + {0, NULL, 0, NULL, NULL}}; EnumPropertyItem operator_return_items[] = { - {OPERATOR_RUNNING_MODAL, "RUNNING_MODAL", 0, "Running Modal", "Keep the operator running with blender"}, - {OPERATOR_CANCELLED, "CANCELLED", 0, "Cancelled", "When no action has been taken, operator exits"}, - {OPERATOR_FINISHED, "FINISHED", 0, "Finished", "When the operator is complete, operator exits"}, - {OPERATOR_PASS_THROUGH, "PASS_THROUGH", 0, "Pass Through", "Do nothing and pass the event on"}, // used as a flag - {0, NULL, 0, NULL, NULL}}; + {OPERATOR_RUNNING_MODAL, "RUNNING_MODAL", 0, "Running Modal", "Keep the operator running with blender"}, + {OPERATOR_CANCELLED, "CANCELLED", 0, "Cancelled", "When no action has been taken, operator exits"}, + {OPERATOR_FINISHED, "FINISHED", 0, "Finished", "When the operator is complete, operator exits"}, + {OPERATOR_PASS_THROUGH, "PASS_THROUGH", 0, "Pass Through", "Do nothing and pass the event on"}, // used as a flag + {0, NULL, 0, NULL, NULL}}; /* flag/enum */ EnumPropertyItem wm_report_items[] = { - {RPT_DEBUG, "DEBUG", 0, "Debug", ""}, - {RPT_INFO, "INFO", 0, "Info", ""}, - {RPT_OPERATOR, "OPERATOR", 0, "Operator", ""}, - {RPT_WARNING, "WARNING", 0, "Warning", ""}, - {RPT_ERROR, "ERROR", 0, "Error", ""}, - {RPT_ERROR_INVALID_INPUT, "ERROR_INVALID_INPUT", 0, "Invalid Input", ""},\ - {RPT_ERROR_INVALID_CONTEXT, "ERROR_INVALID_CONTEXT", 0, "Invalid Context", ""}, - {RPT_ERROR_OUT_OF_MEMORY, "ERROR_OUT_OF_MEMORY", 0, "Out of Memory", ""}, - {0, NULL, 0, NULL, NULL}}; + {RPT_DEBUG, "DEBUG", 0, "Debug", ""}, + {RPT_INFO, "INFO", 0, "Info", ""}, + {RPT_OPERATOR, "OPERATOR", 0, "Operator", ""}, + {RPT_WARNING, "WARNING", 0, "Warning", ""}, + {RPT_ERROR, "ERROR", 0, "Error", ""}, + {RPT_ERROR_INVALID_INPUT, "ERROR_INVALID_INPUT", 0, "Invalid Input", ""},\ + {RPT_ERROR_INVALID_CONTEXT, "ERROR_INVALID_CONTEXT", 0, "Invalid Context", ""}, + {RPT_ERROR_OUT_OF_MEMORY, "ERROR_OUT_OF_MEMORY", 0, "Out of Memory", ""}, + {0, NULL, 0, NULL, NULL}}; #define KMI_TYPE_KEYBOARD 0 #define KMI_TYPE_MOUSE 1 @@ -419,7 +421,7 @@ static IDProperty *rna_OperatorProperties_idprops(PointerRNA *ptr, int create) { if(create && !ptr->data) { IDPropertyTemplate val = {0}; - ptr->data= IDP_New(IDP_GROUP, val, "RNA_OperatorProperties group"); + ptr->data= IDP_New(IDP_GROUP, &val, "RNA_OperatorProperties group"); } return ptr->data; @@ -964,7 +966,7 @@ void macro_wrapper(wmOperatorType *ot, void *userdata); static char _operator_idname[OP_MAX_TYPENAME]; static char _operator_name[OP_MAX_TYPENAME]; -static char _operator_descr[1024]; +static char _operator_descr[RNA_DYN_DESCR_MAX]; static StructRNA *rna_Operator_register(Main *bmain, ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free) { wmOperatorType dummyot = {NULL}; @@ -1159,7 +1161,7 @@ static void rna_Operator_bl_idname_set(PointerRNA *ptr, const char *value) { wmOperator *data= (wmOperator*)(ptr->data); char *str= (char *)data->type->idname; - if(!str[0]) strcpy(str, value); + if(!str[0]) BLI_strncpy(str, value, RNA_DYN_DESCR_MAX); /* utf8 already ensured */ else assert(!"setting the bl_idname on a non-builtin operator"); } @@ -1167,7 +1169,7 @@ static void rna_Operator_bl_label_set(PointerRNA *ptr, const char *value) { wmOperator *data= (wmOperator*)(ptr->data); char *str= (char *)data->type->name; - if(!str[0]) strcpy(str, value); + if(!str[0]) BLI_strncpy(str, value, RNA_DYN_DESCR_MAX); /* utf8 already ensured */ else assert(!"setting the bl_label on a non-builtin operator"); } @@ -1175,7 +1177,7 @@ static void rna_Operator_bl_description_set(PointerRNA *ptr, const char *value) { wmOperator *data= (wmOperator*)(ptr->data); char *str= (char *)data->type->description; - if(!str[0]) strcpy(str, value); + if(!str[0]) BLI_strncpy(str, value, RNA_DYN_DESCR_MAX); /* utf8 already ensured */ else assert(!"setting the bl_description on a non-builtin operator"); } @@ -1230,14 +1232,14 @@ static void rna_def_operator(BlenderRNA *brna) prop= RNA_def_property(srna, "bl_label", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "type->name"); - RNA_def_property_string_maxlength(prop, 1024); /* else it uses the pointer size! */ + RNA_def_property_string_maxlength(prop, RNA_DYN_DESCR_MAX); /* else it uses the pointer size! */ RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Operator_bl_label_set"); // RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_flag(prop, PROP_REGISTER); prop= RNA_def_property(srna, "bl_description", PROP_STRING, PROP_TRANSLATE); RNA_def_property_string_sdna(prop, NULL, "type->description"); - RNA_def_property_string_maxlength(prop, 1024); /* else it uses the pointer size! */ + RNA_def_property_string_maxlength(prop, RNA_DYN_DESCR_MAX); /* else it uses the pointer size! */ RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Operator_bl_description_set"); // RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL); @@ -1291,14 +1293,14 @@ static void rna_def_macro_operator(BlenderRNA *brna) prop= RNA_def_property(srna, "bl_label", PROP_STRING, PROP_TRANSLATE); RNA_def_property_string_sdna(prop, NULL, "type->name"); - RNA_def_property_string_maxlength(prop, 1024); /* else it uses the pointer size! */ + RNA_def_property_string_maxlength(prop, RNA_DYN_DESCR_MAX); /* else it uses the pointer size! */ RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Operator_bl_label_set"); // RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_flag(prop, PROP_REGISTER); prop= RNA_def_property(srna, "bl_description", PROP_STRING, PROP_TRANSLATE); RNA_def_property_string_sdna(prop, NULL, "type->description"); - RNA_def_property_string_maxlength(prop, 1024); /* else it uses the pointer size! */ + RNA_def_property_string_maxlength(prop, RNA_DYN_DESCR_MAX); /* else it uses the pointer size! */ RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Operator_bl_description_set"); // RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL); |