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:
@@ -28,7 +28,8 @@ class MeshSelectInteriorFaces(bpy.types.Operator):
|
||||
bl_label = "Select Interior Faces"
|
||||
bl_options = {'REGISTER', 'UNDO'}
|
||||
|
||||
def poll(self, context):
|
||||
@staticmethod
|
||||
def poll(context):
|
||||
ob = context.active_object
|
||||
return (ob and ob.type == 'MESH')
|
||||
|
||||
@@ -69,7 +70,8 @@ class MeshMirrorUV(bpy.types.Operator):
|
||||
bl_label = "Copy Mirrored UV coords"
|
||||
bl_options = {'REGISTER', 'UNDO'}
|
||||
|
||||
def poll(self, context):
|
||||
@staticmethod
|
||||
def poll(context):
|
||||
ob = context.active_object
|
||||
return (ob and ob.type == 'MESH')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user