Revision: 21348
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=21348
Author:   dingto
Date:     2009-07-03 16:11:00 +0200 (Fri, 03 Jul 2009)

Log Message:
-----------
2.5 Physic Buttons:

Don't show panels when object is not a mesh. 

Modified Paths:
--------------
    branches/blender2.5/blender/release/ui/buttons_physic_cloth.py
    branches/blender2.5/blender/release/ui/buttons_physics_field.py
    branches/blender2.5/blender/release/ui/buttons_physics_softbody.py

Modified: branches/blender2.5/blender/release/ui/buttons_physic_cloth.py
===================================================================
--- branches/blender2.5/blender/release/ui/buttons_physic_cloth.py      
2009-07-03 13:48:42 UTC (rev 21347)
+++ branches/blender2.5/blender/release/ui/buttons_physic_cloth.py      
2009-07-03 14:11:00 UTC (rev 21348)
@@ -7,7 +7,8 @@
        __context__ = "physics"
 
        def poll(self, context):
-               return (context.object != None)
+               ob = context.object
+               return (ob and ob.type == 'MESH')
                
 class PHYSICS_PT_cloth(PhysicButtonsPanel):
        __idname__ = "PHYSICS_PT_cloth"

Modified: branches/blender2.5/blender/release/ui/buttons_physics_field.py
===================================================================
--- branches/blender2.5/blender/release/ui/buttons_physics_field.py     
2009-07-03 13:48:42 UTC (rev 21347)
+++ branches/blender2.5/blender/release/ui/buttons_physics_field.py     
2009-07-03 14:11:00 UTC (rev 21348)
@@ -30,6 +30,10 @@
 class PHYSICS_PT_collision(PhysicButtonsPanel):
        __idname__ = "PHYSICS_PT_collision"
        __label__ = "Collision"
+       
+       def poll(self, context):
+               ob = context.object
+               return (ob and ob.type == 'MESH')
 
        def draw_header(self, context):
                settings = context.object.collision

Modified: branches/blender2.5/blender/release/ui/buttons_physics_softbody.py
===================================================================
--- branches/blender2.5/blender/release/ui/buttons_physics_softbody.py  
2009-07-03 13:48:42 UTC (rev 21347)
+++ branches/blender2.5/blender/release/ui/buttons_physics_softbody.py  
2009-07-03 14:11:00 UTC (rev 21348)
@@ -7,7 +7,8 @@
        __context__ = "physics"
 
        def poll(self, context):
-               return (context.object != None)
+               ob = context.object
+               return (ob and ob.type == 'MESH')
                
 class PHYSICS_PT_softbody(PhysicButtonsPanel):
        __idname__ = "PHYSICS_PT_softbody"


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

Reply via email to