I already learned that you can't and don't need to overload in Python, but I didn't know how to call it otherwise.
(all pseudo code)
I have a button:
myBox = layout.box() myBox.operator(my_Button.bl_idname, text = "Move it")
And want to add a non-obligatory parameter to the execute method:
class my_Button(bpy.types.Operator): bl_idname = "object.my_button" def execute(self, context, calledByButton=True):
So I can call the method by using the button, or somewhere in the script:
But I get an error on registering it (strangly for the next class)
ValueError: expected Operator, my_NextButton class "execute" function to have 2 args , found 3
How would I do that correctly?