Skip to content

Commit

Permalink
Merge pull request #1112 from ynput/bugfix/fix_clip_media_reviewable
Browse files Browse the repository at this point in the history
Fix [clip_media] reviewable.
  • Loading branch information
jakubjezek001 authored Jan 30, 2025
2 parents f5bd7a9 + 3f69160 commit 41739bd
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 22 deletions.
19 changes: 14 additions & 5 deletions client/ayon_core/plugins/publish/collect_otio_review.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,29 @@ def process(self, instance):
# optionally get `reviewTrack`
review_track_name = instance.data.get("reviewTrack")

# [clip_media] setting:
# Extract current clip source range as reviewable.
# Flag review content from otio_clip.
if not review_track_name and "review" in instance.data["families"]:
otio_review_clips = [otio_clip]

# skip if no review track available
elif not review_track_name:
return

# generate range in parent
otio_tl_range = otio_clip.range_in_parent()

# calculate real timeline end needed for the clip
clip_frame_end = int(
otio_tl_range.start_time.value + otio_tl_range.duration.value)

# skip if no review track available
if not review_track_name:
return

# loop all tracks and match with name in `reviewTrack`
for track in otio_timeline.tracks:
if review_track_name != track.name:
if (
review_track_name is None
or review_track_name != track.name
):
continue

# process correct track
Expand Down
17 changes: 0 additions & 17 deletions client/ayon_core/plugins/publish/collect_otio_subset_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,13 +195,6 @@ def process(self, instance):
repre = self._create_representation(
frame_start, frame_end, file=filename)

if (
not instance.data.get("otioReviewClips")
and "review" in instance.data["families"]
):
review_repre = self._create_representation(
frame_start, frame_end, collection=collection,
delete=True, review=True)

else:
_trim = False
Expand All @@ -217,13 +210,6 @@ def process(self, instance):
repre = self._create_representation(
frame_start, frame_end, file=filename, trim=_trim)

if (
not instance.data.get("otioReviewClips")
and "review" in instance.data["families"]
):
review_repre = self._create_representation(
frame_start, frame_end,
file=filename, delete=True, review=True)

instance.data["originalDirname"] = self.staging_dir

Expand All @@ -236,9 +222,6 @@ def process(self, instance):

instance.data["representations"].append(repre)

# add review representation to instance data
if review_repre:
instance.data["representations"].append(review_repre)

self.log.debug(instance.data)

Expand Down
3 changes: 3 additions & 0 deletions client/ayon_core/plugins/publish/extract_otio_review.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,9 @@ def _create_representation(self, start, duration):
end = max(collection.indexes)

files = [f for f in collection]
# single frame sequence
if len(files) == 1:
files = files[0]
ext = collection.format("{tail}")
representation_data.update({
"name": ext[1:],
Expand Down

0 comments on commit 41739bd

Please sign in to comment.