diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-08-05 20:05:30 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-08-05 20:05:30 +0400 |
commit | 163f6055d26383b7fa11df00da09ef63efb8cb6c (patch) | |
tree | d552a9ad0ce4c64a95088264021914008bf8fdf9 /release/scripts/ui/properties_physics_softbody.py | |
parent | 5d18274cacef89fe4e290dbae8427122028ba868 (diff) |
bugfix [#23182] Using self.report() inside poll() gives crash
poll() function is now a static method in python, this is more correct, matching C where the operator is not created to run poll.
def poll(self, context): ...
is now...
@staticmethod
def poll(context): ...
Pythons way of doing static methods is a bit odd but cant be helped :|
This does make subclassing poll functions with COMPAT_ENGINES break, so had to modify quite a few scripts for this.
Diffstat (limited to 'release/scripts/ui/properties_physics_softbody.py')
-rw-r--r-- | release/scripts/ui/properties_physics_softbody.py | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/release/scripts/ui/properties_physics_softbody.py b/release/scripts/ui/properties_physics_softbody.py index 5e7aae26630..e7dc39bbaf7 100644 --- a/release/scripts/ui/properties_physics_softbody.py +++ b/release/scripts/ui/properties_physics_softbody.py @@ -35,7 +35,8 @@ class PhysicButtonsPanel(): bl_region_type = 'WINDOW' bl_context = "physics" - def poll(self, context): + @staticmethod + def poll(context): ob = context.object rd = context.scene.render # return (ob and ob.type == 'MESH') and (not rd.use_game_engine) @@ -92,7 +93,8 @@ class PHYSICS_PT_softbody_cache(PhysicButtonsPanel, bpy.types.Panel): bl_label = "Soft Body Cache" bl_default_closed = True - def poll(self, context): + @staticmethod + def poll(context): return context.soft_body def draw(self, context): @@ -104,7 +106,8 @@ class PHYSICS_PT_softbody_goal(PhysicButtonsPanel, bpy.types.Panel): bl_label = "Soft Body Goal" bl_default_closed = True - def poll(self, context): + @staticmethod + def poll(context): return context.soft_body def draw_header(self, context): @@ -148,7 +151,8 @@ class PHYSICS_PT_softbody_edge(PhysicButtonsPanel, bpy.types.Panel): bl_label = "Soft Body Edges" bl_default_closed = True - def poll(self, context): + @staticmethod + def poll(context): return context.soft_body def draw_header(self, context): @@ -203,7 +207,8 @@ class PHYSICS_PT_softbody_collision(PhysicButtonsPanel, bpy.types.Panel): bl_label = "Soft Body Self Collision" bl_default_closed = True - def poll(self, context): + @staticmethod + def poll(context): return context.soft_body def draw_header(self, context): @@ -238,7 +243,8 @@ class PHYSICS_PT_softbody_solver(PhysicButtonsPanel, bpy.types.Panel): bl_label = "Soft Body Solver" bl_default_closed = True - def poll(self, context): + @staticmethod + def poll(context): return context.soft_body def draw(self, context): @@ -275,7 +281,8 @@ class PHYSICS_PT_softbody_field_weights(PhysicButtonsPanel, bpy.types.Panel): bl_label = "Soft Body Field Weights" bl_default_closed = True - def poll(self, context): + @staticmethod + def poll(context): return (context.soft_body) def draw(self, context): |