We have some long draft renders occasionally. I was hoping that if I included total frames in the job, and set the chunk size to the total frames as well, that the draft job would be aware of the number of frames, even though it is still a single task But this does not seem to be the case.
Is it possible (with Deadline 5.2) to show task progress on a draft job that has just 1 task?
Yes, this is possible. To do so, you’ll need to update your Draft script.
Deadline is looking for “Progress:” messages to determine the task progress. We’ll need to add such progress messages to your script.
Your script probably has a “for” loop over a number of frames, similar to:
[code]for currFrame in frames:
# Read in the frame
currFile = ReplaceFilenameHashesWithNumber( inFilePattern, currFrame )
# etc...[/code]
We can add a progress message to the for loop:[code]frameIndex = 0
for currFrame in frames:
# Update the task progress
print( “Progress: %f” % (float(frameIndex) / len(frames) * 100) )
frameIndex += 1
# Read in the frame
currFile = ReplaceFilenameHashesWithNumber( inFilePattern, currFrame )
# etc...[/code]
Now when you run the script, you should see the task progress in the Deadline Monitor.
Having implemented it, something must be missing on my end. The output looks like this but the deadline interface does not update, even with manual refresh.
NOTE: People who are using newer versions of Deadline do NOT need to do this… these modifications are already in newer versions of Deadline.
Because you’re still on Deadline 5.2, you’ll need to add a bit of code to the Draft plugin (in repo/plugins/Draft/Draft.py) that will look for something that looks like “Progress: xx%” (or whatever you are printing out in your scripts).
To do this, you’ll have to add the following few lines in the InitializeProcess function of the Draft Plugin. Note you might have to change the regex depending on what your script outputs, but this should work for what you’re printing:def InitializeProcess(self):
self.StdoutHandling=True
regexStr = ".*Progress: ([0-9]+).*"
self.AddStdoutHandler(regexStr, self.HandleStdoutProgress)
And then add a HandleStdoutProgress function, something like this:def HandleStdoutProgress( self ):
percentage = float(self.GetRegexMatch(1))
SetProgress( percentage )
(Credit for this answer goes to Jon. )
I’m getting the sense that you’re referring to the Job’s progress – is the Task’s progress updating properly? If so, that’s normal, since Deadline currently bases Job progress solely on the completion of Tasks. While this works fine for sequence renders with lots of frames, it’s definitely a little weird with single Task Jobs (since those jobs will always go from 0% -> 100%).
Pulling progress from Tasks for lower Task Count jobs has been a wishlist item for a while, we’re hoping to get to it soon!
Note: to see the progress of a particular task (as opposed to the “Task Progress” column in the Jobs panel), you will likely need to scroll the Tasks panel over.
Another proud moment for me, this. You’re spot on - I didn’t even know about the per task progress output.
I scrolled over like Andrea said, and there it was! So it’s definitely working. I think we would really love to put another vote in for that feature you mentioned, that’s the outcome I was hoping to achieve. For now, we’ll hang tight