Deadline Basic

  • Deadline is a render manage application, it needs to install on all render client and all render slave and also the main deadline database server machine.
  • Deadline needs all machine can access a common network shared drive, one for all project, one for its repo which holds all the config and setting and tools under Deadline.
  • The “Deadline Repo” location is important,
    • under its repo/, it has
      • repo/api/python: for use python to control the whole deadline system and its network
      • repo/settings: connection.ini contains all the server info, like IP address, database info
  • There are several applications under it to form the Deadline system
    • Deadline Monitor: the overview list app to view and submit job in one location
      • Tool (check Super user mode) > Configure Repository Option > web service settings : shows it listening port for web RESTful api info

Python Scripting for Deadline

  • command in windows
    cd "c:\Program Files\Thinkbox\Deadline10\bin"
    deadlinecommand.exe --version
    
    REM get job detail and put into text
    "D:\App\Deadline\bin\deadlinecommand.exe" -getjob 5cb6d7a04a99da2b84ad7cbe > d:\zTmp\result.txt
    
    REM get slave names of a pool, return a list of slave machine names
    "D:\App\Deadline\bin\deadlinecommand.exe" -getslavenamesinpool movie_nuke Assigned
    
    REM job list
    "D:\App\Deadline\bin\deadlinecommand.exe" -getjobsfilter username=tester
  • Python can be used for commanding the Deadline system, also can be used to Post-render/Pre-render script for triggering under render job events

Get Submission Info

  • mel process (SubmitMayaToDeadline.mel)
    1. submit job label (9163 line) > SetupSubmission()
    2. submit job label (next to Pipeline tool) @ 10743 > DeadlineSubmitterOnOk() > SetupSubmission()
  • for commandline
# get deadline cmd exe path
dl_cmd = os.path.normpath( os.path.join(os.environ['DEADLINE_PATH'], 'deadlinecommand.exe') )
 
# use deadline cmd to get deadline system info
cmd = r'"{0}" -JSON -GetSubmissionInfo Pools Groups MaxPriority TaskLimit UserHomeDir RepoDir:submission/Maya/Main RepoDir:submission/Integration/Main'.format(dl_cmd)
 
# note: the original mel code, put " 2> nul" at the end of the cmd, which means no err output, and only 1st output/the result to the string. 
# so they don't need 2 variable like bellow to catch the return values.
 
info=subprocess.Popen(cmd,stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.PIPE)
out, err = info.communicate()
exitcode = info.returncode
 
# read data
import json
dl_data = json.loads(out)
deadlineSubmissionInfo=dl_data['result']
 
# pool list
pool_list = deadlineSubmissionInfo['Pools']
  • for existing maya deadline scene, the attribute is stored at defaultRenderGlobals
    # for existing deadline scene
    cmds.getAttr('defaultRenderGlobals.DeadlineMayaRepoPath')
    # all the attribute saving is at SavePersistentDeadlineOptions() in mel
  • other maya info
    # current renderer
    renderer = cmds.getAttr('defaultRenderGlobals.currentRenderer') # arnold
    # current render layer
    currentRenderLayer = cmds.editRenderLayerGlobals(q=1, currentRenderLayer=1)
    # render animation?
    render_animation = cmds.getAttr("defaultRenderGlobals.animation") # true
     
    # Get frame list 1-3 style
    frameList = str( int(cmds.currentTime(q=1)) )
    if render_animation:
        fromFrame = int( cmds.getAttr('defaultRenderGlobals.startFrame') )
        toFrame = int( cmds.getAttr('defaultRenderGlobals.endFrame') )
        byFrame = int( cmds.getAttr('defaultRenderGlobals.byFrameStep') )
     
        frameList = fromFrame
        if fromFrame != toFrame:
            frameList = "{0}-{1}".format(frameList, toFrame)
            if byFrame > 1:
                frameList = "{0}x{1}".format(frameList, byFrame)