Merged in hotfix/review_integrate_fix (pull request #337)

Hotfix/review integrate fix
This commit is contained in:
Jakub Trllo 2019-10-29 14:18:54 +00:00 committed by Jakub Ježek
commit 749852fc8b
2 changed files with 14 additions and 5 deletions

View file

@ -109,7 +109,7 @@ class CollectContextDataSAPublish(pyblish.api.ContextPlugin):
if component["preview"]: if component["preview"]:
instance.data["families"].append("review") instance.data["families"].append("review")
instance.data["repreProfiles"] = ["h264"] instance.data["repreProfiles"] = ["h264"]
component["tags"] = ["review", "delete"] component["tags"] = ["review"]
self.log.debug("Adding review family") self.log.debug("Adding review family")
instance.data["representations"].append(component) instance.data["representations"].append(component)

View file

@ -1,4 +1,5 @@
import os import os
import tempfile
import pyblish.api import pyblish.api
from pype.vendor import clique from pype.vendor import clique
@ -82,9 +83,10 @@ class ExtractReviewSP(pyblish.api.InstancePlugin):
full_input_path = os.path.join(staging_dir, repre["files"]) full_input_path = os.path.join(staging_dir, repre["files"])
filename = repre["files"].split(".")[0] filename = repre["files"].split(".")[0]
# prepare output file
repr_file = filename + "_{0}.{1}".format(name, ext) repr_file = filename + "_{0}.{1}".format(name, ext)
out_stagigng_dir = tempfile.mkdtemp(prefix="extract_review_")
full_output_path = os.path.join(staging_dir, repr_file) full_output_path = os.path.join(out_stagigng_dir, repr_file)
self.log.info("input {}".format(full_input_path)) self.log.info("input {}".format(full_input_path))
self.log.info("output {}".format(full_output_path)) self.log.info("output {}".format(full_output_path))
@ -169,18 +171,25 @@ class ExtractReviewSP(pyblish.api.InstancePlugin):
"name": name, "name": name,
"ext": ext, "ext": ext,
"files": repr_file, "files": repr_file,
"stagingDir": out_stagigng_dir,
"tags": new_tags, "tags": new_tags,
"outputName": name, "outputName": name,
"startFrameReview": 1, "startFrameReview": 1,
"endFrameReview": video_len "endFrameReview": video_len
}) })
if repre_new.get("preview"): # cleanup thumbnail from new repre
repre_new.pop("preview")
if repre_new.get("thumbnail"): if repre_new.get("thumbnail"):
repre_new.pop("thumbnail") repre_new.pop("thumbnail")
if "thumbnail" in repre_new["tags"]:
repre_new["tags"].remove("thumbnail")
# adding representation # adding representation
self.log.debug("Adding: {}".format(repre_new)) self.log.debug("Adding: {}".format(repre_new))
# cleanup repre from preview
if "preview" in repre:
repre.pop("preview")
if "preview" in repre["tags"]:
repre["tags"].remove("preview")
new_repres.append(repre_new) new_repres.append(repre_new)
for repre in instance.data["representations"]: for repre in instance.data["representations"]: