2.5 Physic Buttons:
authorThomas Dinges <blender@dingto.org>
Fri, 3 Jul 2009 14:11:00 +0000 (14:11 +0000)
committerThomas Dinges <blender@dingto.org>
Fri, 3 Jul 2009 14:11:00 +0000 (14:11 +0000)
Don't show panels when object is not a mesh.

release/ui/buttons_physic_cloth.py
release/ui/buttons_physics_field.py
release/ui/buttons_physics_softbody.py

index ecb5e48569aebdb243342f6d733809f86805c0ed..edb778b4dce3694960dd15427809842a55914640 100644 (file)
@@ -7,7 +7,8 @@ class PhysicButtonsPanel(bpy.types.Panel):
        __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"
index 3204ab4709d9b09b7909ab07059d47e26bd488a0..5843d1aadf655e5479add5ea42813c97c7696a6b 100644 (file)
@@ -30,6 +30,10 @@ class PHYSICS_PT_field(PhysicButtonsPanel):
 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
index 389d91bafa7ad25b83e404a105307807dd91fa51..2597645f7ba578d458b2f3f021d5b05c5c9cbfc1 100644 (file)
@@ -7,7 +7,8 @@ class PhysicButtonsPanel(bpy.types.Panel):
        __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"