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:
Diffstat (limited to 'source/blender/makesrna/intern/rna_actuator.c')
-rw-r--r--source/blender/makesrna/intern/rna_actuator.c75
1 files changed, 59 insertions, 16 deletions
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);