Python Modules and Maya


#61

Alright, let me try this.


#62

Well, simply set the paths as I wrote in my last post. It should work. Ah… too late, I wrote it before your last posting. Yes, please try it.


#63

Yes, and that’s exactly why the NSUV mel scripts cannot be found in your setup. As you may have seen, the NSUV directory contains mel scripts and python scripts. If you want to access the mel scripts for this tool correctly then the MAYA_SCRIPT_PATH has to be extended to the directory above the NSUV directory (above the one which contains the mel scripts because the mel scripts are loaded like this “source NSUV/xxx.mel”).

Are you saying I need to add os.environ[“MAYA_SCRIPT_PATH”] += <the path where the NSUV python and mel script exist> in the userSetup.py file for strictly python scripts as in the import.sys command; not MEL script as in impost os ?


#64

To make it more clear:

#extend python path
import sys
sys.path.append("C:/scripts/maya/pythonscript/NSUV/scripts")

#extend mel script search path
import os
os.environ["MAYA_SCRIPT_PATH"] += ";C:/scripts/maya/pythonscript/NSUV/scripts"

Does this answer your question?