forked from bartvdbraak/blender
2.5 Physic Buttons:
Don't show panels when object is not a mesh.
This commit is contained in:
parent
a7d6b6eebf
commit
bcea99d8d5
@ -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"
|
||||
|
@ -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
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user