From 2926b1cdd576290fb436b3fa8fd8a35dec4c2224 Mon Sep 17 00:00:00 2001 From: "robin@ynput.io" Date: Tue, 3 Dec 2024 16:48:36 -0500 Subject: [PATCH 1/4] Fi clip_media review source from Hiero. --- .../plugins/publish/collect_plates.py | 40 +++++++++++++++++-- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/client/ayon_hiero/plugins/publish/collect_plates.py b/client/ayon_hiero/plugins/publish/collect_plates.py index f47d5ad..073037b 100644 --- a/client/ayon_hiero/plugins/publish/collect_plates.py +++ b/client/ayon_hiero/plugins/publish/collect_plates.py @@ -1,3 +1,4 @@ +import os import pyblish from ayon_core.pipeline import PublishError @@ -39,12 +40,45 @@ def process(self, instance): if review_switch is True: if reviewable_source == "clip_media": instance.data["families"].append("review") + instance.data.pop("reviewTrack", None) + + # Retrieve source clip media from otio clip. + # image sequence + if hasattr(otio_clip.media_reference, "target_url_base"): + file_url = otio_clip.media_reference.target_url_for_image_number(0) + sequence_length = ( + otio_clip.media_reference.end_frame() + - otio_clip.media_reference.start_frame + ) + file_names = [ + os.path.basename( + otio_clip.media_reference.target_url_for_image_number(frame) + ) + for frame in range(0, sequence_length) + ] + + # movie + else: + file_url = otio_clip.media_reference.target_url + file_names = os.path.basename(file_url) + + _, ext = os.path.splitext(file_url) + + repre = { + "name": ext[1:], + "ext": ext[1:], + "files": file_names, + "stagingDir": os.path.dirname(file_url), + "tags": ["review", "delete"] + } + instance.data["representations"].append(repre) + else: instance.data["reviewTrack"] = reviewable_source - # remove review keys from instance data - instance.data.pop("reviewableSource", None) - instance.data.pop("review", None) + # remove creator-specific review keys from instance data + instance.data.pop("reviewableSource", None) + instance.data.pop("review", None) # Retrieve instance data from parent instance shot instance. parent_instance_id = instance.data["parent_instance_id"] From 7eede7cf9addd038d684350aa2daa4f8a70522d1 Mon Sep 17 00:00:00 2001 From: "robin@ynput.io" Date: Tue, 3 Dec 2024 16:54:34 -0500 Subject: [PATCH 2/4] minor fix. --- client/ayon_hiero/plugins/publish/collect_plates.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/ayon_hiero/plugins/publish/collect_plates.py b/client/ayon_hiero/plugins/publish/collect_plates.py index 073037b..2b75a8f 100644 --- a/client/ayon_hiero/plugins/publish/collect_plates.py +++ b/client/ayon_hiero/plugins/publish/collect_plates.py @@ -44,7 +44,7 @@ def process(self, instance): # Retrieve source clip media from otio clip. # image sequence - if hasattr(otio_clip.media_reference, "target_url_base"): + if hasattr(otio_clip.media_reference, "target_url_for_image_number"): file_url = otio_clip.media_reference.target_url_for_image_number(0) sequence_length = ( otio_clip.media_reference.end_frame() From e2becd9494e5db9095d34dda472beb168dd2a574 Mon Sep 17 00:00:00 2001 From: "robin@ynput.io" Date: Wed, 4 Dec 2024 16:30:51 -0500 Subject: [PATCH 3/4] Rework clip_media option in ayon_core. --- .../plugins/publish/collect_plates.py | 32 ------------------- 1 file changed, 32 deletions(-) diff --git a/client/ayon_hiero/plugins/publish/collect_plates.py b/client/ayon_hiero/plugins/publish/collect_plates.py index 2b75a8f..0846829 100644 --- a/client/ayon_hiero/plugins/publish/collect_plates.py +++ b/client/ayon_hiero/plugins/publish/collect_plates.py @@ -41,38 +41,6 @@ def process(self, instance): if reviewable_source == "clip_media": instance.data["families"].append("review") instance.data.pop("reviewTrack", None) - - # Retrieve source clip media from otio clip. - # image sequence - if hasattr(otio_clip.media_reference, "target_url_for_image_number"): - file_url = otio_clip.media_reference.target_url_for_image_number(0) - sequence_length = ( - otio_clip.media_reference.end_frame() - - otio_clip.media_reference.start_frame - ) - file_names = [ - os.path.basename( - otio_clip.media_reference.target_url_for_image_number(frame) - ) - for frame in range(0, sequence_length) - ] - - # movie - else: - file_url = otio_clip.media_reference.target_url - file_names = os.path.basename(file_url) - - _, ext = os.path.splitext(file_url) - - repre = { - "name": ext[1:], - "ext": ext[1:], - "files": file_names, - "stagingDir": os.path.dirname(file_url), - "tags": ["review", "delete"] - } - instance.data["representations"].append(repre) - else: instance.data["reviewTrack"] = reviewable_source From cf0066826e714fc89caaa0b1bf4e91216bb97c63 Mon Sep 17 00:00:00 2001 From: "robin@ynput.io" Date: Wed, 4 Dec 2024 16:34:41 -0500 Subject: [PATCH 4/4] Fix lint. --- client/ayon_hiero/plugins/publish/collect_plates.py | 1 - 1 file changed, 1 deletion(-) diff --git a/client/ayon_hiero/plugins/publish/collect_plates.py b/client/ayon_hiero/plugins/publish/collect_plates.py index 0846829..500f2af 100644 --- a/client/ayon_hiero/plugins/publish/collect_plates.py +++ b/client/ayon_hiero/plugins/publish/collect_plates.py @@ -1,4 +1,3 @@ -import os import pyblish from ayon_core.pipeline import PublishError