From 40640eb598bb79d4d2d29a2e257dc8c1741aa4b6 Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Sat, 21 Jul 2018 14:50:58 +0200 Subject: [PATCH] Fix FUS-48 loader update not offsetting correctly to its frame time upon update/switch --- .../plugins/fusion/load/load_sequence.py | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/colorbleed/plugins/fusion/load/load_sequence.py b/colorbleed/plugins/fusion/load/load_sequence.py index 6d3d743c8a..81313992ed 100644 --- a/colorbleed/plugins/fusion/load/load_sequence.py +++ b/colorbleed/plugins/fusion/load/load_sequence.py @@ -82,9 +82,13 @@ def loader_shift(loader, frame, relative=True): comp = loader.Comp() time = comp.TIME_UNDEFINED - if not relative: - start = loader["GlobalIn"][time] - frame -= start + old_in = loader["GlobalIn"][time] + old_out = loader["GlobalOut"][time] + + if relative: + shift = frame + else: + shift = frame - old_in # Shifting global in will try to automatically compensate for the change # in the "ClipTimeStart" and "HoldFirstFrame" inputs, so we preserve those @@ -93,9 +97,17 @@ def loader_shift(loader, frame, relative=True): "ClipTimeEnd", "HoldFirstFrame", "HoldLastFrame"]): - loader["GlobalIn"][time] = loader["GlobalIn"][time] + frame - return int(frame) + # GlobalIn cannot be set past GlobalOut or vice versa + # so we must apply them in the order of the shift. + if shift > 0: + loader["GlobalOut"][time] = old_out + shift + loader["GlobalIn"][time] = old_in + shift + else: + loader["GlobalIn"][time] = old_in + shift + loader["GlobalOut"][time] = old_out + shift + + return int(shift) class FusionLoadSequence(api.Loader):