diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2011-01-31 10:52:45 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2011-01-31 10:52:45 +0300 |
commit | e5cbc0307a3b3a5e5c922bf07eaf71000440b4ab (patch) | |
tree | ee541bc84b84f3423be9f8e81275a504ca725c27 /source/blender/makesrna | |
parent | d5c7231339c5a5a9714549e0e919fbbd331f09d0 (diff) |
Logic UI: Servo Control (Motion/ObjectActuator) default options + camera actuator tweak
In 2.49 we had this implemented in the logic_windows.c. I think I skipped this when porting the new UI. I probably didn't know how to do it back then or was waiting for something. Anyhoo, it's all good now.
For the records, the Logic Bricks that I haven't gone over to make sure everything is 100% are:
Filter 2D, Constraints and Animation (action, shapekey, fcurve)
I'm going over them this week, so the Logic Bricks are close to receive a "revisited review check-up" ISO 9000 :)
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_actuator.c | 29 |
1 files changed, 28 insertions, 1 deletions
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); |