2.5 Physic Buttons:

Don't show panels when object is not a mesh.
This commit is contained in:
Thomas Dinges 2009-07-03 14:11:00 +00:00
parent a7d6b6eebf
commit bcea99d8d5
3 changed files with 8 additions and 2 deletions

@ -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"

@ -31,6 +31,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
self.layout.itemR(settings, "enabled", text="")

@ -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"