-
Notifications
You must be signed in to change notification settings - Fork 201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add frame range to Blender command in CueSubmit #1337
Changes from 3 commits
2009e12
2ff33f5
29fdbeb
507a11a
ce618a0
3c0f2ff
d3d7c6d
2d254c7
2d4ba88
a17be62
ee2af1e
41b6e81
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -21,6 +21,7 @@ | |||||||||||||||||||||
from __future__ import absolute_import | ||||||||||||||||||||||
|
||||||||||||||||||||||
from builtins import str | ||||||||||||||||||||||
import re | ||||||||||||||||||||||
|
||||||||||||||||||||||
import outline | ||||||||||||||||||||||
import outline.cuerun | ||||||||||||||||||||||
|
@@ -63,6 +64,7 @@ def buildBlenderCmd(layerData): | |||||||||||||||||||||
blenderFile = layerData.cmd.get('blenderFile') | ||||||||||||||||||||||
outputPath = layerData.cmd.get('outputPath') | ||||||||||||||||||||||
outputFormat = layerData.cmd.get('outputFormat') | ||||||||||||||||||||||
frameRange = layerData.layerRange | ||||||||||||||||||||||
if not blenderFile: | ||||||||||||||||||||||
raise ValueError('No Blender file provided. Cannot submit job.') | ||||||||||||||||||||||
|
||||||||||||||||||||||
|
@@ -72,8 +74,19 @@ def buildBlenderCmd(layerData): | |||||||||||||||||||||
renderCommand += ' -o {}'.format(outputPath) | ||||||||||||||||||||||
if outputFormat: | ||||||||||||||||||||||
renderCommand += ' -F {}'.format(outputFormat) | ||||||||||||||||||||||
# The render frame must come after the scene and output | ||||||||||||||||||||||
renderCommand += ' -f {frameToken}'.format(frameToken=Constants.FRAME_TOKEN) | ||||||||||||||||||||||
if frameRange: | ||||||||||||||||||||||
# Checks if frame range is in the correct format | ||||||||||||||||||||||
if re.match(r'^\d+$', frameRange): | ||||||||||||||||||||||
renderCommand += ' -f {}'.format(frameRange) | ||||||||||||||||||||||
elif re.match(r'^\d+-\d+$', frameRange): | ||||||||||||||||||||||
startFrame, endFrame = map(int, frameRange.split("-")) | ||||||||||||||||||||||
renderCommand += (' -s {startFrame} -e {endFrame} -a' | ||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If I'm reading this correctly, I think this will result in a layer command with the start/end frames hardcoded. I.e., if the frame range is Compare this to the code prior to this change, which instead inserts the I think instead, we want to use tokens for start frame / end frame: OpenCue/cuesubmit/cuesubmit/Constants.py Lines 45 to 54 in 5b9defd
These tokens should allow Cuebot to swap in the correct frame numbers for each task based on the chunk size. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The thread relate error on cuebot is normal, it's related to a race condition that's handled first come first. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @bcipriano noted.
Got it. Sorry, I'm not very familiar with the concept of chunk sizes in render farms, hence the confusion 😅 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, you've got that right. To extend the same example, if the frame range is
Cuebot should handle all of this already -- dividing up the frame range into chunks and the replacement of the Kind of confusingly, in OpenCue each task is called a "frame". This is because when OpenCue was originally written, it only operated on single frames -- chunk size was always assumed to be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @bcipriano I've resolved this in ce618a0. |
||||||||||||||||||||||
.format(startFrame=startFrame, endFrame=endFrame)) | ||||||||||||||||||||||
else: | ||||||||||||||||||||||
raise ValueError('Invalid frameRange format: {}'.format(frameRange)) | ||||||||||||||||||||||
else: | ||||||||||||||||||||||
# The render frame must come after the scene and output | ||||||||||||||||||||||
renderCommand += ' -f {frameToken}'.format(frameToken=Constants.FRAME_TOKEN) | ||||||||||||||||||||||
return renderCommand | ||||||||||||||||||||||
|
||||||||||||||||||||||
|
||||||||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be great if you could add unit tests to cover both the single-frame and start/end frame cases.
https://github.com/AcademySoftwareFoundation/OpenCue/blob/master/cuesubmit/tests/Submission_tests.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added in 2d4ba88
@bcipriano however, I'm having a bit of trouble with lines #178 and #153 of Submission_tests.py
The test fails when I set it to
blender
but passes when I set it toshell
. This is despite the layerType being set as Blender. Any thoughts on this?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ping @bcipriano