From 7fec3f8f99d4099ac9bc2b16b5162f52c5093339 Mon Sep 17 00:00:00 2001 From: kramester Date: Mon, 8 Oct 2018 12:10:15 -0500 Subject: [PATCH 1/2] Nuke frame range locks after setting nuke now locks automatically after setting --- app.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app.py b/app.py index 1ff5282..aac3a3b 100644 --- a/app.py +++ b/app.py @@ -188,9 +188,8 @@ def set_frame_range(self, engine, in_frame, out_frame): # set values nuke.root()["first_frame"].setValue(in_frame) nuke.root()["last_frame"].setValue(out_frame) - # and lock again - if locked: - nuke.root()["lock_range"].setValue(True) + # and lock range + nuke.root()["lock_range"].setValue(True) elif engine == "tk-motionbuilder": from pyfbsdk import FBPlayerControl, FBTime From 719e00b134a785c86bf9222aaf926809eac432dc Mon Sep 17 00:00:00 2001 From: kramester Date: Mon, 8 Oct 2018 15:08:51 -0500 Subject: [PATCH 2/2] Always lock option added to nuke Added always_lock variable that reads from setting "always_lock_range" to determine whether to always lock the range in nuke, or only lock if was previously locked --- app.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app.py b/app.py index aac3a3b..c69d00b 100644 --- a/app.py +++ b/app.py @@ -182,6 +182,7 @@ def set_frame_range(self, engine, in_frame, out_frame): import nuke # unlock + always_lock = self.get_setting("always_lock_range") locked = nuke.root()["lock_range"].value() if locked: nuke.root()["lock_range"].setValue(False) @@ -189,7 +190,8 @@ def set_frame_range(self, engine, in_frame, out_frame): nuke.root()["first_frame"].setValue(in_frame) nuke.root()["last_frame"].setValue(out_frame) # and lock range - nuke.root()["lock_range"].setValue(True) + if locked or always_lock: + nuke.root()["lock_range"].setValue(True) elif engine == "tk-motionbuilder": from pyfbsdk import FBPlayerControl, FBTime