Merge pull request #149 from ynput/bugfix/AY-1684_Bug-Resolve-Clip-Load-doesnt-support-Slate

Resolve: Adjust clip start if slate is present
This commit is contained in:
Jakub Ježek 2024-03-06 16:55:40 +01:00 committed by GitHub
commit 7bf7780dd6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -410,6 +410,11 @@ class ClipLoader:
source_out = int(_clip_property("End"))
source_duration = int(_clip_property("Frames"))
# Trim clip start if slate is present
if "slate" in self.data["versionData"]["families"]:
source_in += 1
source_duration = source_out - source_in + 1
if not self.with_handles:
# Load file without the handles of the source media
# We remove the handles from the source in and source out
@ -435,7 +440,7 @@ class ClipLoader:
handle_start = version_data.get("handleStart", 0)
handle_end = version_data.get("handleEnd", 0)
frame_start_handle = frame_start - handle_start
frame_end_handle = frame_start + handle_end
frame_end_handle = frame_end + handle_end
database_frame_duration = int(
frame_end_handle - frame_start_handle + 1
)