i am struggling too for understanding the material but here what i know.
You can write things in the scripting editor, but that will not automatically make an operator.
print ("i do something")
there is no way to call this , because is just some code.
You can define an operator to make your actions.
the operator will have a bl_idname that you can call via buttons keyboards …
bl_idname = "wm.myactions"
bl_label = "test actions"
def execute(self, context):
print ("i will do something")
But you have to “register” an operator,
that will say to blender to learn and save that script for the rest of the session (until closed)
Once is registered you can call the operat
if __name__ == "__main__":
Once this is done without errors you can call the operator
but there is a different way for every place.
the only constant is the bl_idname you give to him
Here an example using the template simple operator,
beware that this operator name start with “object.”
this will make the operator run only if you are in object mode
for make it run in every case i name it " wm. "
Its a bit tricky but you can find the panel in preference, keymap
i am using the 290, so may be different, you add a shortcut under the right section “object” or “window” for wm… and type in the blidname. i set this to 0
EDIT ADDON :
I forgot, to say that this will give you a script that you have to run every time you load blender,
Because blender will remember the shortcut to the operato but not the operator.
For make blender reload the script too, you have to make it become an addon !
I just have like 6 script open in my blender , and since i am working on and tweaking all , its just more easy hit Run every time i need it.