mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
Fix [clip_media] reviewable.
This commit is contained in:
parent
f5bd7a9172
commit
3f691607e5
3 changed files with 17 additions and 22 deletions
|
|
@ -36,6 +36,16 @@ class CollectOtioReview(pyblish.api.InstancePlugin):
|
||||||
# optionally get `reviewTrack`
|
# optionally get `reviewTrack`
|
||||||
review_track_name = instance.data.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
|
# generate range in parent
|
||||||
otio_tl_range = otio_clip.range_in_parent()
|
otio_tl_range = otio_clip.range_in_parent()
|
||||||
|
|
||||||
|
|
@ -43,13 +53,12 @@ class CollectOtioReview(pyblish.api.InstancePlugin):
|
||||||
clip_frame_end = int(
|
clip_frame_end = int(
|
||||||
otio_tl_range.start_time.value + otio_tl_range.duration.value)
|
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`
|
# loop all tracks and match with name in `reviewTrack`
|
||||||
for track in otio_timeline.tracks:
|
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
|
continue
|
||||||
|
|
||||||
# process correct track
|
# process correct track
|
||||||
|
|
|
||||||
|
|
@ -195,13 +195,6 @@ class CollectOtioSubsetResources(
|
||||||
repre = self._create_representation(
|
repre = self._create_representation(
|
||||||
frame_start, frame_end, file=filename)
|
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:
|
else:
|
||||||
_trim = False
|
_trim = False
|
||||||
|
|
@ -217,13 +210,6 @@ class CollectOtioSubsetResources(
|
||||||
repre = self._create_representation(
|
repre = self._create_representation(
|
||||||
frame_start, frame_end, file=filename, trim=_trim)
|
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
|
instance.data["originalDirname"] = self.staging_dir
|
||||||
|
|
||||||
|
|
@ -236,9 +222,6 @@ class CollectOtioSubsetResources(
|
||||||
|
|
||||||
instance.data["representations"].append(repre)
|
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)
|
self.log.debug(instance.data)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -320,6 +320,9 @@ class ExtractOTIOReview(
|
||||||
end = max(collection.indexes)
|
end = max(collection.indexes)
|
||||||
|
|
||||||
files = [f for f in collection]
|
files = [f for f in collection]
|
||||||
|
# single frame sequence
|
||||||
|
if len(files) == 1:
|
||||||
|
files = files[0]
|
||||||
ext = collection.format("{tail}")
|
ext = collection.format("{tail}")
|
||||||
representation_data.update({
|
representation_data.update({
|
||||||
"name": ext[1:],
|
"name": ext[1:],
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue