diff options
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/space_logic/logic_window.c | 19 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_actuator_types.h | 7 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_actuator.c | 17 |
3 files changed, 41 insertions, 2 deletions
diff --git a/source/blender/editors/space_logic/logic_window.c b/source/blender/editors/space_logic/logic_window.c index f46151fd33a..fa7e888f8d7 100644 --- a/source/blender/editors/space_logic/logic_window.c +++ b/source/blender/editors/space_logic/logic_window.c @@ -1860,6 +1860,25 @@ static void draw_actuator_motion(uiLayout *layout, PointerRNA *ptr) uiItemR(col, ptr, "integral_coefficient", UI_ITEM_R_SLIDER, NULL, ICON_NONE); uiItemR(col, ptr, "derivate_coefficient", UI_ITEM_R_SLIDER, NULL, ICON_NONE); break; + case ACT_OBJECT_CHARACTER: + split = uiLayoutSplit(layout, 0.9, FALSE); + row = uiLayoutRow(split, FALSE); + uiItemR(row, ptr, "offset_location", 0, NULL, ICON_NONE); + row = uiLayoutRow(split, TRUE); + uiItemR(row, ptr, "use_local_location", UI_ITEM_R_TOGGLE, NULL, ICON_NONE); + uiItemR(row, ptr, "use_add_character_location", UI_ITEM_R_TOGGLE, NULL, ICON_NONE); + + split = uiLayoutSplit(layout, 0.9, FALSE); + row = uiLayoutRow(split, FALSE); + uiItemR(row, ptr, "offset_rotation", 0, NULL, ICON_NONE); + uiItemR(split, ptr, "use_local_rotation", UI_ITEM_R_TOGGLE, NULL, ICON_NONE); + + split = uiLayoutSplit(layout, 0.9, FALSE); + row = uiLayoutRow(split, FALSE); + split = uiLayoutSplit(row, 0.7, FALSE); + uiItemL(split, "", ICON_NONE); /*Just use this for some spacing */ + uiItemR(split, ptr, "use_character_jump", UI_ITEM_R_TOGGLE, NULL, ICON_NONE); + break; } } diff --git a/source/blender/makesdna/DNA_actuator_types.h b/source/blender/makesdna/DNA_actuator_types.h index b445d59db2c..7c4772f24e8 100644 --- a/source/blender/makesdna/DNA_actuator_types.h +++ b/source/blender/makesdna/DNA_actuator_types.h @@ -277,10 +277,13 @@ typedef struct bActuator { #define ACT_ANG_VEL_LOCAL 32 //#define ACT_ADD_LIN_VEL_LOCAL 64 #define ACT_ADD_LIN_VEL 64 +#define ACT_ADD_CHAR_LOC 128 +#define ACT_CHAR_JUMP 256 /* objectactuator->type */ -#define ACT_OBJECT_NORMAL 0 -#define ACT_OBJECT_SERVO 1 +#define ACT_OBJECT_NORMAL 0 +#define ACT_OBJECT_SERVO 1 +#define ACT_OBJECT_CHARACTER 2 /* actuator->type */ #define ACT_OBJECT 0 diff --git a/source/blender/makesrna/intern/rna_actuator.c b/source/blender/makesrna/intern/rna_actuator.c index b653289e44d..18035acdb63 100644 --- a/source/blender/makesrna/intern/rna_actuator.c +++ b/source/blender/makesrna/intern/rna_actuator.c @@ -389,6 +389,12 @@ static void rna_ObjectActuator_type_set(struct PointerRNA *ptr, int value) oa->forcerot[1] = 0.5f; oa->forcerot[2] = 0.0f; break; + + case ACT_OBJECT_CHARACTER: + memset(oa, 0, sizeof(bObjectActuator)); + oa->flag = ACT_DLOC_LOCAL | ACT_DROT_LOCAL; + oa->type = ACT_OBJECT_CHARACTER; + break; } } } @@ -701,6 +707,7 @@ static void rna_def_object_actuator(BlenderRNA *brna) static EnumPropertyItem prop_type_items[] = { {ACT_OBJECT_NORMAL, "OBJECT_NORMAL", 0, "Simple Motion", ""}, {ACT_OBJECT_SERVO, "OBJECT_SERVO", 0, "Servo Control", ""}, + {ACT_OBJECT_CHARACTER, "OBJECT_CHARACTER", 0, "Character Motion", ""}, {0, NULL, 0, NULL, NULL} }; @@ -867,6 +874,11 @@ static void rna_def_object_actuator(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Add", "Toggles between ADD and SET linV"); RNA_def_property_update(prop, NC_LOGIC, NULL); + prop = RNA_def_property(srna, "use_add_character_location", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_ADD_CHAR_LOC); + RNA_def_property_ui_text(prop, "Add", "Toggles between ADD and SET character location"); + RNA_def_property_update(prop, NC_LOGIC, NULL); + prop = RNA_def_property(srna, "use_servo_limit_x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_SERVO_LIMIT_X); RNA_def_property_ui_text(prop, "X", "Set limit to force along the X axis"); @@ -881,6 +893,11 @@ static void rna_def_object_actuator(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_SERVO_LIMIT_Z); RNA_def_property_ui_text(prop, "Z", "Set limit to force along the Z axis"); RNA_def_property_update(prop, NC_LOGIC, NULL); + + prop = RNA_def_property(srna, "use_character_jump", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_CHAR_JUMP); + RNA_def_property_ui_text(prop, "Jump", "Makes the character jump using the settings in the physics properties"); + RNA_def_property_update(prop, NC_LOGIC, NULL); } static void rna_def_camera_actuator(BlenderRNA *brna) |