diff options
Diffstat (limited to 'source/blender/makesrna/intern')
23 files changed, 799 insertions, 120 deletions
diff --git a/source/blender/makesrna/intern/CMakeLists.txt b/source/blender/makesrna/intern/CMakeLists.txt index cb593e7deab..7d7c5532fb5 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 diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index 7da538e171b..feb926fd28e 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -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 8d57403ec35..82217cdc3e4 100644 --- a/source/blender/makesrna/intern/rna_ID.c +++ b/source/blender/makesrna/intern/rna_ID.c @@ -67,6 +67,7 @@ EnumPropertyItem id_type_items[] = { {ID_PA, "PARTICLE", ICON_PARTICLE_DATA, "Particle", ""}, {ID_SCE, "SCENE", ICON_SCENE_DATA, "Scene", ""}, {ID_SCR, "SCREEN", ICON_SPLITSCREEN, "Screen", ""}, + {ID_SPK, "SPEAKER", ICON_SPEAKER, "Speaker", ""}, {ID_SO, "SOUND", ICON_PLAY_AUDIO, "Sound", ""}, {ID_TXT, "TEXT", ICON_TEXT, "Text", ""}, {ID_TE, "TEXTURE", ICON_TEXTURE_DATA, "Texture", ""}, @@ -137,6 +138,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; @@ -170,6 +172,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 f1056c86a4c..ac3508b9b4a 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -85,7 +85,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); @@ -1391,6 +1393,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) @@ -3192,7 +3300,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) { diff --git a/source/blender/makesrna/intern/rna_action.c b/source/blender/makesrna/intern/rna_action.c index cfedee3c6cd..25c08a57889 100644 --- a/source/blender/makesrna/intern/rna_action.c +++ b/source/blender/makesrna/intern/rna_action.c @@ -258,10 +258,17 @@ static void rna_def_dopesheet(BlenderRNA *brna) RNA_def_struct_ui_text(srna, "DopeSheet", "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, "Source", "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_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); @@ -410,6 +417,12 @@ static void rna_def_dopesheet(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Display Node", "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..3c44720d469 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, 4); /* This should match BL_ActionManager::MAX_ACTION_LAYERS */ + 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..a3b3d0ac8c9 100644 --- a/source/blender/makesrna/intern/rna_animation.c +++ b/source/blender/makesrna/intern/rna_animation.c @@ -74,36 +74,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 +666,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_armature.c b/source/blender/makesrna/intern/rna_armature.c index 0310ce917d4..19a6b482621 100644 --- a/source/blender/makesrna/intern/rna_armature.c +++ b/source/blender/makesrna/intern/rna_armature.c @@ -816,6 +816,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 +868,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_constraint.c b/source/blender/makesrna/intern/rna_constraint.c index 8127c180706..2887232b659 100644 --- a/source/blender/makesrna/intern/rna_constraint.c +++ b/source/blender/makesrna/intern/rna_constraint.c @@ -1034,6 +1034,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); @@ -1378,7 +1384,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); @@ -1771,6 +1777,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); @@ -1795,6 +1807,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) @@ -1863,6 +1880,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 599d36ec8b8..3cf6feb005c 100644 --- a/source/blender/makesrna/intern/rna_curve.c +++ b/source/blender/makesrna/intern/rna_curve.c @@ -47,9 +47,17 @@ EnumPropertyItem beztriple_handle_type_items[] = { {HD_FREE, "FREE", 0, "Free", ""}, + {HD_VECT, "VECTOR", 0, "Vector", ""}, + {HD_ALIGN, "ALIGNED", 0, "Aligned", ""}, {HD_AUTO, "AUTO", 0, "Auto", ""}, + {0, NULL, 0, NULL, NULL}}; + +EnumPropertyItem keyframe_handle_type_items[] = { + {HD_FREE, "FREE", 0, "Free", ""}, {HD_VECT, "VECTOR", 0, "Vector", ""}, {HD_ALIGN, "ALIGNED", 0, "Aligned", ""}, + {HD_AUTO, "AUTO", 0, "Automatic", ""}, + {HD_AUTO_ANIM, "AUTO_CLAMPED", 0, "Auto Clamped", "Auto handles clamped to not overshoot"}, {0, NULL, 0, NULL, NULL}}; EnumPropertyItem beztriple_interpolation_mode_items[] = { diff --git a/source/blender/makesrna/intern/rna_fcurve.c b/source/blender/makesrna/intern/rna_fcurve.c index a46f84a22d2..6bb1416e7fc 100644 --- a/source/blender/makesrna/intern/rna_fcurve.c +++ b/source/blender/makesrna/intern/rna_fcurve.c @@ -139,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... @@ -454,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; @@ -571,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++; } } @@ -1015,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); } /* *********************** */ @@ -1035,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"); @@ -1075,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"); } @@ -1167,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); @@ -1242,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); @@ -1258,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); @@ -1277,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 */ @@ -1296,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); } @@ -1463,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_internal.h b/source/blender/makesrna/intern/rna_internal.h index c0ae7b02b1a..b1e4721bc79 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); @@ -282,6 +283,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..e99958c2217 100644 --- a/source/blender/makesrna/intern/rna_main_api.c +++ b/source/blender/makesrna/intern/rna_main_api.c @@ -63,6 +63,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 +72,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 +149,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 +411,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 +523,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 +1098,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_nla.c b/source/blender/makesrna/intern/rna_nla.c index 71bff06a864..5756044d12b 100644 --- a/source/blender/makesrna/intern/rna_nla.c +++ b/source/blender/makesrna/intern/rna_nla.c @@ -222,6 +222,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 +380,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 +452,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_object.c b/source/blender/makesrna/intern/rna_object.c index 76bbfcbed41..3371f194e6e 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -115,6 +115,7 @@ EnumPropertyItem object_type_items[] = { {0, "", 0, NULL, NULL}, {OB_CAMERA, "CAMERA", 0, "Camera", ""}, {OB_LAMP, "LAMP", 0, "Lamp", ""}, + {OB_SPEAKER, "SPEAKER", 0, "Speaker", ""}, {0, NULL, 0, NULL, NULL}}; EnumPropertyItem object_type_curve_items[] = { @@ -365,6 +366,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; } } diff --git a/source/blender/makesrna/intern/rna_pose.c b/source/blender/makesrna/intern/rna_pose.c index 47c8435cc46..635fc967a5a 100644 --- a/source/blender/makesrna/intern/rna_pose.c +++ b/source/blender/makesrna/intern/rna_pose.c @@ -45,6 +45,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 +731,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 +809,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 +826,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 29cfc695911..7313a39e5ec 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -182,6 +182,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" @@ -332,6 +333,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; @@ -991,9 +1012,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; } @@ -1051,10 +1071,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[] = { @@ -1197,7 +1221,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"); @@ -1208,7 +1232,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); @@ -2141,6 +2165,14 @@ static void rna_def_scene_render_data(BlenderRNA *brna) #endif #ifdef WITH_FFMPEG + 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 ffmpeg_format_items[] = { {FFMPEG_MPEG1, "MPEG1", 0, "MPEG-1", ""}, {FFMPEG_MPEG2, "MPEG2", 0, "MPEG-2", ""}, @@ -2452,28 +2484,37 @@ 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, "Audio Codec", "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, "Bitrate", "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_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_range(prop, 8000, 192000); RNA_def_property_ui_text(prop, "Samplerate", "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, "Volume", "Audio volume"); 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, "Audio Channels", "Sets the audio channel count"); #endif prop= RNA_def_property(srna, "fps", PROP_INT, PROP_NONE); @@ -2481,14 +2522,14 @@ static void rna_def_scene_render_data(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_range(prop, 1, 120); RNA_def_property_ui_text(prop, "FPS", "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, "FPS Base", "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); @@ -3427,21 +3468,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, "Speed of Sound", "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, "Doppler Factor", "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, "Distance Model", "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, "Volume", "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_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c index 8c4e4d9e736..38575242fd6 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" @@ -418,6 +419,8 @@ static StructRNA* rna_Sequence_refine(struct PointerRNA *ptr) return &RNA_ColorSequence; case SEQ_SPEED: return &RNA_SpeedControlSequence; + case SEQ_TITLECARD: + return &RNA_TitleCardSequence; default: return &RNA_Sequence; } @@ -525,6 +528,33 @@ static void rna_Sequence_attenuation_set(PointerRNA *ptr, float value) seq->volume = from_dB(value); } +static void rna_Sequence_volume_set(PointerRNA *ptr, float value) +{ + Sequence *seq= (Sequence*)(ptr->data); + + 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_pitch_set(PointerRNA *ptr, float value) +{ + Sequence *seq= (Sequence*)(ptr->data); + + 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); +} + static int rna_Sequence_input_count_get(PointerRNA *ptr) { @@ -556,9 +586,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 +595,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); } @@ -886,6 +913,7 @@ static void rna_def_sequence(BlenderRNA *brna) {SEQ_SPEED, "SPEED", 0, "Speed", ""}, {SEQ_MULTICAM, "MULTICAM", 0, "Multicam Selector", ""}, {SEQ_ADJUSTMENT, "ADJUSTMENT", 0, "Adjustment Layer", ""}, + {SEQ_TITLECARD, "TITLE_CARD", 0, "Title Card", ""}, {0, NULL, 0, NULL, NULL}}; static const EnumPropertyItem blend_mode_items[]= { @@ -948,6 +976,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); @@ -1365,13 +1398,27 @@ 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); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); + 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); @@ -1666,6 +1713,37 @@ static void rna_def_speed_control(BlenderRNA *brna) RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); } +static void rna_def_title_card(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + srna = RNA_def_struct(brna, "TitleCardSequence", "EffectSequence"); + RNA_def_struct_ui_text(srna, "Title Card Sequence", "Sequence strip creating an image displaying some text on a plain color background"); + RNA_def_struct_sdna_from(srna, "TitleCardVars", "effectdata"); + + /* texts */ + prop= RNA_def_property(srna, "title", PROP_STRING, PROP_NONE); + RNA_def_property_string_sdna(prop, NULL, "titlestr"); + RNA_def_property_ui_text(prop, "Title", "Text for main heading"); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); + + prop= RNA_def_property(srna, "subtitle", PROP_STRING, PROP_NONE); + RNA_def_property_ui_text(prop, "Subtitle", "Additional text to be shown under the main heading"); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); + + /* colors */ + prop= RNA_def_property(srna, "color_background", PROP_FLOAT, PROP_COLOR); + RNA_def_property_float_sdna(prop, NULL, "bgcol"); + RNA_def_property_ui_text(prop, "Background Color", ""); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); + + prop= RNA_def_property(srna, "color_foreground", PROP_FLOAT, PROP_COLOR); + RNA_def_property_float_sdna(prop, NULL, "fgcol"); + RNA_def_property_ui_text(prop, "Text Color", ""); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); +} + void RNA_def_sequencer(BlenderRNA *brna) { rna_def_strip_element(brna); @@ -1691,6 +1769,7 @@ void RNA_def_sequencer(BlenderRNA *brna) rna_def_transform(brna); rna_def_solid_color(brna); rna_def_speed_control(brna); + rna_def_title_card(brna); } #endif diff --git a/source/blender/makesrna/intern/rna_sound.c b/source/blender/makesrna/intern/rna_sound.c index 97339058794..e78bc092040 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_filepath_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) @@ -87,7 +92,7 @@ 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"); } 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 b79d5395eec..2ad3022bceb 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -1877,11 +1877,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, "DopeSheet", "DopeSheet Editor"}, - {SACTCONT_ACTION, "ACTION", 0, "Action Editor", "Action Editor"}, - {SACTCONT_SHAPEKEY, "SHAPEKEY", 0, "ShapeKey Editor", "ShapeKey Editor"}, - {SACTCONT_GPENCIL, "GPENCIL", 0, "Grease Pencil", "Grease Pencil"}, + {SACTCONT_DOPESHEET, "DOPESHEET", ICON_OOPS, "DopeSheet", "DopeSheet Editor"}, + {SACTCONT_ACTION, "ACTION", ICON_OBJECT_DATA, "Action Editor", "Action Editor"}, + {SACTCONT_SHAPEKEY, "SHAPEKEY", ICON_SHAPEKEY_DATA, "ShapeKey Editor", "ShapeKey Editor"}, + {SACTCONT_GPENCIL, "GPENCIL", ICON_GREASEPENCIL, "Grease Pencil", "Grease Pencil"}, {0, NULL, 0, NULL, NULL}}; @@ -1960,8 +1961,8 @@ static void rna_def_space_graph(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem mode_items[] = { - {SIPO_MODE_ANIMATION, "FCURVES", 0, "F-Curve Editor", "Edit f-curves"}, - {SIPO_MODE_DRIVERS, "DRIVERS", 0, "Drivers", "Edit drivers"}, + {SIPO_MODE_ANIMATION, "FCURVES", ICON_IPO, "F-Curve Editor", "Edit animation/keyframes displayed as 2D curves"}, + {SIPO_MODE_DRIVERS, "DRIVERS", ICON_DRIVER, "Drivers", "Edit drivers"}, {0, NULL, 0, NULL, NULL}}; /* this is basically the same as the one for the 3D-View, but with some entries ommitted */ @@ -2018,9 +2019,9 @@ static void rna_def_space_graph(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Only Selected Keyframes Handles", "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, "Use Fancy Drawing", "Draw F-Curves using Anti-Aliasing and other fancy effects. Disable for better performance"); + RNA_def_property_ui_text(prop, "Use High Quality Drawing", "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 */ @@ -2130,7 +2131,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, "Only Selected channels", "Show keyframes for active Object and/or its selected channels only"); + RNA_def_property_ui_text(prop, "Only Selected Channels", "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_speaker.c b/source/blender/makesrna/intern/rna_speaker.c new file mode 100644 index 00000000000..60208de5aa5 --- /dev/null +++ b/source/blender/makesrna/intern/rna_speaker.c @@ -0,0 +1,172 @@ +/* + * $Id$ + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * Contributor(s): Jörg Müller. + * + * ***** END GPL LICENSE BLOCK ***** + */ + +/** \file blender/makesrna/intern/rna_speaker.c + * \ingroup RNA + */ + + +#include <stdlib.h> + +#include "RNA_define.h" +#include "RNA_enum_types.h" + +#include "rna_internal.h" + +#include "DNA_speaker_types.h" +#include "DNA_sound_types.h" + +#ifdef RNA_RUNTIME + +#include "MEM_guardedalloc.h" + +#include "BKE_depsgraph.h" +#include "BKE_main.h" + +#include "WM_api.h" +#include "WM_types.h" + + +#else + +static void rna_def_speaker(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + srna= RNA_def_struct(brna, "Speaker", "ID"); + RNA_def_struct_ui_text(srna, "Speaker", "Speaker datablock for 3D audio speaker objects"); + RNA_def_struct_ui_icon(srna, ICON_SPEAKER); + + prop= RNA_def_property(srna, "muted", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", SPK_MUTED); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_ui_text(prop, "Mute", "Mutes the speaker."); + // RNA_def_property_update(prop, 0, "rna_Speaker_update"); + + /* This shouldn't be changed actually, hiding it! + prop= RNA_def_property(srna, "relative", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", SPK_RELATIVE); + RNA_def_property_ui_text(prop, "Relative", "Whether the source is relative to the camera or not."); + // RNA_def_property_update(prop, 0, "rna_Speaker_update");*/ + + prop= RNA_def_property(srna, "sound", PROP_POINTER, PROP_NONE); + RNA_def_property_pointer_sdna(prop, NULL, "sound"); + RNA_def_property_struct_type(prop, "Sound"); + RNA_def_property_flag(prop, PROP_EDITABLE); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_ui_text(prop, "Sound", "Sound datablock used by this speaker."); + // RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_sound_set", NULL); + // RNA_def_property_update(prop, 0, "rna_Speaker_update"); + + prop= RNA_def_property(srna, "volume_max", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "volume_max"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_range(prop, 0.0f, 1.0f); + RNA_def_property_ui_text(prop, "Maximum Volume", "Maximum volume, no matter how near the object is."); + // RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_volume_max_set", NULL); + // RNA_def_property_update(prop, 0, "rna_Speaker_update"); + + prop= RNA_def_property(srna, "volume_min", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "volume_min"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_range(prop, 0.0f, 1.0f); + RNA_def_property_ui_text(prop, "Minimum Volume", "Minimum volume, no matter how far away the object is."); + // RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_volume_min_set", NULL); + // RNA_def_property_update(prop, 0, "rna_Speaker_update"); + + prop= RNA_def_property(srna, "distance_max", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "distance_max"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_range(prop, 0.0f, FLT_MAX); + RNA_def_property_ui_text(prop, "Maximum Distance", "Maximum distance for volume calculation, no matter how far away the object is."); + // RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_distance_max_set", NULL); + // RNA_def_property_update(prop, 0, "rna_Speaker_update"); + + prop= RNA_def_property(srna, "distance_reference", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "distance_reference"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_range(prop, 0.0f, FLT_MAX); + RNA_def_property_ui_text(prop, "Reference Distance", "Reference distance at which volume is 100 %."); + // RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_distance_reference_set", NULL); + // RNA_def_property_update(prop, 0, "rna_Speaker_update"); + + prop= RNA_def_property(srna, "attenuation", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "attenuation"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_range(prop, 0.0f, FLT_MAX); + RNA_def_property_ui_text(prop, "Attenuation", "How strong the distance affects volume, depending on distance model."); + // RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_attenuation_set", NULL); + // RNA_def_property_update(prop, 0, "rna_Speaker_update"); + + prop= RNA_def_property(srna, "cone_angle_outer", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "cone_angle_outer"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_range(prop, 0.0f, 360.0f); + RNA_def_property_ui_text(prop, "Outer Cone Angle", "Outer angle of the cone in degrees, outside this cone the volume is the outer cone volume, between inner and outer cone the volume is interpolated."); + // RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_cone_angle_outer_set", NULL); + // RNA_def_property_update(prop, 0, "rna_Speaker_update"); + + prop= RNA_def_property(srna, "cone_angle_inner", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "cone_angle_inner"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_range(prop, 0.0f, 360.0f); + RNA_def_property_ui_text(prop, "Inner Cone Angle", "Inner angle of the cone in degrees, inside the cone the volume is 100 %."); + // RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_cone_angle_inner_set", NULL); + // RNA_def_property_update(prop, 0, "rna_Speaker_update"); + + prop= RNA_def_property(srna, "cone_volume_outer", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "cone_volume_outer"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_range(prop, 0.0f, 1.0f); + RNA_def_property_ui_text(prop, "Outer Cone Volume", "Volume outside the outer cone."); + // RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_cone_volume_outer_set", NULL); + // RNA_def_property_update(prop, 0, "rna_Speaker_update"); + + prop= RNA_def_property(srna, "volume", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "volume"); + RNA_def_property_range(prop, 0.0f, 1.0f); + RNA_def_property_ui_text(prop, "Volume", "How loud the sound is."); + // RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_volume_set", NULL); + // RNA_def_property_update(prop, 0, "rna_Speaker_update"); + + 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_Speaker_pitch_set", NULL); + // RNA_def_property_update(prop, 0, "rna_Speaker_update"); + + /* common */ + rna_def_animdata_common(srna); +} + + +void RNA_def_speaker(BlenderRNA *brna) +{ + rna_def_speaker(brna); +} + +#endif + diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index a685c6deb34..a67cd40e62a 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -878,6 +878,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"); @@ -919,6 +934,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); @@ -2225,13 +2245,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, "Auto Keying Enable", "Automatic keyframe insertion for Objects and Bones"); + RNA_def_property_ui_text(prop, "Auto Keying Enable", "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, "Auto Keying Mode", "Mode of automatic keyframe insertion for Objects and Bones"); + RNA_def_property_ui_text(prop, "Auto Keying Mode", "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); @@ -2253,12 +2273,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, "New Interpolation Type", ""); + RNA_def_property_ui_text(prop, "New Interpolation Type", "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, "New Handles Type", ""); + RNA_def_property_ui_text(prop, "New Handles Type", "Handle type for handles of new keyframes"); /* frame numbers */ prop= RNA_def_property(srna, "use_negative_frames", PROP_BOOLEAN, PROP_NONE); @@ -2930,7 +2950,11 @@ static void rna_def_userdef_filepaths(BlenderRNA *brna) prop= RNA_def_property(srna, "recent_files", PROP_INT, PROP_NONE); RNA_def_property_range(prop, 0, 30); RNA_def_property_ui_text(prop, "Recent Files", "Maximum number of recently opened files to remember"); - + + prop= RNA_def_property(srna, "use_update_recent_files_on_load", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_NO_RECENTLOAD_UPDATE); + RNA_def_property_ui_text(prop, "Update Recent on Load", "When enabled, opening files will update the recent files list. Otherwise, updates only occur when saving"); + prop= RNA_def_property(srna, "use_save_preview_images", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_SAVE_PREVIEWS); RNA_def_property_ui_text(prop, "Save Preview Images", "Enables automatic saving of preview images in the .blend file"); |