Hello,
I’m trying to use the deadline equivalent of subprocess in a pre-job script (as it appears to fail to import subprocess module).
I want to apply a python patch to scene files before it is render with slaves (opening the maya file in batch mode with mayapy), so I wrote the script below.
Could someone tell me how to reproduce this subprocess command : subprocess.Popen(mayaPath + ’ ’ + scriptPath + ’ ’ + scene) with Deadline “RunProcess” command ?
Thanks !
[code]import os
from System.IO import *
from Deadline.Scripting import *
from Deadline.Plugins import *
def main():
outputDirectories = SlaveUtils.GetCurrentJobValue(“OutputDirectories”)
Name = GetJob()
sceneName = str(Name).replace(" ","").split("-")[0] + ".ma"
scene = str(outputDirectories[0]) + "\\" + str(sceneName)
mayaPath = 'c:/program files/autodesk/maya2013/bin/mayapy.exe'
scriptPath = 'D:\\temp\\createSphere.py'
maya = RunProcess(mayaPath, '"<scriptPath>"'+'"<scene>"',"c:/program files/autodesk/maya2013/bin/", -1)
#maya = subprocess.Popen(mayaPath + ' ' + scriptPath + ' ' + scene)[/code]