I am trying to basically replicate the call made by the Maya in-app command to call the same thing within a python script. I can pull all the same variables from maya in exactly the same format as used in the mel script, but I keep getting errors saying the string is not translatable into a dict or qb.job. It seems like it doesn't like white space or forward slashes in the dict statement, but it is (as far as I can tell) the same format as the mel command. Perhaps I just don't understand this well enough yet, but any help to shed some light would be greatly appreciated.
The mel command the shows in the script editor is:
system("start \""+`qube_get_qubeguiPath`+"\" --submitDict \"{'name':'maya batchrender "+`file -q -sn -shn`+"', 'prototype':'cmdrange', 'package':{'simpleCmdType':'Maya BatchRender ("+`qube_getCurrentRendererShortname`+")', 'scenefile':'"+`file -q -sn`+"', '-proj':'"+`workspace -q -rd`+"', 'range':'"+`playbackOptions -q -min`+"-"+`playbackOptions -q -max`+"','camera_all':'"+stringArrayToString(`listCameras -p -o`, " ")+"', 'renderLayer_all':'"+stringArrayToString(`ls -type renderLayer`, " ")+"','renderPass_all':'"+stringArrayToString(`ls -type renderPass`, " ")+"'}}\" ");
My python code for the same line looks like:
os.system("start qube.exe --submitDict {'name':'" + submitName + "','prototype':'cmdrange','package':{'simpleCmdType':'" + submitSimCmdType + "','scenefile':'" + submitSceneFile + "','-proj':'" + submitProj + "','range':'" + submitRange + "','camera_all':'" + submitCameraAll + "','renderLayer_all':'" + submitRenderLayerAll + "','renderPass_all':'" + submitRenderPassAll + "'}}")
The variables resolve to:
submitName: Cubes_MR_TestScene.ma
submitPrototype: cmdrange
submitSimCmdType: Maya BatchRender (mentalRay)
submitSceneFile: Y:/Staff/Jason/MI_Test/test2/scenes/Cubes_MR_TestScene.ma
submitProj: Y:/Staff/Jason/MI_Test/test2/
submitRange: 1.0-60.0
submitCameraAll: front persp side top
submitRenderLayerAll: defaultRenderLayer
submitRenderPassAll:
the error box I get is:
Submit Error: String "{'name':'Cubes_MR_TestScene.ma','prototype':'cmdrange','package':{'simpleCmdType':'Maya" not translatable into a dict or qb.job.
Traceback (most recent call last):
File "qube.py", line 2734, in <module>
File "<string>", line 1
SyntaxError: EOL while scanning string literal