Skip to content

Introduction

In order to submit a job to Deadline we must use the duedate api.

Warning

In the future this api will be interacted with via a Handler


Examples

In the following examples, mock_data is a module containing mock data to test this api. Each sample of mock data contains a dicionary of keyword arguments, or a list of dictionaries of keyword arguments.

Submitting a Maya Script Job

from duedate.api.batch_submission import BatchSubmission

# Maya Render Submission

maya_render_batch = BatchSubmission(name="Maya Renders")

for render_data in mock_data.tile_render_data:
    maya_render_batch.add_maya_render_job(**render_data)

# Set some additional settings
for job in maya_render_batch.jobs:
    if job.type == "draft_assembly":
        job.comment = "Tile Assembly"
        job.priority = 40
    elif job.type == "maya_render":
        job.priority = 90

# Check the jobs you are about to submit
for job in maya_render_batch.jobs:
    print(job)

# Submit
maya_render_batch.submit()

Submitting a Maya Script Job

from duedate.api.jobs.maya_script_job import MayaScriptJob

# Maya Script Job

my_scene_build = MayaScriptJob(**mock_data.maya_build_data)
my_scene_build.submit()

Submitting a Harmony Script Job

# Harmony Render Job

harmony_render_batch = BatchSubmission("Harmony Renders")
for render_data in mock_data.harmony_render_data:
    job = harmony_render_batch.add_harmony_render_job(**render_data)
    # This is an important job
    job.priority = 99 

harmony_render_batch.submit()

Work in progress

In order to submit chained jobs that require auxillary files that do not yet exist, an event plugin would be required. This is not yet implemented