ZBrushCentral

"Question" Recognizing open Maya process instead of opening new

Hi, I’ve written a bunch of Maya side pipeline stuff for current project, and on Zbrush end, using ZFileUtils LaunchAppWithFile to open Maya. In Python/Maya , found a way to get Zbrush ID for moving to open app, but have no clue how to swap to existing maya session through zscript and whether I can use LaunchAppWithFile to launch app WITHOUT a file. Any help here would be GREATLY APPRECIATED!

You can use LaunchAppWithFile to launch an application without a file like this:

[VarSet, appPath,"C:\Program Files\Autodesk\Maya2020\bin\maya.exe"]
[VarSet,err,[FileExecute,[Var,dllPath],"LaunchAppWithFile",#appPath]]

However, I’m not sure that you will be able to stop Maya opening a second instance. The way you could do it is to open a command port in Maya and then use that to send MEL instructions (e.g. to load a file) but that’s beyond the scope of ZFileUtils and would involve some C++ coding for another DLL.

-Marcus

1 Like

Thank you so much for helping out with some guidance on this one for me, and for all your continuous efforts and help I see on this forum, very much appreciated!