Perform periodic checks during Rendering - custom Unreal Progress Update

Hello there!

I am currently in the process of adding Unreal into our Deadline Pipeline and after weeks of rewriting the code and testing, it finally all comes together.
It already works - for the most part, however I am currently trying to get a progress report working:

Any Unreal Deadline Job consists of 1 Task that is rendering all frames of a given Frame Range. During rendering however, Unreal does not communicate when a frame has finished, so the Deadline Task is stuck at 0% Progress until ALL Frames have rendered sucessfully, after which the progress snaps to 100%

My solution for this:

  • write a function that checks the OutputDirectory for the number of image files
  • calculate the progress: (num_frames / (end_frame - start_frame + 1) ) * 100
  • update the progress with SetProgress()
  • do this - lets say- every 20 seconds

Seems like a sensible and easy to implement solution - however here is my main question:

how can I inject this function into the deadline plugin? I have callbacks for when the jobexits or finishes etc, but I wanna have it check on a regular interval. currently, the UnrealEngine5 plugin hands the wheels to UE5 until that process exits - with only some stoutā€™s sent back - Instead I would want Deadline to do periodic checks.

Any help is greatly appreciated.

1 Like

Instead of messing with the plugin the easiest way to perform periodic tasks would be to trigger an event on house cleaning.

I dont know how the offical Unreal plugin works but what I did in our Unreal plugin was sending progress from Unreal to StdOut and read it back with a StdOut handling from the plugin to update it in deadline.

Thanks for the reply. We already had to mess with the plugin quite a bit, so we could get our integration with Shotgrid, as well as Perforce working.

Could you elaborate what you mean with ā€œhouse cleaningā€? Are you referring to the clean_up of the plugin? I thought that function is only called after the job is finished, while we want to get the progress to refresh during our (quite lengthy) renders.

I have little experience with StdOut-Handling, but if it works for you, maybe Iā€™ll look into it.

Iā€™m speaking of the reposity house cleaning, which you can use to trigger events off of. Not very elegant since the event doesnt a reference to the job you try to work on. So youā€™d have to parse the repos jobs, select your unreal job, then parse the outputā€¦
But it would run periodically.

StdOut handling would defenitely be the cleaner solution as it would already run from the job and isnt hard at all from the deadline side as long as unreal sends something to StdOut that you can use to get the progress.

Thats what I did in the plugin (wich is different from the official one):

def InitializeProcess(self):
怐....怑
    self.AddStdoutHandlerCallback(r"(Progress:\s*)([0-9]*)%").HandleCallback += self.handleStdOutProgress

def handleStdOutProgess(self): 
    self.SetProgress(self.GetRegexMatch(2))

Yes Iā€™d probably go the StOut-Route, thanks for the input.

We also do not use the official plugin - well we do, but heavily modified, since it did not fit our pipeline.

Iā€™ll see if I can get it to work.