For an automated process, I want to launch maya.exe with a script to execute at launch, using
maya.exe -hideConsole -command mel_command
I was thinking about creating a subprocess.Popen command with some env vars, which will itself call maya.exe but it seems pretty hacky, …
Is there a way to pass environment variables to this maya session? I can’t find anything in the doc
calling subprocess with a specific environment works just fine.
otherwise you can modify the "MAYA.ENV’ file that lives in your “My Documents/Maya” folder to contain the environment variables you want, and those should be inherited by each Maya session.
'''
Exposes the MayaPyManager class, which is used to run instances of MayaPy with explict control over paths and environment variables. A Manager can run scripts, modules, or command strings in a separate MayaPy environment; results and errors are captured and returned.
Typical uses might be:
- running unit tests
- running a copy of Maya.standalone as a headless RPC server with StandaloneRPC https://github.com/theodox/standaloneRPC
- spawning multipe copies of maya to batch process files in parallel on a multi-core machine
- do any of the above on multiple maya versions concurrently
While you can use a standalone GUI library like PyQt/PySide from mayapy, you don’t get access to the normal maya GUI.
For something like playblasts, you’d need to handle that in a normal maya process.