I’m trying to create a brand new python package for use in maya and I have a question about init.py files.
According tomost of the information i’ve read online, these can be blank files, but Maya doesn’t seem to be able to find sub-folders of the package - it only finds modules in the root of the package.
for example:
myfolder
__init__.py
prefs.py
utilsFolder
__init__.py
selectionFolder
__init__.py
selectionTool.py
I can get to pref.py just fine, but I can’t get to selectionTool.py, python says the module has no attribute.
I can import “myfolder.utilsFolder.selectionFolder” just fine, but when I try dir(myfolder.utilsFolder.selectionFolder) on it, it doesn’t list selectionTool.py.
I have seen other people recommend adding “from blah import *” for each file in the subfolders into the outer most init.py - is this the right answer?
Thanks.
A question about packages and the PythonPath - does only the top folder of a package need to be added to the PythonPath, or do all the subfolders also need to be added as well?