diff options
author | Xiao Xiangquan <xiaoxiangquan@gmail.com> | 2011-09-01 19:08:32 +0400 |
---|---|---|
committer | Xiao Xiangquan <xiaoxiangquan@gmail.com> | 2011-09-01 19:08:32 +0400 |
commit | 981f7fcd0d315abb425bf34dd37f7cd4d9e8d55e (patch) | |
tree | 70800c93ec1a12579c32874e2a72eaf3290eba8e /source/blender/makesrna | |
parent | 5b91a783cf0ec132398a2767d3419d675e5126b5 (diff) | |
parent | 2365c64014b3e067bb212b2061f1d14c1f944090 (diff) |
merge with trunk r39834
Diffstat (limited to 'source/blender/makesrna')
40 files changed, 865 insertions, 245 deletions
diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index 9a818a6b7f3..92dbc42e91d 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -470,6 +470,7 @@ extern StructRNA RNA_SpaceTimeline; extern StructRNA RNA_SpaceUVEditor; extern StructRNA RNA_SpaceUserPreferences; extern StructRNA RNA_SpaceView3D; +extern StructRNA RNA_Speaker; extern StructRNA RNA_SpeedControlSequence; extern StructRNA RNA_Spline; extern StructRNA RNA_SplineIKConstraint; @@ -667,7 +668,7 @@ int RNA_property_flag(PropertyRNA *prop); void *RNA_property_py_data_get(PropertyRNA *prop); int RNA_property_array_length(PointerRNA *ptr, PropertyRNA *prop); -int RNA_property_array_check(PointerRNA *ptr, PropertyRNA *prop); +int RNA_property_array_check(PropertyRNA *prop); int RNA_property_multi_array_length(PointerRNA *ptr, PropertyRNA *prop, int dimension); int RNA_property_array_dimension(PointerRNA *ptr, PropertyRNA *prop, int length[]); char RNA_property_array_item_char(PropertyRNA *prop, int index); @@ -715,6 +716,10 @@ void RNA_property_update(struct bContext *C, PointerRNA *ptr, PropertyRNA *prop) void RNA_property_update_main(struct Main *bmain, struct Scene *scene, PointerRNA *ptr, PropertyRNA *prop); int RNA_property_update_check(struct PropertyRNA *prop); +void RNA_property_update_cache_add(PointerRNA *ptr, PropertyRNA *prop); +void RNA_property_update_cache_flush(struct Main *bmain, struct Scene *scene); +void RNA_property_update_cache_free(void); + /* Property Data */ int RNA_property_boolean_get(PointerRNA *ptr, PropertyRNA *prop); diff --git a/source/blender/makesrna/RNA_enum_types.h b/source/blender/makesrna/RNA_enum_types.h index fc415dc8082..0b63bb02436 100644 --- a/source/blender/makesrna/RNA_enum_types.h +++ b/source/blender/makesrna/RNA_enum_types.h @@ -54,10 +54,12 @@ extern EnumPropertyItem constraint_type_items[]; extern EnumPropertyItem boidrule_type_items[]; extern EnumPropertyItem image_type_items[]; +extern EnumPropertyItem image_color_mode_items[]; extern EnumPropertyItem beztriple_keyframe_type_items[]; extern EnumPropertyItem beztriple_handle_type_items[]; extern EnumPropertyItem beztriple_interpolation_mode_items[]; +extern EnumPropertyItem keyframe_handle_type_items[]; extern EnumPropertyItem keyingset_path_grouping_items[]; @@ -97,6 +99,8 @@ extern EnumPropertyItem wm_report_items[]; extern EnumPropertyItem transform_mode_types[]; +extern EnumPropertyItem posebone_rotmode_items[]; + extern EnumPropertyItem property_type_items[]; extern EnumPropertyItem property_unit_items[]; diff --git a/source/blender/makesrna/RNA_types.h b/source/blender/makesrna/RNA_types.h index ec213d6a496..f8199074f27 100644 --- a/source/blender/makesrna/RNA_types.h +++ b/source/blender/makesrna/RNA_types.h @@ -281,7 +281,7 @@ typedef struct ParameterList { typedef struct ParameterIterator { struct ParameterList *parms; - PointerRNA funcptr; + /* PointerRNA funcptr; */ /*UNUSED*/ void *data; int size, offset; diff --git a/source/blender/makesrna/SConscript b/source/blender/makesrna/SConscript index b706db5e64c..1cb24630fbe 100644 --- a/source/blender/makesrna/SConscript +++ b/source/blender/makesrna/SConscript @@ -54,7 +54,7 @@ if env['WITH_BF_PYTHON']: if env['WITH_BF_COLLADA']: defs.append('WITH_COLLADA') -if env['OURPLATFORM'] == 'linux2': +if env['OURPLATFORM'] == 'linux': cflags='-pthread' incs += ' ../../../extern/binreloc/include' diff --git a/source/blender/makesrna/intern/CMakeLists.txt b/source/blender/makesrna/intern/CMakeLists.txt index cb593e7deab..0307b5222d7 100644 --- a/source/blender/makesrna/intern/CMakeLists.txt +++ b/source/blender/makesrna/intern/CMakeLists.txt @@ -78,6 +78,7 @@ set(DEFSRC rna_smoke.c rna_sound.c rna_space.c + rna_speaker.c rna_test.c rna_text.c rna_texture.c @@ -100,6 +101,7 @@ set(APISRC rna_main_api.c rna_material_api.c rna_mesh_api.c + rna_texture_api.c rna_object_api.c rna_pose_api.c rna_scene_api.c @@ -243,6 +245,7 @@ blender_include_dirs_sys( add_executable(makesrna ${SRC} ${SRC_RNA_INC} ${SRC_DNA_INC}) target_link_libraries(makesrna bf_dna) +target_link_libraries(makesrna bf_dna_blenlib) # Output rna_*_gen.c # note (linux only): with crashes try add this after COMMAND: valgrind --leak-check=full --track-origins=yes diff --git a/source/blender/makesrna/intern/SConscript b/source/blender/makesrna/intern/SConscript index 5e43ed9b2fb..24c892b96c4 100644 --- a/source/blender/makesrna/intern/SConscript +++ b/source/blender/makesrna/intern/SConscript @@ -91,7 +91,7 @@ if env['WITH_BF_PYTHON']: if env['WITH_BF_COLLADA']: defs.append('WITH_COLLADA') -if env['OURPLATFORM'] == 'linux2': +if env['OURPLATFORM'] == 'linux': cflags='-pthread' incs += ' ../../../extern/binreloc/include' @@ -140,7 +140,7 @@ targetpath = root_build_dir+'/makesrna' if not (root_build_dir[0]==os.sep or root_build_dir[1]==':'): targetpath = '#' + targetpath -if env['OURPLATFORM'] == 'linux2' and root_build_dir[0]==os.sep: +if env['OURPLATFORM'] == 'linux' and root_build_dir[0]==os.sep: makesrna = makesrna_tool.Program (target = targetpath, source = source_files, LIBS=['bf_intern_guardedalloc', 'bf_dna', 'bf_blenlib']) else: makesrna = makesrna_tool.Program (target = targetpath, source = source_files, LIBS=['bf_intern_guardedalloc', 'bf_dna', 'bf_blenlib']) diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index 7da538e171b..bc30210bfbb 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -66,7 +66,7 @@ static int file_older(const char *file1, const char *file2) return (st1.st_mtime < st2.st_mtime); } -const char *makesrna_path= NULL; +static const char *makesrna_path= NULL; static int replace_if_different(char *tmpfile, const char *dep_files[]) { @@ -569,7 +569,7 @@ static char *rna_def_property_get_func(FILE *f, StructRNA *srna, PropertyRNA *pr if(prop->flag & PROP_DYNAMIC) fprintf(f, "void %s(PointerRNA *ptr, %s values[])\n", func, rna_type_type(prop)); else - fprintf(f, "void %s(PointerRNA *ptr, %s values[%d])\n", func, rna_type_type(prop), prop->totarraylength); + fprintf(f, "void %s(PointerRNA *ptr, %s values[%u])\n", func, rna_type_type(prop), prop->totarraylength); fprintf(f, "{\n"); if(manualfunc) { @@ -587,7 +587,7 @@ static char *rna_def_property_get_func(FILE *f, StructRNA *srna, PropertyRNA *pr } else { fprintf(f, " int i;\n\n"); - fprintf(f, " for(i=0; i<%d; i++) {\n", prop->totarraylength); + fprintf(f, " for(i=0; i<%u; i++) {\n", prop->totarraylength); } if(dp->dnaarraylength == 1) { @@ -783,7 +783,7 @@ static char *rna_def_property_set_func(FILE *f, StructRNA *srna, PropertyRNA *pr if(prop->flag & PROP_DYNAMIC) fprintf(f, "void %s(PointerRNA *ptr, const %s values[])\n", func, rna_type_type(prop)); else - fprintf(f, "void %s(PointerRNA *ptr, const %s values[%d])\n", func, rna_type_type(prop), prop->totarraylength); + fprintf(f, "void %s(PointerRNA *ptr, const %s values[%u])\n", func, rna_type_type(prop), prop->totarraylength); fprintf(f, "{\n"); if(manualfunc) { @@ -803,7 +803,7 @@ static char *rna_def_property_set_func(FILE *f, StructRNA *srna, PropertyRNA *pr else { fprintf(f, " int i;\n\n"); rna_clamp_value_range(f, prop); - fprintf(f, " for(i=0; i<%d; i++) {\n", prop->totarraylength); + fprintf(f, " for(i=0; i<%u; i++) {\n", prop->totarraylength); } if(dp->dnaarraylength == 1) { @@ -1324,7 +1324,7 @@ static void rna_def_property_funcs_header(FILE *f, StructRNA *srna, PropertyDefR //fprintf(f, "void %sset(PointerRNA *ptr, int value);\n", func); } else if(prop->arraydimension && prop->totarraylength) { - fprintf(f, "void %sget(PointerRNA *ptr, int values[%d]);\n", func, prop->totarraylength); + fprintf(f, "void %sget(PointerRNA *ptr, int values[%u]);\n", func, prop->totarraylength); //fprintf(f, "void %sset(PointerRNA *ptr, const int values[%d]);\n", func, prop->arraylength); } else { @@ -1339,7 +1339,7 @@ static void rna_def_property_funcs_header(FILE *f, StructRNA *srna, PropertyDefR //fprintf(f, "void %sset(PointerRNA *ptr, float value);\n", func); } else if(prop->arraydimension && prop->totarraylength) { - fprintf(f, "void %sget(PointerRNA *ptr, float values[%d]);\n", func, prop->totarraylength); + fprintf(f, "void %sget(PointerRNA *ptr, float values[%u]);\n", func, prop->totarraylength); //fprintf(f, "void %sset(PointerRNA *ptr, const float values[%d]);\n", func, prop->arraylength); } else { @@ -1420,21 +1420,21 @@ static void rna_def_property_funcs_header_cpp(FILE *f, StructRNA *srna, Property if(!prop->arraydimension) fprintf(f, "\tinline bool %s(void);", rna_safe_id(prop->identifier)); else - fprintf(f, "\tinline Array<int, %d> %s(void);", prop->totarraylength, rna_safe_id(prop->identifier)); + fprintf(f, "\tinline Array<int, %u> %s(void);", prop->totarraylength, rna_safe_id(prop->identifier)); break; } case PROP_INT: { if(!prop->arraydimension) fprintf(f, "\tinline int %s(void);", rna_safe_id(prop->identifier)); else - fprintf(f, "\tinline Array<int, %d> %s(void);", prop->totarraylength, rna_safe_id(prop->identifier)); + fprintf(f, "\tinline Array<int, %u> %s(void);", prop->totarraylength, rna_safe_id(prop->identifier)); break; } case PROP_FLOAT: { if(!prop->arraydimension) fprintf(f, "\tinline float %s(void);", rna_safe_id(prop->identifier)); else - fprintf(f, "\tinline Array<float, %d> %s(void);", prop->totarraylength, rna_safe_id(prop->identifier)); + fprintf(f, "\tinline Array<float, %u> %s(void);", prop->totarraylength, rna_safe_id(prop->identifier)); break; } case PROP_ENUM: { @@ -1495,21 +1495,21 @@ static void rna_def_property_funcs_impl_cpp(FILE *f, StructRNA *srna, PropertyDe if(!prop->arraydimension) 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, rna_safe_id(prop->identifier)); + fprintf(f, "\tBOOLEAN_ARRAY_PROPERTY(%s, %u, %s)", srna->identifier, prop->totarraylength, rna_safe_id(prop->identifier)); break; } case PROP_INT: { if(!prop->arraydimension) fprintf(f, "\tINT_PROPERTY(%s, %s)", srna->identifier, rna_safe_id(prop->identifier)); else - fprintf(f, "\tINT_ARRAY_PROPERTY(%s, %d, %s)", srna->identifier, prop->totarraylength, rna_safe_id(prop->identifier)); + fprintf(f, "\tINT_ARRAY_PROPERTY(%s, %u, %s)", srna->identifier, prop->totarraylength, rna_safe_id(prop->identifier)); break; } case PROP_FLOAT: { if(!prop->arraydimension) fprintf(f, "\tFLOAT_PROPERTY(%s, %s)", srna->identifier, rna_safe_id(prop->identifier)); else - fprintf(f, "\tFLOAT_ARRAY_PROPERTY(%s, %d, %s)", srna->identifier, prop->totarraylength, rna_safe_id(prop->identifier)); + fprintf(f, "\tFLOAT_ARRAY_PROPERTY(%s, %u, %s)", srna->identifier, prop->totarraylength, rna_safe_id(prop->identifier)); break; } case PROP_ENUM: { @@ -2028,7 +2028,7 @@ static void rna_generate_static_parameter_prototypes(BlenderRNA *brna, StructRNA fprintf(f, "int %s%s_len, ", pout ? "*" : "", dparm->prop->identifier); if(!(flag & PROP_DYNAMIC) && dparm->prop->arraydimension) - fprintf(f, "%s%s %s[%d]", rna_type_struct(dparm->prop), rna_parameter_type_name(dparm->prop), dparm->prop->identifier, dparm->prop->totarraylength); + fprintf(f, "%s%s %s[%u]", rna_type_struct(dparm->prop), rna_parameter_type_name(dparm->prop), dparm->prop->identifier, dparm->prop->totarraylength); else fprintf(f, "%s%s %s%s", rna_type_struct(dparm->prop), rna_parameter_type_name(dparm->prop), ptrstr, dparm->prop->identifier); @@ -2129,7 +2129,7 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr unsigned int i; if(prop->arraydimension && prop->totarraylength) { - fprintf(f, "static int rna_%s%s_%s_default[%d] = {\n\t", srna->identifier, strnest, prop->identifier, prop->totarraylength); + fprintf(f, "static int rna_%s%s_%s_default[%u] = {\n\t", srna->identifier, strnest, prop->identifier, prop->totarraylength); for(i=0; i<prop->totarraylength; i++) { if(bprop->defaultarray) @@ -2149,7 +2149,7 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr unsigned int i; if(prop->arraydimension && prop->totarraylength) { - fprintf(f, "static int rna_%s%s_%s_default[%d] = {\n\t", srna->identifier, strnest, prop->identifier, prop->totarraylength); + fprintf(f, "static int rna_%s%s_%s_default[%u] = {\n\t", srna->identifier, strnest, prop->identifier, prop->totarraylength); for(i=0; i<prop->totarraylength; i++) { if(iprop->defaultarray) @@ -2169,7 +2169,7 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr unsigned int i; if(prop->arraydimension && prop->totarraylength) { - fprintf(f, "static float rna_%s%s_%s_default[%d] = {\n\t", srna->identifier, strnest, prop->identifier, prop->totarraylength); + fprintf(f, "static float rna_%s%s_%s_default[%u] = {\n\t", srna->identifier, strnest, prop->identifier, prop->totarraylength); for(i=0; i<prop->totarraylength; i++) { if(fprop->defaultarray) @@ -2200,7 +2200,7 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr rna_print_c_string(f, prop->name); fprintf(f, ",\n\t"); rna_print_c_string(f, prop->description); fprintf(f, ",\n\t"); fprintf(f, "%d,\n", prop->icon); - fprintf(f, "\t%s, %s|%s, %s, %d, {%d, %d, %d}, %d,\n", RNA_property_typename(prop->type), rna_property_subtypename(prop->subtype), rna_property_subtype_unit(prop->subtype), rna_function_string(prop->getlength), prop->arraydimension, prop->arraylength[0], prop->arraylength[1], prop->arraylength[2], prop->totarraylength); + fprintf(f, "\t%s, %s|%s, %s, %u, {%u, %u, %u}, %u,\n", RNA_property_typename(prop->type), rna_property_subtypename(prop->subtype), rna_property_subtype_unit(prop->subtype), rna_function_string(prop->getlength), prop->arraydimension, prop->arraylength[0], prop->arraylength[1], prop->arraylength[2], prop->totarraylength); fprintf(f, "\t%s%s, %d, %s, %s,\n", (prop->flag & PROP_CONTEXT_UPDATE)? "(UpdateFunc)": "", rna_function_string(prop->update), prop->noteflag, rna_function_string(prop->editable), rna_function_string(prop->itemeditable)); if(prop->flag & PROP_RAW_ACCESS) rna_set_raw_offset(f, srna, prop); @@ -2417,7 +2417,7 @@ typedef struct RNAProcessItem { static RNAProcessItem PROCESS_ITEMS[]= { {"rna_rna.c", NULL, RNA_def_rna}, {"rna_ID.c", NULL, RNA_def_ID}, - {"rna_texture.c", NULL, RNA_def_texture}, + {"rna_texture.c", "rna_texture_api.c", RNA_def_texture}, {"rna_action.c", "rna_action_api.c", RNA_def_action}, {"rna_animation.c", "rna_animation_api.c", RNA_def_animation}, {"rna_animviz.c", NULL, RNA_def_animviz}, @@ -2461,6 +2461,7 @@ static RNAProcessItem PROCESS_ITEMS[]= { {"rna_sequencer.c", "rna_sequencer_api.c", RNA_def_sequencer}, {"rna_smoke.c", NULL, RNA_def_smoke}, {"rna_space.c", NULL, RNA_def_space}, + {"rna_speaker.c", NULL, RNA_def_speaker}, {"rna_test.c", NULL, RNA_def_test}, {"rna_text.c", NULL, RNA_def_text}, {"rna_timeline.c", NULL, RNA_def_timeline_marker}, diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c index f6a7d299025..e6a807fc261 100644 --- a/source/blender/makesrna/intern/rna_ID.c +++ b/source/blender/makesrna/intern/rna_ID.c @@ -69,6 +69,7 @@ EnumPropertyItem id_type_items[] = { {ID_PA, "PARTICLE", ICON_PARTICLE_DATA, N_("Particle"), ""}, {ID_SCE, "SCENE", ICON_SCENE_DATA, N_("Scene"), ""}, {ID_SCR, "SCREEN", ICON_SPLITSCREEN, N_("Screen"), ""}, + {ID_SPK, "SPEAKER", ICON_SPEAKER, N_("Speaker"), ""}, {ID_SO, "SOUND", ICON_PLAY_AUDIO, N_("Sound"), ""}, {ID_TXT, "TEXT", ICON_TEXT, N_("Text"), ""}, {ID_TE, "TEXTURE", ICON_TEXTURE_DATA, N_("Texture"), ""}, @@ -139,6 +140,7 @@ short RNA_type_to_ID_code(StructRNA *type) if(RNA_struct_is_a(type, &RNA_ParticleSettings)) return ID_PA; if(RNA_struct_is_a(type, &RNA_Scene)) return ID_SCE; if(RNA_struct_is_a(type, &RNA_Screen)) return ID_SCR; + if(RNA_struct_is_a(type, &RNA_Speaker)) return ID_SPK; if(RNA_struct_is_a(type, &RNA_Sound)) return ID_SO; if(RNA_struct_is_a(type, &RNA_Text)) return ID_TXT; if(RNA_struct_is_a(type, &RNA_Texture)) return ID_TE; @@ -172,6 +174,7 @@ StructRNA *ID_code_to_RNA_type(short idcode) case ID_PA: return &RNA_ParticleSettings; case ID_SCE: return &RNA_Scene; case ID_SCR: return &RNA_Screen; + case ID_SPK: return &RNA_Speaker; case ID_SO: return &RNA_Sound; case ID_TXT: return &RNA_Text; case ID_TE: return &RNA_Texture; diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index 0d7a34b17ff..27290929767 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -87,7 +87,9 @@ void RNA_init(void) void RNA_exit(void) { StructRNA *srna; - + + RNA_property_update_cache_free(); + for(srna=BLENDER_RNA.structs.first; srna; srna=srna->cont.next) { if(srna->cont.prophash) { BLI_ghash_free(srna->cont.prophash, NULL, NULL); @@ -398,7 +400,7 @@ static int rna_ensure_property_array_length(PointerRNA *ptr, PropertyRNA *prop) } } -static int rna_ensure_property_array_check(PointerRNA *UNUSED(ptr), PropertyRNA *prop) +static int rna_ensure_property_array_check(PropertyRNA *prop) { if(prop->magic == RNA_MAGIC) { return (prop->getlength || prop->totarraylength) ? 1:0; @@ -875,9 +877,9 @@ int RNA_property_array_length(PointerRNA *ptr, PropertyRNA *prop) return rna_ensure_property_array_length(ptr, prop); } -int RNA_property_array_check(PointerRNA *ptr, PropertyRNA *prop) +int RNA_property_array_check(PropertyRNA *prop) { - return rna_ensure_property_array_check(ptr, prop); + return rna_ensure_property_array_check(prop); } /* used by BPY to make an array from the python object */ @@ -1501,6 +1503,112 @@ void RNA_property_update_main(Main *bmain, Scene *scene, PointerRNA *ptr, Proper rna_property_update(NULL, bmain, scene, ptr, prop); } + +/* RNA Updates Cache ------------------------ */ +/* Overview of RNA Update cache system: + * + * RNA Update calls need to be cached in order to maintain reasonable performance + * of the animation system (i.e. maintaining a somewhat interactive framerate) + * while still allowing updates to be called (necessary in particular for modifier + * property updates to actually work). + * + * The cache is structured with a dual-layer structure + * - L1 = PointerRNA used as key; id.data is used (it should always be defined, + * and most updates end up using just that anyways) + * - L2 = Update functions to be called on those PointerRNA's + */ + +/* cache element */ +typedef struct tRnaUpdateCacheElem { + struct tRnaUpdateCacheElem *next, *prev; + + PointerRNA ptr; /* L1 key - id as primary, data secondary/ignored? */ + ListBase L2Funcs; /* L2 functions (LinkData<RnaUpdateFuncRef>) */ +} tRnaUpdateCacheElem; + +/* cache global (tRnaUpdateCacheElem's) - only accessible using these API calls */ +static ListBase rna_updates_cache = {NULL, NULL}; + +/* ........................... */ + +void RNA_property_update_cache_add(PointerRNA *ptr, PropertyRNA *prop) +{ + tRnaUpdateCacheElem *uce = NULL; + UpdateFunc fn = NULL; + LinkData *ld; + short is_rna = (prop->magic == RNA_MAGIC); + + /* sanity check */ + if (ELEM(NULL, ptr, prop)) + return; + + prop= rna_ensure_property(prop); + + /* we can only handle update calls with no context args for now (makes animsys updates easier) */ + if ((is_rna == 0) || (prop->update == NULL) || (prop->flag & PROP_CONTEXT_UPDATE)) + return; + fn = prop->update; + + /* find cache element for which key matches... */ + for (uce = rna_updates_cache.first; uce; uce = uce->next) { + /* just match by id only for now, since most update calls that we'll encounter only really care about this */ + // TODO: later, the cache might need to have some nesting on L1 to cope better with these problems + some tagging to indicate we need this + if (uce->ptr.id.data == ptr->id.data) + break; + } + if (uce == NULL) { + /* create new instance */ + uce = MEM_callocN(sizeof(tRnaUpdateCacheElem), "tRnaUpdateCacheElem"); + BLI_addtail(&rna_updates_cache, uce); + + /* copy pointer */ + RNA_pointer_create(ptr->id.data, ptr->type, ptr->data, &uce->ptr); + } + + /* check on the update func */ + for (ld = uce->L2Funcs.first; ld; ld = ld->next) { + /* stop on match - function already cached */ + if (fn == ld->data) + return; + } + /* else... if still here, we need to add it */ + BLI_addtail(&uce->L2Funcs, BLI_genericNodeN(fn)); +} + +void RNA_property_update_cache_flush(Main *bmain, Scene *scene) +{ + tRnaUpdateCacheElem *uce; + + // TODO: should we check that bmain and scene are valid? The above stuff doesn't! + + /* execute the cached updates */ + for (uce = rna_updates_cache.first; uce; uce = uce->next) { + LinkData *ld; + + for (ld = uce->L2Funcs.first; ld; ld = ld->next) { + UpdateFunc fn = (UpdateFunc)ld->data; + fn(bmain, scene, &uce->ptr); + } + } +} + +void RNA_property_update_cache_free(void) +{ + tRnaUpdateCacheElem *uce, *ucn; + + for (uce = rna_updates_cache.first; uce; uce = ucn) { + ucn = uce->next; + + /* free L2 cache */ + BLI_freelistN(&uce->L2Funcs); + + /* remove self */ + BLI_freelinkN(&rna_updates_cache, uce); + } +} + +/* ---------------------------------------------------------------------- */ + /* Property Data */ int RNA_property_boolean_get(PointerRNA *ptr, PropertyRNA *prop) @@ -1509,6 +1617,7 @@ int RNA_property_boolean_get(PointerRNA *ptr, PropertyRNA *prop) IDProperty *idprop; BLI_assert(RNA_property_type(prop) == PROP_BOOLEAN); + BLI_assert(RNA_property_array_check(prop) == 0); if((idprop=rna_idproperty_check(&prop, ptr))) return IDP_Int(idprop); @@ -1524,6 +1633,7 @@ void RNA_property_boolean_set(PointerRNA *ptr, PropertyRNA *prop, int value) IDProperty *idprop; BLI_assert(RNA_property_type(prop) == PROP_BOOLEAN); + BLI_assert(RNA_property_array_check(prop) == 0); /* just incase other values are passed */ if(value) value= 1; @@ -1550,6 +1660,7 @@ void RNA_property_boolean_get_array(PointerRNA *ptr, PropertyRNA *prop, int *val IDProperty *idprop; BLI_assert(RNA_property_type(prop) == PROP_BOOLEAN); + BLI_assert(RNA_property_array_check(prop) != 0); if((idprop=rna_idproperty_check(&prop, ptr))) { if(prop->arraydimension == 0) @@ -1573,6 +1684,7 @@ int RNA_property_boolean_get_index(PointerRNA *ptr, PropertyRNA *prop, int index int len= rna_ensure_property_array_length(ptr, prop); BLI_assert(RNA_property_type(prop) == PROP_BOOLEAN); + BLI_assert(RNA_property_array_check(prop) != 0); if(len <= RNA_MAX_ARRAY_LENGTH) { RNA_property_boolean_get_array(ptr, prop, tmp); @@ -1596,6 +1708,7 @@ void RNA_property_boolean_set_array(PointerRNA *ptr, PropertyRNA *prop, const in IDProperty *idprop; BLI_assert(RNA_property_type(prop) == PROP_BOOLEAN); + BLI_assert(RNA_property_array_check(prop) != 0); if((idprop=rna_idproperty_check(&prop, ptr))) { if(prop->arraydimension == 0) @@ -1629,6 +1742,7 @@ void RNA_property_boolean_set_index(PointerRNA *ptr, PropertyRNA *prop, int inde int len= rna_ensure_property_array_length(ptr, prop); BLI_assert(RNA_property_type(prop) == PROP_BOOLEAN); + BLI_assert(RNA_property_array_check(prop) != 0); if(len <= RNA_MAX_ARRAY_LENGTH) { RNA_property_boolean_get_array(ptr, prop, tmp); @@ -1651,6 +1765,7 @@ int RNA_property_boolean_get_default(PointerRNA *UNUSED(ptr), PropertyRNA *prop) BooleanPropertyRNA *bprop= (BooleanPropertyRNA*)prop; BLI_assert(RNA_property_type(prop) == PROP_BOOLEAN); + BLI_assert(RNA_property_array_check(prop) == 0); return bprop->defaultvalue; } @@ -1660,6 +1775,7 @@ void RNA_property_boolean_get_default_array(PointerRNA *UNUSED(ptr), PropertyRNA BooleanPropertyRNA *bprop= (BooleanPropertyRNA*)prop; BLI_assert(RNA_property_type(prop) == PROP_BOOLEAN); + BLI_assert(RNA_property_array_check(prop) != 0); if(prop->arraydimension == 0) values[0]= bprop->defaultvalue; @@ -1675,6 +1791,7 @@ int RNA_property_boolean_get_default_index(PointerRNA *ptr, PropertyRNA *prop, i int len= rna_ensure_property_array_length(ptr, prop); BLI_assert(RNA_property_type(prop) == PROP_BOOLEAN); + BLI_assert(RNA_property_array_check(prop) != 0); if(len <= RNA_MAX_ARRAY_LENGTH) { RNA_property_boolean_get_default_array(ptr, prop, tmp); @@ -1698,6 +1815,7 @@ int RNA_property_int_get(PointerRNA *ptr, PropertyRNA *prop) IDProperty *idprop; BLI_assert(RNA_property_type(prop) == PROP_INT); + BLI_assert(RNA_property_array_check(prop) == 0); if((idprop=rna_idproperty_check(&prop, ptr))) return IDP_Int(idprop); @@ -1713,6 +1831,7 @@ void RNA_property_int_set(PointerRNA *ptr, PropertyRNA *prop, int value) IDProperty *idprop; BLI_assert(RNA_property_type(prop) == PROP_INT); + BLI_assert(RNA_property_array_check(prop) == 0); /* useful to check on bad values but set function should clamp */ /* BLI_assert(RNA_property_int_clamp(ptr, prop, &value) == 0); */ @@ -1738,6 +1857,7 @@ void RNA_property_int_get_array(PointerRNA *ptr, PropertyRNA *prop, int *values) IDProperty *idprop; BLI_assert(RNA_property_type(prop) == PROP_INT); + BLI_assert(RNA_property_array_check(prop) != 0); if((idprop=rna_idproperty_check(&prop, ptr))) { if(prop->arraydimension == 0) @@ -1798,6 +1918,7 @@ int RNA_property_int_get_index(PointerRNA *ptr, PropertyRNA *prop, int index) int len= rna_ensure_property_array_length(ptr, prop); BLI_assert(RNA_property_type(prop) == PROP_INT); + BLI_assert(RNA_property_array_check(prop) != 0); if(len <= RNA_MAX_ARRAY_LENGTH) { RNA_property_int_get_array(ptr, prop, tmp); @@ -1821,6 +1942,7 @@ void RNA_property_int_set_array(PointerRNA *ptr, PropertyRNA *prop, const int *v IDProperty *idprop; BLI_assert(RNA_property_type(prop) == PROP_INT); + BLI_assert(RNA_property_array_check(prop) != 0); if((idprop=rna_idproperty_check(&prop, ptr))) { if(prop->arraydimension == 0) @@ -1854,6 +1976,7 @@ void RNA_property_int_set_index(PointerRNA *ptr, PropertyRNA *prop, int index, i int len= rna_ensure_property_array_length(ptr, prop); BLI_assert(RNA_property_type(prop) == PROP_INT); + BLI_assert(RNA_property_array_check(prop) != 0); if(len <= RNA_MAX_ARRAY_LENGTH) { RNA_property_int_get_array(ptr, prop, tmp); @@ -1882,6 +2005,7 @@ void RNA_property_int_get_default_array(PointerRNA *UNUSED(ptr), PropertyRNA *pr IntPropertyRNA *iprop= (IntPropertyRNA*)prop; BLI_assert(RNA_property_type(prop) == PROP_INT); + BLI_assert(RNA_property_array_check(prop) != 0); if(prop->arraydimension == 0) values[0]= iprop->defaultvalue; @@ -1918,6 +2042,7 @@ float RNA_property_float_get(PointerRNA *ptr, PropertyRNA *prop) IDProperty *idprop; BLI_assert(RNA_property_type(prop) == PROP_FLOAT); + BLI_assert(RNA_property_array_check(prop) == 0); if((idprop=rna_idproperty_check(&prop, ptr))) { if(idprop->type == IDP_FLOAT) @@ -1937,6 +2062,7 @@ void RNA_property_float_set(PointerRNA *ptr, PropertyRNA *prop, float value) IDProperty *idprop; BLI_assert(RNA_property_type(prop) == PROP_FLOAT); + BLI_assert(RNA_property_array_check(prop) == 0); /* useful to check on bad values but set function should clamp */ /* BLI_assert(RNA_property_float_clamp(ptr, prop, &value) == 0); */ @@ -1968,6 +2094,7 @@ void RNA_property_float_get_array(PointerRNA *ptr, PropertyRNA *prop, float *val int i; BLI_assert(RNA_property_type(prop) == PROP_FLOAT); + BLI_assert(RNA_property_array_check(prop) != 0); if((idprop=rna_idproperty_check(&prop, ptr))) { if(prop->arraydimension == 0) @@ -2033,6 +2160,7 @@ float RNA_property_float_get_index(PointerRNA *ptr, PropertyRNA *prop, int index int len= rna_ensure_property_array_length(ptr, prop); BLI_assert(RNA_property_type(prop) == PROP_FLOAT); + BLI_assert(RNA_property_array_check(prop) != 0); if(len <= RNA_MAX_ARRAY_LENGTH) { RNA_property_float_get_array(ptr, prop, tmp); @@ -2058,6 +2186,7 @@ void RNA_property_float_set_array(PointerRNA *ptr, PropertyRNA *prop, const floa int i; BLI_assert(RNA_property_type(prop) == PROP_FLOAT); + BLI_assert(RNA_property_array_check(prop) != 0); if((idprop=rna_idproperty_check(&prop, ptr))) { if(prop->arraydimension == 0) { @@ -2101,6 +2230,7 @@ void RNA_property_float_set_index(PointerRNA *ptr, PropertyRNA *prop, int index, int len= rna_ensure_property_array_length(ptr, prop); BLI_assert(RNA_property_type(prop) == PROP_FLOAT); + BLI_assert(RNA_property_array_check(prop) != 0); if(len <= RNA_MAX_ARRAY_LENGTH) { RNA_property_float_get_array(ptr, prop, tmp); @@ -2123,6 +2253,7 @@ float RNA_property_float_get_default(PointerRNA *UNUSED(ptr), PropertyRNA *prop) FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop; BLI_assert(RNA_property_type(prop) == PROP_FLOAT); + BLI_assert(RNA_property_array_check(prop) == 0); return fprop->defaultvalue; } @@ -2132,6 +2263,7 @@ void RNA_property_float_get_default_array(PointerRNA *UNUSED(ptr), PropertyRNA * FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop; BLI_assert(RNA_property_type(prop) == PROP_FLOAT); + BLI_assert(RNA_property_array_check(prop) != 0); if(prop->arraydimension == 0) values[0]= fprop->defaultvalue; @@ -2147,6 +2279,7 @@ float RNA_property_float_get_default_index(PointerRNA *ptr, PropertyRNA *prop, i int len= rna_ensure_property_array_length(ptr, prop); BLI_assert(RNA_property_type(prop) == PROP_FLOAT); + BLI_assert(RNA_property_array_check(prop) != 0); if(len <= RNA_MAX_ARRAY_LENGTH) { RNA_property_float_get_default_array(ptr, prop, tmp); @@ -2191,7 +2324,7 @@ char *RNA_property_string_get_alloc(PointerRNA *ptr, PropertyRNA *prop, char *fi if(length+1 < fixedlen) buf= fixedbuf; else - buf= MEM_callocN(sizeof(char)*(length+1), "RNA_string_get_alloc"); + buf= MEM_mallocN(sizeof(char)*(length+1), "RNA_string_get_alloc"); RNA_property_string_get(ptr, prop, buf); @@ -3302,7 +3435,7 @@ static char *rna_path_token(const char **path, char *fixedbuf, int fixedlen, int /* 2 kinds of lookups now, quoted or unquoted */ quote= *p; - if(quote != '"') + if(quote != '"') /* " - this comment is hack for Aligorith's text editor's sanity */ quote= 0; if(quote==0) { @@ -4356,11 +4489,18 @@ char *RNA_property_as_string(bContext *C, PointerRNA *ptr, PropertyRNA *prop) break; case PROP_STRING: { - /* string arrays dont exist */ + char *buf_esc; char *buf; - buf = RNA_property_string_get_alloc(ptr, prop, NULL, -1); - BLI_dynstr_appendf(dynstr, "\"%s\"", buf); + int length; + + length= RNA_property_string_length(ptr, prop); + buf= MEM_mallocN(sizeof(char)*(length+1), "RNA_property_as_string"); + buf_esc= MEM_mallocN(sizeof(char)*(length*2+1), "RNA_property_as_string esc"); + RNA_property_string_get(ptr, prop, buf); + BLI_strescape(buf_esc, buf, length*2); MEM_freeN(buf); + BLI_dynstr_appendf(dynstr, "\"%s\"", buf_esc); + MEM_freeN(buf_esc); break; } case PROP_ENUM: @@ -4594,7 +4734,8 @@ int RNA_parameter_list_ret_count(ParameterList *parms) void RNA_parameter_list_begin(ParameterList *parms, ParameterIterator *iter) { - RNA_pointer_create(NULL, &RNA_Function, parms->func, &iter->funcptr); + /* may be useful but unused now */ + /* RNA_pointer_create(NULL, &RNA_Function, parms->func, &iter->funcptr); */ /*UNUSED*/ iter->parms= parms; iter->parm= parms->func->cont.properties.first; diff --git a/source/blender/makesrna/intern/rna_action.c b/source/blender/makesrna/intern/rna_action.c index e958908db49..9b18a8be277 100644 --- a/source/blender/makesrna/intern/rna_action.c +++ b/source/blender/makesrna/intern/rna_action.c @@ -1,6 +1,4 @@ /* - * $Id$ - * * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or @@ -260,10 +258,18 @@ static void rna_def_dopesheet(BlenderRNA *brna) RNA_def_struct_ui_text(srna, N_("DopeSheet"), N_("Settings for filtering the channels shown in Animation Editors")); /* Source of DopeSheet data */ + // XXX: make this obsolete? prop= RNA_def_property(srna, "source", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "ID"); RNA_def_property_ui_text(prop, N_("Source"), N_("ID-Block representing source data, currently ID_SCE (for Dopesheet), and ID_SC (for Grease Pencil)")); + /* Show datablock filters */ + prop= RNA_def_property(srna, "show_datablock_filters", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", ADS_FLAG_SHOW_DBFILTERS); + RNA_def_property_ui_text(prop, "Show Datablock Filters", "Show options for whether channels related to certain types of data are included"); + RNA_def_property_ui_icon(prop, ICON_DISCLOSURE_TRI_RIGHT, -1); + RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN, NULL); + /* General Filtering Settings */ prop= RNA_def_property(srna, "show_only_selected", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "filterflag", ADS_FILTER_ONLYSEL); @@ -412,6 +418,12 @@ static void rna_def_dopesheet(BlenderRNA *brna) RNA_def_property_ui_text(prop, N_("Display Node"), N_("Include visualization of Node related Animation data")); RNA_def_property_ui_icon(prop, ICON_NODETREE, 0); RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL); + + prop= RNA_def_property(srna, "show_speakers", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOSPK); + RNA_def_property_ui_text(prop, "Display Speaker", "Include visualization of Speaker related Animation data"); + RNA_def_property_ui_icon(prop, ICON_SPEAKER, 0); + RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL); } static void rna_def_action_group(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_actuator.c b/source/blender/makesrna/intern/rna_actuator.c index cddba59f979..5eccba16c3d 100644 --- a/source/blender/makesrna/intern/rna_actuator.c +++ b/source/blender/makesrna/intern/rna_actuator.c @@ -49,7 +49,6 @@ EnumPropertyItem actuator_type_items[] ={ {ACT_CAMERA, "CAMERA", 0, "Camera", ""}, {ACT_CONSTRAINT, "CONSTRAINT", 0, "Constraint", ""}, {ACT_EDIT_OBJECT, "EDIT_OBJECT", 0, "Edit Object", ""}, - {ACT_IPO, "FCURVE", 0, "F-Curve", ""}, {ACT_2DFILTER, "FILTER_2D", 0, "Filter 2D", ""}, {ACT_GAME, "GAME", 0, "Game", ""}, {ACT_MESSAGE, "MESSAGE", 0, "Message", ""}, @@ -58,7 +57,6 @@ EnumPropertyItem actuator_type_items[] ={ {ACT_PROPERTY, "PROPERTY", 0, "Property", ""}, {ACT_RANDOM, "RANDOM", 0, "Random", ""}, {ACT_SCENE, "SCENE", 0, "Scene", ""}, - {ACT_SHAPEACTION, "SHAPE_ACTION", 0, "Shape Action", ""}, {ACT_SOUND, "SOUND", 0, "Sound", ""}, {ACT_STATE, "STATE", 0, "State", ""}, {ACT_VISIBILITY, "VISIBILITY", 0, "Visibility", ""}, @@ -77,8 +75,6 @@ static StructRNA* rna_Actuator_refine(struct PointerRNA *ptr) return &RNA_ActionActuator; case ACT_OBJECT: return &RNA_ObjectActuator; - case ACT_IPO: - return &RNA_FCurveActuator; case ACT_CAMERA: return &RNA_CameraActuator; case ACT_SOUND: @@ -103,8 +99,6 @@ static StructRNA* rna_Actuator_refine(struct PointerRNA *ptr) return &RNA_Filter2DActuator; case ACT_PARENT: return &RNA_ParentActuator; - case ACT_SHAPEACTION: - return &RNA_ShapeActionActuator; case ACT_STATE: return &RNA_StateActuator; case ACT_ARMATURE: @@ -353,6 +347,29 @@ static void rna_FcurveActuator_force_set(struct PointerRNA *ptr, int value) ia->flag &= ~ACT_IPOFORCE; } +static void rna_ActionActuator_add_set(struct PointerRNA *ptr, int value) +{ + bActuator *act = (bActuator *)ptr->data; + bActionActuator *aa = act->data; + + if(value == 1){ + aa->flag &= ~ACT_IPOFORCE; + aa->flag |= ACT_IPOADD; + }else + aa->flag &= ~ACT_IPOADD; +} + +static void rna_ActionActuator_force_set(struct PointerRNA *ptr, int value) +{ + bActuator *act = (bActuator *)ptr->data; + bActionActuator *aa = act->data; + + if(value == 1){ + aa->flag &= ~ACT_IPOADD; + aa->flag |= ACT_IPOFORCE; + }else + aa->flag &= ~ACT_IPOFORCE; +} static void rna_ObjectActuator_type_set(struct PointerRNA *ptr, int value) { @@ -426,15 +443,14 @@ EnumPropertyItem *rna_Actuator_type_itemf(bContext *C, PointerRNA *ptr, Property if (ob != NULL) { if (ob->type==OB_ARMATURE) { - RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_ACTION); RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_ARMATURE); } } - + + RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_ACTION); RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_CAMERA); RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_CONSTRAINT); RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_EDIT_OBJECT); - RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_IPO); RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_2DFILTER); RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_GAME); RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_MESSAGE); @@ -444,12 +460,6 @@ EnumPropertyItem *rna_Actuator_type_itemf(bContext *C, PointerRNA *ptr, Property RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_RANDOM); RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_SCENE); - if (ob != NULL) { - if (ob->type==OB_MESH){ - RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_SHAPEACTION); - } - } - RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_SOUND); RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_STATE); RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_VISIBILITY); @@ -616,11 +626,44 @@ static void rna_def_action_actuator(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Priority", "Execution priority - lower numbers will override actions with higher numbers. With 2 or more actions at once, the overriding channels must be lower in the stack"); RNA_def_property_update(prop, NC_LOGIC, NULL); + prop= RNA_def_property(srna, "layer", PROP_INT, PROP_NONE); + RNA_def_property_range(prop, 0, 7); /* This should match BL_ActionManager::MAX_ACTION_LAYERS - 1 */ + RNA_def_property_ui_text(prop, "Layer", "The animation layer to play the action on"); + RNA_def_property_update(prop, NC_LOGIC, NULL); + + prop= RNA_def_property(srna, "layer_weight", PROP_FLOAT, PROP_NONE); + RNA_def_property_range(prop, 0.0, 1.0); + RNA_def_property_ui_text(prop, "Layer Weight", "How much of the previous layer to blend into this one (0 = add mode)"); + RNA_def_property_update(prop, NC_LOGIC, NULL); + prop= RNA_def_property(srna, "frame_property", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "frameProp"); RNA_def_property_ui_text(prop, "Frame Property", "Assign the action's current frame number to this property"); RNA_def_property_update(prop, NC_LOGIC, NULL); + /* booleans */ + prop= RNA_def_property(srna, "use_additive", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_IPOADD); + RNA_def_property_boolean_funcs(prop, NULL, "rna_ActionActuator_add_set"); + RNA_def_property_ui_text(prop, "Add", "Action is added to the current loc/rot/scale in global or local coordinate according to Local flag"); + RNA_def_property_update(prop, NC_LOGIC, NULL); + + prop= RNA_def_property(srna, "use_force", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_IPOFORCE); + RNA_def_property_boolean_funcs(prop, NULL, "rna_ActionActuator_force_set"); + RNA_def_property_ui_text(prop, "Force", "Apply Action as a global or local force depending on the local option (dynamic objects only)"); + RNA_def_property_update(prop, NC_LOGIC, NULL); + + prop= RNA_def_property(srna, "use_local", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_IPOLOCAL); + RNA_def_property_ui_text(prop, "L", "Let the Action act in local coordinates, used in Force and Add mode"); + RNA_def_property_update(prop, NC_LOGIC, NULL); + + prop= RNA_def_property(srna, "apply_to_children", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_IPOCHILD); + RNA_def_property_ui_text(prop, "Child", "Update Action on all children Objects as well"); + RNA_def_property_update(prop, NC_LOGIC, NULL); + #ifdef __NLA_ACTION_BY_MOTION_ACTUATOR prop= RNA_def_property(srna, "stride_length", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "stridelength"); @@ -815,6 +858,7 @@ static void rna_def_object_actuator(BlenderRNA *brna) RNA_def_property_update(prop, NC_LOGIC, NULL); } +/* The fcurve actuator has been replace with the action actuator, so this is no longer used */ static void rna_def_fcurve_actuator(BlenderRNA *brna) { StructRNA *srna; @@ -1957,7 +2001,6 @@ void RNA_def_actuator(BlenderRNA *brna) rna_def_action_actuator(brna); rna_def_object_actuator(brna); - rna_def_fcurve_actuator(brna); rna_def_camera_actuator(brna); rna_def_sound_actuator(brna); rna_def_property_actuator(brna); diff --git a/source/blender/makesrna/intern/rna_animation.c b/source/blender/makesrna/intern/rna_animation.c index 7f817aa5b4b..0395a54be8e 100644 --- a/source/blender/makesrna/intern/rna_animation.c +++ b/source/blender/makesrna/intern/rna_animation.c @@ -1,6 +1,4 @@ /* - * $Id$ - * * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or @@ -74,36 +72,7 @@ static int rna_AnimData_action_editable(PointerRNA *ptr) static void rna_AnimData_action_set(PointerRNA *ptr, PointerRNA value) { ID *ownerId = (ID *)ptr->id.data; - AnimData *adt = (AnimData *)ptr->data; - - /* assume that AnimData's action can in fact be edited... */ - if ((value.data) && (ownerId)) { - bAction *act = (bAction *)value.data; - - /* action must have same type as owner */ - if (ownerId) { - if (ELEM(act->idroot, 0, GS(ownerId->name))) { - /* can set */ - adt->action = act; - } - else { - /* cannot set */ - printf("ERROR: Couldn't set Action '%s' onto ID '%s', as it doesn't have suitably rooted paths for this purpose\n", - act->id.name+2, ownerId->name); - } - } - else { - /* cannot tell if we can set, so let's just be generous... */ - printf("Warning: Set Action '%s' onto AnimData block with an unknown ID-owner. May have attached invalid data\n", - act->id.name+2); - - adt->action = act; - } - } - else { - /* just clearing the action... */ - adt->action = NULL; - } + BKE_animdata_set_action(NULL, ownerId, value.data); } /* ****************************** */ @@ -695,7 +664,7 @@ static void rna_def_keyingset(BlenderRNA *brna) /* Name */ prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_property_ui_text(prop, "Name", ""); - RNA_def_struct_ui_icon(srna, ICON_KEY_HLT); // TODO: we need a dedicated icon + RNA_def_struct_ui_icon(srna, ICON_KEYINGSET); RNA_def_struct_name_property(srna, prop); RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET|NA_RENAME, NULL); diff --git a/source/blender/makesrna/intern/rna_animation_api.c b/source/blender/makesrna/intern/rna_animation_api.c index 4f1a94d62c5..714a74ec424 100644 --- a/source/blender/makesrna/intern/rna_animation_api.c +++ b/source/blender/makesrna/intern/rna_animation_api.c @@ -1,6 +1,4 @@ /* - * $Id$ - * * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or @@ -41,16 +39,43 @@ #include "DNA_object_types.h" #include "DNA_scene_types.h" + #ifdef RNA_RUNTIME -#include "BKE_animsys.h" +#include "BKE_context.h" +#include "BKE_report.h" + +#include "ED_keyframing.h" + +static void rna_KeyingSet_context_refresh(KeyingSet *ks, bContext *C, ReportList *reports) +{ + // TODO: enable access to providing a list of overrides (dsources)? + int success = ANIM_validate_keyingset(C, NULL, ks); + + if (success != 0) { + switch (success) { + case MODIFYKEY_INVALID_CONTEXT: + BKE_report(reports, RPT_ERROR, "Invalid context for Keying Set"); + break; + + case MODIFYKEY_MISSING_TYPEINFO: + BKE_report(reports, RPT_ERROR, "Incomplete built-in Keying Set. Appears to be missing type info"); + break; + } + } +} #else void RNA_api_keyingset(StructRNA *srna) { -// FunctionRNA *func; -// PropertyRNA *parm; + FunctionRNA *func; + //PropertyRNA *parm; + + /* validate relative Keying Set (used to ensure paths are ok for context) */ + func= RNA_def_function(srna, "refresh", "rna_KeyingSet_context_refresh"); + RNA_def_function_ui_description(func, "Refresh Keying Set to ensure that it is valid for the current context. Call before each use of one"); + RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS); } #endif diff --git a/source/blender/makesrna/intern/rna_animviz.c b/source/blender/makesrna/intern/rna_animviz.c index 5e8c5692abe..e65b137e846 100644 --- a/source/blender/makesrna/intern/rna_animviz.c +++ b/source/blender/makesrna/intern/rna_animviz.c @@ -1,6 +1,4 @@ /* - * $Id$ - * * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or diff --git a/source/blender/makesrna/intern/rna_armature.c b/source/blender/makesrna/intern/rna_armature.c index 0310ce917d4..e2399b5b57c 100644 --- a/source/blender/makesrna/intern/rna_armature.c +++ b/source/blender/makesrna/intern/rna_armature.c @@ -1,6 +1,4 @@ /* - * $Id$ - * * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or @@ -816,6 +814,11 @@ static void rna_def_armature(BlenderRNA *brna) {ARM_LINE, "STICK", 0, "Stick", "Display bones as simple 2D lines with dots"}, {ARM_B_BONE, "BBONE", 0, "B-Bone", "Display bones as boxes, showing subdivision and B-Splines"}, {ARM_ENVELOPE, "ENVELOPE", 0, "Envelope", "Display bones as extruded spheres, showing deformation influence volume"}, + {ARM_WIRE, "WIRE", 0, "Wire", "Display bones as thin wires, showing subdivision and B-Splines"}, + {0, NULL, 0, NULL, NULL}}; + static EnumPropertyItem prop_vdeformer[] = { + {ARM_VDEF_BLENDER, "BLENDER", 0, "Blender", "Uses Blender's armature vertex deformation"}, + {ARM_VDEF_BGE_CPU, "BGE_CPU", 0, "BGE", "Uses vertex deformation code optimized for the BGE"}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem prop_ghost_type_items[] = { {ARM_GHOST_CUR, "CURRENT_FRAME", 0, "Around Frame", "Display Ghosts of poses within a fixed number of frames around the current frame"}, @@ -863,6 +866,13 @@ static void rna_def_armature(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Draw Type", ""); RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); RNA_def_property_flag(prop, PROP_LIB_EXCEPTION); + + prop= RNA_def_property(srna, "vert_deformer", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "gevertdeformer"); + RNA_def_property_enum_items(prop, prop_vdeformer); + RNA_def_property_ui_text(prop, "Vertex Deformer", ""); + RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); + RNA_def_property_flag(prop, PROP_LIB_EXCEPTION); // XXX depreceated ....... old animviz for armatures only prop= RNA_def_property(srna, "ghost_type", PROP_ENUM, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_cloth.c b/source/blender/makesrna/intern/rna_cloth.c index 1ce4108bab2..1b2396a4215 100644 --- a/source/blender/makesrna/intern/rna_cloth.c +++ b/source/blender/makesrna/intern/rna_cloth.c @@ -294,6 +294,7 @@ static void rna_def_cloth_sim_settings(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flags", CLOTH_SIMSETTINGS_FLAG_GOAL); RNA_def_property_ui_text(prop, "Pin Cloth", "Enable pinning of cloth vertices to other objects/positions"); RNA_def_property_update(prop, 0, "rna_cloth_pinning_changed"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); prop= RNA_def_property(srna, "pin_stiffness", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "goalspring"); @@ -313,6 +314,7 @@ static void rna_def_cloth_sim_settings(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flags", CLOTH_SIMSETTINGS_FLAG_SCALING); RNA_def_property_ui_text(prop, "Stiffness Scaling", "If enabled, stiffness can be scaled along a weight painted vertex group"); RNA_def_property_update(prop, 0, "rna_cloth_update"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); prop= RNA_def_property(srna, "spring_damping", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "Cdis"); diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c index bc1dede6445..47f7c754ff0 100644 --- a/source/blender/makesrna/intern/rna_constraint.c +++ b/source/blender/makesrna/intern/rna_constraint.c @@ -1,6 +1,4 @@ /* - * $Id$ - * * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or @@ -86,7 +84,7 @@ static EnumPropertyItem target_space_pchan_items[] = { 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"}, + {3, "LOCAL_WITH_PARENT", 0, "Local With Parent", "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}}; @@ -1035,6 +1033,12 @@ static void rna_def_constraint_locked_track(BlenderRNA *brna) srna= RNA_def_struct(brna, "LockedTrackConstraint", "Constraint"); RNA_def_struct_ui_text(srna, "Locked Track Constraint", "Points toward the target along the track axis, while locking the other axis"); + + prop= RNA_def_property(srna, "head_tail", PROP_FLOAT, PROP_FACTOR); + RNA_def_property_float_sdna(prop, "bConstraint", "headtail"); + RNA_def_property_ui_text(prop, "Head/Tail", "Target along length of bone: Head=0, Tail=1"); + RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_struct_sdna_from(srna, "bLockTrackConstraint", "data"); prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE); @@ -1379,7 +1383,7 @@ static void rna_def_constraint_clamp_to(BlenderRNA *brna) RNA_def_struct_sdna_from(srna, "bClampToConstraint", "data"); prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE); - RNA_def_property_pointer_sdna(prop, NULL, "tar"); // TODO: curve only for set function! + RNA_def_property_pointer_sdna(prop, NULL, "tar"); RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Curve_object_poll"); RNA_def_property_ui_text(prop, "Target", "Target Object"); RNA_def_property_flag(prop, PROP_EDITABLE); @@ -1772,6 +1776,12 @@ static void rna_def_constraint_distance_limit(BlenderRNA *brna) srna= RNA_def_struct(brna, "LimitDistanceConstraint", "Constraint"); RNA_def_struct_ui_text(srna, "Limit Distance Constraint", "Limits the distance from target object"); + + prop= RNA_def_property(srna, "head_tail", PROP_FLOAT, PROP_FACTOR); + RNA_def_property_float_sdna(prop, "bConstraint", "headtail"); + RNA_def_property_ui_text(prop, "Head/Tail", "Target along length of bone: Head=0, Tail=1"); + RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_struct_sdna_from(srna, "bDistLimitConstraint", "data"); prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE); @@ -1796,6 +1806,11 @@ static void rna_def_constraint_distance_limit(BlenderRNA *brna) RNA_def_property_enum_items(prop, constraint_distance_items); RNA_def_property_ui_text(prop, "Limit Mode", "Distances in relation to sphere of influence to allow"); RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + + prop= RNA_def_property(srna, "use_transform_limit", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMITDIST_TRANSFORM); + RNA_def_property_ui_text(prop, "For Transform", "Transforms are affected by this constraint as well"); + RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); } static void rna_def_constraint_shrinkwrap(BlenderRNA *brna) @@ -1864,6 +1879,12 @@ static void rna_def_constraint_damped_track(BlenderRNA *brna) srna= RNA_def_struct(brna, "DampedTrackConstraint", "Constraint"); RNA_def_struct_ui_text(srna, "Damped Track Constraint", "Points toward target by taking the shortest rotation path"); + + prop= RNA_def_property(srna, "head_tail", PROP_FLOAT, PROP_FACTOR); + RNA_def_property_float_sdna(prop, "bConstraint", "headtail"); + RNA_def_property_ui_text(prop, "Head/Tail", "Target along length of bone: Head=0, Tail=1"); + RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_struct_sdna_from(srna, "bDampTrackConstraint", "data"); prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c index a40caf87a7f..6930593ad04 100644 --- a/source/blender/makesrna/intern/rna_curve.c +++ b/source/blender/makesrna/intern/rna_curve.c @@ -49,9 +49,17 @@ EnumPropertyItem beztriple_handle_type_items[] = { {HD_FREE, "FREE", 0, N_("Free"), ""}, + {HD_VECT, "VECTOR", 0, N_("Vector"), ""}, + {HD_ALIGN, "ALIGNED", 0, N_("Aligned"), ""}, {HD_AUTO, "AUTO", 0, N_("Auto"), ""}, + {0, NULL, 0, NULL, NULL}}; + +EnumPropertyItem keyframe_handle_type_items[] = { + {HD_FREE, "FREE", 0, N_("Free"), ""}, {HD_VECT, "VECTOR", 0, N_("Vector"), ""}, {HD_ALIGN, "ALIGNED", 0, N_("Aligned"), ""}, + {HD_AUTO, "AUTO", 0, N_("Automatic"), ""}, + {HD_AUTO_ANIM, "AUTO_CLAMPED", 0, N_("Auto Clamped"), N_("Auto handles clamped to not overshoot")}, {0, NULL, 0, NULL, NULL}}; EnumPropertyItem beztriple_interpolation_mode_items[] = { diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c index 91b599a13d9..45d19a4dc46 100644 --- a/source/blender/makesrna/intern/rna_define.c +++ b/source/blender/makesrna/intern/rna_define.c @@ -1051,7 +1051,7 @@ void RNA_def_property_array(PropertyRNA *prop, int length) } if(prop->arraydimension > 1) { - fprintf(stderr, "RNA_def_property_array: \"%s.%s\", array dimensions has been set to %d but would be overwritten as 1.\n", srna->identifier, prop->identifier, prop->arraydimension); + fprintf(stderr, "RNA_def_property_array: \"%s.%s\", array dimensions has been set to %u but would be overwritten as 1.\n", srna->identifier, prop->identifier, prop->arraydimension); DefRNA.error= 1; return; } diff --git a/source/blender/makesrna/intern/rna_fcurve.c b/source/blender/makesrna/intern/rna_fcurve.c index be7fe72e320..33e76bc8131 100644 --- a/source/blender/makesrna/intern/rna_fcurve.c +++ b/source/blender/makesrna/intern/rna_fcurve.c @@ -1,6 +1,4 @@ /* - * $Id$ - * * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or @@ -141,6 +139,7 @@ static void rna_DriverTarget_update_data(Main *bmain, Scene *scene, PointerRNA * /* find the driver this belongs to and update it */ for (fcu=adt->drivers.first; fcu; fcu=fcu->next) { driver= fcu->driver; + fcu->flag &= ~FCURVE_DISABLED; if (driver) { // FIXME: need to be able to search targets for required one... @@ -456,6 +455,30 @@ static void rna_FModifier_active_set(PointerRNA *ptr, int UNUSED(value)) fm->flag |= FMODIFIER_FLAG_ACTIVE; } +static void rna_FModifier_start_frame_range(PointerRNA *ptr, float *min, float *max) +{ + FModifier *fcm= (FModifier*)ptr->data; + + *min= MINAFRAMEF; + *max= (fcm->flag & FMODIFIER_FLAG_RANGERESTRICT)? fcm->efra : MAXFRAMEF; +} + +static void rna_FModifier_end_frame_range(PointerRNA *ptr, float *min, float *max) +{ + FModifier *fcm= (FModifier*)ptr->data; + + *min= (fcm->flag & FMODIFIER_FLAG_RANGERESTRICT)? fcm->sfra : MINAFRAMEF; + *max= MAXFRAMEF; +} + +static void rna_FModifier_blending_range(PointerRNA *ptr, float *min, float *max) +{ + FModifier *fcm= (FModifier*)ptr->data; + + *min= 0.0f; + *max= fcm->efra - fcm->sfra; +} + static void rna_FModifier_active_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { FModifier *fm, *fmo= (FModifier*)ptr->data; @@ -573,15 +596,15 @@ static void rna_FKeyframe_points_add(FCurve *fcu, int tot) else { fcu->bezt= MEM_callocN(sizeof(BezTriple) * tot, "rna_FKeyframe_points_add"); } - + bezt= fcu->bezt + fcu->totvert; fcu->totvert += tot; - + while(tot--) { /* defaults, no userprefs gives pradictable results for API */ bezt->f1= bezt->f2= bezt->f3= SELECT; bezt->ipo= BEZT_IPO_BEZ; - bezt->h1= bezt->h2= HD_AUTO; + bezt->h1= bezt->h2= HD_AUTO_ANIM; bezt++; } } @@ -1017,6 +1040,51 @@ static void rna_def_fmodifier(BlenderRNA *brna) RNA_def_property_boolean_funcs(prop, NULL, "rna_FModifier_active_set"); RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, "rna_FModifier_active_update"); RNA_def_property_ui_icon(prop, ICON_RADIOBUT_OFF, 1); + + /* restricted range */ + prop= RNA_def_property(srna, "use_restricted_range", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", FMODIFIER_FLAG_RANGERESTRICT); + RNA_def_property_ui_text(prop, "Restrict Frame Range", "F-Curve Modifier is only applied for the specified frame range to help mask off effects in order to chain them"); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL); + RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1); // XXX: depends on UI implementation + + prop= RNA_def_property(srna, "frame_start", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "sfra"); + RNA_def_property_float_funcs(prop, NULL, NULL, "rna_FModifier_start_frame_range"); + RNA_def_property_ui_text(prop, "Start Frame", "Frame that modifier's influence starts (if Restrict Frame Range is in use)"); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL); + + prop= RNA_def_property(srna, "frame_end", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "efra"); + RNA_def_property_float_funcs(prop, NULL, NULL, "rna_FModifier_end_frame_range"); + RNA_def_property_ui_text(prop, "End Frame", "Frame that modifier's influence ends (if Restrict Frame Range is in use)"); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL); + + prop= RNA_def_property(srna, "blend_in", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "blendin"); + RNA_def_property_float_funcs(prop, NULL, NULL, "rna_FModifier_blending_range"); + RNA_def_property_ui_text(prop, "Blend In", "Number of frames from start frame for influence to take effect"); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL); + + prop= RNA_def_property(srna, "blend_out", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "blendout"); + RNA_def_property_float_funcs(prop, NULL, NULL, "rna_FModifier_blending_range"); + RNA_def_property_ui_text(prop, "Blend Out", "Number of frames from start frame for influence to fade out"); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL); + + /* influence */ + prop= RNA_def_property(srna, "use_influence", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", FMODIFIER_FLAG_USEINFLUENCE); + RNA_def_property_ui_text(prop, "Use Influence", "F-Curve Modifier's effects will be tempered by a default factor"); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL); + RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1); // XXX: depends on UI implementation + + prop= RNA_def_property(srna, "influence", PROP_FLOAT, PROP_FACTOR); + RNA_def_property_float_sdna(prop, NULL, "influence"); + RNA_def_property_range(prop, 0.0f, 1.0f); + RNA_def_property_float_default(prop, 1.0f); + RNA_def_property_ui_text(prop, "Influence", "Amount of influence F-Curve Modifier will have when not fading in/out"); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL); } /* *********************** */ @@ -1037,6 +1105,12 @@ static void rna_def_drivertarget(BlenderRNA *brna) {DTAR_TRANSCHAN_SCALEY, "SCALE_Y", 0, "Y Scale", ""}, {DTAR_TRANSCHAN_SCALEZ, "SCALE_Z", 0, "Z Scale", ""}, {0, NULL, 0, NULL, NULL}}; + + static EnumPropertyItem prop_local_space_items[] = { + {0, "WORLD_SPACE", 0, "World Space", "Transforms include effects of parenting/restpose and constraints"}, + {DTAR_FLAG_LOCALSPACE, "TRANSFORM_SPACE", 0, "Transform Space", "Transforms don't include parenting/restpose or constraints"}, + {DTAR_FLAG_LOCALSPACE|DTAR_FLAG_LOCAL_CONSTS, "LOCAL_SPACE", 0, "Local Space", "Transforms include effects of constraints but not parenting/restpose"}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "DriverTarget", NULL); RNA_def_struct_ui_text(srna, "Driver Target", "Source of input values for driver variables"); @@ -1077,9 +1151,10 @@ static void rna_def_drivertarget(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Type", "Driver variable type"); RNA_def_property_update(prop, 0, "rna_DriverTarget_update_data"); - prop= RNA_def_property(srna, "use_local_space_transform", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", DTAR_FLAG_LOCALSPACE); - RNA_def_property_ui_text(prop, "Local Space", "Use transforms in Local Space (as opposed to the worldspace default)"); + prop= RNA_def_property(srna, "transform_space", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); + RNA_def_property_enum_items(prop, prop_local_space_items); + RNA_def_property_ui_text(prop, "Transform Space", "Space in which transforms are used"); RNA_def_property_update(prop, 0, "rna_DriverTarget_update_data"); } @@ -1169,6 +1244,7 @@ static void rna_def_channeldriver(BlenderRNA *brna) srna= RNA_def_struct(brna, "Driver", NULL); RNA_def_struct_sdna(srna, "ChannelDriver"); RNA_def_struct_ui_text(srna, "Driver", "Driver for the value of a setting based on an external value"); + RNA_def_struct_ui_icon(srna, ICON_DRIVER); /* Enums */ prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); @@ -1244,12 +1320,12 @@ static void rna_def_fkeyframe(BlenderRNA *brna) /* Boolean values */ prop= RNA_def_property(srna, "select_left_handle", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "f1", 0); - RNA_def_property_ui_text(prop, "Handle 1 selected", "Handle 1 selection status"); + RNA_def_property_ui_text(prop, "Handle 1 selected", "Left handle selection status"); RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_SELECTED, NULL); prop= RNA_def_property(srna, "select_right_handle", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "f3", 0); - RNA_def_property_ui_text(prop, "Handle 2 selected", "Handle 2 selection status"); + RNA_def_property_ui_text(prop, "Handle 2 selected", "Right handle selection status"); RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_SELECTED, NULL); prop= RNA_def_property(srna, "select_control_point", PROP_BOOLEAN, PROP_NONE); @@ -1260,14 +1336,14 @@ static void rna_def_fkeyframe(BlenderRNA *brna) /* Enums */ prop= RNA_def_property(srna, "handle_left_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "h1"); - RNA_def_property_enum_items(prop, beztriple_handle_type_items); - RNA_def_property_ui_text(prop, "Handle 1 Type", "Handle types"); + RNA_def_property_enum_items(prop, keyframe_handle_type_items); + RNA_def_property_ui_text(prop, "Left Handle Type", "Handle types"); RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL); prop= RNA_def_property(srna, "handle_right_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "h2"); - RNA_def_property_enum_items(prop, beztriple_handle_type_items); - RNA_def_property_ui_text(prop, "Handle 2 Type", "Handle types"); + RNA_def_property_enum_items(prop, keyframe_handle_type_items); + RNA_def_property_ui_text(prop, "Right Handle Type", "Handle types"); RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL); prop= RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE); @@ -1279,14 +1355,14 @@ static void rna_def_fkeyframe(BlenderRNA *brna) prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "hide"); RNA_def_property_enum_items(prop, beztriple_keyframe_type_items); - RNA_def_property_ui_text(prop, "Type", "The type of keyframe"); + RNA_def_property_ui_text(prop, "Type", "The type of keyframe (for visual purposes only"); RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL); /* Vector values */ prop= RNA_def_property(srna, "handle_left", PROP_FLOAT, PROP_COORDS); /* keyframes are dimensionless */ RNA_def_property_array(prop, 2); RNA_def_property_float_funcs(prop, "rna_FKeyframe_handle1_get", "rna_FKeyframe_handle1_set", NULL); - RNA_def_property_ui_text(prop, "Handle 1", "Coordinates of the first handle"); + RNA_def_property_ui_text(prop, "Left Handle", "Coordinates of the left handle (before the control point)"); RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL); prop= RNA_def_property(srna, "co", PROP_FLOAT, PROP_COORDS); /* keyframes are dimensionless */ @@ -1298,7 +1374,7 @@ static void rna_def_fkeyframe(BlenderRNA *brna) prop= RNA_def_property(srna, "handle_right", PROP_FLOAT, PROP_COORDS); /* keyframes are dimensionless */ RNA_def_property_array(prop, 2); RNA_def_property_float_funcs(prop, "rna_FKeyframe_handle2_get", "rna_FKeyframe_handle2_set", NULL); - RNA_def_property_ui_text(prop, "Handle 2", "Coordinates of the second handle"); + RNA_def_property_ui_text(prop, "Right Handle", "Coordinates of the right handle (after the control point)"); RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL); } @@ -1465,11 +1541,6 @@ static void rna_def_fcurve(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Muted", "F-Curve is not evaluated"); RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL); - prop= RNA_def_property(srna, "use_auto_handle_clamp", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", FCURVE_AUTO_HANDLES); - RNA_def_property_ui_text(prop, "Auto Clamped Handles", "All auto-handles for F-Curve are clamped"); - RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL); - prop= RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", FCURVE_VISIBLE); RNA_def_property_ui_text(prop, "Hide", "F-Curve and its keyframes are hidden in the Graph Editor graphs"); diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c index 423b4e4f76b..9811d7bd797 100644 --- a/source/blender/makesrna/intern/rna_gpencil.c +++ b/source/blender/makesrna/intern/rna_gpencil.c @@ -1,6 +1,4 @@ /* - * $Id$ - * * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h index c0ae7b02b1a..9e98f166875 100644 --- a/source/blender/makesrna/intern/rna_internal.h +++ b/source/blender/makesrna/intern/rna_internal.h @@ -168,6 +168,7 @@ void RNA_def_sensor(struct BlenderRNA *brna); void RNA_def_sequencer(struct BlenderRNA *brna); void RNA_def_smoke(struct BlenderRNA *brna); void RNA_def_space(struct BlenderRNA *brna); +void RNA_def_speaker(struct BlenderRNA *brna); void RNA_def_test(struct BlenderRNA *brna); void RNA_def_text(struct BlenderRNA *brna); void RNA_def_texture(struct BlenderRNA *brna); @@ -260,6 +261,7 @@ void RNA_api_wm(struct StructRNA *srna); void RNA_api_sensor(struct StructRNA *srna); void RNA_api_controller(struct StructRNA *srna); void RNA_api_actuator(struct StructRNA *srna); +void RNA_api_environment_map(struct StructRNA *srna); /* main collection functions */ void RNA_def_main_cameras(BlenderRNA *brna, PropertyRNA *cprop); @@ -282,6 +284,7 @@ void RNA_def_main_brushes(BlenderRNA *brna, PropertyRNA *cprop); void RNA_def_main_worlds(BlenderRNA *brna, PropertyRNA *cprop); void RNA_def_main_groups(BlenderRNA *brna, PropertyRNA *cprop); void RNA_def_main_texts(BlenderRNA *brna, PropertyRNA *cprop); +void RNA_def_main_speakers(BlenderRNA *brna, PropertyRNA *cprop); void RNA_def_main_sounds(BlenderRNA *brna, PropertyRNA *cprop); void RNA_def_main_armatures(BlenderRNA *brna, PropertyRNA *cprop); void RNA_def_main_actions(BlenderRNA *brna, PropertyRNA *cprop); diff --git a/source/blender/makesrna/intern/rna_main.c b/source/blender/makesrna/intern/rna_main.c index bb13a3b1bf1..021aa9660ed 100644 --- a/source/blender/makesrna/intern/rna_main.c +++ b/source/blender/makesrna/intern/rna_main.c @@ -187,6 +187,12 @@ static void rna_Main_text_begin(CollectionPropertyIterator *iter, PointerRNA *pt rna_iterator_listbase_begin(iter, &bmain->text, NULL); } +static void rna_Main_speaker_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) +{ + Main *bmain= (Main*)ptr->data; + rna_iterator_listbase_begin(iter, &bmain->speaker, NULL); +} + static void rna_Main_sound_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Main *bmain= (Main*)ptr->data; @@ -297,6 +303,7 @@ void RNA_def_main(BlenderRNA *brna) {"shape_keys", "Key", "rna_Main_key_begin", "Shape Keys", "Shape Key datablocks.", NULL}, {"scripts", "ID", "rna_Main_script_begin", "Scripts", "Script datablocks (DEPRECATED).", NULL}, {"texts", "Text", "rna_Main_text_begin", "Texts", "Text datablocks.", RNA_def_main_texts}, + {"speakers", "Speaker", "rna_Main_speaker_begin", "Speakers", "Speaker datablocks.", RNA_def_main_speakers}, {"sounds", "Sound", "rna_Main_sound_begin", "Sounds", "Sound datablocks.", RNA_def_main_sounds}, {"armatures", "Armature", "rna_Main_armature_begin", "Armatures", "Armature datablocks.", RNA_def_main_armatures}, {"actions", "Action", "rna_Main_action_begin", "Actions", "Action datablocks.", RNA_def_main_actions}, diff --git a/source/blender/makesrna/intern/rna_main_api.c b/source/blender/makesrna/intern/rna_main_api.c index 8ac620c2fcf..d69cb2063ab 100644 --- a/source/blender/makesrna/intern/rna_main_api.c +++ b/source/blender/makesrna/intern/rna_main_api.c @@ -38,6 +38,7 @@ #include "RNA_define.h" #include "RNA_access.h" #include "RNA_enum_types.h" +#include "rna_internal.h" #include "BKE_utildefines.h" @@ -63,6 +64,7 @@ #include "BKE_particle.h" #include "BKE_font.h" #include "BKE_node.h" +#include "BKE_speaker.h" #include "DNA_armature_types.h" #include "DNA_camera_types.h" @@ -71,6 +73,7 @@ #include "DNA_material_types.h" #include "DNA_mesh_types.h" #include "DNA_object_types.h" +#include "DNA_speaker_types.h" #include "DNA_text_types.h" #include "DNA_texture_types.h" #include "DNA_group_types.h" @@ -147,6 +150,9 @@ Object *rna_Main_objects_new(Main *UNUSED(bmain), ReportList *reports, const cha case ID_LA: type= OB_LAMP; break; + case ID_SPK: + type= OB_SPEAKER; + break; case ID_CA: type= OB_CAMERA; break; @@ -406,6 +412,22 @@ void rna_Main_groups_remove(Main *bmain, Group *group) /* XXX python now has invalid pointer? */ } +Speaker *rna_Main_speakers_new(Main *UNUSED(bmain), const char *name) +{ + Speaker *speaker= add_speaker(name); + id_us_min(&speaker->id); + return speaker; +} +void rna_Main_speakers_remove(Main *bmain, ReportList *reports, Speaker *speaker) +{ + if(ID_REAL_USERS(speaker) <= 0) + free_libblock(&bmain->speaker, speaker); + else + BKE_reportf(reports, RPT_ERROR, "Speaker \"%s\" must have zero users to be removed, found %d.", speaker->id.name+2, ID_REAL_USERS(speaker)); + + /* XXX python now has invalid pointer? */ +} + Text *rna_Main_texts_new(Main *UNUSED(bmain), const char *name) { return add_empty_text(name); @@ -502,6 +524,7 @@ void rna_Main_groups_tag(Main *bmain, int value) { tag_main_lb(&bmain->group, va void rna_Main_shape_keys_tag(Main *bmain, int value) { tag_main_lb(&bmain->key, value); } void rna_Main_scripts_tag(Main *bmain, int value) { tag_main_lb(&bmain->script, value); } void rna_Main_texts_tag(Main *bmain, int value) { tag_main_lb(&bmain->text, value); } +void rna_Main_speakers_tag(Main *bmain, int value) { tag_main_lb(&bmain->speaker, value); } void rna_Main_sounds_tag(Main *bmain, int value) { tag_main_lb(&bmain->sound, value); } void rna_Main_armatures_tag(Main *bmain, int value) { tag_main_lb(&bmain->armature, value); } void rna_Main_actions_tag(Main *bmain, int value) { tag_main_lb(&bmain->action, value); } @@ -1076,6 +1099,37 @@ void RNA_def_main_groups(BlenderRNA *brna, PropertyRNA *cprop) parm= RNA_def_boolean(func, "value", 0, "Value", ""); RNA_def_property_flag(parm, PROP_REQUIRED); } + +void RNA_def_main_speakers(BlenderRNA *brna, PropertyRNA *cprop) +{ + StructRNA *srna; + FunctionRNA *func; + PropertyRNA *parm; + + RNA_def_property_srna(cprop, "BlendDataSpeakers"); + srna= RNA_def_struct(brna, "BlendDataSpeakers", NULL); + RNA_def_struct_sdna(srna, "Main"); + RNA_def_struct_ui_text(srna, "Main Speakers", "Collection of speakers"); + + func= RNA_def_function(srna, "new", "rna_Main_speakers_new"); + RNA_def_function_ui_description(func, "Add a new speaker to the main database"); + parm= RNA_def_string(func, "name", "Speaker", 0, "", "New name for the datablock."); + RNA_def_property_flag(parm, PROP_REQUIRED); + /* return type */ + parm= RNA_def_pointer(func, "speaker", "Speaker", "", "New speaker datablock."); + RNA_def_function_return(func, parm); + + func= RNA_def_function(srna, "remove", "rna_Main_speakers_remove"); + RNA_def_function_flag(func, FUNC_USE_REPORTS); + RNA_def_function_ui_description(func, "Remove a speaker from the current blendfile."); + parm= RNA_def_pointer(func, "speaker", "Speaker", "", "Speaker to remove."); + RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); + + func= RNA_def_function(srna, "tag", "rna_Main_speakers_tag"); + parm= RNA_def_boolean(func, "value", 0, "Value", ""); + RNA_def_property_flag(parm, PROP_REQUIRED); +} + void RNA_def_main_texts(BlenderRNA *brna, PropertyRNA *cprop) { StructRNA *srna; diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index af9e433cfad..28f2d76f7ed 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -32,6 +32,7 @@ #include <stdlib.h> #include "RNA_define.h" +#include "RNA_enum_types.h" #include "rna_internal.h" @@ -2266,6 +2267,13 @@ static void rna_def_modifier_solidify(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Thickness", "Thickness of the shell"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); + prop= RNA_def_property(srna, "thickness_vertex_group", PROP_FLOAT, PROP_FACTOR); + RNA_def_property_float_sdna(prop, NULL, "offset_fac_vg"); + RNA_def_property_range(prop, 0.0, 1.0); + RNA_def_property_ui_range(prop, 0, 1, 0.1, 3); + RNA_def_property_ui_text(prop, "Vertex Group Factor", "Thickness factor to use for zero vertex group influence"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); + prop= RNA_def_property(srna, "offset", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "offset_fac"); RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); diff --git a/source/blender/makesrna/intern/rna_nla.c b/source/blender/makesrna/intern/rna_nla.c index 71bff06a864..ef4adde6fb4 100644 --- a/source/blender/makesrna/intern/rna_nla.c +++ b/source/blender/makesrna/intern/rna_nla.c @@ -1,6 +1,4 @@ /* - * $Id$ - * * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or @@ -222,6 +220,29 @@ static void rna_NlaStrip_blend_out_set(PointerRNA *ptr, float value) data->blendout= value; } +static int rna_NlaStrip_action_editable(PointerRNA *ptr) +{ + NlaStrip *strip = (NlaStrip *)ptr->data; + + /* strip actions shouldn't be editable if NLA tweakmode is on */ + if (ptr->id.data) { + AnimData *adt = BKE_animdata_from_id(ptr->id.data); + + if (adt) { + /* active action is only editable when it is not a tweaking strip */ + if ((adt->flag & ADT_NLA_EDIT_ON) || (adt->actstrip) || (adt->tmpact)) + return 0; + } + } + + /* check for clues that strip probably shouldn't be used... */ + if (strip->flag & NLASTRIP_FLAG_TWEAKUSER) + return 0; + + /* should be ok, though we may still miss some cases */ + return 1; +} + static void rna_NlaStrip_action_start_frame_set(PointerRNA *ptr, float value) { NlaStrip *data= (NlaStrip*)ptr->data; @@ -357,6 +378,7 @@ static void rna_def_nlastrip(BlenderRNA *brna) {NLASTRIP_TYPE_CLIP, "CLIP", 0, "Action Clip", "NLA Strip references some Action"}, {NLASTRIP_TYPE_TRANSITION, "TRANSITION", 0, "Transition", "NLA Strip 'transitions' between adjacent strips"}, {NLASTRIP_TYPE_META, "META", 0, "Meta", "NLA Strip acts as a container for adjacent strips"}, + {NLASTRIP_TYPE_SOUND, "SOUND", 0, "Sound Clip", "NLA Strip representing a sound event for speakers"}, {0, NULL, 0, NULL, NULL}}; /* struct definition */ @@ -428,6 +450,7 @@ static void rna_def_nlastrip(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "act"); RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Action_id_poll"); RNA_def_property_flag(prop, PROP_EDITABLE); + RNA_def_property_editable_func(prop, "rna_NlaStrip_action_editable"); RNA_def_property_ui_text(prop, "Action", "Action referenced by this strip"); RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */ diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index 7fd6a9dacfe..56492a52da9 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -732,7 +732,7 @@ static StructRNA* def_node(BlenderRNA *brna, int node_id) return srna; } -void alloc_node_type_items(EnumPropertyItem *items, int category) +static void alloc_node_type_items(EnumPropertyItem *items, int category) { int i; int count = 3; diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index 10a728c077b..1ad5da1ae8e 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -116,6 +116,7 @@ EnumPropertyItem object_type_items[] = { {0, "", 0, NULL, NULL}, {OB_CAMERA, "CAMERA", 0, N_("Camera"), ""}, {OB_LAMP, "LAMP", 0, N_("Lamp"), ""}, + {OB_SPEAKER, "SPEAKER", 0, "Speaker", ""}, {0, NULL, 0, NULL, NULL}}; EnumPropertyItem object_type_curve_items[] = { @@ -366,6 +367,7 @@ static StructRNA *rna_Object_data_typef(PointerRNA *ptr) case OB_CAMERA: return &RNA_Camera; case OB_LATTICE: return &RNA_Lattice; case OB_ARMATURE: return &RNA_Armature; + case OB_SPEAKER: return &RNA_Speaker; default: return &RNA_ID; } } @@ -2026,7 +2028,14 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_ui_text(prop, N_("Input Matrix"), N_("Matrix access to location, rotation and scale (including deltas), before constraints and parenting are applied.")); RNA_def_property_float_funcs(prop, "rna_Object_matrix_basis_get", "rna_Object_matrix_basis_set", NULL); RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update"); - + + /*parent_inverse*/ + prop= RNA_def_property(srna, "matrix_parent_inverse", PROP_FLOAT, PROP_MATRIX); + RNA_def_property_float_sdna(prop, NULL, "parentinv"); + RNA_def_property_multi_array(prop, 2, rna_matrix_dimsize_4x4); + RNA_def_property_ui_text(prop, "Matrix", "Inverse of object's parent matrix at time of parenting"); + RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update"); + /* collections */ prop= RNA_def_property(srna, "constraints", PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_type(prop, "Constraint"); diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c index 9714b51a986..eb21e419083 100644 --- a/source/blender/makesrna/intern/rna_object_force.c +++ b/source/blender/makesrna/intern/rna_object_force.c @@ -45,7 +45,7 @@ #include "WM_api.h" #include "WM_types.h" -EnumPropertyItem effector_shape_items[] = { +static EnumPropertyItem effector_shape_items[] = { {PFIELD_SHAPE_POINT, "POINT", 0, "Point", ""}, {PFIELD_SHAPE_PLANE, "PLANE", 0, "Plane", ""}, {PFIELD_SHAPE_SURFACE, "SURFACE", 0, "Surface", ""}, @@ -53,20 +53,23 @@ EnumPropertyItem effector_shape_items[] = { {0, NULL, 0, NULL, NULL} }; -EnumPropertyItem curve_shape_items[] = { +#ifdef RNA_RUNTIME + +/* type spesific return values only used from functions */ +static EnumPropertyItem curve_shape_items[] = { {PFIELD_SHAPE_POINT, "POINT", 0, "Point", ""}, {PFIELD_SHAPE_PLANE, "PLANE", 0, "Plane", ""}, {PFIELD_SHAPE_SURFACE, "SURFACE", 0, "Curve", ""}, {0, NULL, 0, NULL, NULL} }; -EnumPropertyItem empty_shape_items[] = { +static EnumPropertyItem empty_shape_items[] = { {PFIELD_SHAPE_POINT, "POINT", 0, "Point", ""}, {PFIELD_SHAPE_PLANE, "PLANE", 0, "Plane", ""}, {0, NULL, 0, NULL, NULL} }; -EnumPropertyItem vortex_shape_items[] = { +static EnumPropertyItem vortex_shape_items[] = { {PFIELD_SHAPE_POINT, "POINT", 0, "Point", ""}, {PFIELD_SHAPE_PLANE, "PLANE", 0, "Plane", ""}, {PFIELD_SHAPE_SURFACE, "SURFACE", 0, "Surface falloff (New)", ""}, @@ -74,21 +77,19 @@ EnumPropertyItem vortex_shape_items[] = { {0, NULL, 0, NULL, NULL} }; -EnumPropertyItem curve_vortex_shape_items[] = { +static EnumPropertyItem curve_vortex_shape_items[] = { {PFIELD_SHAPE_POINT, "POINT", 0, "Point", ""}, {PFIELD_SHAPE_PLANE, "PLANE", 0, "Plane", ""}, {PFIELD_SHAPE_SURFACE, "SURFACE", 0, "Curve (New)", ""}, {0, NULL, 0, NULL, NULL} }; -EnumPropertyItem empty_vortex_shape_items[] = { +static EnumPropertyItem empty_vortex_shape_items[] = { {PFIELD_SHAPE_POINT, "POINT", 0, "Point", ""}, {PFIELD_SHAPE_PLANE, "PLANE", 0, "Plane", ""}, {0, NULL, 0, NULL, NULL} }; -#ifdef RNA_RUNTIME - #include "MEM_guardedalloc.h" #include "DNA_modifier_types.h" @@ -772,7 +773,6 @@ static void rna_def_pointcache(BlenderRNA *brna) prop= RNA_def_property(srna, "compression", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, point_cache_compress_items); RNA_def_property_ui_text(prop, "Cache Compression", "Compression method to be used"); - RNA_def_property_update(prop, 0, NULL); /* flags */ prop= RNA_def_property(srna, "is_baked", PROP_BOOLEAN, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c index c80e15b6210..be5b486f08c 100644 --- a/source/blender/makesrna/intern/rna_particle.c +++ b/source/blender/makesrna/intern/rna_particle.c @@ -33,6 +33,7 @@ #include "limits.h" #include "RNA_define.h" +#include "RNA_enum_types.h" #include "rna_internal.h" @@ -52,34 +53,34 @@ #include "WM_types.h" #include "WM_api.h" -EnumPropertyItem part_from_items[] = { +static EnumPropertyItem part_from_items[] = { {PART_FROM_VERT, "VERT", 0, "Verts", ""}, {PART_FROM_FACE, "FACE", 0, "Faces", ""}, {PART_FROM_VOLUME, "VOLUME", 0, "Volume", ""}, {0, NULL, 0, NULL, NULL} }; -EnumPropertyItem part_reactor_from_items[] = { +static EnumPropertyItem part_reactor_from_items[] = { {PART_FROM_VERT, "VERT", 0, "Verts", ""}, {PART_FROM_FACE, "FACE", 0, "Faces", ""}, {PART_FROM_VOLUME, "VOLUME", 0, "Volume", ""}, {0, NULL, 0, NULL, NULL} }; -EnumPropertyItem part_dist_items[] = { +static EnumPropertyItem part_dist_items[] = { {PART_DISTR_JIT, "JIT", 0, "Jittered", ""}, {PART_DISTR_RAND, "RAND", 0, "Random", ""}, {PART_DISTR_GRID, "GRID", 0, "Grid", ""}, {0, NULL, 0, NULL, NULL} }; -EnumPropertyItem part_hair_dist_items[] = { +static EnumPropertyItem part_hair_dist_items[] = { {PART_DISTR_JIT, "JIT", 0, "Jittered", ""}, {PART_DISTR_RAND, "RAND", 0, "Random", ""}, {0, NULL, 0, NULL, NULL} }; -EnumPropertyItem part_draw_as_items[] = { +static EnumPropertyItem part_draw_as_items[] = { {PART_DRAW_NOT, "NONE", 0, "None", ""}, {PART_DRAW_REND, "RENDER", 0, "Rendered", ""}, {PART_DRAW_DOT, "DOT", 0, "Point", ""}, @@ -89,14 +90,14 @@ EnumPropertyItem part_draw_as_items[] = { {0, NULL, 0, NULL, NULL} }; -EnumPropertyItem part_hair_draw_as_items[] = { +static EnumPropertyItem part_hair_draw_as_items[] = { {PART_DRAW_NOT, "NONE", 0, "None", ""}, {PART_DRAW_REND, "RENDER", 0, "Rendered", ""}, {PART_DRAW_PATH, "PATH", 0, "Path", ""}, {0, NULL, 0, NULL, NULL} }; -EnumPropertyItem part_ren_as_items[] = { +static EnumPropertyItem part_ren_as_items[] = { {PART_DRAW_NOT, "NONE", 0, "None", ""}, {PART_DRAW_HALO, "HALO", 0, "Halo", ""}, {PART_DRAW_LINE, "LINE", 0, "Line", ""}, @@ -107,7 +108,7 @@ EnumPropertyItem part_ren_as_items[] = { {0, NULL, 0, NULL, NULL} }; -EnumPropertyItem part_hair_ren_as_items[] = { +static EnumPropertyItem part_hair_ren_as_items[] = { {PART_DRAW_NOT, "NONE", 0, "None", ""}, {PART_DRAW_PATH, "PATH", 0, "Path", ""}, {PART_DRAW_OB, "OBJECT", 0, "Object", ""}, diff --git a/source/blender/makesrna/intern/rna_pose.c b/source/blender/makesrna/intern/rna_pose.c index 47c8435cc46..0dd8218d1b9 100644 --- a/source/blender/makesrna/intern/rna_pose.c +++ b/source/blender/makesrna/intern/rna_pose.c @@ -1,6 +1,4 @@ /* - * $Id$ - * * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or @@ -45,6 +43,20 @@ #include "WM_types.h" + + +// XXX: this RNA enum define is currently duplicated for objects, since there is some text here which is not applicable +EnumPropertyItem posebone_rotmode_items[] = { + {ROT_MODE_QUAT, "QUATERNION", 0, "Quaternion (WXYZ)", "No Gimbal Lock (default)"}, + {ROT_MODE_XYZ, "XYZ", 0, "XYZ Euler", "XYZ Rotation Order. Prone to Gimbal Lock"}, + {ROT_MODE_XZY, "XZY", 0, "XZY Euler", "XZY Rotation Order. Prone to Gimbal Lock"}, + {ROT_MODE_YXZ, "YXZ", 0, "YXZ Euler", "YXZ Rotation Order. Prone to Gimbal Lock"}, + {ROT_MODE_YZX, "YZX", 0, "YZX Euler", "YZX Rotation Order. Prone to Gimbal Lock"}, + {ROT_MODE_ZXY, "ZXY", 0, "ZXY Euler", "ZXY Rotation Order. Prone to Gimbal Lock"}, + {ROT_MODE_ZYX, "ZYX", 0, "ZYX Euler", "ZYX Rotation Order. Prone to Gimbal Lock"}, + {ROT_MODE_AXISANGLE, "AXIS_ANGLE", 0, "Axis Angle", "Axis Angle (W+XYZ). Defines a rotation around some axis defined by 3D-Vector"}, + {0, NULL, 0, NULL, NULL}}; + #ifdef RNA_RUNTIME #include "BIK_api.h" @@ -717,19 +729,7 @@ static void rna_def_pose_channel_constraints(BlenderRNA *brna, PropertyRNA *cpro } static void rna_def_pose_channel(BlenderRNA *brna) -{ - // XXX: this RNA enum define is currently duplicated for objects, since there is some text here which is not applicable - static EnumPropertyItem prop_rotmode_items[] = { - {ROT_MODE_QUAT, "QUATERNION", 0, "Quaternion (WXYZ)", "No Gimbal Lock (default)"}, - {ROT_MODE_XYZ, "XYZ", 0, "XYZ Euler", "XYZ Rotation Order. Prone to Gimbal Lock"}, - {ROT_MODE_XZY, "XZY", 0, "XZY Euler", "XZY Rotation Order. Prone to Gimbal Lock"}, - {ROT_MODE_YXZ, "YXZ", 0, "YXZ Euler", "YXZ Rotation Order. Prone to Gimbal Lock"}, - {ROT_MODE_YZX, "YZX", 0, "YZX Euler", "YZX Rotation Order. Prone to Gimbal Lock"}, - {ROT_MODE_ZXY, "ZXY", 0, "ZXY Euler", "ZXY Rotation Order. Prone to Gimbal Lock"}, - {ROT_MODE_ZYX, "ZYX", 0, "ZYX Euler", "ZYX Rotation Order. Prone to Gimbal Lock"}, - {ROT_MODE_AXISANGLE, "AXIS_ANGLE", 0, "Axis Angle", "Axis Angle (W+XYZ). Defines a rotation around some axis defined by 3D-Vector"}, - {0, NULL, 0, NULL, NULL}}; - +{ static float default_quat[4] = {1,0,0,0}; /* default quaternion values */ static float default_axisAngle[4] = {0,0,1,0}; /* default axis-angle rotation values */ static float default_scale[3] = {1,1,1}; /* default scale values */ @@ -807,7 +807,7 @@ static void rna_def_pose_channel(BlenderRNA *brna) * having a single one is better for Keyframing and other property-management situations... */ prop= RNA_def_property(srna, "rotation_axis_angle", PROP_FLOAT, PROP_AXISANGLE); - RNA_def_property_array(prop, 4); // TODO: maybe we'll need to define the 'default value' getter too... + RNA_def_property_array(prop, 4); RNA_def_property_float_funcs(prop, "rna_PoseChannel_rotation_axis_angle_get", "rna_PoseChannel_rotation_axis_angle_set", NULL); RNA_def_property_editable_array_func(prop, "rna_PoseChannel_rotation_4d_editable"); RNA_def_property_float_array_default(prop, default_axisAngle); @@ -824,7 +824,7 @@ static void rna_def_pose_channel(BlenderRNA *brna) prop= RNA_def_property(srna, "rotation_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "rotmode"); - RNA_def_property_enum_items(prop, prop_rotmode_items); // XXX move to using a single define of this someday + RNA_def_property_enum_items(prop, posebone_rotmode_items); // XXX move to using a single define of this someday RNA_def_property_enum_funcs(prop, NULL, "rna_PoseChannel_rotation_mode_set", NULL); RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable"); // XXX... disabled, since proxy-locked layers are currently used for ensuring proxy-syncing too RNA_def_property_ui_text(prop, "Rotation Mode", ""); diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 9ffe7c0360a..71da2438df6 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -46,7 +46,7 @@ #ifdef WITH_QUICKTIME #include "quicktime_export.h" # ifdef WITH_AUDASPACE -# include "AUD_C-API.h" +# include "AUD_Space.h" # endif #endif @@ -156,6 +156,12 @@ EnumPropertyItem image_type_items[] = { #endif {0, NULL, 0, NULL, NULL}}; +EnumPropertyItem image_color_mode_items[] ={ + {R_PLANESBW, "BW", 0, "BW", "Images get saved in 8 bits grayscale (only PNG, JPEG, TGA, TIF)"}, + {R_PLANES24, "RGB", 0, "RGB", "Images are saved with RGB (color) data"}, + {R_PLANES32, "RGBA", 0, "RGBA", "Images are saved with RGB and Alpha data (if supported)"}, + {0, NULL, 0, NULL, NULL}}; + #ifdef RNA_RUNTIME #include "DNA_anim_types.h" @@ -183,6 +189,7 @@ EnumPropertyItem image_type_items[] = { #include "BKE_mesh.h" #include "BKE_sound.h" #include "BKE_screen.h" +#include "BKE_sequencer.h" #include "BKE_animsys.h" #include "WM_api.h" @@ -333,6 +340,26 @@ static void rna_Scene_layer_update(Main *bmain, Scene *scene, PointerRNA *ptr) DAG_on_visible_update(bmain, FALSE); } +static void rna_Scene_fps_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr)) +{ + sound_update_fps(scene); + seq_update_sound_bounds_all(scene); +} + +static void rna_Scene_listener_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr)) +{ + sound_update_scene_listener(scene); +} + +static void rna_Scene_volume_set(PointerRNA *ptr, float value) +{ + Scene *scene= (Scene*)(ptr->data); + + scene->audio.volume = value; + if(scene->sound_scene) + sound_set_scene_volume(scene, value); +} + static void rna_Scene_framelen_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr)) { scene->r.framelen= (float)scene->r.framapto/(float)scene->r.images; @@ -701,8 +728,8 @@ static void rna_RenderSettings_active_layer_set(PointerRNA *ptr, PointerRNA valu { RenderData *rd= (RenderData*)ptr->data; SceneRenderLayer *srl= (SceneRenderLayer*)value.data; - - rd->actlay = BLI_findindex(&rd->layers, srl); + const int index= BLI_findindex(&rd->layers, srl); + if (index != -1) rd->actlay= index; } static void rna_RenderSettings_engine_set(PointerRNA *ptr, int value) @@ -992,9 +1019,8 @@ static TimeMarker *rna_TimeLine_add(Scene *scene, const char name[]) static void rna_TimeLine_remove(Scene *scene, ReportList *reports, TimeMarker *marker) { - /* try to remove the F-Curve from the action */ if (!BLI_remlink_safe(&scene->markers, marker)) { - BKE_reportf(reports, RPT_ERROR, "TimelineMarker '%s' not found in action '%s'", marker->name, scene->id.name+2); + BKE_reportf(reports, RPT_ERROR, "TimelineMarker '%s' not found in scene '%s'", marker->name, scene->id.name+2); return; } @@ -1052,10 +1078,14 @@ static void rna_def_tool_settings(BlenderRNA *brna) {UV_SELECT_FACE, "FACE", ICON_UV_FACESEL, "Face", "Face selection mode"}, {UV_SELECT_ISLAND, "ISLAND", ICON_UV_ISLANDSEL, "Island", "Island selection mode"}, {0, NULL, 0, NULL, NULL}}; - + + /* the construction of this enum is quite special - everything is stored as bitflags, + * with 1st position only for for on/off (and exposed as boolean), while others are mutually + * exclusive options but which will only have any effect when autokey is enabled + */ static EnumPropertyItem auto_key_items[] = { - {AUTOKEY_MODE_NORMAL, "ADD_REPLACE_KEYS", 0, "Add & Replace", ""}, - {AUTOKEY_MODE_EDITKEYS, "REPLACE_KEYS", 0, "Replace", ""}, + {AUTOKEY_MODE_NORMAL & ~AUTOKEY_ON, "ADD_REPLACE_KEYS", 0, "Add & Replace", ""}, + {AUTOKEY_MODE_EDITKEYS & ~AUTOKEY_ON, "REPLACE_KEYS", 0, "Replace", ""}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem retarget_roll_items[] = { @@ -1198,7 +1228,7 @@ static void rna_def_tool_settings(BlenderRNA *brna) RNA_def_property_ui_icon(prop, ICON_REC, 0); prop= RNA_def_property(srna, "auto_keying_mode", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "autokey_mode"); + RNA_def_property_enum_bitflag_sdna(prop, NULL, "autokey_mode"); RNA_def_property_enum_items(prop, auto_key_items); RNA_def_property_ui_text(prop, "Auto-Keying Mode", "Mode of automatic keyframe insertion for Objects and Bones"); @@ -1209,7 +1239,7 @@ static void rna_def_tool_settings(BlenderRNA *brna) prop= RNA_def_property(srna, "use_keyframe_insert_keyingset", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", AUTOKEY_FLAG_ONLYKEYINGSET); RNA_def_property_ui_text(prop, "Auto Keyframe Insert Keying Set", "Automatic keyframe insertion using active Keying Set only"); - RNA_def_property_ui_icon(prop, ICON_KEY_HLT, 0); // XXX: we need a dedicated icon + RNA_def_property_ui_icon(prop, ICON_KEYINGSET, 0); /* UV */ prop= RNA_def_property(srna, "uv_select_mode", PROP_ENUM, PROP_NONE); @@ -1896,6 +1926,10 @@ static void rna_def_scene_game_data(BlenderRNA *brna) prop= RNA_def_property(srna, "use_auto_start", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_GameSettings_auto_start_get", "rna_GameSettings_auto_start_set"); RNA_def_property_ui_text(prop, "Auto Start", "Automatically start game at load time"); + + prop= RNA_def_property(srna, "restrict_animation_updates", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_RESTRICT_ANIM_UPDATES); + RNA_def_property_ui_text(prop, "Restrict Animation Updates", "Restrict the number of animation updates to the animation FPS. This is better for performance, but can cause issues with smooth playback."); /* materials */ prop= RNA_def_property(srna, "material_mode", PROP_ENUM, PROP_NONE); @@ -1974,7 +2008,7 @@ static void rna_def_render_layers(BlenderRNA *brna, PropertyRNA *cprop) prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_UNSIGNED); RNA_def_property_struct_type(prop, "SceneRenderLayer"); RNA_def_property_pointer_funcs(prop, "rna_RenderSettings_active_layer_get", "rna_RenderSettings_active_layer_set", NULL, NULL); - RNA_def_property_flag(prop, PROP_EDITABLE); + RNA_def_property_flag(prop, PROP_EDITABLE|PROP_NEVER_NULL); RNA_def_property_ui_text(prop, "Active Render Layer", "Active Render Layer"); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); @@ -2000,13 +2034,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna) {R_ALPHAPREMUL, "PREMUL", 0, N_("Premultiplied"), N_("Transparent RGB pixels are multiplied by the alpha channel")}, {R_ALPHAKEY, "STRAIGHT", 0, N_("Straight Alpha"), N_("Transparent RGB and alpha pixels are unmodified")}, {0, NULL, 0, NULL, NULL}}; - - static EnumPropertyItem color_mode_items[] ={ - {R_PLANESBW, "BW", 0, "BW", N_("Images get saved in 8 bits grayscale (only PNG, JPEG, TGA, TIF)")}, - {R_PLANES24, "RGB", 0, "RGB", N_("Images are saved with RGB (color) data")}, - {R_PLANES32, "RGBA", 0, "RGBA", N_("Images are saved with RGB and Alpha data (if supported)")}, - {0, NULL, 0, NULL, NULL}}; - + static EnumPropertyItem display_mode_items[] ={ {R_OUTPUT_SCREEN, "SCREEN", 0, N_("Full Screen"), N_("Images are rendered in full Screen")}, {R_OUTPUT_AREA, "AREA", 0, N_("Image Editor"), N_("Images are rendered in Image Editor")}, @@ -2183,6 +2211,14 @@ static void rna_def_scene_render_data(BlenderRNA *brna) {0, NULL, 0, NULL, NULL}}; #endif + static EnumPropertyItem audio_channel_items[] = { + {1, "MONO", 0, "Mono", "Set audio channels to mono"}, + {2, "STEREO", 0, "Stereo", "Set audio channels to stereo"}, + {4, "SURROUND4", 0, "4 Channels", "Set audio channels to 4 channels"}, + {6, "SURROUND51", 0, "5.1 Surround", "Set audio channels to 5.1 surround sound"}, + {8, "SURROUND71", 0, "7.1 Surround", "Set audio channels to 7.1 surround sound"}, + {0, NULL, 0, NULL, NULL}}; + static EnumPropertyItem engine_items[] = { {0, "BLENDER_RENDER", 0, N_("Blender Render"), N_("Use the Blender internal rendering engine for rendering")}, {0, NULL, 0, NULL, NULL}}; @@ -2195,7 +2231,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna) prop= RNA_def_property(srna, "color_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "planes"); - RNA_def_property_enum_items(prop, color_mode_items); + RNA_def_property_enum_items(prop, image_color_mode_items); RNA_def_property_ui_text(prop, N_("Color Mode"), N_("Choose BW for saving greyscale images, RGB for saving red, green and blue channels, AND RGBA for saving red, green, blue + alpha channels")); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); @@ -2453,43 +2489,53 @@ static void rna_def_scene_render_data(BlenderRNA *brna) /* FFMPEG Audio*/ prop= RNA_def_property(srna, "ffmpeg_audio_codec", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "ffcodecdata.audio_codec"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_enum_items(prop, ffmpeg_audio_codec_items); RNA_def_property_ui_text(prop, N_("Audio Codec"), N_("FFMpeg audio codec to use")); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); prop= RNA_def_property(srna, "ffmpeg_audio_bitrate", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.audio_bitrate"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_range(prop, 32, 384); RNA_def_property_ui_text(prop, N_("Bitrate"), N_("Audio bitrate(kb/s)")); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); - prop= RNA_def_property(srna, "ffmpeg_audio_mixrate", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.audio_mixrate"); - RNA_def_property_range(prop, 8000, 192000); - RNA_def_property_ui_text(prop, N_("Samplerate"), N_("Audio samplerate(samples/s)")); - RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); - prop= RNA_def_property(srna, "ffmpeg_audio_volume", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "ffcodecdata.audio_volume"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, N_("Volume"), N_("Audio volume")); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); - #endif + // the following two "ffmpeg" settings are general audio settings + prop= RNA_def_property(srna, "ffmpeg_audio_mixrate", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.audio_mixrate"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_range(prop, 8000, 192000); + RNA_def_property_ui_text(prop, N_("Samplerate"), N_("Audio samplerate(samples/s)")); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + + prop= RNA_def_property(srna, "ffmpeg_audio_channels", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "ffcodecdata.audio_channels"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_enum_items(prop, audio_channel_items); + RNA_def_property_ui_text(prop, N_("Audio Channels"), N_("Sets the audio channel count")); + prop= RNA_def_property(srna, "fps", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "frs_sec"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_range(prop, 1, 120); RNA_def_property_ui_text(prop, N_("FPS"), N_("Framerate, expressed in frames per second")); - RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_Scene_fps_update"); prop= RNA_def_property(srna, "fps_base", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "frs_sec_base"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_range(prop, 0.1f, 120.0f); RNA_def_property_ui_text(prop, N_("FPS Base"), N_("Framerate base")); - RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_Scene_fps_update"); /* frame mapping */ prop= RNA_def_property(srna, "frame_map_old", PROP_INT, PROP_NONE); @@ -3428,21 +3474,31 @@ void RNA_def_scene(BlenderRNA *brna) prop= RNA_def_property(srna, "audio_doppler_speed", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "audio.speed_of_sound"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_range(prop, 0.01f, FLT_MAX); RNA_def_property_ui_text(prop, N_("Speed of Sound"), N_("Speed of sound for Doppler effect calculation")); - RNA_def_property_update(prop, NC_SCENE, NULL); + RNA_def_property_update(prop, NC_SCENE, "rna_Scene_listener_update"); prop= RNA_def_property(srna, "audio_doppler_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "audio.doppler_factor"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_range(prop, 0.0, FLT_MAX); RNA_def_property_ui_text(prop, N_("Doppler Factor"), N_("Pitch factor for Doppler effect calculation")); - RNA_def_property_update(prop, NC_SCENE, NULL); + RNA_def_property_update(prop, NC_SCENE, "rna_Scene_listener_update"); prop= RNA_def_property(srna, "audio_distance_model", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "audio.distance_model"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_enum_items(prop, audio_distance_model_items); RNA_def_property_ui_text(prop, N_("Distance Model"), N_("Distance model for distance attenuation calculation")); + RNA_def_property_update(prop, NC_SCENE, "rna_Scene_listener_update"); + + prop= RNA_def_property(srna, "audio_volume", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "audio.volume"); + RNA_def_property_range(prop, 0.0f, 1.0f); + RNA_def_property_ui_text(prop, N_("Volume"), N_("Audio volume")); RNA_def_property_update(prop, NC_SCENE, NULL); + RNA_def_property_float_funcs(prop, NULL, "rna_Scene_volume_set", NULL); /* Game Settings */ prop= RNA_def_property(srna, "game_settings", PROP_POINTER, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_sensor.c b/source/blender/makesrna/intern/rna_sensor.c index 5cc8539f187..1f64603d6b4 100644 --- a/source/blender/makesrna/intern/rna_sensor.c +++ b/source/blender/makesrna/intern/rna_sensor.c @@ -803,7 +803,7 @@ static void rna_def_joystick_sensor(BlenderRNA *brna) prop= RNA_def_property(srna, "axis_number", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "axis"); RNA_def_property_ui_text(prop, "Axis Number", "Specify which axis pair to use, 1 is usually the main direction input"); - RNA_def_property_range(prop, 1, 2); + RNA_def_property_range(prop, 1, 8); RNA_def_property_update(prop, NC_LOGIC, NULL); prop= RNA_def_property(srna, "axis_threshold", PROP_INT, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c index 8c4e4d9e736..627c2274965 100644 --- a/source/blender/makesrna/intern/rna_sequencer.c +++ b/source/blender/makesrna/intern/rna_sequencer.c @@ -43,6 +43,7 @@ #include "BKE_animsys.h" #include "BKE_global.h" #include "BKE_sequencer.h" +#include "BKE_sound.h" #include "MEM_guardedalloc.h" @@ -51,16 +52,6 @@ #ifdef RNA_RUNTIME -static float to_dB(float x) -{ - return logf(x * x + 1e-30f) * 4.34294480f; -} - -static float from_dB(float x) -{ - return expf(x * 0.11512925f); -} - /* build a temp referene to the parent */ static void meta_tmp_ref(Sequence *seq_par, Sequence *seq) { @@ -245,6 +236,10 @@ static void rna_Sequence_use_proxy_set(PointerRNA *ptr, int value) seq->flag |= SEQ_USE_PROXY; if(seq->strip->proxy == NULL) { seq->strip->proxy = MEM_callocN(sizeof(struct StripProxy), "StripProxy"); + seq->strip->proxy->quality = 90; + seq->strip->proxy->build_tc_flags = SEQ_PROXY_TC_ALL; + seq->strip->proxy->build_size_flags + = SEQ_PROXY_IMAGE_SIZE_25; } } else { seq->flag ^= SEQ_USE_PROXY; @@ -511,18 +506,31 @@ static int rna_Sequence_proxy_filepath_length(PointerRNA *ptr) return strlen(path)+1; } -static float rna_Sequence_attenuation_get(PointerRNA *ptr) +static void rna_Sequence_volume_set(PointerRNA *ptr, float value) { Sequence *seq= (Sequence*)(ptr->data); - return to_dB(seq->volume); + seq->volume = value; + if(seq->scene_sound) + sound_set_scene_sound_volume(seq->scene_sound, value, (seq->flag & SEQ_AUDIO_VOLUME_ANIMATED) != 0); } -static void rna_Sequence_attenuation_set(PointerRNA *ptr, float value) +static void rna_Sequence_pitch_set(PointerRNA *ptr, float value) { Sequence *seq= (Sequence*)(ptr->data); - seq->volume = from_dB(value); + seq->pitch = value; + if(seq->scene_sound) + sound_set_scene_sound_pitch(seq->scene_sound, value, (seq->flag & SEQ_AUDIO_PITCH_ANIMATED) != 0); +} + +static void rna_Sequence_pan_set(PointerRNA *ptr, float value) +{ + Sequence *seq= (Sequence*)(ptr->data); + + seq->pan = value; + if(seq->scene_sound) + sound_set_scene_sound_pan(seq->scene_sound, value, (seq->flag & SEQ_AUDIO_PAN_ANIMATED) != 0); } @@ -556,9 +564,6 @@ static void rna_Sequence_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *p Editing *ed= seq_give_editing(scene, FALSE); free_imbuf_seq(scene, &ed->seqbase, FALSE, TRUE); - - if(RNA_struct_is_a(ptr->type, &RNA_SoundSequence)) - seq_update_sound(scene, ptr->data); } static void rna_Sequence_update_reopen_files(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr) @@ -568,14 +573,14 @@ static void rna_Sequence_update_reopen_files(Main *UNUSED(bmain), Scene *scene, free_imbuf_seq(scene, &ed->seqbase, FALSE, FALSE); if(RNA_struct_is_a(ptr->type, &RNA_SoundSequence)) - seq_update_sound(scene, ptr->data); + seq_update_sound_bounds(scene, ptr->data); } static void rna_Sequence_mute_update(Main *bmain, Scene *scene, PointerRNA *ptr) { Editing *ed= seq_give_editing(scene, FALSE); - seq_update_muting(scene, ed); + seq_update_muting(ed); rna_Sequence_update(bmain, scene, ptr); } @@ -587,6 +592,34 @@ static void rna_Sequence_filepath_update(Main *bmain, Scene *scene, PointerRNA * rna_Sequence_update(bmain, scene, ptr); } +static int seqproxy_seq_cmp_cb(Sequence *seq, void *arg_pt) +{ + struct { Sequence *seq; void *seq_proxy; } *data= arg_pt; + + if(seq->strip && seq->strip->proxy == data->seq_proxy) { + data->seq= seq; + return -1; /* done so bail out */ + } + return 1; +} + +static void rna_Sequence_tcindex_update(Main *bmain, Scene *scene, PointerRNA *ptr) +{ + Editing *ed= seq_give_editing(scene, FALSE); + Sequence *seq; + + struct { Sequence *seq; void *seq_proxy; } data; + + data.seq= NULL; + data.seq_proxy = ptr->data; + + seqbase_recursive_apply(&ed->seqbase, seqproxy_seq_cmp_cb, &data); + seq= data.seq; + + reload_sequence_new_file(scene, seq, FALSE); + rna_Sequence_frame_change_update(scene, seq); +} + /* do_versions? */ static float rna_Sequence_opacity_get(PointerRNA *ptr) { @@ -789,6 +822,19 @@ static void rna_def_strip_proxy(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; + + static const EnumPropertyItem seq_tc_items[]= { + {SEQ_PROXY_TC_NONE, "NONE", 0, "No TC in use", ""}, + {SEQ_PROXY_TC_RECORD_RUN, "RECORD_RUN", 0, "Record Run", + "use images in the order as they are recorded"}, + {SEQ_PROXY_TC_FREE_RUN, "FREE_RUN", 0, "Free Run", + "use global timestamp written by recording device"}, + {SEQ_PROXY_TC_INTERP_REC_DATE_FREE_RUN, "FREE_RUN_REC_DATE", + 0, "Free Run (rec date)", + "interpolate a global timestamp using the " + "record date and time written by recording " + "device"}, + {0, NULL, 0, NULL, NULL}}; srna = RNA_def_struct(brna, "SequenceProxy", NULL); RNA_def_struct_ui_text(srna, "Sequence Proxy", "Proxy parameters for a sequence strip"); @@ -804,6 +850,46 @@ static void rna_def_strip_proxy(BlenderRNA *brna) RNA_def_property_string_funcs(prop, "rna_Sequence_proxy_filepath_get", "rna_Sequence_proxy_filepath_length", "rna_Sequence_proxy_filepath_set"); RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); + + prop= RNA_def_property(srna, "build_25", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "build_size_flags", SEQ_PROXY_IMAGE_SIZE_25); + RNA_def_property_ui_text(prop, "25%", "Build 25% proxy resolution"); + + prop= RNA_def_property(srna, "build_50", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "build_size_flags", SEQ_PROXY_IMAGE_SIZE_50); + RNA_def_property_ui_text(prop, "50%", "Build 50% proxy resolution"); + + prop= RNA_def_property(srna, "build_75", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "build_size_flags", SEQ_PROXY_IMAGE_SIZE_75); + RNA_def_property_ui_text(prop, "75%", "Build 75% proxy resolution"); + + prop= RNA_def_property(srna, "build_100", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "build_size_flags", SEQ_PROXY_IMAGE_SIZE_100); + RNA_def_property_ui_text(prop, "100%", "Build 100% proxy resolution"); + + prop= RNA_def_property(srna, "build_record_run", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "build_tc_flags", SEQ_PROXY_TC_RECORD_RUN); + RNA_def_property_ui_text(prop, "Rec Run", "Build record run time code index"); + + prop= RNA_def_property(srna, "build_free_run", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "build_tc_flags", SEQ_PROXY_TC_FREE_RUN); + RNA_def_property_ui_text(prop, "Free Run", "Build free run time code index"); + + prop= RNA_def_property(srna, "build_free_run_rec_date", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "build_tc_flags", SEQ_PROXY_TC_INTERP_REC_DATE_FREE_RUN); + RNA_def_property_ui_text(prop, "Free Run (Rec Date)", "Build free run time code index using Record Date/Time"); + + prop= RNA_def_property(srna, "quality", PROP_INT, PROP_UNSIGNED); + RNA_def_property_int_sdna(prop, NULL, "quality"); + RNA_def_property_ui_text(prop, "Quality", "JPEG Quality of proxies to build"); + RNA_def_property_ui_range(prop, 1, 100, 1, 0); + + prop= RNA_def_property(srna, "timecode", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "tc"); + RNA_def_property_enum_items(prop, seq_tc_items); + RNA_def_property_ui_text(prop, "Timecode", ""); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_tcindex_update"); + } static void rna_def_strip_color_balance(BlenderRNA *brna) @@ -948,6 +1034,11 @@ static void rna_def_sequence(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Lock", "Lock strip so that it can't be transformed"); RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); + prop= RNA_def_property(srna, "waveform", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_AUDIO_DRAW_WAVEFORM); + RNA_def_property_ui_text(prop, "Draw Waveform", "Whether to draw the sound's waveform."); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); + /* strip positioning */ prop= RNA_def_property(srna, "frame_final_duration", PROP_INT, PROP_TIME); @@ -1208,7 +1299,7 @@ static void rna_def_proxy(StructRNA *srna) prop= RNA_def_property(srna, "use_proxy", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_PROXY); - RNA_def_property_ui_text(prop, "Use Proxy", "Use a preview proxy for this strip"); + RNA_def_property_ui_text(prop, "Use Proxy / Timecode", "Use a preview proxy and/or timecode index for this strip"); RNA_def_property_boolean_funcs(prop, NULL, "rna_Sequence_use_proxy_set"); prop= RNA_def_property(srna, "proxy", PROP_POINTER, PROP_NONE); @@ -1330,6 +1421,12 @@ static void rna_def_movie(BlenderRNA *brna) RNA_def_property_ui_text(prop, "MPEG Preseek", "For MPEG movies, preseek this many frames"); RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); + prop= RNA_def_property(srna, "streamindex", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "streamindex"); + RNA_def_property_range(prop, 0, 20); + RNA_def_property_ui_text(prop, "Streamindex", "For files with several movie streams, use the stream with the given index"); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update_reopen_files"); + prop= RNA_def_property(srna, "elements", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "strip->stripdata", NULL); RNA_def_property_struct_type(prop, "SequenceElement"); @@ -1365,13 +1462,21 @@ static void rna_def_sound(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "volume"); RNA_def_property_range(prop, 0.0f, 100.0f); RNA_def_property_ui_text(prop, "Volume", "Playback volume of the sound"); + RNA_def_property_float_funcs(prop, NULL, "rna_Sequence_volume_set", NULL); RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); - prop= RNA_def_property(srna, "attenuation", PROP_FLOAT, PROP_NONE); - RNA_def_property_range(prop, -100.0f, +40.0f); - RNA_def_property_ui_text(prop, "Attenuation/dB", "Attenuation in decibel"); - RNA_def_property_float_funcs(prop, "rna_Sequence_attenuation_get", "rna_Sequence_attenuation_set", NULL); + prop= RNA_def_property(srna, "pitch", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "pitch"); + RNA_def_property_range(prop, 0.1f, 10.0f); + RNA_def_property_ui_text(prop, "Pitch", "Playback pitch of the sound"); + RNA_def_property_float_funcs(prop, NULL, "rna_Sequence_pitch_set", NULL); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); + prop= RNA_def_property(srna, "pan", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "pan"); + RNA_def_property_range(prop, -2.0f, 2.0f); + RNA_def_property_ui_text(prop, "Pan", "Playback panning of the sound (only for Mono sources)"); + RNA_def_property_float_funcs(prop, NULL, "rna_Sequence_pan_set", NULL); RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH); @@ -1481,7 +1586,7 @@ static void rna_def_wipe(BlenderRNA *brna) #if 1 /* expose as radians */ prop= RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE); RNA_def_property_float_funcs(prop, "rna_WipeSequence_angle_get", "rna_WipeSequence_angle_set", NULL); - RNA_def_property_range(prop, DEG2RAD(-90.0f), DEG2RAD(90.0f)); + RNA_def_property_range(prop, DEG2RAD(-90.0), DEG2RAD(90.0)); #else prop= RNA_def_property(srna, "angle", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "angle"); diff --git a/source/blender/makesrna/intern/rna_smoke.c b/source/blender/makesrna/intern/rna_smoke.c index 43d1aa24229..d439c2551f1 100644 --- a/source/blender/makesrna/intern/rna_smoke.c +++ b/source/blender/makesrna/intern/rna_smoke.c @@ -241,13 +241,12 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "cache_comp"); RNA_def_property_enum_items(prop, smoke_cache_comp_items); RNA_def_property_ui_text(prop, "Cache Compression", "Compression method to be used"); - RNA_def_property_update(prop, 0, NULL); prop= RNA_def_property(srna, "collision_extents", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "border_collisions"); RNA_def_property_enum_items(prop, smoke_domain_colli_items); RNA_def_property_ui_text(prop, "Border Collisions", "Selects which domain border will be treated as collision object."); - RNA_def_property_update(prop, 0, NULL); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); prop= RNA_def_property(srna, "effector_weights", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "EffectorWeights"); @@ -290,14 +289,12 @@ static void rna_def_smoke_flow_settings(BlenderRNA *brna) RNA_def_property_range(prop, 0.001, 1); RNA_def_property_ui_range(prop, 0.001, 1.0, 1.0, 4); RNA_def_property_ui_text(prop, "Density", ""); - RNA_def_property_update(prop, 0, NULL); // NC_OBJECT|ND_MODIFIER prop= RNA_def_property(srna, "temperature", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "temp"); RNA_def_property_range(prop, -10, 10); RNA_def_property_ui_range(prop, -10, 10, 1, 1); RNA_def_property_ui_text(prop, "Temp. Diff.", "Temperature difference to ambient temperature"); - RNA_def_property_update(prop, 0, NULL); prop= RNA_def_property(srna, "particle_system", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "psys"); @@ -309,24 +306,20 @@ static void rna_def_smoke_flow_settings(BlenderRNA *brna) prop= RNA_def_property(srna, "use_outflow", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "type", MOD_SMOKE_FLOW_TYPE_OUTFLOW); RNA_def_property_ui_text(prop, "Outflow", "Deletes smoke from simulation"); - RNA_def_property_update(prop, 0, NULL); prop= RNA_def_property(srna, "use_absolute", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_FLOW_ABSOLUTE); RNA_def_property_ui_text(prop, "Absolute Density", "Only allows given density value in emitter area."); - RNA_def_property_update(prop, 0, NULL); prop= RNA_def_property(srna, "initial_velocity", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_FLOW_INITVELOCITY); RNA_def_property_ui_text(prop, "Initial Velocity", "Smoke inherits it's velocity from the emitter particle"); - RNA_def_property_update(prop, 0, NULL); prop= RNA_def_property(srna, "velocity_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "vel_multi"); RNA_def_property_range(prop, -2.0, 2.0); RNA_def_property_ui_range(prop, -2.0, 2.0, 0.05, 5); RNA_def_property_ui_text(prop, "Multiplier", "Multiplier to adjust velocity passed to smoke"); - RNA_def_property_update(prop, 0, NULL); } static void rna_def_smoke_coll_settings(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_sound.c b/source/blender/makesrna/intern/rna_sound.c index 97339058794..3a18fb0e7c0 100644 --- a/source/blender/makesrna/intern/rna_sound.c +++ b/source/blender/makesrna/intern/rna_sound.c @@ -41,7 +41,7 @@ #include "BKE_sound.h" #include "BKE_context.h" -static void rna_Sound_filepath_update(Main *bmain, Scene *scene, PointerRNA *ptr) +static void rna_Sound_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) { sound_load(bmain, (bSound*)ptr->data); } @@ -49,18 +49,23 @@ static void rna_Sound_filepath_update(Main *bmain, Scene *scene, PointerRNA *ptr static int rna_Sound_caching_get(PointerRNA *ptr) { bSound *sound = (bSound*)(ptr->data); - return sound->cache != NULL; + return (sound->flags & SOUND_FLAGS_CACHING) != 0; } static void rna_Sound_caching_set(PointerRNA *ptr, const int value) { bSound *sound = (bSound*)(ptr->data); if(value) - sound_cache(sound, 0); + sound_cache(sound); else sound_delete_cache(sound); } +static void rna_Sound_caching_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) +{ + sound_update_sequencer(bmain, (bSound*)(ptr->data)); +} + #else static void rna_def_sound(BlenderRNA *brna) @@ -78,7 +83,7 @@ static void rna_def_sound(BlenderRNA *brna) prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH); RNA_def_property_string_sdna(prop, NULL, "name"); RNA_def_property_ui_text(prop, "File Path", "Sound sample file used by this Sound datablock"); - RNA_def_property_update(prop, 0, "rna_Sound_filepath_update"); + RNA_def_property_update(prop, 0, "rna_Sound_update"); prop= RNA_def_property(srna, "packed_file", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "packedfile"); @@ -87,7 +92,12 @@ static void rna_def_sound(BlenderRNA *brna) prop= RNA_def_property(srna, "use_memory_cache", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_Sound_caching_get", "rna_Sound_caching_set"); RNA_def_property_ui_text(prop, "Caching", "The sound file is decoded and loaded into RAM"); - RNA_def_property_update(prop, 0, "rna_Sound_filepath_update"); + RNA_def_property_update(prop, 0, "rna_Sound_caching_update"); + + prop= RNA_def_property(srna, "mono", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flags", SOUND_FLAGS_MONO); + RNA_def_property_ui_text(prop, "Mono", "If the file contains multiple audio channels they are rendered to a single one."); + RNA_def_property_update(prop, 0, "rna_Sound_update"); } void RNA_def_sound(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index ad0ef7c93bc..1ed12bd688f 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -1676,6 +1676,7 @@ static void rna_def_space_sequencer(BlenderRNA *brna) {SEQ_PROXY_RENDER_SIZE_25, "PROXY_25", 0, N_("Proxy size 25%"), ""}, {SEQ_PROXY_RENDER_SIZE_50, "PROXY_50", 0, N_("Proxy size 50%"), ""}, {SEQ_PROXY_RENDER_SIZE_75, "PROXY_75", 0, N_("Proxy size 75%"), ""}, + {SEQ_PROXY_RENDER_SIZE_100, "PROXY_100", 0, N_("Proxy size 100%"), ""}, {SEQ_PROXY_RENDER_SIZE_FULL, "FULL", 0, N_("No proxy, full render"), ""}, {0, NULL, 0, NULL, NULL}}; @@ -1879,11 +1880,12 @@ static void rna_def_space_dopesheet(BlenderRNA *brna) StructRNA *srna; PropertyRNA *prop; + // XXX: action-editor is currently for object-level only actions, so show that using object-icon hint static EnumPropertyItem mode_items[] = { - {SACTCONT_DOPESHEET, "DOPESHEET", 0, N_("DopeSheet"), N_("DopeSheet Editor")}, - {SACTCONT_ACTION, "ACTION", 0, N_("Action Editor"), N_("Action Editor")}, - {SACTCONT_SHAPEKEY, "SHAPEKEY", 0, N_("ShapeKey Editor"), N_("ShapeKey Editor")}, - {SACTCONT_GPENCIL, "GPENCIL", 0, N_("Grease Pencil"), N_("Grease Pencil")}, + {SACTCONT_DOPESHEET, "DOPESHEET", ICON_OOPS, N_("DopeSheet"), N_("DopeSheet Editor")}, + {SACTCONT_ACTION, "ACTION", ICON_OBJECT_DATA, N_("Action Editor"), N_("Action Editor")}, + {SACTCONT_SHAPEKEY, "SHAPEKEY", ICON_SHAPEKEY_DATA, N_("ShapeKey Editor"), N_("ShapeKey Editor")}, + {SACTCONT_GPENCIL, "GPENCIL", ICON_GREASEPENCIL, N_("Grease Pencil"), N_("Grease Pencil")}, {0, NULL, 0, NULL, NULL}}; @@ -1962,8 +1964,8 @@ static void rna_def_space_graph(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem mode_items[] = { - {SIPO_MODE_ANIMATION, "FCURVES", 0, N_("F-Curve Editor"), N_("Edit f-curves")}, - {SIPO_MODE_DRIVERS, "DRIVERS", 0, N_("Drivers"), N_("Edit drivers")}, + {SIPO_MODE_ANIMATION, "FCURVES", ICON_IPO, N_("F-Curve Editor"), N_("Edit animation/keyframes displayed as 2D curves")}, + {SIPO_MODE_DRIVERS, "DRIVERS", ICON_DRIVER, N_("Drivers"), N_("Edit drivers")}, {0, NULL, 0, NULL, NULL}}; /* this is basically the same as the one for the 3D-View, but with some entries ommitted */ @@ -2020,9 +2022,9 @@ static void rna_def_space_graph(BlenderRNA *brna) RNA_def_property_ui_text(prop, N_("Only Selected Keyframes Handles"), N_("Only show and edit handles of selected keyframes")); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL); - prop= RNA_def_property(srna, "use_fancy_drawing", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "use_beauty_drawing", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_BEAUTYDRAW_OFF); - RNA_def_property_ui_text(prop, N_("Use Fancy Drawing"), N_("Draw F-Curves using Anti-Aliasing and other fancy effects. Disable for better performance")); + RNA_def_property_ui_text(prop, N_("Use High Quality Drawing"), N_("Draw F-Curves using Anti-Aliasing and other fancy effects. Disable for better performance")); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL); /* editing */ @@ -2132,7 +2134,7 @@ static void rna_def_space_time(BlenderRNA *brna) /* view settings */ prop= RNA_def_property(srna, "show_only_selected", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", TIME_ONLYACTSEL); - RNA_def_property_ui_text(prop, N_("Only Selected channels"), N_("Show keyframes for active Object and/or its selected channels only")); + RNA_def_property_ui_text(prop, N_("Only Selected Channels"), N_("Show keyframes for active Object and/or its selected bones only")); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, NULL); prop= RNA_def_property(srna, "show_frame_indicator", PROP_BOOLEAN, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c index ade64ce5021..01261adfc6a 100644 --- a/source/blender/makesrna/intern/rna_texture.c +++ b/source/blender/makesrna/intern/rna_texture.c @@ -32,6 +32,7 @@ #include <stdlib.h> #include "RNA_define.h" +#include "RNA_enum_types.h" #include "rna_internal.h" #include "BLF_api.h" @@ -48,7 +49,7 @@ #include "BKE_node.h" -EnumPropertyItem texture_filter_items[] = { +static EnumPropertyItem texture_filter_items[] = { {TXF_BOX, "BOX", 0, "Box", ""}, {TXF_EWA, "EWA", 0, "EWA", ""}, {TXF_FELINE, "FELINE", 0, "FELINE", ""}, @@ -664,6 +665,13 @@ static void rna_def_environment_map(BlenderRNA *brna) RNA_def_property_range(prop, 0, 5); RNA_def_property_ui_text(prop, "Depth", "Number of times a map will be rendered recursively (mirror effects.)"); RNA_def_property_update(prop, 0, "rna_Texture_update"); + + prop= RNA_def_property(srna, "is_valid", PROP_BOOLEAN, 0); + RNA_def_property_boolean_sdna(prop, NULL, "ok", 2); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Validity", "True if this map is ready for use, False if it needs rendering."); + + RNA_api_environment_map(srna); } static EnumPropertyItem prop_noise_basis_items[] = { @@ -1148,6 +1156,12 @@ static void rna_def_texture_image(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_NORMALMAP); RNA_def_property_ui_text(prop, "Normal Map", "Uses image RGB values for normal mapping"); RNA_def_property_update(prop, 0, "rna_Texture_update"); + + /* Derivative Map */ + prop= RNA_def_property(srna, "use_derivative_map", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_DERIVATIVEMAP); + RNA_def_property_ui_text(prop, "Derivative Map", "Uses red and green as derivative values"); + RNA_def_property_update(prop, 0, "rna_Texture_update"); } static void rna_def_texture_plugin(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index e12caba5bb8..dea8f6c3251 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -879,6 +879,21 @@ static void rna_def_userdef_theme_spaces_curves(StructRNA *srna, short incl_nurb RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Align handle selected color", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); + + if (incl_nurbs == 0) { + /* assume that when nurbs are off, this is for 2D (i.e. anim) editors */ + prop= RNA_def_property(srna, "handle_auto_clamped", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_float_sdna(prop, NULL, "handle_auto_clamped"); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Auto-Clamped handle color", ""); + RNA_def_property_update(prop, 0, "rna_userdef_update"); + + prop= RNA_def_property(srna, "handle_sel_auto_clamped", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_float_sdna(prop, NULL, "handle_sel_auto_clamped"); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Auto-Clamped handle selected color", ""); + RNA_def_property_update(prop, 0, "rna_userdef_update"); + } prop= RNA_def_property(srna, "lastsel_point", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "lastsel_point"); @@ -920,6 +935,11 @@ static void rna_def_userdef_theme_space_view3d(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Lamp", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); + prop= RNA_def_property(srna, "speaker", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Speaker", ""); + RNA_def_property_update(prop, 0, "rna_userdef_update"); + prop= RNA_def_property(srna, "object_selected", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "select"); RNA_def_property_array(prop, 3); @@ -2226,13 +2246,13 @@ static void rna_def_userdef_edit(BlenderRNA *brna) /* auto keyframing */ prop= RNA_def_property(srna, "use_auto_keying", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "autokey_mode", AUTOKEY_ON); - RNA_def_property_ui_text(prop, N_("Auto Keying Enable"), N_("Automatic keyframe insertion for Objects and Bones")); + RNA_def_property_ui_text(prop, N_("Auto Keying Enable"), N_("Automatic keyframe insertion for Objects and Bones (default setting used for new Scenes)")); RNA_def_property_ui_icon(prop, ICON_REC, 0); prop= RNA_def_property(srna, "auto_keying_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, auto_key_modes); RNA_def_property_enum_funcs(prop, "rna_userdef_autokeymode_get", "rna_userdef_autokeymode_set", NULL); - RNA_def_property_ui_text(prop, N_("Auto Keying Mode"), N_("Mode of automatic keyframe insertion for Objects and Bones")); + RNA_def_property_ui_text(prop, N_("Auto Keying Mode"), N_("Mode of automatic keyframe insertion for Objects and Bones (default setting used for new Scenes)")); prop= RNA_def_property(srna, "use_keyframe_insert_available", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", AUTOKEY_FLAG_INSERTAVAIL); @@ -2254,12 +2274,12 @@ static void rna_def_userdef_edit(BlenderRNA *brna) prop= RNA_def_property(srna, "keyframe_new_interpolation_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, beztriple_interpolation_mode_items); RNA_def_property_enum_sdna(prop, NULL, "ipo_new"); - RNA_def_property_ui_text(prop, N_("New Interpolation Type"), ""); + RNA_def_property_ui_text(prop, N_("New Interpolation Type"), N_("Interpolation mode used for first keyframe on newly added F-Curves. Subsequent keyframes take interpolation from preceeding keyframe")); prop= RNA_def_property(srna, "keyframe_new_handle_type", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_items(prop, beztriple_handle_type_items); + RNA_def_property_enum_items(prop, keyframe_handle_type_items); RNA_def_property_enum_sdna(prop, NULL, "keyhandles_new"); - RNA_def_property_ui_text(prop, N_("New Handles Type"), ""); + RNA_def_property_ui_text(prop, N_("New Handles Type"), N_("Handle type for handles of new keyframes")); /* frame numbers */ prop= RNA_def_property(srna, "use_negative_frames", PROP_BOOLEAN, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c index 904fc6bcf03..1aeb8da8262 100644 --- a/source/blender/makesrna/intern/rna_wm.c +++ b/source/blender/makesrna/intern/rna_wm.c @@ -1748,6 +1748,7 @@ static void rna_def_keyconfig(BlenderRNA *brna) RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", KMI_INACTIVE); RNA_def_property_ui_text(prop, N_("Active"), N_("Activate or deactivate item")); RNA_def_property_ui_icon(prop, ICON_CHECKBOX_DEHLT, 1); + RNA_def_property_update(prop, 0, "rna_KeyMapItem_update"); prop= RNA_def_property(srna, "is_user_modified", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", KMI_USER_MODIFIED); |