Add user scripts folder to Maya
<p>I tried all methods explained on several documentation pages.</p>

<p>I modified the <strong>userSetup.mel</strong> file and it adds the folder with this code:</p>

<pre><code>string $s = `getenv MAYA_SCRIPT_PATH` + ";C:/MyScripts";
putenv "MAYA_SCRIPT_PATH" $s;
</code></pre>

<p>It didn't work. I also tried to do a "rehash" after doing putenv.</p>

<p>I removed that userSetup.mel file and modified the <strong>maya.env</strong> file using this other variable (since if I do this to MAYA_SCRIPT_PATH it breaks maya because overrides everything it had)</p>

<pre><code>USER_SCRIPT_PATH = C:/MyScripts
</code></pre>

<p>Anything works when I do "import folder" on a python tab. Folder is inside MyScripts folder, and there's a init file for all of them. It's not a python error, this folder works under maya/scripts folder.</p>

<p>It's not very clear why USER_SCRIPT_PATH is not mentioned anywhere in the docs as an official variable, no information about why any of those works. The folder ends up on the environment variable using getenv on MEL, but code is not loaded.</p>

<p>you can also add the path like:</p>

<pre><code>import sys
sys.path.append("C:/MyScripts")

import my_module
reload(my_module)
my_module.run()
</code></pre>

<p>if you want that maya start with this env, you need a batch file(with all custom env paths like arnold or houdini engine or your own plugins) or a wrapper(more for pipelines with different maya setting for different departments like maya-modeling or maya-fx). this are the default env paths...</p>

<pre><code>-MAYA_PLUG_IN_PATH
-MAYA_MODULE_PATH
-MAYA_SCRIPT_PATH
-USER_SCRIPT_PATH
-PYTHONPATH
-MAYA_SHELF_PATH
-XBMLANGPATH
</code></pre>

python python-2.7 maya mel