Skip to content

Commit

Permalink
Merge pull request #149 from ynput/bugfix/AY-1684_Bug-Resolve-Clip-Lo…
Browse files Browse the repository at this point in the history
…ad-doesnt-support-Slate

Resolve: Adjust clip start if slate is present
  • Loading branch information
jakubjezek001 authored Mar 6, 2024
2 parents bcae718 + 09e12b3 commit 7bf7780
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion client/ayon_core/hosts/resolve/api/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,11 @@ def load(self, files):
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
Expand All @@ -435,7 +440,7 @@ def load(self, files):
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
)
Expand Down

0 comments on commit 7bf7780

Please sign in to comment.