Kym’s answering all my forum threads!
To elaborate a bit, you’re leveraging the code we have here:
self.AddStdoutHandlerCallback( "\\[PROGRESS\\] ([0-9]+) percent" ).HandleCallback += self.HandleProgressMessage1
self.AddStdoutHandlerCallback( "([0-9]+)%" ).HandleCallback += self.HandleProgressMessage1
We have no comments in there, so I’m not sure which apps that’s set up for, but it definitely works. You can piggyback off existing handlers in some plugins, but for others, you’ll have to define your own handler and then your own version of HandleProgressMessage1 which looks like this:
def HandleProgressMessage1( self ):
startFrame = self.deadlinePlugin.GetStartFrame()
endFrame = self.deadlinePlugin.GetEndFrame()
if( endFrame - startFrame + 1 != 0 ):
self.deadlinePlugin.SetProgress( ( float(self.GetRegexMatch(1)) + self.FinishedFrameCount * 100 ) / ( endFrame - startFrame + 1 ) )
That function looks a bit odd because we expect you to restart your progress counts for each frame. If your job is a single frame task (tasks must have one frame, even if it’s not used), then throwing out progress messages will just work.