set the visibility state based on the objects render option in the outliner.
authorCampbell Barton <ideasman42@gmail.com>
Sun, 21 Sep 2008 04:39:40 +0000 (04:39 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 21 Sep 2008 04:39:40 +0000 (04:39 +0000)
- saves adding UV's to faces just to set the invisibility option or having an logic bricks to set the visibility state.

source/gameengine/Converter/BL_BlenderDataConversion.cpp

index ae9b86025006465e0ad7a492bc21af5c7c07cff3..daa67b147c35b78b4854391b7a7a92637f012042 100644 (file)
@@ -1601,6 +1601,8 @@ static KX_GameObject *gameobject_from_blenderobject(
                gameobj->SetPhysicsEnvironment(kxscene->GetPhysicsEnvironment());
                gameobj->SetLayer(ob->lay);
                gameobj->SetBlenderObject(ob);
+               /* set the visibility state based on the objects render option in the outliner */
+               if(ob->restrictflag & OB_RESTRICT_RENDER) gameobj->SetVisible(0, 0);
        }
        return gameobj;
 }