From 2d2880de4bbe26ec763077f69a4cc9e71fa007cb Mon Sep 17 00:00:00 2001 From: Nick Alberelli Date: Mon, 15 May 2023 13:07:23 -0400 Subject: [PATCH 1/2] [Blender-Kitsu] Fix Frame Start Calculation --- scripts-blender/addons/blender_kitsu/props.py | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/scripts-blender/addons/blender_kitsu/props.py b/scripts-blender/addons/blender_kitsu/props.py index 4ee2474f..65051f5e 100644 --- a/scripts-blender/addons/blender_kitsu/props.py +++ b/scripts-blender/addons/blender_kitsu/props.py @@ -337,18 +337,11 @@ def _calc_kitsu_frame_start(self): Calculates strip.kitsu_frame_start, little hack because it seems like we cant access the strip from a property group But we need acess to seqeuence properties. """ - # self.frame_final_start = 50 - # self.frame_start = 60 - # self.kitsu.frame_start_offset = 10 - - offset_start = self.frame_final_start - self.frame_start # 50 - 60 = -10 - - frame_start_final = ( - bkglobals.FRAME_START - self.kitsu.frame_start_offset + offset_start + kitsu_frame_start = ( + bkglobals.FRAME_START - self.kitsu.frame_start_offset ) - # 101 - (-10) +(-10) = 101. - return int(frame_start_final) + return int(kitsu_frame_start) def _calc_kitsu_frame_end(self): -- 2.30.2 From d0bc7f896f027ce01c51f28c1ed3d90f3272a781 Mon Sep 17 00:00:00 2001 From: Nick Alberelli Date: Mon, 15 May 2023 13:59:39 -0400 Subject: [PATCH 2/2] [Blender-Kitsu] Fix Frame_End calculation --- scripts-blender/addons/blender_kitsu/props.py | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/scripts-blender/addons/blender_kitsu/props.py b/scripts-blender/addons/blender_kitsu/props.py index 65051f5e..87ae0f9f 100644 --- a/scripts-blender/addons/blender_kitsu/props.py +++ b/scripts-blender/addons/blender_kitsu/props.py @@ -349,23 +349,8 @@ def _calc_kitsu_frame_end(self): Calculates strip.kitsu_frame_end, little hack because it seems like we cant access the strip from a property group But we need acess to seqeuence properties. """ - # example strip goes from frame 50 - 101 (endpoint picture 100 > 51 frames duration) is trimmed - # 10 frames in beginning and -939 in the end - # bkglobals.FRAME_START = 101 - # self.frame_duration = 1000 - # self.frame_start = 40 (cause of trim in beginning) - # self.kitsu.frame_start_offset = 10 - - frame_end_global = self.frame_start + self.frame_duration # (40 + 1000 = 1040) - - frame_end_final = ( - bkglobals.FRAME_START - + self.frame_duration - - self.kitsu.frame_start_offset - + ((self.frame_final_end - 1) - frame_end_global) - ) - # 101 + 1000 - 10 + ((101 -1) - 1040) = 151. - + frame_start = _calc_kitsu_frame_start(self) + frame_end_final = (frame_start + self.frame_final_duration) return int(frame_end_final) -- 2.30.2