AWS Thinkbox Discussion Forums

Python Job's Tasks

I would like to write a Python script to be used with Deadline Python Plugin as job’s “Script File”.
Since this Python Job will be the multi-Tasks job I need to be able to query a Task object from inside of the running Python script.
Specifically I need to get the Task’s Frame number. How to achieve it?

Hi,

**** Im going to add more to this next week, because we figured out , but its not super clean.
Hopefully edwin gives you a better answer… before then.

Hope that helps.

Cheers
Kym

Passing the start and end frame numbers of the current Slave’s task as additional args to the ‘script’ being executed has been in the CommandLine, CommandScript and Python plugins for some time now, like since Deadline 8.something:

[code] arguments = re.sub( r"<(?i)STARTFRAME>", str( self.GetStartFrame() ), arguments )
arguments = re.sub( r"<(?i)ENDFRAME>", str( self.GetEndFrame() ), arguments )
arguments = re.sub( r"<(?i)QUOTE>", “”", arguments)

    arguments = self.ReplacePaddedFrame( arguments, "<(?i)STARTFRAME%([0-9]+)>", self.GetStartFrame() )
    arguments = self.ReplacePaddedFrame( arguments, "<(?i)ENDFRAME%([0-9]+)>", self.GetEndFrame() )[/code]

You just need to add the above syntax to the submitting Python job info file and the Python plugin translates it into start/end frame numbers for the particular task is dequeues. We should probably write it up more in our docs to help users. I’ll make a note about doing that. Do your tasks contain more than 1 frame ever?

So I realized you can just put in and Deadline will fill in the number.
I am running something like this:
python check_my_image.py --exr /path/to/exr_file.<STARTFRAME>.exr

Privacy | Site terms | Cookie preferences