Python Command for Manual Job Submission Maya to deadline (Including submit maya scene file)

2k Views Asked by At

I am submitting Maya jobs to Deadline via a script where I pass the two job files (maya_deadline_job.job and maya_deadline_info.job) as arguments to deadlinecommand.exe.

I need to make sure I am Submitting the Maya Scene File. Is there any way to include this in any of the job files or using a python script?

2

There are 2 best solutions below

2
On

maya_deadline_job.job is a file containing something like this :

Animation=1
Renderer=vray
UsingRenderLayers=1
RenderLayer=Background
RenderHalfFrames=0
LocalRendering=0
StrictErrorChecking=1
MaxProcessors=0
VRayAutoMemoryEnabled=0
VRayAutoMemoryBuffer=500
Version=2013 x64
Build=64bit
ProjectPath=path/projectName/seqXX/sceneXXX
ImageWidth=1920
ImageHeight=1080
OutputFilePath=path/projectname/render_out_sceneXXX/
OutputFilePrefix=<Scene>/<Layer>/<Scene>.<Layer>.
Camera=render_cam
SceneFile=path/projectName/seqXX/sceneXXX/sceneName.ma
IgnoreError211=0

so you can parse your file and change the path with python, i.e.:

filename = '/path/maya_deadline_job.job'
file_out=''
with open(filename,'r') as fh:
    all_lines = fh.readlines()
    for line in all_lines:
        if 'SceneFile=' in line:
            file_out.append('SceneFile=mynewpath')
        elif...
        else:
            file_out.append(line)
    fh.write(file_out)
0
On

If you would like to link to your scene file, then as DrWeeny showed, use the SceneFile option to provide a path.

If you would actually like to send the file to Deadline, then pass it as another argument, and set SceneFile to the scene name itself, eg. MyScene.ma.

deadlinecommand.exe maya_deadline_job.job maya_deadline_info.job "path/to/MyScene.ma"