Hi there,
This is on a Windows 7 machine, Maya 2017 64-bit
I’m attempting to integrate Pyblish into my company’s pipeline but have a dilemma with how to handle the external python.exe process that is used for launching the pyblish_qml UI.
The primary constraint I have is that leaving a cmd window open that the artists have to leave upon and manually close is not okay.
The second constraint is that the process has to be non-blocking for Maya during startup as we already have a lot of plugins and startup logic to run.
So, I’ve attempted to launch the process using:
subprocess.Popen('python -m pyblish_qml')
This leaves a cmd window open and also doesn’t close when Maya closes. Adding shell=True makes the cmd window go away, but again, there’s a lingering python.exe process in the background once Maya closes.
I’ve tried keeping track of the process ID and killing it using a Maya callback such as:
OpenMaya.MSceneMessage.addCallback(OpenMaya.MSceneMessage.kMayaExiting, kill_process)
But this didn’t do anything.
I also tried messing around with the multiprocessing
package but couldn’t figure out a combination that works.
Is there any way to tell the process to terminate from Maya? Or a way to keep the python.exe process parented to the maya.exe process so it automatically exits when Maya does?
Thank you!