AWS Thinkbox Discussion Forums

MayaBatch scriptJob task progress

Greetings,

I am using deadline 8.0.11.2.

I am using the MayaBatch plugin with a ScriptJob. I would like the progress to update, is there an internal output parser where I can print out progress and have the monitor update the task progress. Or is there some other way to do this. Currently I am printing out something like

0: STDOUT: Progress: 13

I notice there is a ‘task progress’ in the Jobs window, and a ‘progress’ in the tasks view. Ideally, I would love it to update the percent in the job view, is that possible?

Thank you
Lonnie

Hi,

I think if you can match :

[PROGRESS] 12 percent

or:

12%

that should get caught by the std out log parsing and update the task status.

Hope that helps.
Kym

Perfect, thank you! I appreciate the help.

lonnie

Kym’s answering all my forum threads! :laughing:

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.

Oh thanks, really good stuff to know. I am going to need to dig deeper soon enough.

cheers

I’m trying to do this exact thing. Im not quite sure I’m following how this works. Am i adding a simple print statement inside the ‘python script’ that is running inside of maya? The one doing the for loop?

Privacy | Site terms | Cookie preferences