Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoerg Mueller <nexyon@gmail.com>2011-08-30 13:15:55 +0400
committerJoerg Mueller <nexyon@gmail.com>2011-08-30 13:15:55 +0400
commit9424b1ceff992f420fe6315acabfb7138cd0026e (patch)
tree2f19cac8af2ad32852cf9c46cb542e14fabe8d9b /source/blender/makesrna
parentd049a722fea3d150fbfad06ffdbbb5c150717134 (diff)
parent43ab8e86247b7889d16d915b4f370ceb618aaad4 (diff)
Merging pepper to trunk at revision 39791.
Important note: I used rsync to do the local merge, as "svn merge --reintegrate ^/branches/soc-2011-pepper" doesn't work with our svn server right now!
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r--source/blender/makesrna/RNA_access.h5
-rw-r--r--source/blender/makesrna/RNA_enum_types.h3
-rw-r--r--source/blender/makesrna/intern/CMakeLists.txt1
-rw-r--r--source/blender/makesrna/intern/makesrna.c1
-rw-r--r--source/blender/makesrna/intern/rna_ID.c3
-rw-r--r--source/blender/makesrna/intern/rna_access.c112
-rw-r--r--source/blender/makesrna/intern/rna_action.c16
-rw-r--r--source/blender/makesrna/intern/rna_actuator.c75
-rw-r--r--source/blender/makesrna/intern/rna_animation.c35
-rw-r--r--source/blender/makesrna/intern/rna_animation_api.c35
-rw-r--r--source/blender/makesrna/intern/rna_animviz.c2
-rw-r--r--source/blender/makesrna/intern/rna_armature.c14
-rw-r--r--source/blender/makesrna/intern/rna_constraint.c27
-rw-r--r--source/blender/makesrna/intern/rna_curve.c8
-rw-r--r--source/blender/makesrna/intern/rna_fcurve.c115
-rw-r--r--source/blender/makesrna/intern/rna_gpencil.c2
-rw-r--r--source/blender/makesrna/intern/rna_internal.h2
-rw-r--r--source/blender/makesrna/intern/rna_main.c7
-rw-r--r--source/blender/makesrna/intern/rna_main_api.c53
-rw-r--r--source/blender/makesrna/intern/rna_nla.c27
-rw-r--r--source/blender/makesrna/intern/rna_object.c2
-rw-r--r--source/blender/makesrna/intern/rna_pose.c34
-rw-r--r--source/blender/makesrna/intern/rna_scene.c94
-rw-r--r--source/blender/makesrna/intern/rna_sequencer.c60
-rw-r--r--source/blender/makesrna/intern/rna_sound.c20
-rw-r--r--source/blender/makesrna/intern/rna_space.c19
-rw-r--r--source/blender/makesrna/intern/rna_speaker.c172
-rw-r--r--source/blender/makesrna/intern/rna_userdef.c30
28 files changed, 805 insertions, 169 deletions
diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h
index 81deb0c2796..259c7de5cd4 100644
--- a/source/blender/makesrna/RNA_access.h
+++ b/source/blender/makesrna/RNA_access.h
@@ -464,6 +464,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;
@@ -702,6 +703,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 c82a43e371c..0b63bb02436 100644
--- a/source/blender/makesrna/RNA_enum_types.h
+++ b/source/blender/makesrna/RNA_enum_types.h
@@ -59,6 +59,7 @@ 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[];
@@ -98,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/intern/CMakeLists.txt b/source/blender/makesrna/intern/CMakeLists.txt
index 6b042a987e3..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
diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c
index d0dea41b384..bc30210bfbb 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 bc6e17a689d..0d4e31cdaf2 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)
@@ -3217,7 +3325,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..815a9c92968 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
@@ -258,10 +256,18 @@ 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_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);
@@ -410,6 +416,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..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_constraint.c b/source/blender/makesrna/intern/rna_constraint.c
index 8127c180706..22d9a19f933 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
@@ -1034,6 +1032,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 +1382,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 +1775,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 +1805,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 +1878,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..e922a007249 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
@@ -139,6 +137,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 +453,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 +594,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 +1038,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 +1103,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 +1149,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 +1242,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 +1318,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 +1334,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 +1353,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 +1372,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 +1539,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 955e56193c6..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);
@@ -283,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 ea0364084f9..d69cb2063ab 100644
--- a/source/blender/makesrna/intern/rna_main_api.c
+++ b/source/blender/makesrna/intern/rna_main_api.c
@@ -64,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"
@@ -72,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"
@@ -148,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;
@@ -407,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);
@@ -503,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); }
@@ -1077,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_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_object.c b/source/blender/makesrna/intern/rna_object.c
index 55e1119f58e..ad323b0aba4 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..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 552ff7b6365..cc1e7d9390b 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
@@ -188,6 +188,7 @@ EnumPropertyItem image_color_mode_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"
@@ -338,6 +339,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;
@@ -997,9 +1018,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;
}
@@ -1057,10 +1077,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[] = {
@@ -1203,7 +1227,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");
@@ -1214,7 +1238,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);
@@ -1901,6 +1925,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);
@@ -2182,6 +2210,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, "Blender Render", "Use the Blender internal rendering engine for rendering"},
{0, NULL, 0, NULL, NULL}};
@@ -2452,43 +2488,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, "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_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);
-
#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, "Samplerate", "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, "Audio Channels", "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, "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 +3473,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 b6e2117956d..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)
{
@@ -515,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);
+
+ 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);
- return to_dB(seq->volume);
+ 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_attenuation_set(PointerRNA *ptr, float value)
+static void rna_Sequence_pan_set(PointerRNA *ptr, float value)
{
Sequence *seq= (Sequence*)(ptr->data);
- seq->volume = from_dB(value);
+ seq->pan = value;
+ if(seq->scene_sound)
+ sound_set_scene_sound_pan(seq->scene_sound, value, (seq->flag & SEQ_AUDIO_PAN_ANIMATED) != 0);
}
@@ -560,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)
@@ -572,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);
}
@@ -1033,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);
@@ -1456,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);
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 0166baa8443..8f3097e5589 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -1878,11 +1878,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}};
@@ -1961,8 +1962,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 */
@@ -2019,9 +2020,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 */
@@ -2131,7 +2132,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..7d0502f1be9 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);