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 :)
This commit is contained in:
Dalai Felinto
2011-01-31 07:52:45 +00:00
parent d5c7231339
commit e5cbc0307a
2 changed files with 29 additions and 2 deletions

View File

@@ -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);
}

View File

@@ -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);