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:
@@ -753,7 +753,8 @@ class OBJECT_PT_constraints(ConstraintButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Object Constraints"
|
||||
bl_context = "constraint"
|
||||
|
||||
def poll(self, context):
|
||||
@staticmethod
|
||||
def poll(context):
|
||||
return (context.object)
|
||||
|
||||
def draw(self, context):
|
||||
@@ -771,7 +772,8 @@ class BONE_PT_constraints(ConstraintButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Bone Constraints"
|
||||
bl_context = "bone_constraint"
|
||||
|
||||
def poll(self, context):
|
||||
@staticmethod
|
||||
def poll(context):
|
||||
return (context.pose_bone)
|
||||
|
||||
def draw(self, context):
|
||||
|
||||
Reference in New Issue
Block a user