All the frames properties are read only, how do I override the framerange of a job in a OnJobSubmitted callback?
When nothing else works, use deadlinecommand
ClientUtils.ExecuteCommand (["SetJobFrameRange ", aJob.JobId, "1-20", "2" ])
ah ofcourse!
It might not work in an Event though - I just tested, and it appears that when that line is run in an Event Script, it does not modify the submitted job because the event is triggered by deadlinecommand too early.
It does work in a General Monitor script.
This works though:
from Deadline.Events import *
from Deadline.Scripting import *
def GetDeadlineEventListener():
return JobSubmissionFrameRangeEventListener()
def CleanupDeadlineEventListener( eventListener ):
eventListener.Cleanup()
class JobSubmissionFrameRangeEventListener (DeadlineEventListener):
def __init__( self ):
self.OnJobSubmittedCallback += self.OnJobSubmitted
def Cleanup( self ):
del self.OnJobSubmittedCallback
def OnJobSubmitted( self, job ):
self.LogInfo( "OnJobSubmitted Frame Range Callback!" )
RepositoryUtils.SetJobFrameRange(job, "1-20", 2)
RepositoryUtils.SaveJob(job)
pass
Yep, I noticed this…
Maybe OnJobStarted?
I simply want to override the framerange so it does first-middle-last-rest
I updated my reply with the working example using RepositoryUtils.SetJobFrameRange()
Awesome!
Are there any docs about the RepositoryUtils?
Ah it was in there the whole time
Thanks!
Also you might want to look at Deadline/Custom/events/AutomaticPreviewJobSubmission at master · ThinkboxSoftware/Deadline · GitHub
It’s kinda-sorta what you’re looking to do, and might at least have some goodies you’re interested in.
Thanks! I will take a look and maybe take some code from that