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. On 23 March 2014 18:18, Justin Israel <[email protected]> wrote: > Then it would appear that Maya only considers the environment variable > once on launch. > On Mar 24, 2014 12:06 AM, "Tuan Nguyen" <[email protected]> wrote: > >> 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. >> >> -- >> 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 [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/python_inside_maya/CAMCvD%2BGm%2BYLN%2Bt1oGfe4nyb4WTB4DROXd%3DMKYwqLwTKtmtvs5g%40mail.gmail.com<https://groups.google.com/d/msgid/python_inside_maya/CAMCvD%2BGm%2BYLN%2Bt1oGfe4nyb4WTB4DROXd%3DMKYwqLwTKtmtvs5g%40mail.gmail.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > -- > 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 [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA1V%3Dn%3DcdW_aAShp5r-8u42cgTg0zRkC1A7%3DQ3eGDEzaPA%40mail.gmail.com<https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA1V%3Dn%3DcdW_aAShp5r-8u42cgTg0zRkC1A7%3DQ3eGDEzaPA%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > -- *Marcus Ottosson* [email protected] -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOAqag_Yi8BsC6FyTWBjSLsRMHwxGHZyUxDY7H29Rk78aw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
