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_scene.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_scene.py')
-rw-r--r-- | release/scripts/ui/properties_scene.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/release/scripts/ui/properties_scene.py b/release/scripts/ui/properties_scene.py index 859fcc3ce47..a92df6f8203 100644 --- a/release/scripts/ui/properties_scene.py +++ b/release/scripts/ui/properties_scene.py @@ -28,7 +28,8 @@ class SceneButtonsPanel(): bl_region_type = 'WINDOW' bl_context = "scene" - def poll(self, context): + @staticmethod + def poll(context): return context.scene @@ -118,7 +119,8 @@ class SCENE_PT_keying_sets(SceneButtonsPanel, bpy.types.Panel): class SCENE_PT_keying_set_paths(SceneButtonsPanel, bpy.types.Panel): bl_label = "Active Keying Set" - def poll(self, context): + @staticmethod + def poll(context): return (context.scene.active_keying_set and context.scene.active_keying_set.absolute) def draw(self, context): |