mayapylauncher

This module provides a way to launch a new mayapy process.

mayapy_launcher() is supposed to call the regular jukeboxmaya launcher but with tha maya python intepreter. It will setup the necessary environment and transver all arguments to the launcher who handles argparsing etc.

You can also call the mayapy_launcher() via console_scripts and gui_scripts entry points of setuptools. To use execute:

$ jukeboxmayapy -h

or for guiscripts:

$ jukeboxmayapyw -h

You can also execute this script directly!

jukeboxmaya.mayapylauncher.setup_environment()[source]

Set up neccessary environment variables

This appends all path of sys.path to the python path so mayapy will find all installed modules. We have to make sure, that we use maya libs instead of libs of the virtual env. So we insert all the libs for mayapy first.

Returns:None
Return type:None
Raises:None
jukeboxmaya.mayapylauncher.execute_mayapy(args, wait=True)[source]

Execute mayapython with the given arguments, capture and return the output

Parameters:
  • args (list) – arguments for the maya python intepreter
  • wait (bool) – If True, waits for the process to finish and returns the returncode. If False, just returns the process
Returns:

if wait is True, the returncode, else the process

Return type:

int|:class:subprocess.Popen

Raises:

None

jukeboxmaya.mayapylauncher.mayapy_launcher(args=None, wait=True)[source]

Start a new subprocess with mayapy and call the jukeboxmaya.launcher.main_func().

So this can be used when launching jukeboxmaya from an external intepreter but you want to actually use the mayapy intepreter instead (because it’s less buggy).

Parameters:
  • args (list) – arguments for the launcher. If None, sys.argv[1:] is used
  • wait (bool) – If True, waits for the process to finish and returns the returncode. If False, just returns the process
Returns:

if wait is True, the returncode, else the process

Return type:

int|:class:subprocess.Popen