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:
@@ -31,7 +31,8 @@ class PhysicButtonsPanel():
|
||||
bl_region_type = 'WINDOW'
|
||||
bl_context = "physics"
|
||||
|
||||
def poll(self, context):
|
||||
@staticmethod
|
||||
def poll(context):
|
||||
rd = context.scene.render
|
||||
return (context.object) and (not rd.use_game_engine)
|
||||
|
||||
@@ -173,7 +174,8 @@ class PHYSICS_PT_collision(PhysicButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Collision"
|
||||
#bl_default_closed = True
|
||||
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user