This should be pretty straight-forward - but it’s not.
I want to import modules from some custom directory, so I’ve modified the Maya.env and added this:
MAYA_SCRIPT_PATH = %MAYA_APP_DIR%\2017\prefs\
MAYA_MODULE_PATH = %MAYA_APP_DIR%\2017\prefs\
XBMLANGPATH = %MAYA_APP_DIR%\2017\prefs\someModule\icons\
I’ve then placed someModule inside the prefs folder, and also confirmed that the path is working by printing all paths from os.environ
import os
print os.environ['MAYA_SCRIPT_PATH']
But Maya still doesn’t find the module.
import someModule
Error: ImportError: file <maya console> line 1: No module named someModule
Why isn’t this working? The path is clearly there, according to os.environ and the module lies on this path - yet Maya does not find it. This doesn’t make sense to me.