i'm following a 2.79 blender python tutorial for beginners, under 2.83.2. i'm having trouble removing the poll from the classmethod. (is there a reason i shouldn't do that?) this works:
class MonkeyOperator(bpy.types.Operator):
"""Tooltip"""
bl_idname = "object.make_monkey"
bl_label = "Monkey Operator"
@classmethod
def poll(cls, context):
return context.object is None
def execute(self, context):
main(context)
return {'FINISHED'}
def register():
bpy.utils.register_class(MonkeyOperator)
def unregister():
bpy.utils.unregister_class(MonkeyOperator)
if __name__ == "__main__":
register()
...
but if i comment out or delete the poll lines, it throws this error:
line 61, in register TypeError: expected Operator, MonkeyOperator class "execute" attribute to be a function, not a method
the execute is exactly the same as before. so... ???
return True
in case you needpoll()
method later on. $\endgroup$