Im not THAT experienced in Blender Python but i think this is something confusing.c
I want to use multiple files for an addon and im not able to.
I dont understand what am i supposed to do
Am i supposed to just import the class in init and do nothing with it and register it in the same file as the class , or am i supposed to register the classes in the init
even if i do one of them , the relative import doesnt work
if i do from .AddCube import *
it says ImportError: attempted relative import with no known parent package Error: Python script failed, check the message in the system console
Asked
Active
Viewed 140 times
0
SHikha Mittal
- 1,035
- 8
- 21
__name__ = "__main__"to get this error (as opposed to not having the relative submodules?) Have mentioned a work around to this here https://blender.stackexchange.com/questions/183773/trying-to-make-a-menu-using-multiple-modules/183817#183817 using absolute imports based on your addon name, to make testing in text editor possible. See also https://blender.stackexchange.com/questions/158775/having-trouble-creating-an-addon-with-multiple-modules – batFINGER Apr 09 '21 at 07:53