Don't show panels when object is not a mesh.
__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"
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
__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"