Submitting a Python Job via a script

Hey,

So there are plenty of threads here about this kind of thing but I’m a little unclear so would like to have my own thread instead of any hijacking :slight_smile:

I have a script at the moment within nuke that gets a sequence, copies the files and renames them elsewhere. What I’d like to do is recreate this via deadline outside of nuke, then the user can run a job script after they’ve rendered the nuke script in deadline.

I’m thinking that I want to submit a python job via a job script (right click on a job> scripts> myscript) , and all I need is the output frame range and file names.

SO from what I understand so far, I need to parse the frame range (start and end frame or 100-134 or whatever) and the some kind of output file path with the script path INTO a python submit dialog?
The frame range and output path via arguments in the python dialog?

Then a seperate script which can read in those frame ranges and file path from arguments so that they pick up the correct frame?

Is this the best way to go about this? The problem here is I’m a bit unsure how to parse all that stuff to the python dialog from reading the documentation…

Hi Simon,

This sounds like a good approach. There are basically 2 ways you can go about this:

  1. As you’ve suggested, you could have a job right-click script that calls our Python job submitter and pre-populates some fields. Our Python submission script isn’t designed to accepts arguments at the moment though, so you would have to modify it to accept the arguments and then populate the necessary fields. Or, instead of modifying the existing one, you could make a copy of it and call that instead. You can take a look at the JobQuicktimeSubmission job right-click script to see how we do this for the quicktime submission option.

  2. The other option is to have your job right-click script just submit to Python plugin without going through the generic python submitter. This can be useful if you don’t need your artists setting a bunch of options, and it keeps everything self-contained in one script. If you decide to go this route, you can look at the generic python submitter to see how we create the job files and submit them to Deadline.

Hope this helps!

  • Ryan

Actually I just started trying something like that, I duplicated the the python submitter and run it with a very basic script like this

	scriptPath = Path.Combine( GetScriptsDirectory(), "Submission\Analog_PublishSubmission\Analog_PublishSubmission.py" )
	scriptPath = PathUtils.ToPlatformIndependentPath( scriptPath )
	

	ExecuteScript( scriptPath, "" )

and set the inputs on the dialog like this:

# Set the inputs from the selected job! JobNames = JobUtils.GetSelectedJobNames() JobName = JobNames[0] scriptDialog.AddControl( "NameBox", "TextControl", str(JobName), tabWidth - labelWidth - 24, -1 )

seems promising