[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [30102] trunk/blender/source/blender/ editors/space_logic/logic_window.c: Logic UI: fix for #Motion Actuator Dynamic options not showing for Soft Body and Rigid Body (reported by Mal Duffin (malCanDo) over email)

Dalai Felinto dfelinto at gmail.com
Thu Jul 8 08:49:08 CEST 2010


Revision: 30102
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=30102
Author:   dfelinto
Date:     2010-07-08 08:49:08 +0200 (Thu, 08 Jul 2010)

Log Message:
-----------
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...

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_logic/logic_window.c

Modified: trunk/blender/source/blender/editors/space_logic/logic_window.c
===================================================================
--- trunk/blender/source/blender/editors/space_logic/logic_window.c	2010-07-08 06:45:21 UTC (rev 30101)
+++ trunk/blender/source/blender/editors/space_logic/logic_window.c	2010-07-08 06:49:08 UTC (rev 30102)
@@ -3966,9 +3966,11 @@
 	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 @@
 			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);
+			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, "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, "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);
+				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);
+				uiItemR(layout, ptr, "damping", 0, NULL, 0);
+			}
 			break;
 		case ACT_OBJECT_SERVO:
 			uiItemR(layout, ptr, "reference_object", 0, NULL, 0);





More information about the Bf-blender-cvs mailing list