Merged in hotfix/fix-frame-start-for-review (pull request #505)

fixed start frame if it doesn't match rendered frames

Approved-by: Milan Kolar <milan@orbi.tools>
This commit is contained in:
Ondřej Samohel 2020-02-21 23:27:12 +00:00 committed by Milan Kolar
commit a91bc92aa4
2 changed files with 19 additions and 0 deletions

View file

@ -256,10 +256,16 @@ class CollectRenderedFrames(pyblish.api.ContextPlugin):
)
ext = collection.tail.lstrip(".")
detected_start = min(collection.indexes)
detected_end = max(collection.indexes)
representation = {
"name": ext,
"ext": "{}".format(ext),
"files": list(collection),
"frameStart": frame_start,
"detectedStart": detected_start,
"detectedEnd": detected_end,
"stagingDir": root,
"anatomy_template": "render",
"fps": fps,
@ -323,12 +329,17 @@ class CollectRenderedFrames(pyblish.api.ContextPlugin):
if "slate" in instance.data["families"]:
frame_start += 1
detected_start = min(collection.indexes)
detected_end = max(collection.indexes)
representation = {
"name": ext,
"ext": "{}".format(ext),
"files": list(collection),
"frameStart": frame_start,
"frameEnd": frame_end,
"detectedStart": detected_start,
"detectedEnd": detected_end,
"stagingDir": root,
"anatomy_template": "render",
"fps": fps,
@ -394,6 +405,9 @@ class CollectRenderedFrames(pyblish.api.ContextPlugin):
if "review" not in families:
families.append("review")
detected_start = min(collection.indexes)
detected_end = max(collection.indexes)
instance.data.update(
{
"name": str(collection),
@ -428,6 +442,8 @@ class CollectRenderedFrames(pyblish.api.ContextPlugin):
"files": list(collection),
"frameStart": start,
"frameEnd": end,
"detectedStart": detected_start,
"detectedEnd": detected_end,
"stagingDir": root,
"anatomy_template": "render",
"fps": fps,

View file

@ -149,6 +149,9 @@ class ExtractReview(pyblish.api.InstancePlugin):
# necessary input data
# adds start arg only if image sequence
if isinstance(repre["files"], list):
if start_frame != repre.get("detectedStart", start_frame):
start_frame = repre.get("detectedStart")
input_args.append(
"-start_number {0} -framerate {1}".format(
start_frame, fps))