diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2011-05-19 05:40:37 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2011-05-19 05:40:37 +0400 |
commit | dfcd01553536d63dab1037d0ea289b9d9d90c39c (patch) | |
tree | 089cf7b605457c8d565f1e1a3c82558210c5e87d /source/blender/makesrna | |
parent | 31471f644cb9d9c3b88da1977705724649482a82 (diff) | |
parent | c04f9b779c4384f3cc6961b2ed54456bdab14f43 (diff) |
Merged changes in the trunk up to revision 36757.
Diffstat (limited to 'source/blender/makesrna')
37 files changed, 654 insertions, 457 deletions
diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index 4975b1bc984..2e71ebe4cc9 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -31,7 +31,6 @@ #include <stdarg.h> -#include "DNA_listBase.h" #include "RNA_types.h" #ifdef __cplusplus @@ -40,6 +39,7 @@ extern "C" { struct bContext; struct ID; +struct ListBase; struct Main; struct ReportList; struct Scene; @@ -53,6 +53,7 @@ extern StructRNA RNA_ActionGroup; extern StructRNA RNA_Actuator; extern StructRNA RNA_ActuatorSensor; extern StructRNA RNA_Addon; +extern StructRNA RNA_AdjustmentSequence; extern StructRNA RNA_AlwaysSensor; extern StructRNA RNA_AndController; extern StructRNA RNA_AnimData; @@ -627,6 +628,7 @@ int RNA_struct_is_a(StructRNA *type, StructRNA *srna); StructRegisterFunc RNA_struct_register(StructRNA *type); StructUnregisterFunc RNA_struct_unregister(StructRNA *type); +void **RNA_struct_instance(PointerRNA *ptr); void *RNA_struct_py_type_get(StructRNA *srna); void RNA_struct_py_type_set(StructRNA *srna, void *py_type); @@ -919,7 +921,7 @@ int RNA_property_is_idprop(PropertyRNA *prop); /* python compatible string representation of this property, (must be freed!) */ char *RNA_property_as_string(struct bContext *C, PointerRNA *ptr, PropertyRNA *prop); -char *RNA_pointer_as_string(PointerRNA *ptr); +char *RNA_pointer_as_string(struct bContext *C, PointerRNA *ptr); /* Function */ diff --git a/source/blender/makesrna/RNA_define.h b/source/blender/makesrna/RNA_define.h index f131f7c9ebe..f52a69182b5 100644 --- a/source/blender/makesrna/RNA_define.h +++ b/source/blender/makesrna/RNA_define.h @@ -60,7 +60,7 @@ void RNA_def_struct_flag(StructRNA *srna, int flag); void RNA_def_struct_clear_flag(StructRNA *srna, int flag); void RNA_def_struct_refine_func(StructRNA *srna, const char *refine); void RNA_def_struct_idprops_func(StructRNA *srna, const char *refine); -void RNA_def_struct_register_funcs(StructRNA *srna, const char *reg, const char *unreg); +void RNA_def_struct_register_funcs(StructRNA *srna, const char *reg, const char *unreg, const char *instance); void RNA_def_struct_path_func(StructRNA *srna, const char *path); void RNA_def_struct_identifier(StructRNA *srna, const char *identifier); void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description); diff --git a/source/blender/makesrna/RNA_types.h b/source/blender/makesrna/RNA_types.h index 3a15146770f..ec6f05c0e6a 100644 --- a/source/blender/makesrna/RNA_types.h +++ b/source/blender/makesrna/RNA_types.h @@ -43,6 +43,7 @@ struct StructRNA; struct BlenderRNA; struct IDProperty; struct bContext; +struct Main; struct ReportList; /** Pointer @@ -329,9 +330,10 @@ typedef enum StructFlag { typedef int (*StructValidateFunc)(struct PointerRNA *ptr, void *data, int *have_function); typedef int (*StructCallbackFunc)(struct bContext *C, struct PointerRNA *ptr, struct FunctionRNA *func, ParameterList *list); typedef void (*StructFreeFunc)(void *data); -typedef struct StructRNA *(*StructRegisterFunc)(struct bContext *C, struct ReportList *reports, void *data, +typedef struct StructRNA *(*StructRegisterFunc)(struct Main *bmain, struct ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free); -typedef void (*StructUnregisterFunc)(const struct bContext *C, struct StructRNA *type); +typedef void (*StructUnregisterFunc)(struct Main *bmain, struct StructRNA *type); +typedef void **(*StructInstanceFunc)(PointerRNA *ptr); typedef struct StructRNA StructRNA; diff --git a/source/blender/makesrna/SConscript b/source/blender/makesrna/SConscript index a2d332ec807..322101a58cf 100644 --- a/source/blender/makesrna/SConscript +++ b/source/blender/makesrna/SConscript @@ -43,10 +43,6 @@ if env['WITH_BF_QUICKTIME']: defs.append('WITH_QUICKTIME') incs += ' ../quicktime' -if env['WITH_BF_LCMS']: - defs.append('WITH_LCMS') - incs += ' ' + env['BF_LCMS_INC'] - if env['WITH_BF_GAMEENGINE']: defs.append('WITH_GAMEENGINE') diff --git a/source/blender/makesrna/intern/CMakeLists.txt b/source/blender/makesrna/intern/CMakeLists.txt index 68c2f930180..2c6c503fd3c 100644 --- a/source/blender/makesrna/intern/CMakeLists.txt +++ b/source/blender/makesrna/intern/CMakeLists.txt @@ -176,11 +176,6 @@ if(WITH_CODEC_FFMPEG) add_definitions(-DWITH_FFMPEG) endif() -if(WITH_LCMS) - list(APPEND INC ${LCMS_INCLUDE_DIR}) - add_definitions(-DWITH_LCMS) -endif() - if(NOT WITH_MOD_FLUID) add_definitions(-DDISABLE_ELBEEM) endif() @@ -224,7 +219,7 @@ blender_include_dirs( ../../../../intern/audaspace/intern ../../../../intern/guardedalloc ../../../../intern/memutil - ${GLEW_INCLUDE_PATH} + ${GLEW_INCLUDE_PATH} ) add_executable(makesrna ${SRC} ${SRC_RNA_INC} ${SRC_DNA_INC}) diff --git a/source/blender/makesrna/intern/SConscript b/source/blender/makesrna/intern/SConscript index c48b479da16..421c3a60691 100644 --- a/source/blender/makesrna/intern/SConscript +++ b/source/blender/makesrna/intern/SConscript @@ -65,9 +65,6 @@ if env['WITH_BF_QUICKTIME']: defs.append('WITH_QUICKTIME') incs += ' ../../quicktime' -if env['WITH_BF_LCMS']: - defs.append('WITH_LCMS') - if env['WITH_BF_GAMEENGINE']: defs.append('WITH_GAMEENGINE') diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index 8756e352838..d45864812f6 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -193,7 +193,17 @@ static int replace_if_different(char *tmpfile, const char *dep_files[]) #undef REN_IF_DIFF } +/* Helper to solve keyword problems with C/C++ */ +static const char *rna_safe_id(const char *id) +{ + if(strcmp(id, "default") == 0) + return "default_value"; + else if(strcmp(id, "operator") == 0) + return "operator_value"; + + return id; +} /* Sorting */ @@ -501,7 +511,7 @@ static char *rna_def_property_get_func(FILE *f, StructRNA *srna, PropertyRNA *pr } - func= rna_alloc_function_name(srna->identifier, prop->identifier, "get"); + func= rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), "get"); switch(prop->type) { case PROP_STRING: { @@ -569,7 +579,7 @@ static char *rna_def_property_get_func(FILE *f, StructRNA *srna, PropertyRNA *pr rna_print_data_get(f, dp); if(prop->flag & PROP_DYNAMIC) { - char *lenfunc= rna_alloc_function_name(srna->identifier, prop->identifier, "get_length"); + char *lenfunc= rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), "get_length"); fprintf(f, " int i, arraylen[RNA_MAX_ARRAY_DIMENSION];\n"); fprintf(f, " int len= %s(ptr, arraylen);\n\n", lenfunc); fprintf(f, " for(i=0; i<len; i++) {\n"); @@ -684,7 +694,7 @@ static char *rna_def_property_set_func(FILE *f, StructRNA *srna, PropertyRNA *pr } } - func= rna_alloc_function_name(srna->identifier, prop->identifier, "set"); + func= rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), "set"); switch(prop->type) { case PROP_STRING: { @@ -754,7 +764,7 @@ static char *rna_def_property_set_func(FILE *f, StructRNA *srna, PropertyRNA *pr rna_print_data_get(f, dp); if(prop->flag & PROP_DYNAMIC) { - char *lenfunc= rna_alloc_function_name(srna->identifier, prop->identifier, "set_length"); + char *lenfunc= rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), "set_length"); fprintf(f, " int i, arraylen[RNA_MAX_ARRAY_DIMENSION];\n"); fprintf(f, " int len= %s(ptr, arraylen);\n\n", lenfunc); fprintf(f, " for(i=0; i<len; i++) {\n"); @@ -851,7 +861,7 @@ static char *rna_def_property_length_func(FILE *f, StructRNA *srna, PropertyRNA } } - func= rna_alloc_function_name(srna->identifier, prop->identifier, "length"); + func= rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), "length"); fprintf(f, "int %s(PointerRNA *ptr)\n", func); fprintf(f, "{\n"); @@ -873,7 +883,7 @@ static char *rna_def_property_length_func(FILE *f, StructRNA *srna, PropertyRNA } } - func= rna_alloc_function_name(srna->identifier, prop->identifier, "length"); + func= rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), "length"); fprintf(f, "int %s(PointerRNA *ptr)\n", func); fprintf(f, "{\n"); @@ -908,7 +918,7 @@ static char *rna_def_property_begin_func(FILE *f, StructRNA *srna, PropertyRNA * } } - func= rna_alloc_function_name(srna->identifier, prop->identifier, "begin"); + func= rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), "begin"); fprintf(f, "void %s(CollectionPropertyIterator *iter, PointerRNA *ptr)\n", func); fprintf(f, "{\n"); @@ -940,7 +950,7 @@ static char *rna_def_property_begin_func(FILE *f, StructRNA *srna, PropertyRNA * fprintf(f, "\n rna_iterator_listbase_begin(iter, data->%s, NULL);\n", dp->dnaname); } - getfunc= rna_alloc_function_name(srna->identifier, prop->identifier, "get"); + getfunc= rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), "get"); fprintf(f, "\n if(iter->valid)\n"); fprintf(f, " iter->ptr= %s(iter);\n", getfunc); @@ -970,7 +980,7 @@ static char *rna_def_property_lookup_int_func(FILE *f, StructRNA *srna, Property else return NULL; } - func= rna_alloc_function_name(srna->identifier, prop->identifier, "lookup_int"); + func= rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), "lookup_int"); fprintf(f, "int %s(PointerRNA *ptr, int index, PointerRNA *r_ptr)\n", func); fprintf(f, "{\n"); @@ -984,7 +994,7 @@ static char *rna_def_property_lookup_int_func(FILE *f, StructRNA *srna, Property fprintf(f, " int found= 0;\n"); fprintf(f, " CollectionPropertyIterator iter;\n\n"); - fprintf(f, " %s_%s_begin(&iter, ptr);\n\n", srna->identifier, prop->identifier); + fprintf(f, " %s_%s_begin(&iter, ptr);\n\n", srna->identifier, rna_safe_id(prop->identifier)); fprintf(f, " if(iter.valid){\n"); if(strcmp(nextfunc, "rna_iterator_array_next") == 0) { @@ -1022,9 +1032,9 @@ static char *rna_def_property_lookup_int_func(FILE *f, StructRNA *srna, Property fprintf(f, " }\n"); } - fprintf(f, " if(found) *r_ptr = %s_%s_get(&iter);\n", srna->identifier, prop->identifier); + fprintf(f, " if(found) *r_ptr = %s_%s_get(&iter);\n", srna->identifier, rna_safe_id(prop->identifier)); fprintf(f, " }\n\n"); - fprintf(f, " %s_%s_end(&iter);\n\n", srna->identifier, prop->identifier); + fprintf(f, " %s_%s_end(&iter);\n\n", srna->identifier, rna_safe_id(prop->identifier)); fprintf(f, " return found;\n"); @@ -1061,13 +1071,13 @@ static char *rna_def_property_next_func(FILE *f, StructRNA *srna, PropertyRNA *p if(!manualfunc) return NULL; - func= rna_alloc_function_name(srna->identifier, prop->identifier, "next"); + func= rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), "next"); fprintf(f, "void %s(CollectionPropertyIterator *iter)\n", func); fprintf(f, "{\n"); fprintf(f, " %s(iter);\n", manualfunc); - getfunc= rna_alloc_function_name(srna->identifier, prop->identifier, "get"); + getfunc= rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), "get"); fprintf(f, "\n if(iter->valid)\n"); fprintf(f, " iter->ptr= %s(iter);\n", getfunc); @@ -1084,7 +1094,7 @@ static char *rna_def_property_end_func(FILE *f, StructRNA *srna, PropertyRNA *pr if(prop->flag & PROP_IDPROPERTY && manualfunc==NULL) return NULL; - func= rna_alloc_function_name(srna->identifier, prop->identifier, "end"); + func= rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), "end"); fprintf(f, "void %s(CollectionPropertyIterator *iter)\n", func); fprintf(f, "{\n"); @@ -1272,7 +1282,7 @@ static void rna_def_property_funcs_header(FILE *f, StructRNA *srna, PropertyDefR if(prop->flag & (PROP_IDPROPERTY|PROP_BUILTIN)) return; - func= rna_alloc_function_name(srna->identifier, prop->identifier, ""); + func= rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), ""); switch(prop->type) { case PROP_BOOLEAN: @@ -1281,10 +1291,14 @@ static void rna_def_property_funcs_header(FILE *f, StructRNA *srna, PropertyDefR fprintf(f, "int %sget(PointerRNA *ptr);\n", func); //fprintf(f, "void %sset(PointerRNA *ptr, int value);\n", func); } - else { + else if(prop->arraydimension && prop->totarraylength) { fprintf(f, "void %sget(PointerRNA *ptr, int values[%d]);\n", func, prop->totarraylength); //fprintf(f, "void %sset(PointerRNA *ptr, const int values[%d]);\n", func, prop->arraylength); } + else { + fprintf(f, "void %sget(PointerRNA *ptr, int values[]);\n", func); + //fprintf(f, "void %sset(PointerRNA *ptr, const int values[]);\n", func); + } break; } case PROP_FLOAT: { @@ -1292,10 +1306,14 @@ static void rna_def_property_funcs_header(FILE *f, StructRNA *srna, PropertyDefR fprintf(f, "float %sget(PointerRNA *ptr);\n", func); //fprintf(f, "void %sset(PointerRNA *ptr, float value);\n", func); } - else { + else if(prop->arraydimension && prop->totarraylength) { fprintf(f, "void %sget(PointerRNA *ptr, float values[%d]);\n", func, prop->totarraylength); //fprintf(f, "void %sset(PointerRNA *ptr, const float values[%d]);\n", func, prop->arraylength); } + else { + fprintf(f, "void %sget(PointerRNA *ptr, float values[]);\n", func); + //fprintf(f, "void %sset(PointerRNA *ptr, const float values[]);\n", func); + } break; } case PROP_ENUM: { @@ -1368,23 +1386,23 @@ static void rna_def_property_funcs_header_cpp(FILE *f, StructRNA *srna, Property switch(prop->type) { case PROP_BOOLEAN: { if(!prop->arraydimension) - fprintf(f, "\tbool %s(void);", prop->identifier); + fprintf(f, "\tinline bool %s(void);", rna_safe_id(prop->identifier)); else - fprintf(f, "\tArray<int, %d> %s(void);", prop->totarraylength, prop->identifier); + fprintf(f, "\tinline Array<int, %d> %s(void);", prop->totarraylength, rna_safe_id(prop->identifier)); break; } case PROP_INT: { if(!prop->arraydimension) - fprintf(f, "\tint %s(void);", prop->identifier); + fprintf(f, "\tinline int %s(void);", rna_safe_id(prop->identifier)); else - fprintf(f, "\tArray<int, %d> %s(void);", prop->totarraylength, prop->identifier); + fprintf(f, "\tinline Array<int, %d> %s(void);", prop->totarraylength, rna_safe_id(prop->identifier)); break; } case PROP_FLOAT: { if(!prop->arraydimension) - fprintf(f, "\tfloat %s(void);", prop->identifier); + fprintf(f, "\tinline float %s(void);", rna_safe_id(prop->identifier)); else - fprintf(f, "\tArray<float, %d> %s(void);", prop->totarraylength, prop->identifier); + fprintf(f, "\tinline Array<float, %d> %s(void);", prop->totarraylength, rna_safe_id(prop->identifier)); break; } case PROP_ENUM: { @@ -1392,38 +1410,38 @@ static void rna_def_property_funcs_header_cpp(FILE *f, StructRNA *srna, Property int i; if(eprop->item) { - fprintf(f, "\tenum %s_enum {\n", prop->identifier); + fprintf(f, "\tenum %s_enum {\n", rna_safe_id(prop->identifier)); for(i=0; i<eprop->totitem; i++) if(eprop->item[i].identifier[0]) - fprintf(f, "\t\t%s_%s = %d,\n", prop->identifier, eprop->item[i].identifier, eprop->item[i].value); + fprintf(f, "\t\t%s_%s = %d,\n", rna_safe_id(prop->identifier), eprop->item[i].identifier, eprop->item[i].value); fprintf(f, "\t};\n"); } - fprintf(f, "\t%s_enum %s(void);", prop->identifier, prop->identifier); + fprintf(f, "\tinline %s_enum %s(void);", rna_safe_id(prop->identifier), rna_safe_id(prop->identifier)); break; } case PROP_STRING: { - fprintf(f, "\tstd::string %s(void);", prop->identifier); + fprintf(f, "\tinline std::string %s(void);", rna_safe_id(prop->identifier)); break; } case PROP_POINTER: { PointerPropertyRNA *pprop= (PointerPropertyRNA*)dp->prop; if(pprop->type) - fprintf(f, "\t%s %s(void);", (char*)pprop->type, prop->identifier); + fprintf(f, "\tinline %s %s(void);", (char*)pprop->type, rna_safe_id(prop->identifier)); else - fprintf(f, "\t%s %s(void);", "UnknownType", prop->identifier); + fprintf(f, "\tinline %s %s(void);", "UnknownType", rna_safe_id(prop->identifier)); break; } case PROP_COLLECTION: { CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)dp->prop; if(cprop->item_type) - fprintf(f, "\tCOLLECTION_PROPERTY(%s, %s, %s)", (char*)cprop->item_type, srna->identifier, prop->identifier); + fprintf(f, "\tCOLLECTION_PROPERTY(%s, %s, %s)", (char*)cprop->item_type, srna->identifier, rna_safe_id(prop->identifier)); else - fprintf(f, "\tCOLLECTION_PROPERTY(%s, %s, %s)", "UnknownType", srna->identifier, prop->identifier); + fprintf(f, "\tCOLLECTION_PROPERTY(%s, %s, %s)", "UnknownType", srna->identifier, rna_safe_id(prop->identifier)); break; } } @@ -1443,41 +1461,41 @@ static void rna_def_property_funcs_impl_cpp(FILE *f, StructRNA *srna, PropertyDe switch(prop->type) { case PROP_BOOLEAN: { if(!prop->arraydimension) - fprintf(f, "\tBOOLEAN_PROPERTY(%s, %s)", srna->identifier, prop->identifier); + fprintf(f, "\tBOOLEAN_PROPERTY(%s, %s)", srna->identifier, rna_safe_id(prop->identifier)); else - fprintf(f, "\tBOOLEAN_ARRAY_PROPERTY(%s, %d, %s)", srna->identifier, prop->totarraylength, prop->identifier); + fprintf(f, "\tBOOLEAN_ARRAY_PROPERTY(%s, %d, %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, prop->identifier); + fprintf(f, "\tINT_PROPERTY(%s, %s)", srna->identifier, rna_safe_id(prop->identifier)); else - fprintf(f, "\tINT_ARRAY_PROPERTY(%s, %d, %s)", srna->identifier, prop->totarraylength, prop->identifier); + fprintf(f, "\tINT_ARRAY_PROPERTY(%s, %d, %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, prop->identifier); + fprintf(f, "\tFLOAT_PROPERTY(%s, %s)", srna->identifier, rna_safe_id(prop->identifier)); else - fprintf(f, "\tFLOAT_ARRAY_PROPERTY(%s, %d, %s)", srna->identifier, prop->totarraylength, prop->identifier); + fprintf(f, "\tFLOAT_ARRAY_PROPERTY(%s, %d, %s)", srna->identifier, prop->totarraylength, rna_safe_id(prop->identifier)); break; } case PROP_ENUM: { - fprintf(f, "\tENUM_PROPERTY(%s_enum, %s, %s)", prop->identifier, srna->identifier, prop->identifier); + fprintf(f, "\tENUM_PROPERTY(%s_enum, %s, %s)", rna_safe_id(prop->identifier), srna->identifier, rna_safe_id(prop->identifier)); break; } case PROP_STRING: { - fprintf(f, "\tSTRING_PROPERTY(%s, %s)", srna->identifier, prop->identifier); + fprintf(f, "\tSTRING_PROPERTY(%s, %s)", srna->identifier, rna_safe_id(prop->identifier)); break; } case PROP_POINTER: { PointerPropertyRNA *pprop= (PointerPropertyRNA*)dp->prop; if(pprop->type) - fprintf(f, "\tPOINTER_PROPERTY(%s, %s, %s)", (char*)pprop->type, srna->identifier, prop->identifier); + fprintf(f, "\tPOINTER_PROPERTY(%s, %s, %s)", (char*)pprop->type, srna->identifier, rna_safe_id(prop->identifier)); else - fprintf(f, "\tPOINTER_PROPERTY(%s, %s, %s)", "UnknownType", srna->identifier, prop->identifier); + fprintf(f, "\tPOINTER_PROPERTY(%s, %s, %s)", "UnknownType", srna->identifier, rna_safe_id(prop->identifier)); break; } case PROP_COLLECTION: { @@ -2337,6 +2355,7 @@ static void rna_generate_struct(BlenderRNA *brna, StructRNA *srna, FILE *f) fprintf(f, "\t%s,\n", rna_function_string(srna->path)); fprintf(f, "\t%s,\n", rna_function_string(srna->reg)); fprintf(f, "\t%s,\n", rna_function_string(srna->unreg)); + fprintf(f, "\t%s,\n", rna_function_string(srna->instance)); fprintf(f, "\t%s,\n", rna_function_string(srna->idproperties)); if(srna->reg && !srna->refine) { @@ -2547,40 +2566,40 @@ static const char *cpp_classes = "" "\n" "#include <string>\n" "\n" -"namespace RNA {\n" +"namespace BL {\n" "\n" "#define BOOLEAN_PROPERTY(sname, identifier) \\\n" -" bool sname::identifier(void) { return (bool)sname##_##identifier##_get(&ptr); }\n" +" inline bool sname::identifier(void) { return sname##_##identifier##_get(&ptr)? true: false; }\n" "\n" "#define BOOLEAN_ARRAY_PROPERTY(sname, size, identifier) \\\n" -" Array<int,size> sname::identifier(void) \\\n" +" inline Array<int,size> sname::identifier(void) \\\n" " { Array<int, size> ar; sname##_##identifier##_get(&ptr, ar.data); return ar; }\n" "\n" "#define INT_PROPERTY(sname, identifier) \\\n" -" int sname::identifier(void) { return sname##_##identifier##_get(&ptr); }\n" +" inline int sname::identifier(void) { return sname##_##identifier##_get(&ptr); }\n" "\n" "#define INT_ARRAY_PROPERTY(sname, size, identifier) \\\n" -" Array<int,size> sname::identifier(void) \\\n" +" inline Array<int,size> sname::identifier(void) \\\n" " { Array<int, size> ar; sname##_##identifier##_get(&ptr, ar.data); return ar; }\n" "\n" "#define FLOAT_PROPERTY(sname, identifier) \\\n" -" float sname::identifier(void) { return sname##_##identifier##_get(&ptr); }\n" +" inline float sname::identifier(void) { return sname##_##identifier##_get(&ptr); }\n" "\n" "#define FLOAT_ARRAY_PROPERTY(sname, size, identifier) \\\n" -" Array<float,size> sname::identifier(void) \\\n" +" inline Array<float,size> sname::identifier(void) \\\n" " { Array<float, size> ar; sname##_##identifier##_get(&ptr, ar.data); return ar; }\n" "\n" "#define ENUM_PROPERTY(type, sname, identifier) \\\n" -" sname::type sname::identifier(void) { return (type)sname##_##identifier##_get(&ptr); }\n" +" inline sname::type sname::identifier(void) { return (type)sname##_##identifier##_get(&ptr); }\n" "\n" "#define STRING_PROPERTY(sname, identifier) \\\n" -" std::string sname::identifier(void) { \\\n" +" inline std::string sname::identifier(void) { \\\n" " int len= sname##_##identifier##_length(&ptr); \\\n" " std::string str; str.resize(len); \\\n" " sname##_##identifier##_get(&ptr, &str[0]); return str; } \\\n" "\n" "#define POINTER_PROPERTY(type, sname, identifier) \\\n" -" type sname::identifier(void) { return type(sname##_##identifier##_get(&ptr)); }\n" +" inline type sname::identifier(void) { return type(sname##_##identifier##_get(&ptr)); }\n" "\n" "#define COLLECTION_PROPERTY(type, sname, identifier) \\\n" " typedef CollectionIterator<type, sname##_##identifier##_begin, \\\n" @@ -2592,7 +2611,7 @@ static const char *cpp_classes = "" "public:\n" " Pointer(const PointerRNA& p) : ptr(p) { }\n" " operator const PointerRNA&() { return ptr; }\n" -" bool is_a(StructRNA *type) { return RNA_struct_is_a(&ptr, type); }\n" +" bool is_a(StructRNA *type) { return RNA_struct_is_a(ptr.type, type)? true: false; }\n" " operator void*() { return ptr.data; }\n" " operator bool() { return ptr.data != NULL; }\n" "\n" @@ -2616,12 +2635,13 @@ static const char *cpp_classes = "" "public:\n" " CollectionIterator() : t(iter.ptr), init(false) { iter.valid= false; }\n" " ~CollectionIterator(void) { if(init) Tend(&iter); };\n" -" const CollectionIterator<T, Tbegin, Tnext, Tend>& operator=(const CollectionIterator<T, Tbegin, Tnext, Tend>& copy)\n" -" { if(init) Tend(&iter); iter= copy.iter; if(iter.internal) iter.internal= MEM_dupallocN(iter.internal); t= copy.t; init= copy.init; return *this; }\n" "\n" " operator bool(void)\n" " { return iter.valid != 0; }\n" " const CollectionIterator<T, Tbegin, Tnext, Tend>& operator++() { Tnext(&iter); t = T(iter.ptr); return *this; }\n" +" const CollectionIterator<T, Tbegin, Tnext, Tend>& operator=(const CollectionIterator<T, Tbegin, Tnext, Tend>& copy)\n" +" { if(init) Tend(&iter); iter= copy.iter; if(iter.internal) iter.internal= MEM_dupallocN(iter.internal); t= copy.t; init= copy.init; return *this; }\n" +"\n" " T& operator*(void) { return t; }\n" " T* operator->(void) { return &t; }\n" " bool operator==(const CollectionIterator<T, Tbegin, Tnext, Tend>& other) { return iter.valid == other.iter.valid; }\n" @@ -2662,7 +2682,7 @@ static void rna_generate_header_cpp(BlenderRNA *brna, FILE *f) fprintf(f, "/* Automatically generated classes for the Data API.\n" " Do not edit manually, changes will be overwritten. */\n\n"); - + fprintf(f, "#include \"RNA_blender.h\"\n"); fprintf(f, "#include \"RNA_types.h\"\n"); diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c index e2c25972bdf..d31043ef1d9 100644 --- a/source/blender/makesrna/intern/rna_ID.c +++ b/source/blender/makesrna/intern/rna_ID.c @@ -213,12 +213,12 @@ IDProperty *rna_PropertyGroup_idprops(PointerRNA *ptr, int create) return ptr->data; } -void rna_PropertyGroup_unregister(const bContext *C, StructRNA *type) +void rna_PropertyGroup_unregister(Main *bmain, StructRNA *type) { RNA_struct_free(&BLENDER_RNA, type); } -StructRNA *rna_PropertyGroup_register(bContext *C, ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free) +StructRNA *rna_PropertyGroup_register(Main *bmain, ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free) { PointerRNA dummyptr; @@ -387,7 +387,7 @@ static void rna_def_ID_properties(BlenderRNA *brna) RNA_def_struct_sdna(srna, "IDPropertyGroup"); RNA_def_struct_ui_text(srna, "ID Property Group", "Group of ID properties"); RNA_def_struct_idprops_func(srna, "rna_PropertyGroup_idprops"); - RNA_def_struct_register_funcs(srna, "rna_PropertyGroup_register", "rna_PropertyGroup_unregister"); + RNA_def_struct_register_funcs(srna, "rna_PropertyGroup_register", "rna_PropertyGroup_unregister", NULL); RNA_def_struct_refine_func(srna, "rna_PropertyGroup_refine"); /* important so python types can have their name used in list views diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index 03622ec756f..ff54ac6254f 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -681,6 +681,18 @@ StructUnregisterFunc RNA_struct_unregister(StructRNA *type) return NULL; } +void **RNA_struct_instance(PointerRNA *ptr) +{ + StructRNA *type= ptr->type; + + do { + if(type->instance) + return type->instance(ptr); + } while((type=type->base)); + + return NULL; +} + void *RNA_struct_py_type_get(StructRNA *srna) { return srna->py_type; @@ -1107,21 +1119,26 @@ int RNA_property_enum_value(bContext *C, PointerRNA *ptr, PropertyRNA *prop, con { EnumPropertyItem *item, *item_array; int free, found; - + RNA_property_enum_items(C, ptr, prop, &item_array, NULL, &free); - - for(item= item_array; item->identifier; item++) { - if(item->identifier[0] && strcmp(item->identifier, identifier)==0) { - *value = item->value; - break; + + if(item_array) { + for(item= item_array; item->identifier; item++) { + if(item->identifier[0] && strcmp(item->identifier, identifier)==0) { + *value = item->value; + break; + } } - } - - found= (item->identifier != NULL); /* could be alloc'd, assign before free */ - if(free) - MEM_freeN(item_array); + found= (item->identifier != NULL); /* could be alloc'd, assign before free */ + if(free) { + MEM_freeN(item_array); + } + } + else { + found= 0; + } return found; } @@ -4036,8 +4053,9 @@ int RNA_property_is_idprop(PropertyRNA *prop) } /* string representation of a property, python - * compatible but can be used for display too*/ -char *RNA_pointer_as_string(PointerRNA *ptr) + * compatible but can be used for display too, + * context may be NULL */ +char *RNA_pointer_as_string(bContext *C, PointerRNA *ptr) { DynStr *dynstr= BLI_dynstr_new(); char *cstring; @@ -4057,7 +4075,7 @@ char *RNA_pointer_as_string(PointerRNA *ptr) BLI_dynstr_append(dynstr, ", "); first_time= 0; - cstring = RNA_property_as_string(NULL, ptr, prop); + cstring = RNA_property_as_string(C, ptr, prop); BLI_dynstr_appendf(dynstr, "\"%s\":%s", propname, cstring); MEM_freeN(cstring); } @@ -4175,7 +4193,7 @@ char *RNA_property_as_string(bContext *C, PointerRNA *ptr, PropertyRNA *prop) case PROP_POINTER: { PointerRNA tptr= RNA_property_pointer_get(ptr, prop); - cstring= RNA_pointer_as_string(&tptr); + cstring= RNA_pointer_as_string(C, &tptr); BLI_dynstr_append(dynstr, cstring); MEM_freeN(cstring); break; @@ -4194,7 +4212,7 @@ char *RNA_property_as_string(bContext *C, PointerRNA *ptr, PropertyRNA *prop) first_time= 0; /* now get every prop of the collection */ - cstring= RNA_pointer_as_string(&itemptr); + cstring= RNA_pointer_as_string(C, &itemptr); BLI_dynstr_append(dynstr, cstring); MEM_freeN(cstring); } diff --git a/source/blender/makesrna/intern/rna_animation.c b/source/blender/makesrna/intern/rna_animation.c index 106c51865fd..7f817aa5b4b 100644 --- a/source/blender/makesrna/intern/rna_animation.c +++ b/source/blender/makesrna/intern/rna_animation.c @@ -188,7 +188,7 @@ static StructRNA *rna_KeyingSetInfo_refine(PointerRNA *ptr) return (ksi->ext.srna)? ksi->ext.srna: &RNA_KeyingSetInfo; } -static void rna_KeyingSetInfo_unregister(const bContext *C, StructRNA *type) +static void rna_KeyingSetInfo_unregister(Main *bmain, StructRNA *type) { KeyingSetInfo *ksi= RNA_struct_blender_type_get(type); @@ -200,10 +200,10 @@ static void rna_KeyingSetInfo_unregister(const bContext *C, StructRNA *type) RNA_struct_free(&BLENDER_RNA, type); /* unlink Blender-side data */ - ANIM_keyingset_info_unregister(C, ksi); + ANIM_keyingset_info_unregister(bmain, ksi); } -static StructRNA *rna_KeyingSetInfo_register(bContext *C, ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free) +static StructRNA *rna_KeyingSetInfo_register(Main *bmain, ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free) { KeyingSetInfo dummyksi = {NULL}; KeyingSetInfo *ksi; @@ -226,7 +226,7 @@ static StructRNA *rna_KeyingSetInfo_register(bContext *C, ReportList *reports, v /* check if we have registered this info before, and remove it */ ksi = ANIM_keyingset_info_find_named(dummyksi.idname); if (ksi && ksi->ext.srna) - rna_KeyingSetInfo_unregister(C, ksi->ext.srna); + rna_KeyingSetInfo_unregister(bmain, ksi->ext.srna); /* create a new KeyingSetInfo type */ ksi= MEM_callocN(sizeof(KeyingSetInfo), "python keying set info"); @@ -509,7 +509,7 @@ static void rna_def_keyingset_info(BlenderRNA *brna) RNA_def_struct_sdna(srna, "KeyingSetInfo"); RNA_def_struct_ui_text(srna, "Keying Set Info", "Callback function defines for builtin Keying Sets"); RNA_def_struct_refine_func(srna, "rna_KeyingSetInfo_refine"); - RNA_def_struct_register_funcs(srna, "rna_KeyingSetInfo_register", "rna_KeyingSetInfo_unregister"); + RNA_def_struct_register_funcs(srna, "rna_KeyingSetInfo_register", "rna_KeyingSetInfo_unregister", NULL); /* Properties --------------------- */ diff --git a/source/blender/makesrna/intern/rna_camera.c b/source/blender/makesrna/intern/rna_camera.c index 34b1dc85881..1705e2e5376 100644 --- a/source/blender/makesrna/intern/rna_camera.c +++ b/source/blender/makesrna/intern/rna_camera.c @@ -67,6 +67,16 @@ void RNA_def_camera(BlenderRNA *brna) {CAM_PERSP, "PERSP", 0, "Perspective", ""}, {CAM_ORTHO, "ORTHO", 0, "Orthographic", ""}, {0, NULL, 0, NULL, NULL}}; + static EnumPropertyItem prop_draw_type_extra_items[] = { + {CAM_DTX_CENTER, "CENTER", 0, "Center", ""}, + {CAM_DTX_CENTER_DIAG, "CENTER_DIAGONAL", 0, "Center Diagonal", ""}, + {CAM_DTX_THIRDS, "THIRDS", 0, "Thirds", ""}, + {CAM_DTX_GOLDEN, "GOLDEN", 0, "Golden", ""}, + {CAM_DTX_GOLDEN_TRI_A, "GOLDEN_TRIANGLE_A", 0, "Golden Triangle A", ""}, + {CAM_DTX_GOLDEN_TRI_B, "GOLDEN_TRIANGLE_B", 0, "Golden Triangle B", ""}, + {CAM_DTX_HARMONY_TRI_A, "HARMONY_TRIANGLE_A", 0, "Harmonious Triangle A", ""}, + {CAM_DTX_HARMONY_TRI_B, "HARMONY_TRIANGLE_B", 0, "Harmonious Triangle B", ""}, + {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem prop_lens_unit_items[] = { {0, "MILLIMETERS", 0, "Millimeters", ""}, {CAM_ANGLETOGGLE, "DEGREES", 0, "Degrees", ""}, @@ -81,6 +91,13 @@ void RNA_def_camera(BlenderRNA *brna) RNA_def_property_enum_items(prop, prop_type_items); RNA_def_property_ui_text(prop, "Type", "Camera types"); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); + + prop= RNA_def_property(srna, "show_guide", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "dtx"); + RNA_def_property_enum_items(prop, prop_draw_type_extra_items); + RNA_def_property_flag(prop, PROP_ENUM_FLAG); + RNA_def_property_ui_text(prop, "Composition Guides", "Draw overlay"); + RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); /* Number values */ @@ -91,7 +108,7 @@ void RNA_def_camera(BlenderRNA *brna) prop= RNA_def_property(srna, "clip_start", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "clipsta"); - RNA_def_property_range(prop, 0.0f, FLT_MAX); + RNA_def_property_range(prop, 0.001f, FLT_MAX); RNA_def_property_ui_text(prop, "Clip Start", "Camera near clipping distance"); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); diff --git a/source/blender/makesrna/intern/rna_color.c b/source/blender/makesrna/intern/rna_color.c index 3fba13deb32..af9cfd80ca6 100644 --- a/source/blender/makesrna/intern/rna_color.c +++ b/source/blender/makesrna/intern/rna_color.c @@ -458,13 +458,13 @@ static void rna_def_color_ramp_element(BlenderRNA *brna) prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "r"); RNA_def_property_array(prop, 4); - RNA_def_property_ui_text(prop, "Color", ""); + RNA_def_property_ui_text(prop, "Color", "Set color of selected color stop"); RNA_def_property_update(prop, 0, "rna_ColorRamp_update"); prop= RNA_def_property(srna, "position", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "pos"); RNA_def_property_range(prop, 0, 1); - RNA_def_property_ui_text(prop, "Position", ""); + RNA_def_property_ui_text(prop, "Position", "Set position of selected color stop"); RNA_def_property_update(prop, 0, "rna_ColorRamp_update"); } diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c index 966e679f0fe..e7604b2beb4 100644 --- a/source/blender/makesrna/intern/rna_constraint.c +++ b/source/blender/makesrna/intern/rna_constraint.c @@ -75,18 +75,25 @@ EnumPropertyItem constraint_type_items[] ={ {CONSTRAINT_TYPE_SHRINKWRAP, "SHRINKWRAP", ICON_CONSTRAINT_DATA, "Shrinkwrap", ""}, {0, NULL, 0, NULL, NULL}}; -static EnumPropertyItem space_pchan_items[] = { - {0, "WORLD", 0, "World Space", ""}, - {2, "POSE", 0, "Pose Space", ""}, - {3, "LOCAL_WITH_PARENT", 0, "Local With Parent", ""}, - {1, "LOCAL", 0, "Local Space", ""}, +static EnumPropertyItem target_space_pchan_items[] = { + {0, "WORLD", 0, "World Space", "The transformation of the target is evaluated relative to the world coordinate system"}, + {2, "POSE", 0, "Pose Space", "The transformation of the target is only evaluated in the Pose Space, the target armature object transformation is ignored"}, + {3, "LOCAL_WITH_PARENT", 0, "Local With Parent", "The transformation of the target bone is evaluated relative its local coordinate system, with the parent transformation added"}, + {1, "LOCAL", 0, "Local Space", "The transformation of the target is evaluated relative to its local coordinate system"}, + {0, NULL, 0, NULL, NULL}}; + +static EnumPropertyItem owner_space_pchan_items[] = { + {0, "WORLD", 0, "World Space", "The constraint is applied relative to the world coordinate system"}, + {2, "POSE", 0, "Pose Space", "The constraint is applied in Pose Space, the object transformation is ignored"}, + {3, "LOCAL_WITH_PARENT", 0, "The constraint is applied relative to the local coordinate system of the object, with the parent transformation added"}, + {1, "LOCAL", 0, "Local Space", "The constraint is applied relative to the local coordinate sytem of the object"}, {0, NULL, 0, NULL, NULL}}; #ifdef RNA_RUNTIME static EnumPropertyItem space_object_items[] = { - {0, "WORLD", 0, "World Space", ""}, - {1, "LOCAL", 0, "Local Space", ""}, + {0, "WORLD", 0, "World Space", "The transformation of the target is evaluated relative to the world coordinate system"}, + {1, "LOCAL", 0, "Local Space", "The transformation of the target is evaluated relative to its local coordinate system"}, {0, NULL, 0, NULL, NULL}}; #include "BKE_animsys.h" @@ -242,7 +249,7 @@ static EnumPropertyItem *rna_Constraint_owner_space_itemf(bContext *C, PointerRN bConstraint *con= (bConstraint*)ptr->data; if(BLI_findindex(&ob->constraints, con) == -1) - return space_pchan_items; + return owner_space_pchan_items; else /* object */ return space_object_items; } @@ -265,7 +272,7 @@ static EnumPropertyItem *rna_Constraint_target_space_itemf(bContext *C, PointerR cti->flush_constraint_targets(con, &targets, 1); if(ct) - return space_pchan_items; + return target_space_pchan_items; } return space_object_items; @@ -318,9 +325,9 @@ static void rna_SplineIKConstraint_joint_bindings_set(PointerRNA *ptr, const flo #else EnumPropertyItem constraint_distance_items[] = { - {LIMITDIST_INSIDE, "LIMITDIST_INSIDE", 0, "Inside", ""}, - {LIMITDIST_OUTSIDE, "LIMITDIST_OUTSIDE", 0, "Outside", ""}, - {LIMITDIST_ONSURFACE, "LIMITDIST_ONSURFACE", 0, "On Surface", ""}, + {LIMITDIST_INSIDE, "LIMITDIST_INSIDE", 0, "Inside", "The object is constrained inside a virtual sphere around the target object, with a radius defined by the limit distance"}, + {LIMITDIST_OUTSIDE, "LIMITDIST_OUTSIDE", 0, "Outside", "The object is constrained outside a virtual sphere around the target object, with a radius defined by the limit distance"}, + {LIMITDIST_ONSURFACE, "LIMITDIST_ONSURFACE", 0, "On Surface", "The object is constrained on the surface of a virtual sphere around the target object, with a radius defined by the limit distance"}, {0, NULL, 0, NULL, NULL} }; @@ -966,7 +973,7 @@ static void rna_def_constraint_action(BlenderRNA *brna) prop= RNA_def_property(srna, "action", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "act"); - RNA_def_property_ui_text(prop, "Action", ""); + RNA_def_property_ui_text(prop, "Action", "The constraining action"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); @@ -1183,10 +1190,10 @@ static void rna_def_constraint_rigid_body_joint(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem pivot_items[] = { - {CONSTRAINT_RB_BALL, "BALL", 0, "Ball", ""}, - {CONSTRAINT_RB_HINGE, "HINGE", 0, "Hinge", ""}, - {CONSTRAINT_RB_CONETWIST, "CONE_TWIST", 0, "Cone Twist", ""}, - {CONSTRAINT_RB_GENERIC6DOF, "GENERIC_6_DOF", 0, "Generic 6 DoF", ""}, + {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_GENERIC6DOF, "GENERIC_6_DOF", 0, "Generic 6 DoF", "No constraints by default, limits can be set individually"}, {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "RigidBodyJointConstraint", "Constraint"); @@ -1788,9 +1795,9 @@ static void rna_def_constraint_shrinkwrap(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem type_items[] = { - {MOD_SHRINKWRAP_NEAREST_SURFACE, "NEAREST_SURFACE", 0, "Nearest Surface Point", ""}, - {MOD_SHRINKWRAP_PROJECT, "PROJECT", 0, "Project", ""}, - {MOD_SHRINKWRAP_NEAREST_VERTEX, "NEAREST_VERTEX", 0, "Nearest Vertex", ""}, + {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"}, {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "ShrinkwrapConstraint", "Constraint"); @@ -1940,13 +1947,13 @@ static void rna_def_constraint_pivot(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem pivot_rotAxis_items[] = { - {PIVOTCON_AXIS_NONE, "ALWAYS_ACTIVE", 0, "Always", ""}, - {PIVOTCON_AXIS_X_NEG, "NX", 0, "-X Rot", ""}, - {PIVOTCON_AXIS_Y_NEG, "NY", 0, "-Y Rot", ""}, - {PIVOTCON_AXIS_Z_NEG, "NZ", 0, "-Z Rot", ""}, - {PIVOTCON_AXIS_X, "X", 0, "X Rot", ""}, - {PIVOTCON_AXIS_Y, "Y", 0, "Y Rot", ""}, - {PIVOTCON_AXIS_Z, "Z", 0, "Z Rot", ""}, + {PIVOTCON_AXIS_NONE, "ALWAYS_ACTIVE", 0, "Always", "Use the pivot point in every rotation"}, + {PIVOTCON_AXIS_X_NEG, "NX", 0, "-X Rot", "Use the pivot point in the negative rotation range around the X-axis"}, + {PIVOTCON_AXIS_Y_NEG, "NY", 0, "-Y Rot", "Use the pivot point in the negative rotation range around the Y-axis"}, + {PIVOTCON_AXIS_Z_NEG, "NZ", 0, "-Z Rot", "Use the pivot point in the negative rotation range around the Z-axis"}, + {PIVOTCON_AXIS_X, "X", 0, "X Rot", "Use the pivot point in the positive rotation range around the X-axis"}, + {PIVOTCON_AXIS_Y, "Y", 0, "Y Rot", "Use the pivot point in the positive rotation range around the Y-axis"}, + {PIVOTCON_AXIS_Z, "Z", 0, "Z Rot", "Use the pivot point in the positive rotation range around the Z-axis"}, {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "PivotConstraint", "Constraint"); @@ -2019,13 +2026,13 @@ void RNA_def_constraint(BlenderRNA *brna) prop= RNA_def_property(srna, "owner_space", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "ownspace"); - RNA_def_property_enum_items(prop, space_pchan_items); + RNA_def_property_enum_items(prop, owner_space_pchan_items); RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Constraint_owner_space_itemf"); RNA_def_property_ui_text(prop, "Owner Space", "Space that owner is evaluated in"); prop= RNA_def_property(srna, "target_space", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "tarspace"); - RNA_def_property_enum_items(prop, space_pchan_items); + RNA_def_property_enum_items(prop, target_space_pchan_items); RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Constraint_target_space_itemf"); RNA_def_property_ui_text(prop, "Target Space", "Space that target is evaluated in"); diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c index 3afec03a13f..d66f0042d88 100644 --- a/source/blender/makesrna/intern/rna_define.c +++ b/source/blender/makesrna/intern/rna_define.c @@ -813,7 +813,7 @@ void RNA_def_struct_idprops_func(StructRNA *srna, const char *idproperties) if(idproperties) srna->idproperties= (IDPropertiesFunc)idproperties; } -void RNA_def_struct_register_funcs(StructRNA *srna, const char *reg, const char *unreg) +void RNA_def_struct_register_funcs(StructRNA *srna, const char *reg, const char *unreg, const char *instance) { if(!DefRNA.preprocess) { fprintf(stderr, "RNA_def_struct_register_funcs: only during preprocessing.\n"); @@ -822,6 +822,7 @@ void RNA_def_struct_register_funcs(StructRNA *srna, const char *reg, const char if(reg) srna->reg= (StructRegisterFunc)reg; if(unreg) srna->unreg= (StructUnregisterFunc)unreg; + if(instance) srna->instance= (StructInstanceFunc)instance; } void RNA_def_struct_path_func(StructRNA *srna, const char *path) diff --git a/source/blender/makesrna/intern/rna_fluidsim.c b/source/blender/makesrna/intern/rna_fluidsim.c index acec2ca7a24..7c93ae4168b 100644 --- a/source/blender/makesrna/intern/rna_fluidsim.c +++ b/source/blender/makesrna/intern/rna_fluidsim.c @@ -195,6 +195,18 @@ static char *rna_FluidSettings_path(PointerRNA *ptr) return BLI_sprintfN("modifiers[\"%s\"].settings", md->name); } +static void rna_FluidMeshVertex_data_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) +{ + FluidsimSettings *fss = (FluidsimSettings*)ptr->data; + rna_iterator_array_begin(iter, fss->meshVelocities, sizeof(float)*3, fss->totvert, 0, NULL); +} + +static int rna_FluidMeshVertex_data_length(PointerRNA *ptr) +{ + FluidsimSettings *fss = (FluidsimSettings*)ptr->data; + return fss->totvert; +} + #else static void rna_def_fluidsim_slip(StructRNA *srna) @@ -219,6 +231,24 @@ static void rna_def_fluidsim_slip(StructRNA *srna) RNA_def_property_ui_text(prop, "Partial Slip Amount", "Amount of mixing between no- and free-slip, 0 is no slip and 1 is free slip"); } +static void rna_def_fluid_mesh_vertices(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + srna= RNA_def_struct(brna, "FluidMeshVertex", NULL); + RNA_def_struct_sdna(srna, "FluidVertexVelocity"); + RNA_def_struct_ui_text(srna, "Fluid Mesh Vertex", "Vertex of a simulated fluid mesh"); + RNA_def_struct_ui_icon(srna, ICON_VERTEXSEL); + + prop= RNA_def_property(srna, "velocity", PROP_FLOAT, PROP_VELOCITY); + RNA_def_property_array(prop, 3); + RNA_def_property_float_sdna(prop, NULL, "vel"); + RNA_def_property_ui_text(prop, "Velocity", ""); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); +} + + static void rna_def_fluidsim_domain(BlenderRNA *brna) { StructRNA *srna; @@ -367,6 +397,13 @@ static void rna_def_fluidsim_domain(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_range(prop, 0.0, 10.0); RNA_def_property_ui_text(prop, "Generate Particles", "Amount of particles to generate (0=off, 1=normal, >1=more)"); + + /* simulated fluid mesh data */ + prop= RNA_def_property(srna, "fluid_mesh_vertices", PROP_COLLECTION, PROP_NONE); + RNA_def_property_struct_type(prop, "FluidMeshVertex"); + RNA_def_property_ui_text(prop, "Fluid Mesh Vertices", "Vertices of the fluid mesh generated by simulation"); + RNA_def_property_collection_funcs(prop, "rna_FluidMeshVertex_data_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_FluidMeshVertex_data_length", 0, 0); + rna_def_fluid_mesh_vertices(brna); } static void rna_def_fluidsim_volume(StructRNA *srna) diff --git a/source/blender/makesrna/intern/rna_image.c b/source/blender/makesrna/intern/rna_image.c index 5872542d10a..3db90c2de0e 100644 --- a/source/blender/makesrna/intern/rna_image.c +++ b/source/blender/makesrna/intern/rna_image.c @@ -221,6 +221,39 @@ static void rna_Image_size_get(PointerRNA *ptr,int *values) BKE_image_release_ibuf(im, lock); } +static void rna_Image_resolution_get(PointerRNA *ptr, float *values) +{ + Image *im= (Image*)ptr->data; + ImBuf *ibuf; + void *lock; + + ibuf = BKE_image_acquire_ibuf(im, NULL , &lock); + if (ibuf) { + values[0]= ibuf->ppm[0]; + values[1]= ibuf->ppm[1]; + } + else { + values[0]= 0; + values[1]= 0; + } + + BKE_image_release_ibuf(im, lock); +} + +static void rna_Image_resolution_set(PointerRNA *ptr, const float *values) +{ + Image *im= (Image*)ptr->data; + ImBuf *ibuf; + void *lock; + + ibuf = BKE_image_acquire_ibuf(im, NULL , &lock); + if (ibuf) { + ibuf->ppm[0]= values[0]; + ibuf->ppm[1]= values[1]; + } + + BKE_image_release_ibuf(im, lock); +} static int rna_Image_depth_get(PointerRNA *ptr) { @@ -557,6 +590,9 @@ static void rna_def_image(BlenderRNA *brna) RNA_def_property_int_funcs(prop, "rna_Image_size_get" , NULL, NULL); RNA_def_property_clear_flag(prop, PROP_EDITABLE); + prop= RNA_def_float_vector(srna, "resolution" , 2 , NULL , 0, 0, "Resolution" , "X/Y pixels per meter" , 0 , 0); + RNA_def_property_float_funcs(prop, "rna_Image_resolution_get" , "rna_Image_resolution_set", NULL); + prop= RNA_def_property(srna, "pixels", PROP_FLOAT, PROP_NONE); RNA_def_property_flag(prop, PROP_DYNAMIC); RNA_def_property_multi_array(prop, 1, NULL); diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h index 7df31fc12f9..81edf6f6a0d 100644 --- a/source/blender/makesrna/intern/rna_internal.h +++ b/source/blender/makesrna/intern/rna_internal.h @@ -198,8 +198,8 @@ struct StructRNA *rna_ID_refine(struct PointerRNA *ptr); struct IDProperty *rna_ID_idprops(struct PointerRNA *ptr, int create); void rna_ID_fake_user_set(struct PointerRNA *ptr, int value); struct IDProperty *rna_PropertyGroup_idprops(struct PointerRNA *ptr, int create); -void rna_PropertyGroup_unregister(const struct bContext *C, struct StructRNA *type); -struct StructRNA *rna_PropertyGroup_register(struct bContext *C, struct ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free); +void rna_PropertyGroup_unregister(struct Main *bmain, struct StructRNA *type); +struct StructRNA *rna_PropertyGroup_register(struct Main *bmain, struct ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free); struct StructRNA* rna_PropertyGroup_refine(struct PointerRNA *ptr); void rna_object_vgroup_name_index_get(struct PointerRNA *ptr, char *value, int index); diff --git a/source/blender/makesrna/intern/rna_internal_types.h b/source/blender/makesrna/intern/rna_internal_types.h index eb1beb90567..a59db183453 100644 --- a/source/blender/makesrna/intern/rna_internal_types.h +++ b/source/blender/makesrna/intern/rna_internal_types.h @@ -330,6 +330,7 @@ struct StructRNA { /* function to register/unregister subclasses */ StructRegisterFunc reg; StructUnregisterFunc unreg; + StructInstanceFunc instance; /* callback to get id properties */ IDPropertiesFunc idproperties; diff --git a/source/blender/makesrna/intern/rna_key.c b/source/blender/makesrna/intern/rna_key.c index 3f0ccf99266..3e65eb8665e 100644 --- a/source/blender/makesrna/intern/rna_key.c +++ b/source/blender/makesrna/intern/rna_key.c @@ -521,7 +521,7 @@ static void rna_def_keyblock(BlenderRNA *brna) RNA_def_struct_ui_icon(srna, ICON_SHAPEKEY_DATA); prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); - RNA_def_property_ui_text(prop, "Name", ""); + RNA_def_property_ui_text(prop, "Name", "Name of Shape Key"); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_ShapeKey_name_set"); RNA_def_struct_name_property(srna, prop); diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c index 909c824074e..0e9629f973d 100644 --- a/source/blender/makesrna/intern/rna_material.c +++ b/source/blender/makesrna/intern/rna_material.c @@ -743,7 +743,7 @@ static void rna_def_material_colors(StructRNA *srna) prop= RNA_def_property(srna, "diffuse_color", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "r"); RNA_def_property_array(prop, 3); - RNA_def_property_ui_text(prop, "Diffuse Color", ""); + RNA_def_property_ui_text(prop, "Diffuse Color", "Diffuse color of the material"); RNA_def_property_update(prop, 0, "rna_Material_draw_update"); prop= RNA_def_property(srna, "specular_color", PROP_FLOAT, PROP_COLOR); @@ -797,25 +797,25 @@ static void rna_def_material_colors(StructRNA *srna) prop= RNA_def_property(srna, "diffuse_ramp_blend", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "rampblend_col"); RNA_def_property_enum_items(prop, ramp_blend_items); - RNA_def_property_ui_text(prop, "Diffuse Ramp Blend", ""); + RNA_def_property_ui_text(prop, "Diffuse Ramp Blend", "Blending method of the ramp and the diffuse color"); RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "specular_ramp_blend", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "rampblend_spec"); RNA_def_property_enum_items(prop, ramp_blend_items); - RNA_def_property_ui_text(prop, "Diffuse Ramp Blend", ""); + RNA_def_property_ui_text(prop, "Diffuse Ramp Blend", "Blending method of the ramp and the specular color"); RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "diffuse_ramp_input", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "rampin_col"); RNA_def_property_enum_items(prop, prop_ramp_input_items); - RNA_def_property_ui_text(prop, "Diffuse Ramp Input", ""); + RNA_def_property_ui_text(prop, "Diffuse Ramp Input", "Determines how the ramp maps on the surface"); RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "specular_ramp_input", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "rampin_spec"); RNA_def_property_enum_items(prop, prop_ramp_input_items); - RNA_def_property_ui_text(prop, "Specular Ramp Input", ""); + RNA_def_property_ui_text(prop, "Specular Ramp Input", "Determines how the ramp maps on the surface"); RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "diffuse_ramp_factor", PROP_FLOAT, PROP_FACTOR); @@ -836,11 +836,11 @@ static void rna_def_material_diffuse(StructRNA *srna) PropertyRNA *prop; static EnumPropertyItem prop_diff_shader_items[] = { - {MA_DIFF_LAMBERT, "LAMBERT", 0, "Lambert", ""}, - {MA_DIFF_ORENNAYAR, "OREN_NAYAR", 0, "Oren-Nayar", ""}, - {MA_DIFF_TOON, "TOON", 0, "Toon", ""}, - {MA_DIFF_MINNAERT, "MINNAERT", 0, "Minnaert", ""}, - {MA_DIFF_FRESNEL, "FRESNEL", 0, "Fresnel", ""}, + {MA_DIFF_LAMBERT, "LAMBERT", 0, "Lambert", "Use a Lambertian shader"}, + {MA_DIFF_ORENNAYAR, "OREN_NAYAR", 0, "Oren-Nayar", "Use an Oren-Nayar shader"}, + {MA_DIFF_TOON, "TOON", 0, "Toon", "Use a toon shader"}, + {MA_DIFF_MINNAERT, "MINNAERT", 0, "Minnaert", "Use a Minnaert shader"}, + {MA_DIFF_FRESNEL, "FRESNEL", 0, "Fresnel", "Use a Fresnel shader"}, {0, NULL, 0, NULL, NULL}}; prop= RNA_def_property(srna, "diffuse_shader", PROP_ENUM, PROP_NONE); @@ -1048,7 +1048,7 @@ static void rna_def_material_volume(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem prop_lighting_items[] = { - {MA_VOL_SHADE_SHADELESS, "SHADELESS", 0, "Shadeless", ""}, + {MA_VOL_SHADE_SHADELESS, "SHADELESS", 0, "Shadeless", "Do not calculate lighting and shadows"}, {MA_VOL_SHADE_SHADOWED, "SHADOWED", 0, "Shadowed", ""}, {MA_VOL_SHADE_SHADED, "SHADED", 0, "Shaded", ""}, {MA_VOL_SHADE_MULTIPLE, "MULTIPLE_SCATTERING", 0, "Multiple Scattering", ""}, @@ -1168,7 +1168,7 @@ static void rna_def_material_volume(BlenderRNA *brna) prop= RNA_def_property(srna, "emission_color", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "emission_col"); RNA_def_property_array(prop, 3); - RNA_def_property_ui_text(prop, "Emission Color", ""); + RNA_def_property_ui_text(prop, "Emission Color", "Color of emitted light"); RNA_def_property_update(prop, 0, "rna_Material_draw_update"); prop= RNA_def_property(srna, "emission", PROP_FLOAT, PROP_NONE); @@ -1389,11 +1389,11 @@ static void rna_def_material_specularity(StructRNA *srna) PropertyRNA *prop; static EnumPropertyItem prop_specular_shader_items[] = { - {MA_SPEC_COOKTORR, "COOKTORR", 0, "CookTorr", ""}, - {MA_SPEC_PHONG, "PHONG", 0, "Phong", ""}, - {MA_SPEC_BLINN, "BLINN", 0, "Blinn", ""}, - {MA_SPEC_TOON, "TOON", 0, "Toon", ""}, - {MA_SPEC_WARDISO, "WARDISO", 0, "WardIso", ""}, + {MA_SPEC_COOKTORR, "COOKTORR", 0, "CookTorr", "Use a Cook-Torrance shader"}, + {MA_SPEC_PHONG, "PHONG", 0, "Phong", "Use a Phong shader"}, + {MA_SPEC_BLINN, "BLINN", 0, "Blinn", "Use a Blinn shader"}, + {MA_SPEC_TOON, "TOON", 0, "Toon", "Use a toon shader"}, + {MA_SPEC_WARDISO, "WARDISO", 0, "WardIso", "Use a Ward anisotropic shader"}, {0, NULL, 0, NULL, NULL}}; prop= RNA_def_property(srna, "specular_shader", PROP_ENUM, PROP_NONE); @@ -1405,7 +1405,7 @@ static void rna_def_material_specularity(StructRNA *srna) prop= RNA_def_property(srna, "specular_intensity", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "spec"); RNA_def_property_range(prop, 0, 1); - RNA_def_property_ui_text(prop, "Specular Intensity", ""); + RNA_def_property_ui_text(prop, "Specular Intensity", "How intense (bright) the specular reflection is"); RNA_def_property_update(prop, 0, "rna_Material_draw_update"); /* NOTE: "har", "param", etc are used for multiple purposes depending on @@ -1416,13 +1416,13 @@ static void rna_def_material_specularity(StructRNA *srna) prop= RNA_def_property(srna, "specular_hardness", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "har"); RNA_def_property_range(prop, 1, 511); - RNA_def_property_ui_text(prop, "Specular Hardness", ""); + RNA_def_property_ui_text(prop, "Specular Hardness", "How hard (sharp) the specular reflection is"); RNA_def_property_update(prop, 0, "rna_Material_draw_update"); prop= RNA_def_property(srna, "specular_ior", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "refrac"); RNA_def_property_range(prop, 1, 10); - RNA_def_property_ui_text(prop, "Specular IOR", ""); + RNA_def_property_ui_text(prop, "Specular IOR", "Specular index of refraction"); RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "specular_toon_size", PROP_FLOAT, PROP_NONE); @@ -1585,9 +1585,9 @@ void RNA_def_material(BlenderRNA *brna) {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem prop_shadows_only_items[] = { - {MA_SO_OLD, "SHADOW_ONLY_OLD", 0, "Shadow and Distance", ""}, - {MA_SO_SHADOW, "SHADOW_ONLY", 0, "Shadow Only", ""}, - {MA_SO_SHADED, "SHADOW_ONLY_SHADED", 0, "Shadow and Shading", ""}, + {MA_SO_OLD, "SHADOW_ONLY_OLD", 0, "Shadow and Distance", "Old shadow only method"}, + {MA_SO_SHADOW, "SHADOW_ONLY", 0, "Shadow Only", "Improved shadow only method"}, + {MA_SO_SHADED, "SHADOW_ONLY_SHADED", 0, "Shadow and Shading", "Improved shadow only method which also renders lightless areas as shadows"}, {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "Material", "ID"); diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c index 03c79af1907..9e5a2e9f65a 100644 --- a/source/blender/makesrna/intern/rna_mesh.c +++ b/source/blender/makesrna/intern/rna_mesh.c @@ -1346,7 +1346,7 @@ static void rna_def_mtface(BlenderRNA *brna) prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_struct_name_property(srna, prop); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_MeshTextureFaceLayer_name_set"); - RNA_def_property_ui_text(prop, "Name", ""); + RNA_def_property_ui_text(prop, "Name", "Name of UV unwrapping layer"); RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE); @@ -1530,7 +1530,7 @@ static void rna_def_mcol(BlenderRNA *brna) prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_struct_name_property(srna, prop); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_MeshColorLayer_name_set"); - RNA_def_property_ui_text(prop, "Name", ""); + RNA_def_property_ui_text(prop, "Name", "Name of Vertex color layer"); RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index f6cc93664d6..333451e1d31 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -631,10 +631,10 @@ static void rna_def_modifier_subsurf(BlenderRNA *brna) static void rna_def_modifier_generic_map_info(StructRNA *srna) { static EnumPropertyItem prop_texture_coordinates_items[] = { - {MOD_DISP_MAP_LOCAL, "LOCAL", 0, "Map", ""}, - {MOD_DISP_MAP_GLOBAL, "GLOBAL", 0, "Global", ""}, - {MOD_DISP_MAP_OBJECT, "OBJECT", 0, "Object", ""}, - {MOD_DISP_MAP_UV, "UV", 0, "UV", ""}, + {MOD_DISP_MAP_LOCAL, "LOCAL", 0, "Map", "Uses the local coordinate system for the texture coordinates"}, + {MOD_DISP_MAP_GLOBAL, "GLOBAL", 0, "Global", "Uses the global coordinate system for the texture coordinates"}, + {MOD_DISP_MAP_OBJECT, "OBJECT", 0, "Object", "Uses the linked object's local coordinate system for the texture coordinates"}, + {MOD_DISP_MAP_UV, "UV", 0, "UV", "Uses UV coordinates for the texture coordinates"}, {0, NULL, 0, NULL, NULL}}; PropertyRNA *prop; @@ -656,9 +656,9 @@ static void rna_def_modifier_generic_map_info(StructRNA *srna) RNA_def_property_string_funcs(prop, NULL, NULL, "rna_MappingInfo_uvlayer_set"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); - prop= RNA_def_property(srna, "texture_coordinate_object", PROP_POINTER, PROP_NONE); + prop= RNA_def_property(srna, "texture_coords_object", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "map_object"); - RNA_def_property_ui_text(prop, "Texture Coordinate Object", ""); + RNA_def_property_ui_text(prop, "Texture Coordinate Object", "Object to set the texture coordinates"); RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK); RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); } @@ -754,7 +754,7 @@ static void rna_def_modifier_multires(BlenderRNA *brna) prop= RNA_def_property(srna, "render_levels", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "renderlvl"); - RNA_def_property_ui_text(prop, "Render Levels", ""); + RNA_def_property_ui_text(prop, "Render Levels", "The subdivision level visible at render time"); RNA_def_property_int_funcs(prop, NULL, NULL, "rna_MultiresModifier_level_range"); prop= RNA_def_property(srna, "total_levels", PROP_INT, PROP_UNSIGNED); @@ -1020,39 +1020,39 @@ static void rna_def_modifier_wave(BlenderRNA *brna) prop= RNA_def_property(srna, "lifetime", PROP_FLOAT, PROP_TIME); RNA_def_property_float_sdna(prop, NULL, "lifetime"); RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF); - RNA_def_property_ui_text(prop, "Lifetime", ""); + RNA_def_property_ui_text(prop, "Lifetime", "Lifetime of the wave in frames, zero means infinite"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "damping_time", PROP_FLOAT, PROP_TIME); RNA_def_property_float_sdna(prop, NULL, "damp"); RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF); - RNA_def_property_ui_text(prop, "Damping Time", ""); + RNA_def_property_ui_text(prop, "Damping Time", "Number of frames in which the waves damps out after it dies"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "falloff_radius", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "falloff"); RNA_def_property_range(prop, 0, FLT_MAX); RNA_def_property_ui_range(prop, 0, 100, 100, 2); - RNA_def_property_ui_text(prop, "Falloff Radius", ""); + RNA_def_property_ui_text(prop, "Falloff Radius", "Distance after which it fades out"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "start_position_x", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "startx"); RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); RNA_def_property_ui_range(prop, -100, 100, 100, 2); - RNA_def_property_ui_text(prop, "Start Position X", ""); + RNA_def_property_ui_text(prop, "Start Position X", "X coordinate of the start position"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "start_position_y", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "starty"); RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); RNA_def_property_ui_range(prop, -100, 100, 100, 2); - RNA_def_property_ui_text(prop, "Start Position Y", ""); + RNA_def_property_ui_text(prop, "Start Position Y", "Z coordinate of the start position"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "start_position_object", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "objectcenter"); - RNA_def_property_ui_text(prop, "Start Position Object", ""); + RNA_def_property_ui_text(prop, "Start Position Object", "Object which defines the wave center"); RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK); RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); @@ -1088,26 +1088,26 @@ static void rna_def_modifier_wave(BlenderRNA *brna) prop= RNA_def_property(srna, "speed", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); RNA_def_property_ui_range(prop, -1, 1, 10, 2); - RNA_def_property_ui_text(prop, "Speed", ""); + RNA_def_property_ui_text(prop, "Speed", "Speed of the wave, towards the starting point when negative"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "height", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); RNA_def_property_ui_range(prop, -2, 2, 10, 2); - RNA_def_property_ui_text(prop, "Height", ""); + RNA_def_property_ui_text(prop, "Height", "Height of the wave"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "width", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_range(prop, 0, FLT_MAX); RNA_def_property_ui_range(prop, 0, 5, 10, 2); - RNA_def_property_ui_text(prop, "Width", ""); + RNA_def_property_ui_text(prop, "Width", "Distance between the waves"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "narrowness", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "narrow"); RNA_def_property_range(prop, 0, FLT_MAX); RNA_def_property_ui_range(prop, 0, 10, 10, 2); - RNA_def_property_ui_text(prop, "Narrowness", ""); + RNA_def_property_ui_text(prop, "Narrowness", "Distance between the top and the base of a wave, the higher the value, the more narrow the wave"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); } @@ -1129,12 +1129,12 @@ static void rna_def_modifier_armature(BlenderRNA *brna) prop= RNA_def_property(srna, "use_bone_envelopes", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "deformflag", ARM_DEF_ENVELOPE); - RNA_def_property_ui_text(prop, "Use Bone Envelopes", ""); + RNA_def_property_ui_text(prop, "Use Bone Envelopes", "Binds Bone envelope to armature modifier"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "use_vertex_groups", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "deformflag", ARM_DEF_VGROUP); - RNA_def_property_ui_text(prop, "Use Vertex Groups", ""); + RNA_def_property_ui_text(prop, "Use Vertex Groups", "Binds vertex group to armature modifier"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "use_deform_preserve_volume", PROP_BOOLEAN, PROP_NONE); @@ -1226,9 +1226,9 @@ static void rna_def_modifier_boolean(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem prop_operation_items[] = { - {eBooleanModifierOp_Intersect, "INTERSECT", 0, "Intersect", ""}, - {eBooleanModifierOp_Union, "UNION", 0, "Union", ""}, - {eBooleanModifierOp_Difference, "DIFFERENCE", 0, "Difference", ""}, + {eBooleanModifierOp_Intersect, "INTERSECT", 0, "Intersect", "Keeps the part of the mesh that intersects with the other selected object"}, + {eBooleanModifierOp_Union, "UNION", 0, "Union", "Combines two meshes in an additive way"}, + {eBooleanModifierOp_Difference, "DIFFERENCE", 0, "Difference", "Combines two meshes in a subtractive way"}, {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "BooleanModifier", "Modifier"); @@ -1254,9 +1254,9 @@ static void rna_def_modifier_array(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem prop_fit_type_items[] = { - {MOD_ARR_FIXEDCOUNT, "FIXED_COUNT", 0, "Fixed Count", ""}, - {MOD_ARR_FITLENGTH, "FIT_LENGTH", 0, "Fit Length", ""}, - {MOD_ARR_FITCURVE, "FIT_CURVE", 0, "Fit Curve", ""}, + {MOD_ARR_FIXEDCOUNT, "FIXED_COUNT", 0, "Fixed Count", "Duplicate the object a certain number of times"}, + {MOD_ARR_FITLENGTH, "FIT_LENGTH", 0, "Fit Length", "Duplicate the object as many times as fits in a certain length"}, + {MOD_ARR_FITCURVE, "FIT_CURVE", 0, "Fit Curve", "Fit the duplicated objects to a curve"}, {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "ArrayModifier", "Modifier"); @@ -1298,7 +1298,7 @@ static void rna_def_modifier_array(BlenderRNA *brna) prop= RNA_def_property(srna, "constant_offset_displace", PROP_FLOAT, PROP_TRANSLATION); RNA_def_property_float_sdna(prop, NULL, "offset"); - RNA_def_property_ui_text(prop, "Constant Offset Displacement", ""); + RNA_def_property_ui_text(prop, "Constant Offset Displacement", "Value for the distance between arrayed items"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "use_relative_offset", PROP_BOOLEAN, PROP_NONE); @@ -1308,7 +1308,7 @@ static void rna_def_modifier_array(BlenderRNA *brna) prop= RNA_def_property(srna, "relative_offset_displace", PROP_FLOAT, PROP_NONE); /* PROP_TRANSLATION causes units to be used which we dont want */ RNA_def_property_float_sdna(prop, NULL, "scale"); - RNA_def_property_ui_text(prop, "Relative Offset Displacement", ""); + RNA_def_property_ui_text(prop, "Relative Offset Displacement", "The size of the geometry will determine the distance between arrayed items"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); /* Vertex merging parameters */ @@ -1337,7 +1337,7 @@ static void rna_def_modifier_array(BlenderRNA *brna) prop= RNA_def_property(srna, "offset_object", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "offset_ob"); - RNA_def_property_ui_text(prop, "Object Offset", ""); + RNA_def_property_ui_text(prop, "Object Offset", "Uses the location and rotation of another object to determine the distance and rotational change between arrayed items"); RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK); RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); @@ -1389,11 +1389,11 @@ static void rna_def_modifier_displace(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem prop_direction_items[] = { - {MOD_DISP_DIR_X, "X", 0, "X", ""}, - {MOD_DISP_DIR_Y, "Y", 0, "Y", ""}, - {MOD_DISP_DIR_Z, "Z", 0, "Z", ""}, - {MOD_DISP_DIR_NOR, "NORMAL", 0, "Normal", ""}, - {MOD_DISP_DIR_RGB_XYZ, "RGB_TO_XYZ", 0, "RGB to XYZ", ""}, + {MOD_DISP_DIR_X, "X", 0, "X", "Uses the texture's intensity value to displace in the X direction"}, + {MOD_DISP_DIR_Y, "Y", 0, "Y", "Uses the texture's intensity value to displace in the Y direction"}, + {MOD_DISP_DIR_Z, "Z", 0, "Z", "Uses the texture's intensity value to displace in the Z direction"}, + {MOD_DISP_DIR_NOR, "NORMAL", 0, "Normal", "Uses the texture's intensity value to displace in the normal direction"}, + {MOD_DISP_DIR_RGB_XYZ, "RGB_TO_XYZ", 0, "RGB to XYZ", "Uses the texture's RGB values to displace the mesh in the XYZ direction"}, {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "DisplaceModifier", "Modifier"); @@ -1409,7 +1409,7 @@ static void rna_def_modifier_displace(BlenderRNA *brna) prop= RNA_def_property(srna, "mid_level", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "midlevel"); - RNA_def_property_range(prop, 0, 1); + RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); RNA_def_property_ui_range(prop, 0, 1, 10, 3); RNA_def_property_ui_text(prop, "Midlevel", "Material value that gives no displacement"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); @@ -1417,7 +1417,7 @@ static void rna_def_modifier_displace(BlenderRNA *brna) prop= RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); RNA_def_property_ui_range(prop, -100, 100, 10, 3); - RNA_def_property_ui_text(prop, "Strength", ""); + RNA_def_property_ui_text(prop, "Strength", "Amount to displace geometry"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "direction", PROP_ENUM, PROP_NONE); @@ -1517,24 +1517,24 @@ static void rna_def_modifier_smooth(BlenderRNA *brna) prop= RNA_def_property(srna, "use_x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_SMOOTH_X); - RNA_def_property_ui_text(prop, "X", ""); + RNA_def_property_ui_text(prop, "X", "Smooth object along X axis"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "use_y", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_SMOOTH_Y); - RNA_def_property_ui_text(prop, "Y", ""); + RNA_def_property_ui_text(prop, "Y", "Smooth object along Y axis"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "use_z", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_SMOOTH_Z); - RNA_def_property_ui_text(prop, "Z", ""); + RNA_def_property_ui_text(prop, "Z", "Smooth object along Z axis"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "fac"); RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); RNA_def_property_ui_range(prop, -10, 10, 1, 3); - RNA_def_property_ui_text(prop, "Factor", ""); + RNA_def_property_ui_text(prop, "Factor", "Strength of modifier effect"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "iterations", PROP_INT, PROP_NONE); @@ -1569,7 +1569,7 @@ static void rna_def_modifier_cast(BlenderRNA *brna) prop= RNA_def_property(srna, "cast_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "type"); RNA_def_property_enum_items(prop, prop_cast_type_items); - RNA_def_property_ui_text(prop, "Cast Type", ""); + RNA_def_property_ui_text(prop, "Cast Type", "Target object shape"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE); @@ -1979,9 +1979,9 @@ static void rna_def_modifier_shrinkwrap(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem shrink_type_items[] = { - {MOD_SHRINKWRAP_NEAREST_SURFACE, "NEAREST_SURFACEPOINT", 0, "Nearest Surface Point", ""}, - {MOD_SHRINKWRAP_PROJECT, "PROJECT", 0, "Project", ""}, - {MOD_SHRINKWRAP_NEAREST_VERTEX, "NEAREST_VERTEX", 0, "Nearest Vertex", ""}, + {MOD_SHRINKWRAP_NEAREST_SURFACE, "NEAREST_SURFACEPOINT", 0, "Nearest Surface Point", "Shrinks the mesh to the nearest target surface"}, + {MOD_SHRINKWRAP_PROJECT, "PROJECT", 0, "Project", "Shrinks the mesh to the nearest target surface along a given axis"}, + {MOD_SHRINKWRAP_NEAREST_VERTEX, "NEAREST_VERTEX", 0, "Nearest Vertex", "Shrinks the mesh to the nearest target vertex"}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem shrink_face_cull_items[] = { @@ -2133,10 +2133,10 @@ static void rna_def_modifier_simpledeform(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem simple_deform_mode_items[] = { - {MOD_SIMPLEDEFORM_MODE_TWIST, "TWIST", 0, "Twist", ""}, - {MOD_SIMPLEDEFORM_MODE_BEND, "BEND", 0, "Bend", ""}, - {MOD_SIMPLEDEFORM_MODE_TAPER, "TAPER", 0, "Taper", ""}, - {MOD_SIMPLEDEFORM_MODE_STRETCH, "STRETCH", 0, "Stretch", ""}, + {MOD_SIMPLEDEFORM_MODE_TWIST, "TWIST", 0, "Twist", "Rotates around the Z axis of the modifier space"}, + {MOD_SIMPLEDEFORM_MODE_BEND, "BEND", 0, "Bend", "Bends the mesh over the Z axis of the modifier space"}, + {MOD_SIMPLEDEFORM_MODE_TAPER, "TAPER", 0, "Taper", "Linearly scales along Z axis of the modifier space"}, + {MOD_SIMPLEDEFORM_MODE_STRETCH, "STRETCH", 0, "Stretch", "Stretches the object along the Z axis of the modifier space"}, {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "SimpleDeformModifier", "Modifier"); @@ -2169,7 +2169,7 @@ static void rna_def_modifier_simpledeform(BlenderRNA *brna) prop= RNA_def_property(srna, "factor", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); RNA_def_property_ui_range(prop, -10, 10, 1, 3); - RNA_def_property_ui_text(prop, "Factor", ""); + RNA_def_property_ui_text(prop, "Factor", "Amount to deform object"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "limits", PROP_FLOAT, PROP_NONE); @@ -2182,12 +2182,12 @@ static void rna_def_modifier_simpledeform(BlenderRNA *brna) prop= RNA_def_property(srna, "lock_x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "axis", MOD_SIMPLEDEFORM_LOCK_AXIS_X); - RNA_def_property_ui_text(prop, "Lock X Axis", ""); + RNA_def_property_ui_text(prop, "Lock X Axis", "Do not allow tapering along the X axis"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "lock_y", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "axis", MOD_SIMPLEDEFORM_LOCK_AXIS_Y); - RNA_def_property_ui_text(prop, "Lock Y Axis", ""); + RNA_def_property_ui_text(prop, "Lock Y Axis", "Do not allow tapering along the Y axis"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); } diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index 11e7dd81cb6..4407ca8ad4e 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -68,14 +68,14 @@ EnumPropertyItem object_mode_items[] = { {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem parent_type_items[] = { - {PAROBJECT, "OBJECT", 0, "Object", ""}, - {PARCURVE, "CURVE", 0, "Curve", ""}, + {PAROBJECT, "OBJECT", 0, "Object", "The object is parented to an object"}, + {PARCURVE, "CURVE", 0, "Curve", "The object is parented to a curve"}, {PARKEY, "KEY", 0, "Key", ""}, {PARSKEL, "ARMATURE", 0, "Armature", ""}, - {PARSKEL, "LATTICE", 0, "Lattice", ""}, // PARSKEL reuse will give issues - {PARVERT1, "VERTEX", 0, "Vertex", ""}, + {PARSKEL, "LATTICE", 0, "Lattice", "The object is parented to a lattice"}, // PARSKEL reuse will give issues + {PARVERT1, "VERTEX", 0, "Vertex", "The object is parented to a vertex"}, {PARVERT3, "VERTEX_3", 0, "3 Vertices", ""}, - {PARBONE, "BONE", 0, "Bone", ""}, + {PARBONE, "BONE", 0, "Bone", "The object is parented to a bone"}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem collision_bounds_items[] = { @@ -307,22 +307,26 @@ static void rna_Base_layer_update(Main *bmain, Scene *scene, PointerRNA *ptr) WM_main_add_notifier(NC_SCENE|ND_LAYER_CONTENT, scene); } -static int rna_Object_data_editable(PointerRNA *ptr) -{ - Object *ob= (Object*)ptr->data; - - return (ob->type == OB_EMPTY)? 0: PROP_EDITABLE; -} - static void rna_Object_data_set(PointerRNA *ptr, PointerRNA value) { Object *ob= (Object*)ptr->data; ID *id= value.data; - if(ob->type == OB_EMPTY || id == NULL || ob->mode & OB_MODE_EDIT) + if (id == NULL || ob->mode & OB_MODE_EDIT) return; - - if(ob->type == OB_MESH) { + + if (ob->type == OB_EMPTY) { + if(ob->data) { + id_us_min((ID*)ob->data); + ob->data = NULL; + } + + if (id && GS(id->name) == ID_IM) { + id_us_plus(id); + ob->data = id; + } + } + else if(ob->type == OB_MESH) { set_mesh(ob, (Mesh*)id); } else { @@ -346,6 +350,7 @@ static StructRNA *rna_Object_data_typef(PointerRNA *ptr) Object *ob= (Object*)ptr->data; switch(ob->type) { + case OB_EMPTY: return &RNA_Image; case OB_MESH: return &RNA_Mesh; case OB_CURVE: return &RNA_Curve; case OB_SURF: return &RNA_Curve; @@ -1691,6 +1696,7 @@ static void rna_def_object(BlenderRNA *brna) {OB_CUBE, "CUBE", 0, "Cube", ""}, {OB_EMPTY_SPHERE, "SPHERE", 0, "Sphere", ""}, {OB_EMPTY_CONE, "CONE", 0, "Cone", ""}, + {OB_EMPTY_IMAGE, "IMAGE", 0, "Image", ""}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem track_items[] = { @@ -1709,20 +1715,20 @@ static void rna_def_object(BlenderRNA *brna) {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem drawtype_items[] = { - {OB_BOUNDBOX, "BOUNDS", 0, "Bounds", ""}, - {OB_WIRE, "WIRE", 0, "Wire", ""}, - {OB_SOLID, "SOLID", 0, "Solid", ""}, + {OB_BOUNDBOX, "BOUNDS", 0, "Bounds", "Draw the bounding box of the object"}, + {OB_WIRE, "WIRE", 0, "Wire", "Draw the object as a wireframe"}, + {OB_SOLID, "SOLID", 0, "Solid", "Draw the object as a solid (If solid drawing is enabled in the viewport)"}, // disabled {OB_SHADED, "SHADED", 0, "Shaded", ""}, - {OB_TEXTURE, "TEXTURED", 0, "Textured", ""}, + {OB_TEXTURE, "TEXTURED", 0, "Textured", "Draw the object with textures (If textures are enabled in the viewport)"}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem boundtype_items[] = { - {OB_BOUND_BOX, "BOX", 0, "Box", ""}, - {OB_BOUND_SPHERE, "SPHERE", 0, "Sphere", ""}, - {OB_BOUND_CYLINDER, "CYLINDER", 0, "Cylinder", ""}, - {OB_BOUND_CONE, "CONE", 0, "Cone", ""}, - {OB_BOUND_POLYH, "POLYHEDRON", 0, "Polyhedron", ""}, - {OB_BOUND_CAPSULE, "CAPSULE", 0, "Capsule", ""}, + {OB_BOUND_BOX, "BOX", 0, "Box", "Draw bounds as box"}, + {OB_BOUND_SPHERE, "SPHERE", 0, "Sphere", "Draw bounds as sphere"}, + {OB_BOUND_CYLINDER, "CYLINDER", 0, "Cylinder", "Draw bounds as cylinder"}, + {OB_BOUND_CONE, "CONE", 0, "Cone", "Draw bounds as cone"}, + {OB_BOUND_POLYH, "POLYHEDRON", 0, "Polyhedron", "Draw bounds as polyhedron"}, + {OB_BOUND_CAPSULE, "CAPSULE", 0, "Capsule", "Draw bounds as capsule"}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem dupli_items[] = { @@ -1758,7 +1764,6 @@ static void rna_def_object(BlenderRNA *brna) prop= RNA_def_property(srna, "data", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "ID"); RNA_def_property_pointer_funcs(prop, NULL, "rna_Object_data_set", "rna_Object_data_typef", NULL); - RNA_def_property_editable_func(prop, "rna_Object_data_editable"); RNA_def_property_flag(prop, PROP_EDITABLE|PROP_NEVER_UNLINK); RNA_def_property_ui_text(prop, "Data", "Object data"); RNA_def_property_update(prop, 0, "rna_Object_internal_update_data"); @@ -2043,6 +2048,12 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Empty Display Size", "Size of display for empties in the viewport"); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); + prop= RNA_def_property(srna, "empty_image_offset", PROP_FLOAT, PROP_DISTANCE); + RNA_def_property_float_sdna(prop, NULL, "ima_ofs"); + RNA_def_property_ui_text(prop, "Origin Offset", "Origin offset distance"); + RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 0.1f, 2); + RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); + /* render */ prop= RNA_def_property(srna, "pass_index", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "index"); diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c index a4fbd7c160e..6955c7f8fa8 100644 --- a/source/blender/makesrna/intern/rna_object_force.c +++ b/source/blender/makesrna/intern/rna_object_force.c @@ -1055,18 +1055,18 @@ static void rna_def_field(BlenderRNA *brna) static EnumPropertyItem field_type_items[] = { {0, "NONE", 0, "None", ""}, - {PFIELD_FORCE, "FORCE", ICON_FORCE_FORCE, "Force", ""}, - {PFIELD_WIND, "WIND", ICON_FORCE_WIND, "Wind", ""}, - {PFIELD_VORTEX, "VORTEX", ICON_FORCE_VORTEX, "Vortex", ""}, - {PFIELD_MAGNET, "MAGNET", ICON_FORCE_MAGNETIC, "Magnetic", ""}, - {PFIELD_HARMONIC, "HARMONIC", ICON_FORCE_HARMONIC, "Harmonic", ""}, - {PFIELD_CHARGE, "CHARGE", ICON_FORCE_CHARGE, "Charge", ""}, - {PFIELD_LENNARDJ, "LENNARDJ", ICON_FORCE_LENNARDJONES, "Lennard-Jones", ""}, - {PFIELD_TEXTURE, "TEXTURE", ICON_FORCE_TEXTURE, "Texture", ""}, - {PFIELD_GUIDE, "GUIDE", ICON_FORCE_CURVE, "Curve Guide", ""}, + {PFIELD_FORCE, "FORCE", ICON_FORCE_FORCE, "Force", "Gives a radial field toward the center of object"}, + {PFIELD_WIND, "WIND", ICON_FORCE_WIND, "Wind", "Gives a constant force along the force object’s local Z axis"}, + {PFIELD_VORTEX, "VORTEX", ICON_FORCE_VORTEX, "Vortex", "Gives a spiraling force that twists the force object’s local Z axis"}, + {PFIELD_MAGNET, "MAGNET", ICON_FORCE_MAGNETIC, "Magnetic", "Forcefield depends on the speed of the particles"}, + {PFIELD_HARMONIC, "HARMONIC", ICON_FORCE_HARMONIC, "Harmonic", "The source of this force field is the zero point of a harmonic oscillator"}, + {PFIELD_CHARGE, "CHARGE", ICON_FORCE_CHARGE, "Charge", "Spherical forcefield based on the charge of particles, only influences other charge force fields"}, + {PFIELD_LENNARDJ, "LENNARDJ", ICON_FORCE_LENNARDJONES, "Lennard-Jones", "Forcefield based on the Lennard-Jones potential"}, + {PFIELD_TEXTURE, "TEXTURE", ICON_FORCE_TEXTURE, "Texture", "Forcefield based on a texture"}, + {PFIELD_GUIDE, "GUIDE", ICON_FORCE_CURVE, "Curve Guide", "Creates a force along a curve object"}, {PFIELD_BOID, "BOID", ICON_FORCE_BOID, "Boid", ""}, - {PFIELD_TURBULENCE, "TURBULENCE", ICON_FORCE_TURBULENCE, "Turbulence", ""}, - {PFIELD_DRAG, "DRAG", ICON_FORCE_DRAG, "Drag", ""}, + {PFIELD_TURBULENCE, "TURBULENCE", ICON_FORCE_TURBULENCE, "Turbulence", "Creates turbulence with a noise field"}, + {PFIELD_DRAG, "DRAG", ICON_FORCE_DRAG, "Drag", "Creates a force that dampens motion"}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem falloff_items[] = { @@ -1126,7 +1126,7 @@ static void rna_def_field(BlenderRNA *brna) prop= RNA_def_property(srna, "falloff_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "falloff"); RNA_def_property_enum_items(prop, falloff_items); - RNA_def_property_ui_text(prop, "Fall-Off", "Fall-off shape"); + RNA_def_property_ui_text(prop, "Fall-Off", ""); RNA_def_property_update(prop, 0, "rna_FieldSettings_update"); prop= RNA_def_property(srna, "texture_mode", PROP_ENUM, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c index 9fd5fafc712..fa69fad253f 100644 --- a/source/blender/makesrna/intern/rna_particle.c +++ b/source/blender/makesrna/intern/rna_particle.c @@ -1682,7 +1682,7 @@ static void rna_def_particle_settings(BlenderRNA *brna) prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, type_items); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); - RNA_def_property_ui_text(prop, "Type", ""); + RNA_def_property_ui_text(prop, "Type", "Particle Type"); RNA_def_property_update(prop, 0, "rna_Particle_change_type"); prop= RNA_def_property(srna, "emit_from", PROP_ENUM, PROP_NONE); @@ -1840,15 +1840,15 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); prop= RNA_def_property(srna, "draw_step", PROP_INT, PROP_NONE); - RNA_def_property_range(prop, 0, 7); - RNA_def_property_ui_range(prop, 0, 10, 1, 0); + RNA_def_property_range(prop, 0, 10); + RNA_def_property_ui_range(prop, 0, 7, 1, 0); RNA_def_property_ui_text(prop, "Steps", "How many steps paths are drawn with (power of 2)"); RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "render_step", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "ren_step"); - RNA_def_property_range(prop, 0, 9); - RNA_def_property_ui_range(prop, 0, 20, 1, 0); + RNA_def_property_range(prop, 0, 20); + RNA_def_property_ui_range(prop, 0, 9, 1, 0); RNA_def_property_ui_text(prop, "Render", "How many steps paths are rendered with (power of 2)"); prop= RNA_def_property(srna, "hair_step", PROP_INT, PROP_NONE); @@ -1896,7 +1896,7 @@ static void rna_def_particle_settings(BlenderRNA *brna) prop= RNA_def_property(srna, "integrator", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, integrator_type_items); - RNA_def_property_ui_text(prop, "Integration", "Select physics integrator type"); + RNA_def_property_ui_text(prop, "Integration", "Algorithm used to calculate physics. Fastest to most stable/accurate: Midpoint, Euler, Verlet, RK4 (Old)"); RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "kink", PROP_ENUM, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_property.c b/source/blender/makesrna/intern/rna_property.c index 08a3f174c15..9fd5610a577 100644 --- a/source/blender/makesrna/intern/rna_property.c +++ b/source/blender/makesrna/intern/rna_property.c @@ -101,11 +101,11 @@ void RNA_def_gameproperty(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem gameproperty_type_items[] ={ - {GPROP_BOOL, "BOOL", 0, "Boolean", ""}, - {GPROP_INT, "INT", 0, "Integer", ""}, - {GPROP_FLOAT, "FLOAT", 0, "Float", ""}, - {GPROP_STRING, "STRING", 0, "String", ""}, - {GPROP_TIME, "TIMER", 0, "Timer", ""}, + {GPROP_BOOL, "BOOL", 0, "Boolean", "Boolean Property"}, + {GPROP_INT, "INT", 0, "Integer", "Integer Property"}, + {GPROP_FLOAT, "FLOAT", 0, "Float", "Floating-Point Property"}, + {GPROP_STRING, "STRING", 0, "String", "String Property"}, + {GPROP_TIME, "TIMER", 0, "Timer", "Timer Property"}, {0, NULL, 0, NULL, NULL}}; /* Base Struct for GameProperty */ diff --git a/source/blender/makesrna/intern/rna_render.c b/source/blender/makesrna/intern/rna_render.c index f87eb4ca4aa..da2704ab641 100644 --- a/source/blender/makesrna/intern/rna_render.c +++ b/source/blender/makesrna/intern/rna_render.c @@ -101,7 +101,7 @@ static void engine_render(RenderEngine *engine, struct Scene *scene) RNA_parameter_list_free(&list); } -static void rna_RenderEngine_unregister(const bContext *C, StructRNA *type) +static void rna_RenderEngine_unregister(Main *bmain, StructRNA *type) { RenderEngineType *et= RNA_struct_blender_type_get(type); @@ -113,7 +113,7 @@ static void rna_RenderEngine_unregister(const bContext *C, StructRNA *type) RNA_struct_free(&BLENDER_RNA, type); } -static StructRNA *rna_RenderEngine_register(bContext *C, ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free) +static StructRNA *rna_RenderEngine_register(Main *bmain, ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free) { RenderEngineType *et, dummyet = {NULL}; RenderEngine dummyengine= {NULL}; @@ -137,7 +137,7 @@ static StructRNA *rna_RenderEngine_register(bContext *C, ReportList *reports, vo for(et=R_engines.first; et; et=et->next) { if(strcmp(et->idname, dummyet.idname) == 0) { if(et->ext.srna) - rna_RenderEngine_unregister(C, et->ext.srna); + rna_RenderEngine_unregister(bmain, et->ext.srna); break; } } @@ -233,7 +233,7 @@ static void rna_def_render_engine(BlenderRNA *brna) RNA_def_struct_sdna(srna, "RenderEngine"); RNA_def_struct_ui_text(srna, "Render Engine", "Render engine"); RNA_def_struct_refine_func(srna, "rna_RenderEngine_refine"); - RNA_def_struct_register_funcs(srna, "rna_RenderEngine_register", "rna_RenderEngine_unregister"); + RNA_def_struct_register_funcs(srna, "rna_RenderEngine_register", "rna_RenderEngine_unregister", NULL); /* render */ func= RNA_def_function(srna, "render", NULL); diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index b8ce006461d..6450e2259fb 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -68,13 +68,13 @@ EnumPropertyItem snap_target_items[] = { {0, NULL, 0, NULL, NULL}}; EnumPropertyItem proportional_falloff_items[] ={ - {PROP_SMOOTH, "SMOOTH", ICON_SMOOTHCURVE, "Smooth", ""}, - {PROP_SPHERE, "SPHERE", ICON_SPHERECURVE, "Sphere", ""}, - {PROP_ROOT, "ROOT", ICON_ROOTCURVE, "Root", ""}, - {PROP_SHARP, "SHARP", ICON_SHARPCURVE, "Sharp", ""}, - {PROP_LIN, "LINEAR", ICON_LINCURVE, "Linear", ""}, - {PROP_CONST, "CONSTANT", ICON_NOCURVE, "Constant", ""}, - {PROP_RANDOM, "RANDOM", ICON_RNDCURVE, "Random", ""}, + {PROP_SMOOTH, "SMOOTH", ICON_SMOOTHCURVE, "Smooth", "Smooth falloff"}, + {PROP_SPHERE, "SPHERE", ICON_SPHERECURVE, "Sphere", "Spherical falloff"}, + {PROP_ROOT, "ROOT", ICON_ROOTCURVE, "Root", "Root falloff"}, + {PROP_SHARP, "SHARP", ICON_SHARPCURVE, "Sharp", "Sharp falloff"}, + {PROP_LIN, "LINEAR", ICON_LINCURVE, "Linear", "Linear falloff"}, + {PROP_CONST, "CONSTANT", ICON_NOCURVE, "Constant", "Consant falloff"}, + {PROP_RANDOM, "RANDOM", ICON_RNDCURVE, "Random", "Random falloff"}, {0, NULL, 0, NULL, NULL}}; @@ -101,54 +101,54 @@ EnumPropertyItem snap_element_items[] = { EnumPropertyItem image_type_items[] = { {0, "", 0, "Image", NULL}, - {R_BMP, "BMP", ICON_FILE_IMAGE, "BMP", ""}, + {R_BMP, "BMP", ICON_FILE_IMAGE, "BMP", "Output image in bitmap format"}, #ifdef WITH_DDS - {R_DDS, "DDS", ICON_FILE_IMAGE, "DDS", ""}, + {R_DDS, "DDS", ICON_FILE_IMAGE, "DDS", "Output image in DDS format"}, #endif - {R_IRIS, "IRIS", ICON_FILE_IMAGE, "Iris", ""}, - {R_PNG, "PNG", ICON_FILE_IMAGE, "PNG", ""}, - {R_JPEG90, "JPEG", ICON_FILE_IMAGE, "JPEG", ""}, + {R_IRIS, "IRIS", ICON_FILE_IMAGE, "Iris", "Output image in (old!) SGI IRIS format"}, + {R_PNG, "PNG", ICON_FILE_IMAGE, "PNG", "Output image in PNG format"}, + {R_JPEG90, "JPEG", ICON_FILE_IMAGE, "JPEG", "Output image in JPEG format"}, #ifdef WITH_OPENJPEG - {R_JP2, "JPEG2000", ICON_FILE_IMAGE, "JPEG 2000", ""}, + {R_JP2, "JPEG2000", ICON_FILE_IMAGE, "JPEG 2000", "Output image in JPEG 2000 format"}, #endif - {R_TARGA, "TARGA", ICON_FILE_IMAGE, "Targa", ""}, - {R_RAWTGA, "TARGA_RAW", ICON_FILE_IMAGE, "Targa Raw", ""}, + {R_TARGA, "TARGA", ICON_FILE_IMAGE, "Targa", "Output image in Targa format"}, + {R_RAWTGA, "TARGA_RAW", ICON_FILE_IMAGE, "Targa Raw", "Output image in uncompressed Targa format"}, {0, "", 0, " ", NULL}, #ifdef WITH_CINEON - {R_CINEON, "CINEON", ICON_FILE_IMAGE, "Cineon", ""}, - {R_DPX, "DPX",ICON_FILE_IMAGE, "DPX", ""}, + {R_CINEON, "CINEON", ICON_FILE_IMAGE, "Cineon", "Output image in Cineon format"}, + {R_DPX, "DPX",ICON_FILE_IMAGE, "DPX", "Output image in DPX format"}, #endif #ifdef WITH_OPENEXR - {R_MULTILAYER, "MULTILAYER", ICON_FILE_IMAGE, "MultiLayer", ""}, - {R_OPENEXR, "OPEN_EXR", ICON_FILE_IMAGE, "OpenEXR", ""}, + {R_MULTILAYER, "MULTILAYER", ICON_FILE_IMAGE, "MultiLayer", "Output image in multilayer OpenEXR format"}, + {R_OPENEXR, "OPEN_EXR", ICON_FILE_IMAGE, "OpenEXR", "Output image in OpenEXR format"}, #endif #ifdef WITH_HDR - {R_RADHDR, "HDR", ICON_FILE_IMAGE, "Radiance HDR", ""}, + {R_RADHDR, "HDR", ICON_FILE_IMAGE, "Radiance HDR", "Output image in Radiance HDR format"}, #endif #ifdef WITH_TIFF - {R_TIFF, "TIFF", ICON_FILE_IMAGE, "TIFF", ""}, + {R_TIFF, "TIFF", ICON_FILE_IMAGE, "TIFF", "Output image in TIFF format"}, #endif {0, "", 0, "Movie", NULL}, #ifdef _WIN32 - {R_AVICODEC, "AVICODEC", ICON_FILE_MOVIE, "AVI Codec", ""}, // XXX Missing codec menu + {R_AVICODEC, "AVICODEC", ICON_FILE_MOVIE, "AVI Codec", "Output video in AVI format"}, // XXX Missing codec menu #endif - {R_AVIJPEG, "AVI_JPEG", ICON_FILE_MOVIE, "AVI JPEG", ""}, - {R_AVIRAW, "AVI_RAW", ICON_FILE_MOVIE, "AVI Raw", ""}, - {R_FRAMESERVER, "FRAMESERVER", ICON_FILE_SCRIPT, "Frame Server", ""}, + {R_AVIJPEG, "AVI_JPEG", ICON_FILE_MOVIE, "AVI JPEG", "Output video in AVI JPEG format"}, + {R_AVIRAW, "AVI_RAW", ICON_FILE_MOVIE, "AVI Raw", "Output video in AVI Raw format"}, + {R_FRAMESERVER, "FRAMESERVER", ICON_FILE_SCRIPT, "Frame Server", "Output image to a frameserver"}, #ifdef WITH_FFMPEG - {R_H264, "H264", ICON_FILE_MOVIE, "H.264", ""}, - {R_FFMPEG, "FFMPEG", ICON_FILE_MOVIE, "MPEG", ""}, - {R_THEORA, "THEORA", ICON_FILE_MOVIE, "Ogg Theora", ""}, + {R_H264, "H264", ICON_FILE_MOVIE, "H.264", "Output video in H.264 format"}, + {R_FFMPEG, "FFMPEG", ICON_FILE_MOVIE, "MPEG", "Output video in MPEG format"}, + {R_THEORA, "THEORA", ICON_FILE_MOVIE, "Ogg Theora", "Output video in Ogg format"}, #endif #ifdef WITH_QUICKTIME # ifdef USE_QTKIT - {R_QUICKTIME, "QUICKTIME_QTKIT", ICON_FILE_MOVIE, "QuickTime", ""}, + {R_QUICKTIME, "QUICKTIME_QTKIT", ICON_FILE_MOVIE, "QuickTime", "Output video in Quicktime format"}, # else - {R_QUICKTIME, "QUICKTIME_CARBON", ICON_FILE_MOVIE, "QuickTime", ""}, + {R_QUICKTIME, "QUICKTIME_CARBON", ICON_FILE_MOVIE, "QuickTime", "Output video in Quicktime format"}, # endif #endif #ifdef WITH_FFMPEG - {R_XVID, "XVID", ICON_FILE_MOVIE, "Xvid", ""}, + {R_XVID, "XVID", ICON_FILE_MOVIE, "Xvid", "Output video in Xvid format"}, #endif {0, NULL, 0, NULL, NULL}}; @@ -1374,7 +1374,7 @@ static void rna_def_unit_settings(BlenderRNA *brna) {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem rotation_units[] = { - {0, "DEGREES", 0, "Degrees", ""}, + {0, "DEGREES", 0, "Degrees", "Use degrees for measuring rotation"}, {USER_UNIT_ROT_RADIANS, "RADIANS", 0, "Radians", ""}, {0, NULL, 0, NULL, NULL}}; @@ -1993,12 +1993,12 @@ static void rna_def_scene_game_data(BlenderRNA *brna) {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem physics_engine_items[] = { - {WOPHY_NONE, "NONE", 0, "None", ""}, + {WOPHY_NONE, "NONE", 0, "None", "Don't use a physics engine"}, //{WOPHY_ENJI, "ENJI", 0, "Enji", ""}, //{WOPHY_SUMO, "SUMO", 0, "Sumo (Deprecated)", ""}, //{WOPHY_DYNAMO, "DYNAMO", 0, "Dynamo", ""}, //{WOPHY_ODE, "ODE", 0, "ODE", ""}, - {WOPHY_BULLET, "BULLET", 0, "Bullet", ""}, + {WOPHY_BULLET, "BULLET", 0, "Bullet", "Use the Bullet physics engine"}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem material_items[] ={ @@ -2122,7 +2122,8 @@ static void rna_def_scene_game_data(BlenderRNA *brna) prop= RNA_def_property(srna, "physics_gravity", PROP_FLOAT, PROP_ACCELERATION); RNA_def_property_float_sdna(prop, NULL, "gravity"); - RNA_def_property_range(prop, 0.0, 25.0); + RNA_def_property_ui_range(prop, 0.0, 25.0, 1, 2); + RNA_def_property_range(prop, 0.0, 10000.0); RNA_def_property_ui_text(prop, "Physics Gravity", "Gravitational constant used for physics simulation in the game engine"); RNA_def_property_update(prop, NC_SCENE, NULL); @@ -2313,13 +2314,13 @@ static void rna_def_scene_render_data(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem pixel_filter_items[] ={ - {R_FILTER_BOX, "BOX", 0, "Box", ""}, - {R_FILTER_TENT, "TENT", 0, "Tent", ""}, - {R_FILTER_QUAD, "QUADRATIC", 0, "Quadratic", ""}, - {R_FILTER_CUBIC, "CUBIC", 0, "Cubic", ""}, - {R_FILTER_CATROM, "CATMULLROM", 0, "Catmull-Rom", ""}, - {R_FILTER_GAUSS, "GAUSSIAN", 0, "Gaussian", ""}, - {R_FILTER_MITCH, "MITCHELL", 0, "Mitchell-Netravali", ""}, + {R_FILTER_BOX, "BOX", 0, "Box", "Use a box filter for anti-aliasing"}, + {R_FILTER_TENT, "TENT", 0, "Tent", "Use a tent filter for anti-aliasing"}, + {R_FILTER_QUAD, "QUADRATIC", 0, "Quadratic", "Use a quadratic filter for anti-aliasing"}, + {R_FILTER_CUBIC, "CUBIC", 0, "Cubic", "Use a cubic filter for anti-aliasing"}, + {R_FILTER_CATROM, "CATMULLROM", 0, "Catmull-Rom", "Use a Catmull-Rom filter for anti-aliasing"}, + {R_FILTER_GAUSS, "GAUSSIAN", 0, "Gaussian", "Use a Gaussian filter for anti-aliasing"}, + {R_FILTER_MITCH, "MITCHELL", 0, "Mitchell-Netravali", "Use a Mitchell-Netravali filter for anti-aliasing"}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem alpha_mode_items[] ={ @@ -2343,19 +2344,25 @@ static void rna_def_scene_render_data(BlenderRNA *brna) /* Bake */ static EnumPropertyItem bake_mode_items[] ={ - {RE_BAKE_ALL, "FULL", 0, "Full Render", ""}, - {RE_BAKE_AO, "AO", 0, "Ambient Occlusion", ""}, - {RE_BAKE_SHADOW, "SHADOW", 0, "Shadow", ""}, - {RE_BAKE_NORMALS, "NORMALS", 0, "Normals", ""}, - {RE_BAKE_TEXTURE, "TEXTURE", 0, "Textures", ""}, - {RE_BAKE_DISPLACEMENT, "DISPLACEMENT", 0, "Displacement", ""}, + {RE_BAKE_ALL, "FULL", 0, "Full Render", "Bake everything"}, + {RE_BAKE_AO, "AO", 0, "Ambient Occlusion", "Bake ambient occlusion"}, + {RE_BAKE_SHADOW, "SHADOW", 0, "Shadow", "Bake shadows"}, + {RE_BAKE_NORMALS, "NORMALS", 0, "Normals", "Bake normals"}, + {RE_BAKE_TEXTURE, "TEXTURE", 0, "Textures", "Bake textures"}, + {RE_BAKE_DISPLACEMENT, "DISPLACEMENT", 0, "Displacement", "Bake displacement"}, + {RE_BAKE_EMIT, "EMIT", 0, "Emission", "Bake Emit values (glow)"}, + {RE_BAKE_ALPHA, "ALPHA", 0, "Alpha", "Bake Alpha values (transparency)"}, + {RE_BAKE_MIRROR_INTENSITY, "MIRROR_INTENSITY", 0, "Mirror Intensity", "Bake Mirror values"}, + {RE_BAKE_MIRROR_COLOR, "MIRROR_COLOR", 0, "Mirror Colors", "Bake Mirror colors"}, + {RE_BAKE_SPEC_INTENSITY, "SPEC_INTENSITY", 0, "Specular Intensity", "Bake Specular values"}, + {RE_BAKE_SPEC_COLOR, "SPEC_COLOR", 0, "Specular Colors", "Bake Specular colors"}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem bake_normal_space_items[] ={ - {R_BAKE_SPACE_CAMERA, "CAMERA", 0, "Camera", ""}, - {R_BAKE_SPACE_WORLD, "WORLD", 0, "World", ""}, - {R_BAKE_SPACE_OBJECT, "OBJECT", 0, "Object", ""}, - {R_BAKE_SPACE_TANGENT, "TANGENT", 0, "Tangent", ""}, + {R_BAKE_SPACE_CAMERA, "CAMERA", 0, "Camera", "Bake the normals in camera space"}, + {R_BAKE_SPACE_WORLD, "WORLD", 0, "World", "Bake the normals in world space"}, + {R_BAKE_SPACE_OBJECT, "OBJECT", 0, "Object", "Bake the normals in object space"}, + {R_BAKE_SPACE_TANGENT, "TANGENT", 0, "Tangent", "Bake the normals in tangent space"}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem bake_qyad_split_items[] ={ @@ -2372,12 +2379,12 @@ static void rna_def_scene_render_data(BlenderRNA *brna) {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem raytrace_structure_items[] = { - {R_RAYSTRUCTURE_AUTO, "AUTO", 0, "Auto", ""}, + {R_RAYSTRUCTURE_AUTO, "AUTO", 0, "Auto", "Automatically select acceleration structure"}, {R_RAYSTRUCTURE_OCTREE, "OCTREE", 0, "Octree", "Use old Octree structure"}, {R_RAYSTRUCTURE_BLIBVH, "BLIBVH", 0, "BLI BVH", "Use BLI K-Dop BVH.c"}, - {R_RAYSTRUCTURE_VBVH, "VBVH", 0, "vBVH", ""}, - {R_RAYSTRUCTURE_SIMD_SVBVH, "SIMD_SVBVH", 0, "SIMD SVBVH", ""}, - {R_RAYSTRUCTURE_SIMD_QBVH, "SIMD_QBVH", 0, "SIMD QBVH", ""}, + {R_RAYSTRUCTURE_VBVH, "VBVH", 0, "vBVH", "Use vBVH"}, + {R_RAYSTRUCTURE_SIMD_SVBVH, "SIMD_SVBVH", 0, "SIMD SVBVH", "Use SIMD SVBVH"}, + {R_RAYSTRUCTURE_SIMD_QBVH, "SIMD_QBVH", 0, "SIMD QBVH", "Use SIMD QBVH"}, {0, NULL, 0, NULL, NULL} }; @@ -2506,7 +2513,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna) #endif static EnumPropertyItem engine_items[] = { - {0, "BLENDER_RENDER", 0, "Blender Render", ""}, + {0, "BLENDER_RENDER", 0, "Blender Render", "Use the Blender internal rendering engine for rendering"}, {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "RenderSettings", NULL); @@ -2947,7 +2954,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna) prop= RNA_def_property(srna, "edge_color", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "edgeR"); RNA_def_property_array(prop, 3); - RNA_def_property_ui_text(prop, "Edge Color", ""); + RNA_def_property_ui_text(prop, "Edge Color", "Edge color"); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); prop= RNA_def_property(srna, "use_freestyle", PROP_BOOLEAN, PROP_NONE); @@ -3571,10 +3578,15 @@ void RNA_def_scene(BlenderRNA *brna) RNA_def_property_int_sdna(prop, NULL, "r.cfra"); RNA_def_property_range(prop, MINAFRAME, MAXFRAME); RNA_def_property_int_funcs(prop, NULL, "rna_Scene_current_frame_set", NULL); - RNA_def_property_ui_text(prop, "Current Frame", ""); + RNA_def_property_ui_text(prop, "Current Frame", "Current Frame"); RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); RNA_def_property_update(prop, NC_SCENE|ND_FRAME, "rna_Scene_frame_update"); + prop= RNA_def_property(srna, "frame_subframe", PROP_FLOAT, PROP_TIME); + RNA_def_property_float_sdna(prop, NULL, "r.subframe"); + RNA_def_property_ui_text(prop, "Current Sub-Frame", ""); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE|PROP_EDITABLE); + prop= RNA_def_property(srna, "frame_start", PROP_INT, PROP_TIME); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_int_sdna(prop, NULL, "r.sfra"); diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c index ce018fdfd6e..da536f95cba 100644 --- a/source/blender/makesrna/intern/rna_sculpt_paint.c +++ b/source/blender/makesrna/intern/rna_sculpt_paint.c @@ -481,12 +481,12 @@ static void rna_def_particle_edit(BlenderRNA *brna) RNA_def_struct_sdna(srna, "ParticleBrushData"); RNA_def_struct_ui_text(srna, "Particle Brush", "Particle editing brush"); - prop= RNA_def_property(srna, "size", PROP_INT, PROP_NONE); + prop= RNA_def_property(srna, "size", PROP_INT, PROP_DISTANCE); RNA_def_property_range(prop, 1, SHRT_MAX); RNA_def_property_ui_range(prop, 1, 100, 10, 3); RNA_def_property_ui_text(prop, "Radius", "Radius of the brush in pixels"); - prop= RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE); + prop= RNA_def_property(srna, "strength", PROP_FLOAT, PROP_FACTOR); RNA_def_property_range(prop, 0.001, 1.0); RNA_def_property_ui_text(prop, "Strength", "Brush strength"); diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c index 34963e9507f..90ae95894b0 100644 --- a/source/blender/makesrna/intern/rna_sequencer.c +++ b/source/blender/makesrna/intern/rna_sequencer.c @@ -387,6 +387,8 @@ static StructRNA* rna_Sequence_refine(struct PointerRNA *ptr) return &RNA_EffectSequence; case SEQ_MULTICAM: return &RNA_MulticamSequence; + case SEQ_ADJUSTMENT: + return &RNA_AdjustmentSequence; case SEQ_PLUGIN: return &RNA_PluginSequence; case SEQ_WIPE: @@ -844,6 +846,7 @@ static void rna_def_sequence(BlenderRNA *brna) {SEQ_COLOR, "COLOR", 0, "Color", ""}, {SEQ_SPEED, "SPEED", 0, "Speed", ""}, {SEQ_MULTICAM, "MULTICAM", 0, "Multicam Selector", ""}, + {SEQ_ADJUSTMENT, "ADJUSTMENT", 0, "Adjustment Layer", ""}, {0, NULL, 0, NULL, NULL}}; static const EnumPropertyItem blend_mode_items[]= { @@ -1371,6 +1374,20 @@ static void rna_def_multicam(BlenderRNA *brna) rna_def_input(srna); } +static void rna_def_adjustment(BlenderRNA *brna) +{ + StructRNA *srna; +// PropertyRNA *prop; + + srna = RNA_def_struct(brna, "AdjustmentSequence", "Sequence"); + RNA_def_struct_ui_text(srna, "Adjustment Layer Sequence", "Sequence strip to perform filter adjustments to layers below"); + RNA_def_struct_sdna(srna, "Sequence"); + + rna_def_filter_video(srna); + rna_def_proxy(srna); + rna_def_input(srna); +} + static void rna_def_plugin(BlenderRNA *brna) { StructRNA *srna; @@ -1620,6 +1637,7 @@ void RNA_def_sequencer(BlenderRNA *brna) rna_def_sound(brna); rna_def_effect(brna); rna_def_multicam(brna); + rna_def_adjustment(brna); rna_def_plugin(brna); rna_def_wipe(brna); rna_def_glow(brna); diff --git a/source/blender/makesrna/intern/rna_smoke.c b/source/blender/makesrna/intern/rna_smoke.c index 922c68f45bd..974f2fdecb8 100644 --- a/source/blender/makesrna/intern/rna_smoke.c +++ b/source/blender/makesrna/intern/rna_smoke.c @@ -212,7 +212,7 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "strength"); RNA_def_property_range(prop, 0.0, 10.0); RNA_def_property_ui_range(prop, 0.0, 10.0, 1, 2); - RNA_def_property_ui_text(prop, "Strength", "Strength of wavelet noise"); + RNA_def_property_ui_text(prop, "Strength", "Strength of noise"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); prop= RNA_def_property(srna, "dissolve_speed", PROP_INT, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 59824d6a752..6b6071c4912 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -76,9 +76,6 @@ static EnumPropertyItem draw_channels_items[] = { {SI_USE_ALPHA, "COLOR_ALPHA", ICON_IMAGE_RGB_ALPHA, "Color and Alpha", "Draw image with RGB colors and alpha transparency"}, {SI_SHOW_ALPHA, "ALPHA", ICON_IMAGE_ALPHA, "Alpha", "Draw alpha transparency channel"}, {SI_SHOW_ZBUF, "Z_BUFFER", ICON_IMAGE_ZDEPTH, "Z-Buffer", "Draw Z-buffer associated with image (mapped from camera clip start to end)"}, -#ifdef WITH_LCMS - {SI_COLOR_CORRECTION, "COLOR_CORRECTED", ICON_IMAGE_ALPHA, "Color Corrected", "Display color corrected image"}, -#endif {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem transform_orientation_items[] = { @@ -426,7 +423,7 @@ static void rna_RegionView3D_view_matrix_set(PointerRNA *ptr, const float *value { RegionView3D *rv3d= (RegionView3D *)(ptr->data); negate_v3_v3(rv3d->ofs, values); - view3d_apply_mat4((float (*)[4])values, rv3d->ofs, rv3d->viewquat, &rv3d->dist); + ED_view3d_from_m4((float (*)[4])values, rv3d->ofs, rv3d->viewquat, &rv3d->dist); } /* Space Image Editor */ @@ -498,16 +495,33 @@ static EnumPropertyItem *rna_SpaceImageEditor_draw_channels_itemf(bContext *C, P RNA_enum_items_add_value(&item, &totitem, draw_channels_items, SI_SHOW_ZBUF); } -#ifdef WITH_LCMS - RNA_enum_items_add_value(&item, &totitem, draw_channels_items, SI_COLOR_CORRECTION); -#endif - RNA_enum_item_end(&item, &totitem); *free= 1; return item; } +static void rna_SpaceImageEditor_zoom_get(PointerRNA *ptr, float *values) +{ + SpaceImage *sima= (SpaceImage*)ptr->data; + ScrArea *sa; + ARegion *ar; + + values[0] = values[1] = 1; + + sa = rna_area_from_space(ptr); + if(!sa) return; + + /* find aregion */ + for(ar=sa->regionbase.first; ar; ar=ar->next) { + if(ar->regiontype == RGN_TYPE_WINDOW) + break; + } + if(!ar) return; + + ED_space_image_zoom(sima, ar, &values[0], &values[1]); +} + static void rna_SpaceImageEditor_cursor_location_get(PointerRNA *ptr, float *values) { SpaceImage *sima= (SpaceImage*)ptr->data; @@ -1017,18 +1031,18 @@ static void rna_def_space_outliner(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem display_mode_items[] = { - {SO_ALL_SCENES, "ALL_SCENES", 0, "All Scenes", ""}, - {SO_CUR_SCENE, "CURRENT_SCENE", 0, "Current Scene", ""}, - {SO_VISIBLE, "VISIBLE_LAYERS", 0, "Visible Layers", ""}, - {SO_SELECTED, "SELECTED", 0, "Selected", ""}, - {SO_ACTIVE, "ACTIVE", 0, "Active", ""}, - {SO_SAME_TYPE, "SAME_TYPES", 0, "Same Types", ""}, - {SO_GROUPS, "GROUPS", 0, "Groups", ""}, - {SO_LIBRARIES, "LIBRARIES", 0, "Libraries", ""}, - {SO_SEQUENCE, "SEQUENCE", 0, "Sequence", ""}, - {SO_DATABLOCKS, "DATABLOCKS", 0, "Datablocks", ""}, - {SO_USERDEF, "USER_PREFERENCES", 0, "User Preferences", ""}, - {SO_KEYMAP, "KEYMAPS", 0, "Key Maps", ""}, + {SO_ALL_SCENES, "ALL_SCENES", 0, "All Scenes", "Display datablocks in all scenes"}, + {SO_CUR_SCENE, "CURRENT_SCENE", 0, "Current Scene", "Display datablocks in current scene"}, + {SO_VISIBLE, "VISIBLE_LAYERS", 0, "Visible Layers", "Display datablocks in visible layers"}, + {SO_SELECTED, "SELECTED", 0, "Selected", "Display datablocks of selected objects"}, + {SO_ACTIVE, "ACTIVE", 0, "Active", "Display datablocks of active object"}, + {SO_SAME_TYPE, "SAME_TYPES", 0, "Same Types", "Display datablocks of all objects of same type as selected object"}, + {SO_GROUPS, "GROUPS", 0, "Groups", "Display groups and their datablocks"}, + {SO_LIBRARIES, "LIBRARIES", 0, "Libraries", "Display libraries"}, + {SO_SEQUENCE, "SEQUENCE", 0, "Sequence", "Display sequence datablocks"}, + {SO_DATABLOCKS, "DATABLOCKS", 0, "Datablocks", "Display raw datablocks"}, + {SO_USERDEF, "USER_PREFERENCES", 0, "User Preferences", "Display the user preference datablocks"}, + {SO_KEYMAP, "KEYMAPS", 0, "Key Maps", "Display keymap datablocks"}, {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "SpaceOutliner", "Space"); @@ -1070,20 +1084,20 @@ static void rna_def_background_image(BlenderRNA *brna) /* note: combinations work but dont flip so arnt that useful */ static EnumPropertyItem bgpic_axis_items[] = { {0, "", 0, "X Axis", ""}, - {(1<<RV3D_VIEW_LEFT), "LEFT", 0, "Left", ""}, - {(1<<RV3D_VIEW_RIGHT), "RIGHT", 0, "Right", ""}, + {(1<<RV3D_VIEW_LEFT), "LEFT", 0, "Left", "Show background image while looking to the left"}, + {(1<<RV3D_VIEW_RIGHT), "RIGHT", 0, "Right", "Show background image while looking to the right"}, /*{(1<<RV3D_VIEW_LEFT)|(1<<RV3D_VIEW_RIGHT), "LEFT_RIGHT", 0, "Left/Right", ""},*/ {0, "", 0, "Y Axis", ""}, - {(1<<RV3D_VIEW_BACK), "BACK", 0, "Back", ""}, - {(1<<RV3D_VIEW_FRONT), "FRONT", 0, "Front", ""}, + {(1<<RV3D_VIEW_BACK), "BACK", 0, "Back", "Show background image in back view"}, + {(1<<RV3D_VIEW_FRONT), "FRONT", 0, "Front", "Show background image in front view"}, /*{(1<<RV3D_VIEW_BACK)|(1<<RV3D_VIEW_FRONT), "BACK_FRONT", 0, "Back/Front", ""},*/ {0, "", 0, "Z Axis", ""}, - {(1<<RV3D_VIEW_BOTTOM), "BOTTOM", 0, "Bottom", ""}, - {(1<<RV3D_VIEW_TOP), "TOP", 0, "Top", ""}, + {(1<<RV3D_VIEW_BOTTOM), "BOTTOM", 0, "Bottom", "Show background image in bottom view"}, + {(1<<RV3D_VIEW_TOP), "TOP", 0, "Top", "Show background image in top view"}, /*{(1<<RV3D_VIEW_BOTTOM)|(1<<RV3D_VIEW_TOP), "BOTTOM_TOP", 0, "Top/Bottom", ""},*/ {0, "", 0, "Other", ""}, - {0, "ALL", 0, "All Views", ""}, - {(1<<RV3D_VIEW_CAMERA), "CAMERA", 0, "Camera", ""}, + {0, "ALL", 0, "All Views", "Show background image in all views"}, + {(1<<RV3D_VIEW_CAMERA), "CAMERA", 0, "Camera", "Show background image in camera view"}, {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "BackgroundImage", NULL); @@ -1145,11 +1159,11 @@ static void rna_def_space_view3d(BlenderRNA *brna) const int matrix_dimsize[]= {4, 4}; static EnumPropertyItem pivot_items[] = { - {V3D_CENTER, "BOUNDING_BOX_CENTER", ICON_ROTATE, "Bounding Box Center", ""}, - {V3D_CURSOR, "CURSOR", ICON_CURSOR, "3D Cursor", ""}, - {V3D_LOCAL, "INDIVIDUAL_ORIGINS", ICON_ROTATECOLLECTION, "Individual Origins", ""}, - {V3D_CENTROID, "MEDIAN_POINT", ICON_ROTATECENTER, "Median Point", ""}, - {V3D_ACTIVE, "ACTIVE_ELEMENT", ICON_ROTACTIVE, "Active Element", ""}, + {V3D_CENTER, "BOUNDING_BOX_CENTER", ICON_ROTATE, "Bounding Box Center", "Pivot around bounding box center of selected object(s)"}, + {V3D_CURSOR, "CURSOR", ICON_CURSOR, "3D Cursor", "Pivot around the 3D cursor"}, + {V3D_LOCAL, "INDIVIDUAL_ORIGINS", ICON_ROTATECOLLECTION, "Individual Origins", "Pivot around each object's own origin"}, + {V3D_CENTROID, "MEDIAN_POINT", ICON_ROTATECENTER, "Median Point", "Pivot around the median point of selected objects"}, + {V3D_ACTIVE, "ACTIVE_ELEMENT", ICON_ROTACTIVE, "Active Element", "Pivot around active object"}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem rv3d_persp_items[] = { @@ -1209,7 +1223,7 @@ static void rna_def_space_view3d(BlenderRNA *brna) prop= RNA_def_property(srna, "clip_start", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "near"); - RNA_def_property_range(prop, 0.0f, FLT_MAX); + RNA_def_property_range(prop, 0.001f, FLT_MAX); RNA_def_property_ui_text(prop, "Clip Start", "3D View near clipping distance"); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); @@ -1277,6 +1291,11 @@ static void rna_def_space_view3d(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Textured Solid", "Display face-assigned textures in solid view"); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); + prop= RNA_def_property(srna, "lock_camera", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_LOCK_CAMERA); + RNA_def_property_ui_text(prop, "Lock Camera to View", "Enable view navigation within the camera view"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); + prop= RNA_def_property(srna, "show_only_render", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_RENDER_OVERRIDE); RNA_def_property_ui_text(prop, "Only Render", "Display only objects which will be rendered"); @@ -1416,6 +1435,11 @@ static void rna_def_space_view3d(BlenderRNA *brna) RNA_def_property_enum_items(prop, rv3d_persp_items); RNA_def_property_ui_text(prop, "Perspective", "View Perspective"); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); + + prop= RNA_def_property(srna, "is_perspective", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "is_persp", 1); + RNA_def_property_ui_text(prop, "Is Perspective", ""); + RNA_def_property_flag(prop, PROP_EDITABLE); prop= RNA_def_property(srna, "view_location", PROP_FLOAT, PROP_TRANSLATION); #if 0 @@ -1556,6 +1580,12 @@ static void rna_def_space_image(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "sample_line_hist"); RNA_def_property_struct_type(prop, "Histogram"); RNA_def_property_ui_text(prop, "Line sample", "Sampled colors along line"); + + prop= RNA_def_property(srna, "zoom", PROP_FLOAT, PROP_NONE); + RNA_def_property_array(prop, 2); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_float_funcs(prop, "rna_SpaceImageEditor_zoom_get", NULL, NULL); + RNA_def_property_ui_text(prop, "Zoom", "Zoom factor"); /* image draw */ prop= RNA_def_property(srna, "show_repeat", PROP_BOOLEAN, PROP_NONE); @@ -1847,10 +1877,10 @@ static void rna_def_space_dopesheet(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem mode_items[] = { - {SACTCONT_DOPESHEET, "DOPESHEET", 0, "DopeSheet", ""}, - {SACTCONT_ACTION, "ACTION", 0, "Action Editor", ""}, - {SACTCONT_SHAPEKEY, "SHAPEKEY", 0, "ShapeKey Editor", ""}, - {SACTCONT_GPENCIL, "GPENCIL", 0, "Grease Pencil", ""}, + {SACTCONT_DOPESHEET, "DOPESHEET", 0, "DopeSheet", "DopeSheet Editor"}, + {SACTCONT_ACTION, "ACTION", 0, "Action Editor", "Action Editor"}, + {SACTCONT_SHAPEKEY, "SHAPEKEY", 0, "ShapeKey Editor", "ShapeKey Editor"}, + {SACTCONT_GPENCIL, "GPENCIL", 0, "Grease Pencil", "Grease Pencil"}, {0, NULL, 0, NULL, NULL}}; @@ -1929,8 +1959,8 @@ static void rna_def_space_graph(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem mode_items[] = { - {SIPO_MODE_ANIMATION, "FCURVES", 0, "F-Curve Editor", ""}, - {SIPO_MODE_DRIVERS, "DRIVERS", 0, "Drivers", ""}, + {SIPO_MODE_ANIMATION, "FCURVES", 0, "F-Curve Editor", "Edit f-curves"}, + {SIPO_MODE_DRIVERS, "DRIVERS", 0, "Drivers", "Edit drivers"}, {0, NULL, 0, NULL, NULL}}; /* this is basically the same as the one for the 3D-View, but with some entries ommitted */ diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c index fc74fc7268d..a750fa3765f 100644 --- a/source/blender/makesrna/intern/rna_texture.c +++ b/source/blender/makesrna/intern/rna_texture.c @@ -56,21 +56,21 @@ EnumPropertyItem texture_filter_items[] = { EnumPropertyItem texture_type_items[] = { {0, "NONE", 0, "None", ""}, - {TEX_BLEND, "BLEND", ICON_TEXTURE, "Blend", ""}, - {TEX_CLOUDS, "CLOUDS", ICON_TEXTURE, "Clouds", ""}, - {TEX_DISTNOISE, "DISTORTED_NOISE", ICON_TEXTURE, "Distorted Noise", ""}, - {TEX_ENVMAP, "ENVIRONMENT_MAP", ICON_IMAGE_DATA, "Environment Map", ""}, - {TEX_IMAGE, "IMAGE", ICON_IMAGE_DATA, "Image or Movie", ""}, - {TEX_MAGIC, "MAGIC", ICON_TEXTURE, "Magic", ""}, - {TEX_MARBLE, "MARBLE", ICON_TEXTURE, "Marble", ""}, - {TEX_MUSGRAVE, "MUSGRAVE", ICON_TEXTURE, "Musgrave", ""}, - {TEX_NOISE, "NOISE", ICON_TEXTURE, "Noise", ""}, + {TEX_BLEND, "BLEND", ICON_TEXTURE, "Blend", "Procedural - Creates a ramp texture"}, + {TEX_CLOUDS, "CLOUDS", ICON_TEXTURE, "Clouds", "Procedural - Creates a cloud-like fractal noise texture"}, + {TEX_DISTNOISE, "DISTORTED_NOISE", ICON_TEXTURE, "Distorted Noise", "Procedural - Noise texture distorted by two noise algorithms"}, + {TEX_ENVMAP, "ENVIRONMENT_MAP", ICON_IMAGE_DATA, "Environment Map", "Creates a render of the environment mapped to a texture"}, + {TEX_IMAGE, "IMAGE", ICON_IMAGE_DATA, "Image or Movie", "Allows for images or movies to be used as textures"}, + {TEX_MAGIC, "MAGIC", ICON_TEXTURE, "Magic", "Procedural - Color texture based on trigonometric functions"}, + {TEX_MARBLE, "MARBLE", ICON_TEXTURE, "Marble", "Procedural - Marble-like noise texture with wave generated bands"}, + {TEX_MUSGRAVE, "MUSGRAVE", ICON_TEXTURE, "Musgrave", "Procedural - Highly flexible fractal noise texture"}, + {TEX_NOISE, "NOISE", ICON_TEXTURE, "Noise", "Procedural - Random noise, gives a different result every time, for every frame, for every pixel"}, //{TEX_PLUGIN, "PLUGIN", ICON_PLUGIN, "Plugin", ""}, /* Nothing yet */ {TEX_POINTDENSITY, "POINT_DENSITY", ICON_TEXTURE, "Point Density", ""}, - {TEX_STUCCI, "STUCCI", ICON_TEXTURE, "Stucci", ""}, - {TEX_VORONOI, "VORONOI", ICON_TEXTURE, "Voronoi", ""}, - {TEX_VOXELDATA, "VOXEL_DATA", ICON_TEXTURE, "Voxel Data", ""}, - {TEX_WOOD, "WOOD", ICON_TEXTURE, "Wood", ""}, + {TEX_STUCCI, "STUCCI", ICON_TEXTURE, "Stucci", "Procedural - Creates a fractal noise texture"}, + {TEX_VORONOI, "VORONOI", ICON_TEXTURE, "Voronoi", "Procedural - Creates cell-like patterns based on Worley noise"}, + {TEX_VOXELDATA, "VOXEL_DATA", ICON_TEXTURE, "Voxel Data", "Creates a 3d texture based on volumetric data"}, + {TEX_WOOD, "WOOD", ICON_TEXTURE, "Wood", "Procedural - Wave generated bands or rings, with optional noise"}, {0, NULL, 0, NULL, NULL}}; #ifdef RNA_RUNTIME @@ -509,7 +509,7 @@ static void rna_def_mtex(BlenderRNA *brna) prop= RNA_def_property(srna, "blend_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "blendtype"); RNA_def_property_enum_items(prop, prop_blend_type_items); - RNA_def_property_ui_text(prop, "Blend Type", ""); + RNA_def_property_ui_text(prop, "Blend Type", "The mode used to apply the texture"); RNA_def_property_update(prop, 0, "rna_TextureSlot_update"); prop= RNA_def_property(srna, "use_stencil", PROP_BOOLEAN, PROP_NONE); @@ -627,7 +627,7 @@ static void rna_def_environment_map(BlenderRNA *brna) prop= RNA_def_property(srna, "clip_start", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "clipsta"); - RNA_def_property_range(prop, 0.01, FLT_MAX); + RNA_def_property_range(prop, 0.001, FLT_MAX); RNA_def_property_ui_range(prop, 0.01, 50, 100, 2); RNA_def_property_ui_text(prop, "Clip Start", "Objects nearer than this are not visible to map"); RNA_def_property_update(prop, 0, "rna_Texture_update"); @@ -665,21 +665,21 @@ static void rna_def_environment_map(BlenderRNA *brna) } static EnumPropertyItem prop_noise_basis_items[] = { - {TEX_BLENDER, "BLENDER_ORIGINAL", 0, "Blender Original", ""}, - {TEX_STDPERLIN, "ORIGINAL_PERLIN", 0, "Original Perlin", ""}, - {TEX_NEWPERLIN, "IMPROVED_PERLIN", 0, "Improved Perlin", ""}, - {TEX_VORONOI_F1, "VORONOI_F1", 0, "Voronoi F1", ""}, - {TEX_VORONOI_F2, "VORONOI_F2", 0, "Voronoi F2", ""}, - {TEX_VORONOI_F3, "VORONOI_F3", 0, "Voronoi F3", ""}, - {TEX_VORONOI_F4, "VORONOI_F4", 0, "Voronoi F4", ""}, - {TEX_VORONOI_F2F1, "VORONOI_F2_F1", 0, "Voronoi F2-F1", ""}, - {TEX_VORONOI_CRACKLE, "VORONOI_CRACKLE", 0, "Voronoi Crackle", ""}, - {TEX_CELLNOISE, "CELL_NOISE", 0, "Cell Noise", ""}, + {TEX_BLENDER, "BLENDER_ORIGINAL", 0, "Blender Original", "Noise algorithm - Blender original: Smooth interpolated noise"}, + {TEX_STDPERLIN, "ORIGINAL_PERLIN", 0, "Original Perlin", "Noise algorithm - Original Perlin: Smooth interpolated noise"}, + {TEX_NEWPERLIN, "IMPROVED_PERLIN", 0, "Improved Perlin", "Noise algorithm - Improved Perlin: Smooth interpolated noise"}, + {TEX_VORONOI_F1, "VORONOI_F1", 0, "Voronoi F1", "Noise algorithm - Voronoi F1: Returns distance to the closest feature point"}, + {TEX_VORONOI_F2, "VORONOI_F2", 0, "Voronoi F2", "Noise algorithm - Voronoi F2: Returns distance to the 2nd closest feature point"}, + {TEX_VORONOI_F3, "VORONOI_F3", 0, "Voronoi F3", "Noise algorithm - Voronoi F3: Returns distance to the 3rd closest feature point"}, + {TEX_VORONOI_F4, "VORONOI_F4", 0, "Voronoi F4", "Noise algorithm - Voronoi F4: Returns distance to the 4th closest feature point"}, + {TEX_VORONOI_F2F1, "VORONOI_F2_F1", 0, "Voronoi F2-F1", "Noise algorithm - Voronoi F1-F2"}, + {TEX_VORONOI_CRACKLE, "VORONOI_CRACKLE", 0, "Voronoi Crackle", "Noise algorithm - Voronoi Crackle: Voronoi tessellation with sharp edges"}, + {TEX_CELLNOISE, "CELL_NOISE", 0, "Cell Noise", "Noise algorithm - Cell Noise: Square cell tessallation"}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem prop_noise_type[] = { - {TEX_NOISESOFT, "SOFT_NOISE", 0, "Soft", ""}, - {TEX_NOISEPERL, "HARD_NOISE", 0, "Hard", ""}, + {TEX_NOISESOFT, "SOFT_NOISE", 0, "Soft", "Generate soft noise (smooth transitions)"}, + {TEX_NOISEPERL, "HARD_NOISE", 0, "Hard", "Generate hard noise (sharp transitions)"}, {0, NULL, 0, NULL, NULL}}; @@ -726,7 +726,7 @@ static void rna_def_texture_clouds(BlenderRNA *brna) prop= RNA_def_property(srna, "cloud_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "stype"); RNA_def_property_enum_items(prop, prop_clouds_stype); - RNA_def_property_ui_text(prop, "Color", ""); + RNA_def_property_ui_text(prop, "Color", "Determines whether Noise returns grayscale or RGB values"); RNA_def_property_update(prop, 0, "rna_Texture_nodes_update"); prop= RNA_def_property(srna, "nabla", PROP_FLOAT, PROP_NONE); @@ -1195,11 +1195,11 @@ static void rna_def_texture_musgrave(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem prop_musgrave_type[] = { - {TEX_MFRACTAL, "MULTIFRACTAL", 0, "Multifractal", ""}, - {TEX_RIDGEDMF, "RIDGED_MULTIFRACTAL", 0, "Ridged Multifractal", ""}, - {TEX_HYBRIDMF, "HYBRID_MULTIFRACTAL", 0, "Hybrid Multifractal", ""}, - {TEX_FBM, "FBM", 0, "fBM", ""}, - {TEX_HTERRAIN, "HETERO_TERRAIN", 0, "Hetero Terrain", ""}, + {TEX_MFRACTAL, "MULTIFRACTAL", 0, "Multifractal", "Fractal noise algorithm. Multifractal: Uses Perlin noise as a basis"}, + {TEX_RIDGEDMF, "RIDGED_MULTIFRACTAL", 0, "Ridged Multifractal", "Fractal noise algorithm. Ridged Multifractal: Uses Perlin noise with inflection as a basis"}, + {TEX_HYBRIDMF, "HYBRID_MULTIFRACTAL", 0, "Hybrid Multifractal", "Fractal noise algorithm.Hybrid Multifractal: Uses Perlin noise as a basis, with extended controls"}, + {TEX_FBM, "FBM", 0, "fBM", "Fractal noise algorithm. Fractal Brownian Motion: Uses Brownian noise as a basis"}, + {TEX_HTERRAIN, "HETERO_TERRAIN", 0, "Hetero Terrain", "Fractal noise algorithm. Hetero Terrain: similar to multifractal"}, {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "MusgraveTexture", "Texture"); @@ -1245,7 +1245,7 @@ static void rna_def_texture_musgrave(BlenderRNA *brna) prop= RNA_def_property(srna, "noise_intensity", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "ns_outscale"); RNA_def_property_range(prop, 0, 10); - RNA_def_property_ui_text(prop, "Noise Intensity", ""); + RNA_def_property_ui_text(prop, "Noise Intensity", "Scales the intensity of the noise"); RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "noise_scale", PROP_FLOAT, PROP_NONE); @@ -1274,13 +1274,13 @@ static void rna_def_texture_voronoi(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem prop_distance_metric_items[] = { - {TEX_DISTANCE, "DISTANCE", 0, "Actual Distance", ""}, - {TEX_DISTANCE_SQUARED, "DISTANCE_SQUARED", 0, "Distance Squared", ""}, - {TEX_MANHATTAN, "MANHATTAN", 0, "Manhattan", ""}, - {TEX_CHEBYCHEV, "CHEBYCHEV", 0, "Chebychev", ""}, - {TEX_MINKOVSKY_HALF, "MINKOVSKY_HALF", 0, "Minkovsky 1/2", ""}, - {TEX_MINKOVSKY_FOUR, "MINKOVSKY_FOUR", 0, "Minkovsky 4", ""}, - {TEX_MINKOVSKY, "MINKOVSKY", 0, "Minkovsky", ""}, + {TEX_DISTANCE, "DISTANCE", 0, "Actual Distance", "Algorithm used to calculate distance of sample points to feature points. Actual Distance: sqrt(x*x+y*y+z*z)"}, + {TEX_DISTANCE_SQUARED, "DISTANCE_SQUARED", 0, "Distance Squared", "Algorithm used to calculate distance of sample points to feature points. Distance squared: (x*x+y*y+z*z)"}, + {TEX_MANHATTAN, "MANHATTAN", 0, "Manhattan", "Algorithm used to calculate distance of sample points to feature points. Manhattan: The length of the distance in axial directions"}, + {TEX_CHEBYCHEV, "CHEBYCHEV", 0, "Chebychev", "Algorithm used to calculate distance of sample points to feature points. Chebychev: The length of the longest Axial journey"}, + {TEX_MINKOVSKY_HALF, "MINKOVSKY_HALF", 0, "Minkovsky 1/2", "Algorithm used to calculate distance of sample points to feature points. Minovsky 1/2: Sets Minkovsky variable to 0.5"}, + {TEX_MINKOVSKY_FOUR, "MINKOVSKY_FOUR", 0, "Minkovsky 4", "Algorithm used to calculate distance of sample points to feature points. Minkovsky 4: Sets Minkovsky variable to 4"}, + {TEX_MINKOVSKY, "MINKOVSKY", 0, "Minkovsky", "Algorithm used to calculate distance of sample points to feature points. Minkovsky: Uses the Minkowsky function to calculate distance. Exponent value determines the shape of the boundaries"}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem prop_coloring_items[] = { @@ -1340,7 +1340,7 @@ static void rna_def_texture_voronoi(BlenderRNA *brna) prop= RNA_def_property(srna, "noise_intensity", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "ns_outscale"); RNA_def_property_range(prop, 0.01, 10); - RNA_def_property_ui_text(prop, "Noise Intensity", ""); + RNA_def_property_ui_text(prop, "Noise Intensity", "Scales the intensity of the noise"); RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "noise_scale", PROP_FLOAT, PROP_NONE); @@ -1369,7 +1369,7 @@ static void rna_def_texture_distorted_noise(BlenderRNA *brna) prop= RNA_def_property(srna, "distortion", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "dist_amount"); RNA_def_property_range(prop, 0, 10); - RNA_def_property_ui_text(prop, "Distortion Amount", ""); + RNA_def_property_ui_text(prop, "Distortion Amount", "Amount of distortion"); RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "noise_scale", PROP_FLOAT, PROP_NONE); @@ -1550,7 +1550,6 @@ static void rna_def_texture_pointdensity(BlenderRNA *brna) prop= RNA_def_property(srna, "turbulence_strength", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "noise_fac"); RNA_def_property_range(prop, 0.01, FLT_MAX); - RNA_def_property_ui_text(prop, "Strength", ""); RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "turbulence_depth", PROP_INT, PROP_NONE); @@ -1737,17 +1736,17 @@ static void rna_def_texture(BlenderRNA *brna) prop= RNA_def_property(srna, "intensity", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "bright"); RNA_def_property_range(prop, 0, 2); - RNA_def_property_ui_text(prop, "Brightness", ""); + RNA_def_property_ui_text(prop, "Brightness", "Adjusts the brightness of the texture"); RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "contrast", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.01, 5); - RNA_def_property_ui_text(prop, "Contrast", ""); + RNA_def_property_ui_text(prop, "Contrast", "Adjusts the contrast of the texture"); RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "saturation", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0, 2); - RNA_def_property_ui_text(prop, "Saturation", ""); + RNA_def_property_ui_text(prop, "Saturation", "Adjusts the saturation of colors in the texture"); RNA_def_property_update(prop, 0, "rna_Texture_update"); /* RGB Factor */ diff --git a/source/blender/makesrna/intern/rna_ui.c b/source/blender/makesrna/intern/rna_ui.c index d48c1d35c13..13c7ac238a3 100644 --- a/source/blender/makesrna/intern/rna_ui.c +++ b/source/blender/makesrna/intern/rna_ui.c @@ -148,7 +148,7 @@ static void panel_draw_header(const bContext *C, Panel *pnl) RNA_parameter_list_free(&list); } -static void rna_Panel_unregister(const bContext *C, StructRNA *type) +static void rna_Panel_unregister(Main *bmain, StructRNA *type) { ARegionType *art; PanelType *pt= RNA_struct_blender_type_get(type); @@ -164,11 +164,10 @@ static void rna_Panel_unregister(const bContext *C, StructRNA *type) RNA_struct_free(&BLENDER_RNA, type); /* update while blender is running */ - if(C) - WM_main_add_notifier(NC_SCREEN|NA_EDITED, NULL); + WM_main_add_notifier(NC_SCREEN|NA_EDITED, NULL); } -static StructRNA *rna_Panel_register(bContext *C, ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free) +static StructRNA *rna_Panel_register(Main *bmain, ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free) { ARegionType *art; PanelType *pt, dummypt = {NULL}; @@ -196,7 +195,7 @@ static StructRNA *rna_Panel_register(bContext *C, ReportList *reports, void *dat for(pt=art->paneltypes.first; pt; pt=pt->next) { if(strcmp(pt->idname, dummypt.idname) == 0) { if(pt->ext.srna) - rna_Panel_unregister(C, pt->ext.srna); + rna_Panel_unregister(bmain, pt->ext.srna); else BLI_freelinkN(&art->paneltypes, pt); break; @@ -233,8 +232,7 @@ static StructRNA *rna_Panel_register(bContext *C, ReportList *reports, void *dat BLI_addtail(&art->paneltypes, pt); /* update while blender is running */ - if(C) - WM_main_add_notifier(NC_SCREEN|NA_EDITED, NULL); + WM_main_add_notifier(NC_SCREEN|NA_EDITED, NULL); return pt->ext.srna; } @@ -263,7 +261,7 @@ static void header_draw(const bContext *C, Header *hdr) RNA_parameter_list_free(&list); } -static void rna_Header_unregister(const bContext *C, StructRNA *type) +static void rna_Header_unregister(Main *bmain, StructRNA *type) { ARegionType *art; HeaderType *ht= RNA_struct_blender_type_get(type); @@ -279,11 +277,10 @@ static void rna_Header_unregister(const bContext *C, StructRNA *type) RNA_struct_free(&BLENDER_RNA, type); /* update while blender is running */ - if(C) - WM_main_add_notifier(NC_SCREEN|NA_EDITED, NULL); + WM_main_add_notifier(NC_SCREEN|NA_EDITED, NULL); } -static StructRNA *rna_Header_register(bContext *C, ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free) +static StructRNA *rna_Header_register(Main *bmain, ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free) { ARegionType *art; HeaderType *ht, dummyht = {NULL}; @@ -311,7 +308,7 @@ static StructRNA *rna_Header_register(bContext *C, ReportList *reports, void *da for(ht=art->headertypes.first; ht; ht=ht->next) { if(strcmp(ht->idname, dummyht.idname) == 0) { if(ht->ext.srna) - rna_Header_unregister(C, ht->ext.srna); + rna_Header_unregister(bmain, ht->ext.srna); break; } } @@ -331,8 +328,7 @@ static StructRNA *rna_Header_register(bContext *C, ReportList *reports, void *da BLI_addtail(&art->headertypes, ht); /* update while blender is running */ - if(C) - WM_main_add_notifier(NC_SCREEN|NA_EDITED, NULL); + WM_main_add_notifier(NC_SCREEN|NA_EDITED, NULL); return ht->ext.srna; } @@ -384,7 +380,7 @@ static void menu_draw(const bContext *C, Menu *hdr) RNA_parameter_list_free(&list); } -static void rna_Menu_unregister(const bContext *C, StructRNA *type) +static void rna_Menu_unregister(Main *bmain, StructRNA *type) { MenuType *mt= RNA_struct_blender_type_get(type); @@ -398,11 +394,10 @@ static void rna_Menu_unregister(const bContext *C, StructRNA *type) RNA_struct_free(&BLENDER_RNA, type); /* update while blender is running */ - if(C) - WM_main_add_notifier(NC_SCREEN|NA_EDITED, NULL); + WM_main_add_notifier(NC_SCREEN|NA_EDITED, NULL); } -static StructRNA *rna_Menu_register(bContext *C, ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free) +static StructRNA *rna_Menu_register(Main *bmain, ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free) { MenuType *mt, dummymt = {NULL}; Menu dummymenu= {NULL}; @@ -425,7 +420,7 @@ static StructRNA *rna_Menu_register(bContext *C, ReportList *reports, void *data /* check if we have registered this menu type before, and remove it */ mt= WM_menutype_find(dummymt.idname, TRUE); if(mt && mt->ext.srna) - rna_Menu_unregister(C, mt->ext.srna); + rna_Menu_unregister(bmain, mt->ext.srna); /* create a new menu type */ mt= MEM_callocN(sizeof(MenuType), "python buttons menu"); @@ -444,8 +439,7 @@ static StructRNA *rna_Menu_register(bContext *C, ReportList *reports, void *data WM_menutype_add(mt); /* update while blender is running */ - if(C) - WM_main_add_notifier(NC_SCREEN|NA_EDITED, NULL); + WM_main_add_notifier(NC_SCREEN|NA_EDITED, NULL); return mt->ext.srna; } @@ -617,12 +611,12 @@ static void rna_def_panel(BlenderRNA *brna) RNA_def_struct_ui_text(srna, "Panel", "Panel containing UI elements"); RNA_def_struct_sdna(srna, "Panel"); RNA_def_struct_refine_func(srna, "rna_Panel_refine"); - RNA_def_struct_register_funcs(srna, "rna_Panel_register", "rna_Panel_unregister"); + RNA_def_struct_register_funcs(srna, "rna_Panel_register", "rna_Panel_unregister", NULL); /* poll */ func= RNA_def_function(srna, "poll", NULL); RNA_def_function_ui_description(func, "If this method returns a non-null output, then the panel can be drawn."); - RNA_def_function_flag(func, FUNC_NO_SELF|FUNC_REGISTER|FUNC_REGISTER_OPTIONAL); + RNA_def_function_flag(func, FUNC_NO_SELF|FUNC_REGISTER_OPTIONAL); RNA_def_function_return(func, RNA_def_boolean(func, "visible", 1, "", "")); parm= RNA_def_pointer(func, "context", "Context", "", ""); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); @@ -694,7 +688,7 @@ static void rna_def_header(BlenderRNA *brna) RNA_def_struct_ui_text(srna, "Header", "Editor header containing UI elements."); RNA_def_struct_sdna(srna, "Header"); RNA_def_struct_refine_func(srna, "rna_Header_refine"); - RNA_def_struct_register_funcs(srna, "rna_Header_register", "rna_Header_unregister"); + RNA_def_struct_register_funcs(srna, "rna_Header_register", "rna_Header_unregister", NULL); /* draw */ func= RNA_def_function(srna, "draw", NULL); @@ -736,12 +730,12 @@ static void rna_def_menu(BlenderRNA *brna) RNA_def_struct_ui_text(srna, "Menu", "Editor menu containing buttons"); RNA_def_struct_sdna(srna, "Menu"); RNA_def_struct_refine_func(srna, "rna_Menu_refine"); - RNA_def_struct_register_funcs(srna, "rna_Menu_register", "rna_Menu_unregister"); + RNA_def_struct_register_funcs(srna, "rna_Menu_register", "rna_Menu_unregister", NULL); /* poll */ func= RNA_def_function(srna, "poll", NULL); RNA_def_function_ui_description(func, "If this method returns a non-null output, then the menu can be drawn."); - RNA_def_function_flag(func, FUNC_NO_SELF|FUNC_REGISTER|FUNC_REGISTER_OPTIONAL); + RNA_def_function_flag(func, FUNC_NO_SELF|FUNC_REGISTER_OPTIONAL); RNA_def_function_return(func, RNA_def_boolean(func, "visible", 1, "", "")); parm= RNA_def_pointer(func, "context", "Context", "", ""); RNA_def_property_flag(parm, PROP_REQUIRED); diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c index ae308b9423f..d4ac9880290 100644 --- a/source/blender/makesrna/intern/rna_ui_api.c +++ b/source/blender/makesrna/intern/rna_ui_api.c @@ -389,7 +389,7 @@ void RNA_api_ui_layout(StructRNA *srna) RNA_def_function_flag(func, FUNC_USE_CONTEXT); api_ui_item_rna_common(func); parm= RNA_def_pointer(func, "image_user", "ImageUser", "", ""); - RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR); + RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL); RNA_def_boolean(func, "compact", 0, "", "Use more compact layout."); func= RNA_def_function(srna, "template_list", "uiTemplateList"); diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c index 4c79c27e0de..e8b127b68bb 100644 --- a/source/blender/makesrna/intern/rna_wm.c +++ b/source/blender/makesrna/intern/rna_wm.c @@ -669,19 +669,20 @@ static void rna_wmClipboard_set(PointerRNA *ptr, const char *value) } #ifdef WITH_PYTHON -static void rna_Operator_unregister(const bContext *C, StructRNA *type) +static void rna_Operator_unregister(struct Main *bmain, StructRNA *type) { const char *idname; wmOperatorType *ot= RNA_struct_blender_type_get(type); + wmWindowManager *wm; if(!ot) return; /* update while blender is running */ - if(C) { - WM_operator_stack_clear((bContext*)C); - WM_main_add_notifier(NC_SCREEN|NA_EDITED, NULL); - } + wm= bmain->wm.first; + if(wm) + WM_operator_stack_clear(wm); + WM_main_add_notifier(NC_SCREEN|NA_EDITED, NULL); RNA_struct_free_extension(type, &ot->ext); @@ -858,7 +859,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 StructRNA *rna_Operator_register(bContext *C, ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free) +static StructRNA *rna_Operator_register(Main *bmain, ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free) { wmOperatorType dummyot = {NULL}; wmOperator dummyop= {NULL}; @@ -935,7 +936,7 @@ static StructRNA *rna_Operator_register(bContext *C, ReportList *reports, void * { wmOperatorType *ot= WM_operatortype_find(dummyot.idname, TRUE); if(ot && ot->ext.srna) - rna_Operator_unregister(C, ot->ext.srna); + rna_Operator_unregister(bmain, ot->ext.srna); } /* create a new menu type */ @@ -955,14 +956,18 @@ static StructRNA *rna_Operator_register(bContext *C, ReportList *reports, void * WM_operatortype_append_ptr(operator_wrapper, (void *)&dummyot); /* update while blender is running */ - if(C) - WM_main_add_notifier(NC_SCREEN|NA_EDITED, NULL); + WM_main_add_notifier(NC_SCREEN|NA_EDITED, NULL); return dummyot.ext.srna; } +void **rna_Operator_instance(PointerRNA *ptr) +{ + wmOperator *op = ptr->data; + return &op->py_instance; +} -static StructRNA *rna_MacroOperator_register(bContext *C, ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free) +static StructRNA *rna_MacroOperator_register(Main *bmain, ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free) { wmOperatorType dummyot = {NULL}; wmOperator dummyop= {NULL}; @@ -1006,7 +1011,7 @@ static StructRNA *rna_MacroOperator_register(bContext *C, ReportList *reports, v { wmOperatorType *ot= WM_operatortype_find(dummyot.idname, TRUE); if(ot && ot->ext.srna) - rna_Operator_unregister(C, ot->ext.srna); + rna_Operator_unregister(bmain, ot->ext.srna); } /* create a new menu type */ @@ -1021,8 +1026,7 @@ static StructRNA *rna_MacroOperator_register(bContext *C, ReportList *reports, v WM_operatortype_append_macro_ptr(macro_wrapper, (void *)&dummyot); /* update while blender is running */ - if(C) - WM_main_add_notifier(NC_SCREEN|NA_EDITED, NULL); + WM_main_add_notifier(NC_SCREEN|NA_EDITED, NULL); return dummyot.ext.srna; } @@ -1161,7 +1165,7 @@ static void rna_def_operator(BlenderRNA *brna) RNA_def_struct_sdna(srna, "wmOperator"); RNA_def_struct_refine_func(srna, "rna_Operator_refine"); #ifdef WITH_PYTHON - RNA_def_struct_register_funcs(srna, "rna_Operator_register", "rna_Operator_unregister"); + RNA_def_struct_register_funcs(srna, "rna_Operator_register", "rna_Operator_unregister", "rna_Operator_instance"); #endif prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); @@ -1230,7 +1234,7 @@ static void rna_def_macro_operator(BlenderRNA *brna) RNA_def_struct_sdna(srna, "wmOperator"); RNA_def_struct_refine_func(srna, "rna_MacroOperator_refine"); #ifdef WITH_PYTHON - RNA_def_struct_register_funcs(srna, "rna_MacroOperator_register", "rna_Operator_unregister"); + RNA_def_struct_register_funcs(srna, "rna_MacroOperator_register", "rna_Operator_unregister", "rna_Operator_instance"); #endif prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_world.c b/source/blender/makesrna/intern/rna_world.c index 7166d51da5a..064f28df85d 100644 --- a/source/blender/makesrna/intern/rna_world.c +++ b/source/blender/makesrna/intern/rna_world.c @@ -223,7 +223,7 @@ static void rna_def_lighting(BlenderRNA *brna) {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem prop_sample_method_items[] = { - {WO_AOSAMP_CONSTANT, "CONSTANT_JITTERED", 0, "Constant Jittered", ""}, + {WO_AOSAMP_CONSTANT, "CONSTANT_JITTERED", 0, "Constant Jittered", "Fastest and gives the most noise"}, {WO_AOSAMP_HALTON, "ADAPTIVE_QMC", 0, "Adaptive QMC", "Fast in high-contrast areas"}, {WO_AOSAMP_HAMMERSLEY, "CONSTANT_QMC", 0, "Constant QMC", "Best quality"}, {0, NULL, 0, NULL, NULL}}; @@ -314,7 +314,7 @@ static void rna_def_lighting(BlenderRNA *brna) prop= RNA_def_property(srna, "falloff_strength", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "aodistfac"); - RNA_def_property_ui_text(prop, "Strength", "Distance attenuation factor, the higher, the less influence farther away objects have influence"); + RNA_def_property_ui_text(prop, "Strength", "Attenuation falloff strength, the higher, the less influence distant objects have"); RNA_def_property_update(prop, 0, "rna_World_update"); prop= RNA_def_property(srna, "bias", PROP_FLOAT, PROP_NONE); @@ -350,7 +350,7 @@ static void rna_def_lighting(BlenderRNA *brna) prop= RNA_def_property(srna, "use_falloff", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "aomode", WO_AODIST); - RNA_def_property_ui_text(prop, "Falloff", ""); + RNA_def_property_ui_text(prop, "Falloff", "Distance will be used to attenuate shadows"); RNA_def_property_update(prop, 0, "rna_World_update"); prop= RNA_def_property(srna, "use_cache", PROP_BOOLEAN, PROP_NONE); @@ -515,7 +515,7 @@ void RNA_def_world(BlenderRNA *brna) prop= RNA_def_property(srna, "ambient_color", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "ambr"); RNA_def_property_array(prop, 3); - RNA_def_property_ui_text(prop, "Ambient Color", ""); + RNA_def_property_ui_text(prop, "Ambient Color", "Ambient color of the world"); RNA_def_property_update(prop, 0, "rna_World_update"); /* exp, range */ |