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



On Mon, Mar 24, 2014 at 1:28 AM, Marcus Ottosson <[email protected]>wrote:

> 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 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
> [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOAqag_Yi8BsC6FyTWBjSLsRMHwxGHZyUxDY7H29Rk78aw%40mail.gmail.com<https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOAqag_Yi8BsC6FyTWBjSLsRMHwxGHZyUxDY7H29Rk78aw%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/CAMCvD%2BFpBjZ%3DqSxhPM_F0TZ%3DLbMiygPwTixwMVPVNKphbTA-2w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to