Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDalai Felinto <dfelinto@gmail.com>2010-07-08 10:49:08 +0400
committerDalai Felinto <dfelinto@gmail.com>2010-07-08 10:49:08 +0400
commit779368fd4524d35e9b1802a0e720ced3df059ada (patch)
tree434b22cab80d6d262d76e4956b0c3c4e9dd15cec /source/blender/editors
parenta797e81e312146b198be5b4a1a7144ed4dd7ae30 (diff)
Logic UI: fix for #Motion Actuator Dynamic options not showing for Soft Body and Rigid Body (reported by Mal Duffin (malCanDo) over email)
Originally (2.49) we were testing for ob->game_flag to see if the object is dynamic. That could work here (it would require a new rna prop for the object (a read-only is_dynamic) or similar. However using ob.game.physics_type is more explicit, therefore may be more interesting. I have no strong opinions on that...
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/space_logic/logic_window.c55
1 files changed, 28 insertions, 27 deletions
diff --git a/source/blender/editors/space_logic/logic_window.c b/source/blender/editors/space_logic/logic_window.c
index 26b4b6fc08c..9f6fafb1053 100644
--- a/source/blender/editors/space_logic/logic_window.c
+++ b/source/blender/editors/space_logic/logic_window.c
@@ -3966,9 +3966,11 @@ static void draw_actuator_motion(uiLayout *layout, PointerRNA *ptr)
Object *ob;
PointerRNA settings_ptr;
uiLayout *split, *row, *col, *subcol;
+ int physics_type;
ob = (Object *)ptr->id.data;
RNA_pointer_create((ID *)ob, &RNA_GameObjectSettings, ob, &settings_ptr);
+ physics_type = RNA_enum_get(&settings_ptr, "physics_type");
uiItemR(layout, ptr, "mode", 0, NULL, 0);
@@ -3984,33 +3986,32 @@ static void draw_actuator_motion(uiLayout *layout, PointerRNA *ptr)
uiItemR(row, ptr, "rot", 0, NULL, 0);
uiItemR(split, ptr, "local_rotation", UI_ITEM_R_TOGGLE, NULL, 0);
- if (RNA_enum_get(&settings_ptr, "physics_type") != OB_BODY_TYPE_DYNAMIC)
- break;
-
- uiItemL(layout, "Dynamic Object Settings:", 0);
- split = uiLayoutSplit(layout, 0.9, 0);
- row = uiLayoutRow(split, 0);
- uiItemR(row, ptr, "force", 0, NULL, 0);
- uiItemR(split, ptr, "local_force", UI_ITEM_R_TOGGLE, NULL, 0);
-
- split = uiLayoutSplit(layout, 0.9, 0);
- row = uiLayoutRow(split, 0);
- uiItemR(row, ptr, "torque", 0, NULL, 0);
- uiItemR(split, ptr, "local_torque", UI_ITEM_R_TOGGLE, NULL, 0);
-
- split = uiLayoutSplit(layout, 0.9, 0);
- row = uiLayoutRow(split, 0);
- uiItemR(row, ptr, "linear_velocity", 0, NULL, 0);
- row = uiLayoutRow(split, 1);
- uiItemR(row, ptr, "local_linear_velocity", UI_ITEM_R_TOGGLE, NULL, 0);
- uiItemR(row, ptr, "add_linear_velocity", UI_ITEM_R_TOGGLE, NULL, 0);
-
- split = uiLayoutSplit(layout, 0.9, 0);
- row = uiLayoutRow(split, 0);
- uiItemR(row, ptr, "angular_velocity", 0, NULL, 0);
- uiItemR(split, ptr, "local_angular_velocity", UI_ITEM_R_TOGGLE, NULL, 0);
-
- uiItemR(layout, ptr, "damping", 0, NULL, 0);
+ if (ELEM3(physics_type, OB_BODY_TYPE_DYNAMIC, OB_BODY_TYPE_RIGID, OB_BODY_TYPE_SOFT)) {
+ uiItemL(layout, "Dynamic Object Settings:", 0);
+ split = uiLayoutSplit(layout, 0.9, 0);
+ row = uiLayoutRow(split, 0);
+ uiItemR(row, ptr, "force", 0, NULL, 0);
+ uiItemR(split, ptr, "local_force", UI_ITEM_R_TOGGLE, NULL, 0);
+
+ split = uiLayoutSplit(layout, 0.9, 0);
+ row = uiLayoutRow(split, 0);
+ uiItemR(row, ptr, "torque", 0, NULL, 0);
+ uiItemR(split, ptr, "local_torque", UI_ITEM_R_TOGGLE, NULL, 0);
+
+ split = uiLayoutSplit(layout, 0.9, 0);
+ row = uiLayoutRow(split, 0);
+ uiItemR(row, ptr, "linear_velocity", 0, NULL, 0);
+ row = uiLayoutRow(split, 1);
+ uiItemR(row, ptr, "local_linear_velocity", UI_ITEM_R_TOGGLE, NULL, 0);
+ uiItemR(row, ptr, "add_linear_velocity", UI_ITEM_R_TOGGLE, NULL, 0);
+
+ split = uiLayoutSplit(layout, 0.9, 0);
+ row = uiLayoutRow(split, 0);
+ uiItemR(row, ptr, "angular_velocity", 0, NULL, 0);
+ uiItemR(split, ptr, "local_angular_velocity", UI_ITEM_R_TOGGLE, NULL, 0);
+
+ uiItemR(layout, ptr, "damping", 0, NULL, 0);
+ }
break;
case ACT_OBJECT_SERVO:
uiItemR(layout, ptr, "reference_object", 0, NULL, 0);