We've Moved

The blog has been retired - it's up for legacy reasons, but these days I'm blogging at blog.theodox.com. All of the content from this site has been replicated there, and that's where all of the new content will be posted. The new feed is here . I'm experimenting with crossposting from the live site, but if you want to keep up to date use blog.theodox.com or just theodox.com

Tuesday, May 13, 2014

No soup for you, userSetup.py

When I start working on isolating maya environments, I came across a nice bit of trivia I didn't know about.

If you ever want to run a Maya without its userSetup.py and without having to move or rename files, it turns out you can suppress userSetups by setting an environment variable called MAYA_SKIP_USERSETUP_PY to any value that evaluates as True.  This is handy for testing and isolating path management problems - if you've got a rogue path and you're not sure where it's coming from, this is an easy way to make sure it's not being added in by the userSetup.

PS: If you're using a MayaPyManager to run mayapy instances, you can set this variable like so:

    from mayaPyManager import MayaPyManager
    import os

    env = os.environ.copy()
    env['MAYA_SKIP_USERSETUP_PY'] = '1'
    mgr = MayaPyManager('path/to/mayapy.exe', env, 'path/to/maya/scripts')
    # this manager will use only the user provided path
    # and won't run the userSetup.py on startup

No comments:

Post a Comment