Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix [clip_media] reviewable. #1112

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading