poll() as a python '@staticmethod' was too limiting and didnt allow useful base class poll functions in many cases.
now rna functions that dont have a 'self' are automatically assumed '@classmethods'. de-duplicated poll functions and made some minor tweaks too.
This commit is contained in:
@@ -43,8 +43,8 @@ class PhysicButtonsPanel():
|
||||
bl_region_type = 'WINDOW'
|
||||
bl_context = "physics"
|
||||
|
||||
@staticmethod
|
||||
def poll(context):
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
ob = context.object
|
||||
rd = context.scene.render
|
||||
return (ob and ob.type == 'MESH') and (not rd.use_game_engine)
|
||||
@@ -133,8 +133,8 @@ class PHYSICS_PT_cloth_cache(PhysicButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Cloth Cache"
|
||||
bl_default_closed = True
|
||||
|
||||
@staticmethod
|
||||
def poll(context):
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
return context.cloth
|
||||
|
||||
def draw(self, context):
|
||||
@@ -146,8 +146,8 @@ class PHYSICS_PT_cloth_collision(PhysicButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Cloth Collision"
|
||||
bl_default_closed = True
|
||||
|
||||
@staticmethod
|
||||
def poll(context):
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
return context.cloth
|
||||
|
||||
def draw_header(self, context):
|
||||
@@ -185,8 +185,8 @@ class PHYSICS_PT_cloth_stiffness(PhysicButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Cloth Stiffness Scaling"
|
||||
bl_default_closed = True
|
||||
|
||||
@staticmethod
|
||||
def poll(context):
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
return context.cloth
|
||||
|
||||
def draw_header(self, context):
|
||||
@@ -221,8 +221,8 @@ class PHYSICS_PT_cloth_field_weights(PhysicButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Cloth Field Weights"
|
||||
bl_default_closed = True
|
||||
|
||||
@staticmethod
|
||||
def poll(context):
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
return (context.cloth)
|
||||
|
||||
def draw(self, context):
|
||||
|
||||
Reference in New Issue
Block a user