Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Dinges <blender@dingto.org>2009-07-03 18:11:00 +0400
committerThomas Dinges <blender@dingto.org>2009-07-03 18:11:00 +0400
commitbcea99d8d5201a3caf4235b7d8b75aa1c3ee0967 (patch)
tree15ae1d56fd57c04ecc56a9644294421fb7cb75b0
parenta7d6b6eebf761f87ec3e5972c99ca0aedf312acd (diff)
2.5 Physic Buttons:
Don't show panels when object is not a mesh.
-rw-r--r--release/ui/buttons_physic_cloth.py3
-rw-r--r--release/ui/buttons_physics_field.py4
-rw-r--r--release/ui/buttons_physics_softbody.py3
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"