Reputation: 242
I have a folder where I'm storing some maya presets (specifically nCloth presets) and I would like to make this directory available to all of the users on my current network. To do this, I would like to have this folder added to the MAYA_PRESET_PATH on startup. However, I am not able to create/modify the maya.env file (restricted permissions on network). So, is there a way to append a directory to maya's environment variables using python or MEL, so that I can call a script on startup to dynamically load all of my presets?
I tried the following in my startup MEL script, but to no avail...
python("PRESET_DIR = os.environ.get('MAYA_CUSTOM_PRESET_DIR')"); //Path to my custom preset directory
python("PRESET_DIR = os.environ.get('MAYA_PRESET_PATH') + ':' + PRESET_DIR");
python("os.putenv('MAYA_PRESET_PATH', PRESET_DIR)");
Upvotes: 0
Views: 1340
Reputation: 1548
save the code as filename.bat file, running via double click. you have to refactor the paths to your own environment. its a simple example, if you have other artists out of your scope, you should check that the Paths are matching for example that everybody who start maya with this batch should have maya installed on C:\Program Files\Autodesk\Maya2016\bin .
set "pluginsMaya=X:\100_Software\plugins_maya"
rem Pipeline
set "MAYA_MODULE_PATH=%MAYA_MODULE_PATH%;%pluginsMaya%\intern"
set "MAYA_SHELF_PATH=%MAYA_SHELF_PATH%;%pluginsMaya%\intern\shelves"
set "XBMLANGPATH=X:/100_Software/graphics/splashscreens";%XBMLANGPATH%
set "MAYA_PROJECT=%pluginsMaya%/fakeMayaRoot"
rem make maya Quicker?
set "MAYA_DISABLE_CIP=1"
set "MAYA_DISABLE_CER=1"
rem Start Maya
set "PATH=C:\Program Files\Autodesk\Maya2016\bin;%PATH%"
start maya -file %1 -script %pluginsMaya%\intern\startupScript.mel
Upvotes: 1