fixed start frame if it doesn't match render

This commit is contained in:
Ondrej Samohel 2020-02-21 13:28:50 +01:00
parent 2a1e057716
commit 2195652344
No known key found for this signature in database
GPG key ID: 8A29C663C672C2B7
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))