0

What do I need to do in order to import whatEverModul blender script?

My current understanding is, that I need to repeat some black magic (adding extra codelines) to each new script as explained here or mangling with Settings>File Paths>Scripts for each new blender version. And: Adding __init__.py does not help

jjk
  • 980
  • 4
  • 18

1 Answers1

0

If you have something like:

myAddon
├── __init__.py
├── useful_utilts.py
└── app
    └── folder
        └── some_file.py

And you want to use a class some_class from some_file.py and function some_function from useful_utilts.py, you can do so:

from . import useful_utilts
from .app.folder import some_file

Then use like this:

bpy.utils.register_class(some_file.some_class)
useful_utilts.some_function()
Crantisz
  • 35,244
  • 2
  • 37
  • 89