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:
authorMitchell Stokes <mogurijin@gmail.com>2013-08-15 03:32:00 +0400
committerMitchell Stokes <mogurijin@gmail.com>2013-08-15 03:32:00 +0400
commit196d30e0046088820e240642e318e051e2e69fbc (patch)
tree698f2542102463723ac4d8958b9b7b23fdfea46d /source/blender
parent9afae77fedb8a84f4d305ebce81b0cc509a2183b (diff)
BGE: The Action Actuator can now make use of additive blending.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/editors/space_logic/logic_window.c1
-rw-r--r--source/blender/makesdna/DNA_actuator_types.h6
-rw-r--r--source/blender/makesrna/intern/rna_actuator.c14
3 files changed, 19 insertions, 2 deletions
diff --git a/source/blender/editors/space_logic/logic_window.c b/source/blender/editors/space_logic/logic_window.c
index 2957edd941b..aed5699a9d7 100644
--- a/source/blender/editors/space_logic/logic_window.c
+++ b/source/blender/editors/space_logic/logic_window.c
@@ -1465,6 +1465,7 @@ static void draw_actuator_action(uiLayout *layout, PointerRNA *ptr)
row = uiLayoutRow(layout, FALSE);
uiItemR(row, ptr, "layer", 0, NULL, ICON_NONE);
uiItemR(row, ptr, "layer_weight", 0, NULL, ICON_NONE);
+ uiItemR(row, ptr, "blend_mode", 0, "", ICON_NONE);
uiItemPointerR(layout, ptr, "frame_property", &settings_ptr, "properties", NULL, ICON_NONE);
diff --git a/source/blender/makesdna/DNA_actuator_types.h b/source/blender/makesdna/DNA_actuator_types.h
index 1495ba1b1a5..f4e2ff43fc5 100644
--- a/source/blender/makesdna/DNA_actuator_types.h
+++ b/source/blender/makesdna/DNA_actuator_types.h
@@ -59,7 +59,7 @@ typedef struct bActionActuator {
short layer; /* Animation layer */
short end_reset; /* Ending the actuator (negative pulse) wont reset the the action to its starting frame */
short strideaxis; /* Displacement axis */
- short pad;
+ short blend_mode; /* Layer blending mode */
float stridelength; /* Displacement incurred by cycle */ // not in use
float layer_weight; /* How much of the previous layer to use for blending. (<0 = disable, 0 = add mode) */
} bActionActuator;
@@ -341,6 +341,10 @@ typedef struct bActuator {
#define ACT_ACTION_FROM_PROP 6
#define ACT_ACTION_MOTION 7
+/* actionactuator->blend_mode */
+#define ACT_ACTION_BLEND 0
+#define ACT_ACTION_ADD 1
+
/* ipoactuator->type */
#define ACT_IPO_PLAY 0
#define ACT_IPO_PINGPONG 1
diff --git a/source/blender/makesrna/intern/rna_actuator.c b/source/blender/makesrna/intern/rna_actuator.c
index 134c5bcbee4..99053714246 100644
--- a/source/blender/makesrna/intern/rna_actuator.c
+++ b/source/blender/makesrna/intern/rna_actuator.c
@@ -593,6 +593,12 @@ static void rna_def_action_actuator(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}
};
+ static EnumPropertyItem prop_blend_items[] = {
+ {ACT_ACTION_BLEND, "BLEND", 0, "Blend", ""},
+ {ACT_ACTION_ADD, "ADD", 0, "Add", ""},
+ {0, NULL, 0, NULL, NULL}
+ };
+
srna = RNA_def_struct(brna, "ActionActuator", "Actuator");
RNA_def_struct_ui_text(srna, "Action Actuator", "Actuator to control the object movement");
RNA_def_struct_sdna_from(srna, "bActionActuator", "data");
@@ -656,7 +662,7 @@ static void rna_def_action_actuator(BlenderRNA *brna)
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)");
+ "How much of the previous layer to blend into this one");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop = RNA_def_property(srna, "frame_property", PROP_STRING, PROP_NONE);
@@ -691,6 +697,12 @@ static void rna_def_action_actuator(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Child", "Update Action on all children Objects as well");
RNA_def_property_update(prop, NC_LOGIC, NULL);
+ prop = RNA_def_property(srna, "blend_mode", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "blend_mode");
+ RNA_def_property_enum_items(prop, prop_blend_items);
+ RNA_def_property_ui_text(prop, "Blend Mode", "Determines how this layer is blended with previous layers");
+ 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");