This commit is contained in:
Félix David 2022-05-12 12:39:03 +02:00
parent 20f819c1dd
commit 330d4340cc
2 changed files with 19 additions and 7 deletions

View file

@ -19,7 +19,9 @@ class CollectKitsuEntities(pyblish.api.ContextPlugin):
raise AssertionError("Zou asset data not found in OpenPype!")
self.log.debug("Collected zou asset data: {}".format(zou_asset_data))
zou_task_data = asset_data["tasks"][os.environ["AVALON_TASK"]].get("zou")
zou_task_data = asset_data["tasks"][os.environ["AVALON_TASK"]].get(
"zou"
)
if not zou_task_data:
self.log.warning("Zou task data not found in OpenPype!")
self.log.debug("Collected zou task data: {}".format(zou_task_data))
@ -44,13 +46,19 @@ class CollectKitsuEntities(pyblish.api.ContextPlugin):
self.log.debug("Collect kitsu task: {}".format(kitsu_task))
else:
kitsu_task_type = gazu.task.get_task_type_by_name(os.environ["AVALON_TASK"])
kitsu_task_type = gazu.task.get_task_type_by_name(
os.environ["AVALON_TASK"]
)
if not kitsu_task_type:
raise AssertionError(
"Task type {} not found in Kitsu!".format(os.environ["AVALON_TASK"])
"Task type {} not found in Kitsu!".format(
os.environ["AVALON_TASK"]
)
)
kitsu_task = gazu.task.get_task_by_name(kitsu_asset, kitsu_task_type)
kitsu_task = gazu.task.get_task_by_name(
kitsu_asset, kitsu_task_type
)
if not kitsu_task:
raise AssertionError("Task not found in kitsu!")
context.data["kitsu_task"] = kitsu_task

View file

@ -19,19 +19,23 @@ class IntegrateKitsuReview(pyblish.api.InstancePlugin):
# Check comment has been created
if not comment:
self.log.debug("Comment not created, review not pushed to preview.")
self.log.debug(
"Comment not created, review not pushed to preview."
)
return
# Add review representations as preview of comment
for representation in [
r
for r in instance.data.get("representations", [])
if "review" in representation.get("tags", [])
if "review" in r.get("tags", [])
]:
review_path = representation.get("published_path")
self.log.debug("Found review at: {}".format(review_path))
gazu.task.add_preview(task, comment, review_path, normalize_movie=True)
gazu.task.add_preview(
task, comment, review_path, normalize_movie=True
)
self.log.info("Review upload on comment")