I'm creating an addon in Blender using bpy
. It's a side panel with a few buttons and input fields. To speed up development, I would like the addon to automatically clear the original scene (the default cube), open its side panel, and press a button when it is started. By "started," I mean debugging in VS Code. I suppose that means after registering or installing the addon? Is this doable?
I tried registering operator classes and various handlers, but it always ended up either not executing at all or causing problems in ops.py
:
Exception has occurred: AttributeError '_RestrictContext' object has no attribute 'view_layer'
Do you have a small working example?