AWS Thinkbox Discussion Forums

Nuke Job Parameter Reading

Hi,

I’m trying to write an automatic quicktime draft script, that reads the framerate from the corresponding Nuke job that created it.

I have changed the Nuke submission script so that the project frame rate is stored in the Deadline job as “extrainfo6”, I just can’t get the draft job to read this value.

I’m quite sure it is something very simple and possibly just a syntax error, but I’m pretty new to this so any help would be awesome.

Thanks

When you’re setting up your expected parameters dictionary, do you have something like:

expectedTypes = dict()
expectedTypes['extrainfo6'] = '<float>'[/code](Assuming you want a float, rather than an int.)  If you do, then after: [code]
params = ParseCommandLine( expectedTypes, sys.argv )
[/code] you should be able to use: [code]
fps = params['extrainfo6']

If that doesn’t work, what is the exact error message you’re getting?

Edit: I just noticed that the code I gave you is probably only for command line arguments. Have you looked at the example at http://www.thinkboxsoftware.com/draft-using-job-values-recipe/?

(I’ll get Jon to look at your question too… he knows more about the deadline side of things.)

Hi Andrea,

Thanks for your reply.

I’m now getting the following errors:

0: STDOUT: File "C:\Users\render\AppData\Local\Thinkbox\Deadline6\slave\RN04\jobsData\1280_stamped_25fps.py", line 29, in <module> 0: STDOUT: params = ParseCommandLine( expectedTypes, sys.argv ) 0: STDOUT: File "C:\Users\render\AppData\Local\Thinkbox\Deadline6\slave\RN04\Draft\DraftParamParser.py", line 197, in ParseCommandLine 0: STDOUT: return ParseParams( expected, params ) 0: STDOUT: File "C:\Users\render\AppData\Local\Thinkbox\Deadline6\slave\RN04\Draft\DraftParamParser.py", line 120, in ParseParams 0: STDOUT: raise StandardError( "ERROR: Expected parameter '%s' was not found." % key ) 0: STDOUT: StandardError: ERROR: Expected parameter 'extrainfo6' was not found. 0: INFO: Process exit code: 1

It seems that It cant find the value, even though if you right click on the parent deadline job, it is clearly there.

Any other ideas?

Thanks

So the code that Andrea provided will only work for parameters that are already being passed to the Draft script, not for any arbitrary Deadline Job property.

The easiest way to get this working is to tweak the Draft Event Plugin to add the ExtraInfo6 field as a script parameter (so that the above code will work) when creating the Draft Job. For that, you will need to modify the ‘events/Draft/Draft.py’ script in your repository.

Look for this block of code:

[code] scriptArgs.append( 'inFile="%s" ’ % Path.Combine( outputDirectory, draftInputFile ) )
scriptArgs.append( 'outFile="%s" ’ % draftOutput )
scriptArgs.append( 'outFolder="%s" ’ % Path.GetDirectoryName( draftOutput ) )

                scriptArgs.append( 'deadlineJobID=%s ' % job.JobId )[/code]

You’ll want to add a line to that which pulls the ExtraInfo6 field from the job and adds it to the ‘scriptArgs’ list:

[code] scriptArgs.append( 'inFile="%s" ’ % Path.Combine( outputDirectory, draftInputFile ) )
scriptArgs.append( 'outFile="%s" ’ % draftOutput )
scriptArgs.append( 'outFolder="%s" ’ % Path.GetDirectoryName( draftOutput ) )

                scriptArgs.append( 'deadlineJobID=%s ' % job.JobId )
                scriptArgs.append( 'extrainfo6="%s" ' % job.ExtraInfo6 )[/code]

This way, once the Draft job runs, it will get passed the value of the Nuke Job’s ExtraInfo6 field, which will allow you to parse it using the code Andrea provided in her previous post. Alternatively, you could potentially call DeadlineCommand from your Draft script to get Job Info for the value of the ‘deadlineJobID’ parameter, and parse its output to get ExtraInfo6, but that’s a bit more involved (and won’t work if the job gets deleted on completion).

Cheers,

  • Jon

Hi Jon,

Thanks for the very thorough reply!!

I’ll have a go at this later today and let you know how I get on.

Thanks again
M

BINGO!!

that all worked like a charm - thanks for all you help.

I never would have sorted this on my own!!!

Great! Thanks for letting us know.

Privacy | Site terms | Cookie preferences