Maya PresetPath

583 views
Skip to first unread message

illunara

unread,
Mar 23, 2014, 1:05:00 AM3/23/14
to python_in...@googlegroups.com
Hi everybody
How can i change the Maya's Env to load preset from another folder, instead of default one
"Documents\maya\2013-x64\presets"
Thanks

Justin Israel

unread,
Mar 23, 2014, 1:40:50 AM3/23/14
to python_in...@googlegroups.com

MAYA_PRESET_PATH ?

http://download.autodesk.com/global/docs/maya2014/en_us/index.html?url=files/Environment_Variables_File_path_variables.htm,topicNumber=d30e149667

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/45ead3d9-ba68-4ed7-9b70-adf1bed9d833%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Tuan Nguyen

unread,
Mar 23, 2014, 2:01:32 AM3/23/14
to python_in...@googlegroups.com
Hi Justin
Yes, i try to change Maya's env preset path using getEnv and putEnv. But for some reason, maya doesn't recognize it.
Sorry for a vague question, here is what i try to archive:
- Save a nodePreset, using cmds.nodePreset
- Move it to another folder
- Load it



--
You received this message because you are subscribed to a topic in the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python_inside_maya/GlrlJ4weib0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA0UX_3JBMrRmA5PGCb-N4M-mwOk4NykPHDhxqj1cNVGNA%40mail.gmail.com.

Marcus Ottosson

unread,
Mar 23, 2014, 5:27:58 AM3/23/14
to python_in...@googlegroups.com
Never heard of or used getEnv or putEnv, but how about os.environ?

>> import os
>> os.environ['MAYA_PRESET_PATH'] = r'c:\my\custom\path'

You may have to run it prior to booting up Maya, or in your usersetup.py. I've never altered this path and am not sure what it does.



For more options, visit https://groups.google.com/d/optout.



--
Marcus Ottosson
konstr...@gmail.com

Tuan Nguyen

unread,
Mar 23, 2014, 7:06:28 AM3/23/14
to python_in...@googlegroups.com
Hi Marcus
getEnv and putEnv is Mel command, you can also use Pymel.Util.setEnv and getEnv, which had same effect as your method.

However, Maya only find preset from /maya/2013-x64/presets/ folder, if i move my preset to another folder, Maya can't find it, even when i had set the Env Path.

Justin Israel

unread,
Mar 23, 2014, 2:18:48 PM3/23/14
to python_in...@googlegroups.com

Then it would appear that Maya only considers the environment variable once on launch.

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.

Marcus Ottosson

unread,
Mar 23, 2014, 2:28:14 PM3/23/14
to python_in...@googlegroups.com
In that case; Tuan, try setting environment variables in the shell you launch Maya from; be it cmd.exe or bash etc.

$ set MAYA_PRESET_PATH='/my/custom/path'
$ maya &

The shell would pass on the current environment and if Maya read this particular variable on launch then it should pick it up.

You could have a look once inside Maya, using Python

>> import os
>> print os.environ['MAYA_PRESET_PATH']

If the result it the path you supplied, the consider it a success! If it doesn't then it would appear Maya overwrites it upon launch.

If it succeeds, you could make for a persistent method of running Maya with this variable in the future by bundling the two shell commands into a shell or Python script and use that to run Maya as opposed to calling the binary directly.



For more options, visit https://groups.google.com/d/optout.



--
Marcus Ottosson
konstr...@gmail.com

Tuan Nguyen

unread,
Mar 23, 2014, 3:07:15 PM3/23/14
to python_in...@googlegroups.com
I think i know where it goes wrong =.=

The Maya_Preset_Path is defined purely for the attribute editor, meanwhile, the nodePreset built-in command used by the render settings window to build its preset list. It completely ignores Maya_Preset_Path. So there are 2 ways i can work around with it :

I can set Maya_Preset_Path and using mel.applyPresetAttr, or move all the preset i had created using nodePreset into maya's preset folder.

Anyway, thank you guys. I really appreciate your help :D



--
You received this message because you are subscribed to a topic in the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python_inside_maya/GlrlJ4weib0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOAqag_Yi8BsC6FyTWBjSLsRMHwxGHZyUxDY7H29Rk78aw%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages