Revision: 20255
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=20255
Author:   campbellbarton
Date:     2009-05-18 12:27:09 +0200 (Mon, 18 May 2009)

Log Message:
-----------
Sensor objects were initialized as invisible, which conflicted with 
initializing the invisible setting from the outliner render object (which it 
seems nobody knew about).

Added an 'Invisible' button to make this more clear, it seems like a display 
option but its also related to logic because the actuators can toggle this 
after the game starts.

Without this its annoying to add UV's only to set the invisible flag.

Sensor objects were not clearing the softbody gameflag

Modified Paths:
--------------
    trunk/blender/source/blender/src/buttons_logic.c
    trunk/blender/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp

Modified: trunk/blender/source/blender/src/buttons_logic.c
===================================================================
--- trunk/blender/source/blender/src/buttons_logic.c    2009-05-18 08:51:55 UTC 
(rev 20254)
+++ trunk/blender/source/blender/src/buttons_logic.c    2009-05-18 10:27:09 UTC 
(rev 20255)
@@ -3068,7 +3068,7 @@
        switch (ob->body_type) {
        case OB_BODY_TYPE_SENSOR:
                ob->gameflag |= OB_SENSOR|OB_COLLISION|OB_GHOST;
-               ob->gameflag &= 
~(OB_OCCLUDER|OB_DYNAMIC|OB_RIGID_BODY|OB_ACTOR|OB_ANISOTROPIC_FRICTION|OB_DO_FH|OB_ROT_FH|OB_COLLISION_RESPONSE);
+               ob->gameflag &= 
~(OB_OCCLUDER|OB_DYNAMIC|OB_RIGID_BODY|OB_SOFT_BODY|OB_ACTOR|OB_ANISOTROPIC_FRICTION|OB_DO_FH|OB_ROT_FH|OB_COLLISION_RESPONSE);
                break;
        case OB_BODY_TYPE_OCCLUDER:
                ob->gameflag |= OB_OCCLUDER;
@@ -3315,14 +3315,21 @@
                        "Object type%t|Occluder%x5|No 
collision%x0|Sensor%x6|Static%x1|Dynamic%x2|Rigid body%x3|Soft body%x4", 
                        10, 205, 100, 19, &ob->body_type, 0, 0, 0, 0, tip);
        uiButSetFunc(but, check_body_type, but, ob);
-
+       
+       uiBlockEndAlign(block);
+       
+       uiDefButBitS(block, TOG, OB_RESTRICT_RENDER, B_NOP, "Invisible", 
+                               210, 205, 60, 19,
+                               &ob->restrictflag, 0, 0, 0, 0, 
+                               "Initializes objects as invisible, this can be 
toggled by the visibility actuator (uses outliner render option)");
+       
        if (ob->gameflag & OB_COLLISION) {
 
                if (ob->gameflag & OB_SENSOR) {
                        uiBlockEndAlign(block);
                        uiDefBlockBut(block, advanced_bullet_menu, ob, 
-                                                 "Advanced Settings", 
-                                                 210, 205, 140, 19, "Display 
collision advanced settings");
+                                                 "Advanced", 
+                                                 270, 205, 80, 19, "Display 
collision advanced settings");
                        uiBlockBeginAlign(block);
                } else {
                        uiDefButBitI(block, TOG, OB_ACTOR, 0, "Actor",
@@ -3338,8 +3345,8 @@
 
                        //uiBlockSetCol(block, TH_BUT_SETTING1);
                        uiDefBlockBut(block, advanced_bullet_menu, ob, 
-                                                 "Advanced Settings", 
-                                                 210, 205, 140, 19, "Display 
collision advanced settings");
+                                                 "Advanced", 
+                                                 270, 205, 80, 19, "Display 
collision advanced settings");
                        //uiBlockSetCol(block, TH_BUT_SETTING2);
                }
 

Modified: trunk/blender/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp
===================================================================
--- trunk/blender/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp 
2009-05-18 08:51:55 UTC (rev 20254)
+++ trunk/blender/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp 
2009-05-18 10:27:09 UTC (rev 20255)
@@ -1129,8 +1129,6 @@
                // bullet will not synchronize, we must do it explicitely
                SG_Callbacks& callbacks = 
gameobj->GetSGNode()->GetCallBackFunctions();
                callbacks.m_updatefunc = 
KX_GameObject::SynchronizeTransformFunc;
-               // make sensor object invisible by default
-               gameobj->SetVisible(false, false);
        } 
        // don't add automatically sensor object, they are added when a 
collision sensor is registered
        else if (objprop->m_in_active_layer)


_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to