From 122e28660812519948db0707b32f03a24bd22aa7 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Tue, 25 Jan 2022 12:13:38 +0100 Subject: [PATCH] fixing otio frame offset --- openpype/plugins/publish/extract_otio_review.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/openpype/plugins/publish/extract_otio_review.py b/openpype/plugins/publish/extract_otio_review.py index 675e5e0ee00..7cde5ab97ea 100644 --- a/openpype/plugins/publish/extract_otio_review.py +++ b/openpype/plugins/publish/extract_otio_review.py @@ -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 @@ -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))