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.
This commit is contained in:
Campbell Barton
2010-08-05 16:05:30 +00:00
parent 5d18274cac
commit 163f6055d2
54 changed files with 845 additions and 368 deletions

View File

@@ -308,7 +308,8 @@ class OBJECT_PT_motion_paths(MotionPathButtonsPanel, bpy.types.Panel):
#bl_label = "Object Motion Paths"
bl_context = "object"
def poll(self, context):
@staticmethod
def poll(context):
return (context.object)
def draw(self, context):
@@ -335,7 +336,8 @@ class OBJECT_PT_onion_skinning(OnionSkinButtonsPanel): #, bpy.types.Panel): # in
#bl_label = "Object Onion Skinning"
bl_context = "object"
def poll(self, context):
@staticmethod
def poll(context):
return (context.object)
def draw(self, context):