Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Global: fix broken otio review extractor #2590

Merged
merged 2 commits into from
Feb 1, 2022
Merged
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
12 changes: 10 additions & 2 deletions openpype/plugins/publish/extract_otio_review.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,8 @@ def _trim_available_range(self, avl_range, start, duration, fps):
src_start = int(avl_start + start)
avl_durtation = int(avl_range.duration.value)

self.need_offset = bool(avl_start != 0 and src_start != 0)

# if media start is les then clip requires
if src_start < avl_start:
# calculate gap
Expand Down Expand Up @@ -408,11 +410,17 @@ def _generate_used_frames(self, duration, end_offset=None):
"""

padding = "{{:0{}d}}".format(self.padding)

# create frame offset
offset = 0
if self.need_offset:
offset = 1

if end_offset:
new_frames = list()
start_frame = self.used_frames[-1]
for index in range((end_offset + 1),
(int(end_offset + duration) + 1)):
for index in range((end_offset + offset),
(int(end_offset + duration) + offset)):
seq_number = padding.format(start_frame + index)
self.log.debug(
"index: `{}` | seq_number: `{}`".format(index, seq_number))
Expand Down