Tweak for dfelinto, logic ui
authorMatt Ebb <matt@mke3.net>
Thu, 6 May 2010 01:38:17 +0000 (01:38 +0000)
committerMatt Ebb <matt@mke3.net>
Thu, 6 May 2010 01:38:17 +0000 (01:38 +0000)
source/blender/editors/space_logic/logic_window.c
source/blender/editors/space_logic/space_logic.c
source/blender/makesrna/intern/rna_object.c

index b0362cb1980ed4304b7298017419542fcab78c6d..34203d8c76184c4456bb63936facdbe6fbc1379a 100644 (file)
@@ -3651,8 +3651,13 @@ static void draw_actuator_message(uiLayout *layout, PointerRNA *ptr)
 static void draw_actuator_motion(uiLayout *layout, PointerRNA *ptr)
 {
        uiLayout *split, *row, *col, *subcol;
+       Object *ob = (Object *)ptr->id.data;
+       PointerRNA settings_ptr;
+       
+       RNA_pointer_create((ID *)ob, &RNA_GameObjectSettings, ob, &settings_ptr);
+       
        uiItemR(layout, ptr, "mode", 0, NULL, 0);
-
+       
        switch (RNA_enum_get(ptr, "mode")) {
                case ACT_OBJECT_NORMAL:
                        split = uiLayoutSplit(layout, 0.9, 0);
@@ -3662,11 +3667,10 @@ static void draw_actuator_motion(uiLayout *layout, PointerRNA *ptr)
                        split = uiLayoutSplit(layout, 0.9, 0);
                        uiItemR(split, ptr, "rot", 0, NULL, 0);
                        uiItemR(split, ptr, "local_rotation", UI_ITEM_R_TOGGLE, NULL, 0);
-
-                       // Matt, how to check for ob->gameflag here? Do we need to pass the obj through the drawing function only for that?
-//                     if ((ob->gameflag & OB_DYNAMIC)==0)
-//                             break;
-
+                       
+                       if (RNA_enum_get(&settings_ptr, "physics_type") != OB_BODY_TYPE_DYNAMIC)
+                               break;
+                       
                        split = uiLayoutSplit(layout, 0.9, 0);
                        uiItemR(split, ptr, "force", 0, NULL, 0);
                        uiItemR(split, ptr, "local_force", UI_ITEM_R_TOGGLE, NULL, 0);
index 5a969be59167cc44bb321137fcaa47feb3195a91..89eff3beb0c7a9b303370010c1d977424c647a7a 100644 (file)
@@ -195,6 +195,9 @@ static void logic_listener(ARegion *ar, wmNotifier *wmn)
 {
        /* context changes */
        switch(wmn->category) {
+               case NC_LOGIC:
+                       ED_region_tag_redraw(ar);
+                       break;
                case NC_SCENE:
                        switch(wmn->data) {
                                case ND_FRAME:
index 9a67c7fbf1763a89805ba48ee801b84e376c204c..23184af93ff04917d42a6fc081c848069b65e95a 100644 (file)
@@ -1128,6 +1128,7 @@ static void rna_def_object_game_settings(BlenderRNA *brna)
        RNA_def_property_enum_items(prop, body_type_items);
        RNA_def_property_enum_funcs(prop, "rna_GameObjectSettings_physics_type_get", "rna_GameObjectSettings_physics_type_set", NULL);
        RNA_def_property_ui_text(prop, "Physics Type",  "Selects the type of physical representation");
+       RNA_def_property_update(prop, NC_LOGIC, NULL);
 
        prop= RNA_def_property(srna, "actor", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_ACTOR);