diff options
-rw-r--r-- | source/blender/editors/space_logic/logic_window.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_actuator.c | 29 |
2 files changed, 29 insertions, 2 deletions
diff --git a/source/blender/editors/space_logic/logic_window.c b/source/blender/editors/space_logic/logic_window.c index 9e615d0d1aa..38b1284b808 100644 --- a/source/blender/editors/space_logic/logic_window.c +++ b/source/blender/editors/space_logic/logic_window.c @@ -3753,7 +3753,7 @@ static void draw_actuator_camera(uiLayout *layout, PointerRNA *ptr) uiItemR(row, ptr, "height", 0, NULL, ICON_NULL); uiItemR(row, ptr, "axis", 0, NULL, ICON_NULL); - row = uiLayoutRow(layout, 0); + row = uiLayoutRow(layout, 1); uiItemR(row, ptr, "min", 0, NULL, ICON_NULL); uiItemR(row, ptr, "max", 0, NULL, ICON_NULL); } diff --git a/source/blender/makesrna/intern/rna_actuator.c b/source/blender/makesrna/intern/rna_actuator.c index 378209bb2e7..b17e1f14740 100644 --- a/source/blender/makesrna/intern/rna_actuator.c +++ b/source/blender/makesrna/intern/rna_actuator.c @@ -284,7 +284,6 @@ static void rna_ConstraintActuator_spring_set(struct PointerRNA *ptr, float valu *fp = value; } - /* ConstraintActuator uses the same property for Material and Property. Therefore we need to clear the property when "use_material_detect" mode changes */ static void rna_Actuator_constraint_detect_material_set(struct PointerRNA *ptr, int value) @@ -324,6 +323,33 @@ static void rna_FcurveActuator_force_set(struct PointerRNA *ptr, int value) ia->flag &= ~ACT_IPOFORCE; } + +static void rna_ObjectActuator_type_set(struct PointerRNA *ptr, int value) +{ + bActuator *act= (bActuator *)ptr->data; + bObjectActuator *oa = act->data; + if (value != oa->type) + { + oa->type = value; + switch (oa->type) { + case ACT_OBJECT_NORMAL: + memset(oa, 0, sizeof(bObjectActuator)); + oa->flag = ACT_FORCE_LOCAL|ACT_TORQUE_LOCAL|ACT_DLOC_LOCAL|ACT_DROT_LOCAL; + oa->type = ACT_OBJECT_NORMAL; + break; + + case ACT_OBJECT_SERVO: + memset(oa, 0, sizeof(bObjectActuator)); + oa->flag = ACT_LIN_VEL_LOCAL; + oa->type = ACT_OBJECT_SERVO; + oa->forcerot[0] = 30.0f; + oa->forcerot[1] = 0.5f; + oa->forcerot[2] = 0.0f; + break; + } + } +} + static void rna_ObjectActuator_integralcoefficient_set(struct PointerRNA *ptr, float value) { bActuator *act = (bActuator*)ptr->data; @@ -591,6 +617,7 @@ static void rna_def_object_actuator(BlenderRNA *brna) prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "type"); RNA_def_property_enum_items(prop, prop_type_items); + RNA_def_property_enum_funcs(prop, NULL, "rna_ObjectActuator_type_set", NULL); RNA_def_property_ui_text(prop, "Motion Type", "Specify the motion system"); RNA_def_property_update(prop, NC_LOGIC, NULL); |