From 0511086d5fc6915288fb35743b9eab0f04b0c306 Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Fri, 7 May 2010 23:56:26 +0000 Subject: [PATCH] adjusment to constraint actuator layout (forgot to expose normal and before) --- .../editors/space_logic/logic_window.c | 29 ++++++++++++------- source/blender/makesrna/intern/rna_actuator.c | 6 ++-- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/source/blender/editors/space_logic/logic_window.c b/source/blender/editors/space_logic/logic_window.c index aab4f948401..d278cf16fd4 100644 --- a/source/blender/editors/space_logic/logic_window.c +++ b/source/blender/editors/space_logic/logic_window.c @@ -3635,7 +3635,7 @@ static void draw_actuator_camera(uiLayout *layout, PointerRNA *ptr) static void draw_actuator_constraint(uiLayout *layout, PointerRNA *ptr) { - uiLayout *row, *subrow, *split; + uiLayout *row, *subrow, *col, *subcol, *split; uiItemR(layout, ptr, "mode", 0, NULL, 0); switch (RNA_enum_get(ptr, "mode")) @@ -3651,15 +3651,22 @@ static void draw_actuator_constraint(uiLayout *layout, PointerRNA *ptr) break; case ACT_CONST_TYPE_DIST: - uiItemR(layout, ptr, "direction", 0, NULL, 0);//move to the right - if(RNA_enum_get(ptr, "direction")!=0) - uiItemR(layout, ptr, "force_distance", 0, NULL, 0); + split = uiLayoutSplit(layout, 0.8, 0); + uiItemR(split, ptr, "direction", 0, NULL, 0); + row = uiLayoutRow(split, 1); + uiItemR(row, ptr, "local", UI_ITEM_R_TOGGLE, NULL, 0); + uiItemR(row, ptr, "normal", UI_ITEM_R_TOGGLE, NULL, 0); row = uiLayoutRow(layout, 0); - uiItemR(row, ptr, "range", 0, NULL, 0); - subrow = uiLayoutRow(row, 0); - uiLayoutSetActive(subrow, RNA_boolean_get(ptr, "force_distance")==1); - uiItemR(subrow, ptr, "distance", 0, NULL, 0); + col = uiLayoutColumn(row, 0); + uiItemL(col, "Range:", 0); + uiItemR(col, ptr, "range", 0, "", 0); + + col = uiLayoutColumn(row, 1); + uiItemR(col, ptr, "force_distance", UI_ITEM_R_TOGGLE, NULL, 0); + subcol = uiLayoutColumn(col, 0); + uiLayoutSetActive(subcol, RNA_boolean_get(ptr, "force_distance")==1); + uiItemR(subcol, ptr, "distance", 0, "", 0); uiItemR(layout, ptr, "damping", UI_ITEM_R_SLIDER , NULL, 0); @@ -3904,21 +3911,21 @@ static void draw_actuator_motion(uiLayout *layout, PointerRNA *ptr) row = uiLayoutRow(layout, 0); col = uiLayoutColumn(row, 0); uiItemR(col, ptr, "servo_limit_x", UI_ITEM_R_TOGGLE, NULL, 0); - subcol = uiLayoutColumn(col, 0); + subcol = uiLayoutColumn(col, 1); uiLayoutSetActive(subcol, RNA_boolean_get(ptr, "servo_limit_x")==1); uiItemR(subcol, ptr, "force_max_x", 0, NULL, 0); uiItemR(subcol, ptr, "force_min_x", 0, NULL, 0); col = uiLayoutColumn(row, 0); uiItemR(col, ptr, "servo_limit_y", UI_ITEM_R_TOGGLE, NULL, 0); - subcol = uiLayoutColumn(col, 0); + subcol = uiLayoutColumn(col, 1); uiLayoutSetActive(subcol, RNA_boolean_get(ptr, "servo_limit_y")==1); uiItemR(subcol, ptr, "force_max_y", 0, NULL, 0); uiItemR(subcol, ptr, "force_min_y", 0, NULL, 0); col = uiLayoutColumn(row, 0); uiItemR(col, ptr, "servo_limit_z", UI_ITEM_R_TOGGLE, NULL, 0); - subcol = uiLayoutColumn(col, 0); + subcol = uiLayoutColumn(col, 1); uiLayoutSetActive(subcol, RNA_boolean_get(ptr, "servo_limit_z")==1); uiItemR(subcol, ptr, "force_max_z", 0, NULL, 0); uiItemR(subcol, ptr, "force_min_z", 0, NULL, 0); diff --git a/source/blender/makesrna/intern/rna_actuator.c b/source/blender/makesrna/intern/rna_actuator.c index f83cf4a296c..cc1cd9b1e1d 100644 --- a/source/blender/makesrna/intern/rna_actuator.c +++ b/source/blender/makesrna/intern/rna_actuator.c @@ -546,7 +546,7 @@ static void rna_def_object_actuator(BlenderRNA *brna) prop= RNA_def_property(srna, "damping", PROP_INT, PROP_NONE); RNA_def_property_ui_range(prop, 0, 1000, 1, 1); - RNA_def_property_ui_text(prop, "Damping", "Number of frames to reach the target velocity"); + RNA_def_property_ui_text(prop, "Damping Frames", "Number of frames to reach the target velocity"); RNA_def_property_update(prop, NC_LOGIC, NULL); prop= RNA_def_property(srna, "proportional_coefficient", PROP_FLOAT, PROP_NONE); @@ -1044,7 +1044,7 @@ static void rna_def_constraint_actuator(BlenderRNA *brna) prop= RNA_def_property(srna, "range", PROP_FLOAT, PROP_NONE); RNA_def_property_float_funcs(prop, "rna_ConstraintActuator_range_get", "rna_ConstraintActuator_range_set", NULL); RNA_def_property_ui_range(prop, 0.f, 2000.f, 1, 2); - RNA_def_property_ui_text(prop, "Range", ""); + RNA_def_property_ui_text(prop, "Range", "Set the maximum length of ray"); RNA_def_property_update(prop, NC_LOGIC, NULL); prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE); @@ -1127,7 +1127,7 @@ static void rna_def_constraint_actuator(BlenderRNA *brna) RNA_def_property_ui_text(prop, "L", "Set ray along object's axis or global axis"); RNA_def_property_update(prop, NC_LOGIC, NULL); - prop= RNA_def_property(srna, "nomal", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "normal", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_CONST_NORMAL); RNA_def_property_ui_text(prop, "N", "Set object axis along (local axis) or parallel (global axis) to the normal at hit position"); RNA_def_property_update(prop, NC_LOGIC, NULL);