Getting job start frame and end frame

Hi there:

How do I get the jobs start frame and end frame as mentioned in the FameList when submitting a job ? Here is the python script that I am using int post render script - both job.startFrame and GetStartFrame() is not working - GetStartFrame() is giving 0 and job.startFrame is not valid ?

from Deadline.Jobs import *
def main( *args ):
deadlinePlugin = args[0]
job = deadlinePlugin.GetJob()
outputDirectories = job.OutputDirectories
outputFilenames = job.OutputFileNames
sFrame = job.startFrame
eFrame = job.endFrame
sFrame1 = deadlinePlugin.GetStartFrame()
eFrame1 = deadlinePlugin.GetEndFrame()

Try Job.JobFrames it should return 123-456 as string you can split with -

1 Like

Thanks Panupat that worked. Awesome

Hey,

I know this post is 2 years old – but there’s a slight flaw in this solution.

If you use frame list formatting, the returned string isn’t formatted exactly like “123-456”, but (in my case) is more like “44,46,48,50” or “20-40,1-19”. This makes concatenating the first frame number a bit more difficult.

OP mentioned “GetStartFrame()” but for me it returned -1. My guess is because I’m doing a post-action script so maybe the post-action task counts as -1

Is there any other way to get the first frame?

UPDATE:

I found the solution, but I’ll leave it here for anyone else. If you use job.JobFramesList[0] it gives you the first frame. I tested this by submitting a job with a frame count in the order of “45-65,44”. The value at the first index spat out 44, while doing JobFrames gave “45-65,44”.