From bcea99d8d5201a3caf4235b7d8b75aa1c3ee0967 Mon Sep 17 00:00:00 2001 From: Thomas Dinges Date: Fri, 3 Jul 2009 14:11:00 +0000 Subject: [PATCH] 2.5 Physic Buttons: Don't show panels when object is not a mesh. --- release/ui/buttons_physic_cloth.py | 3 ++- release/ui/buttons_physics_field.py | 4 ++++ release/ui/buttons_physics_softbody.py | 3 ++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/release/ui/buttons_physic_cloth.py b/release/ui/buttons_physic_cloth.py index ecb5e48569a..edb778b4dce 100644 --- a/release/ui/buttons_physic_cloth.py +++ b/release/ui/buttons_physic_cloth.py @@ -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" diff --git a/release/ui/buttons_physics_field.py b/release/ui/buttons_physics_field.py index 3204ab4709d..5843d1aadf6 100644 --- a/release/ui/buttons_physics_field.py +++ b/release/ui/buttons_physics_field.py @@ -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 diff --git a/release/ui/buttons_physics_softbody.py b/release/ui/buttons_physics_softbody.py index 389d91bafa7..2597645f7ba 100644 --- a/release/ui/buttons_physics_softbody.py +++ b/release/ui/buttons_physics_softbody.py @@ -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"