Creating and running multi file add-ons from Blender's Text Editor (Blender 2.93)


So far I’ve only created some very simplistic operators, which I have managed to wrap into an add-on. However now I’ve tried to practice creating some multi file add-on with setup like this:

main / file

Or something similar. After reading several articles and discussions, so far I’ve figured that I have to create and edit my add-on script in Blender add-on folder. And my workflow is like this; edit code > save files > F3, reload scripts > F3 to find operator or push a button in UI. Reason for this, I can’t get imports working from Text Editor.

My question is - is it possible to somehow (in relatively non-Python programmer friendly way) get imports working in Text Editor, so I could run multi file add-on from Blender’s Text Editor?

I remember there are some tutorials for how to setup PyCharm for add-on editing, and there was some VS Code add-on to auto load code… or something like that, but I would rather stay in Text Editor for quick tests while learning stuff.

Thanks in advance!

there’s definitely a way to do it, using importlib- but at some point you’re spending a lot of effort trying to avoid using a real dev environment. significantly easier to just use VSCode… Blender’s text editor is not really meant for that sort of thing.

1 Like

Thanks for the reply.

I came across those examples with importlib, but those feel like hacky solutions.

I installed PyCharm community version and setup Blender auto complete files, so maybe I’ll use it (or VS Code) then.