Usersetup
Any file named usersetup.py
will be run by Maya Python interpreter on Maya startup.
How it works¶
It loops over all the paths and callsâexec
âon any usersetup.py
files it finds.
Cons¶
Startup exceptions¶
Since there isnât any error handling, any errors in usersetup will prevent any other usersetups from loading.
If you use Maya modules with usersetup, and one of them fails, other modules might fail to load.
- TODO create a sample
AFAIK startup code in |Maya plugins is cleaner, and doesnât run into this issue. The affected plugin is simply disabled.
Messy environment¶
Often tools rely on editing the usersetup in Documents/Maya/scripts
. This is not recommended, because it might clash with other tools.
E.g. an outsource studio who works for 2 clients installs your tools, which overwrite the usersetup.py
from the other studio.
Security risk flagging¶
Since Maya 2022+, running userSetup.py
on startup can be disabled. Or you might get a popup asking for confirmation if you want to run it.
AFAIK plugins do not have this issue.
Backlinks¶
- Maya module
- If you have a maya module, it can have its own usersetup file (mel or python) that should excute after the main ones
- Maya run on startup
- usersetup in Maya install folder, documents, or in a module