lockNode v1.7


 
This location is for Registered Users Only.
Perhaps you need to login or register.
Contributor: satheesh R
v1.7:Fixed some issue in OC function. v1.6: Added new feature. Now this code works with node locked inside Group node. v1.5ː Fixed adding new line each time while user lock and unlock multiple times. Which causing node became bigger and bigger. 1.3:Minor bug fix. When user un_lock knob. Label text line-up in one line. Now this script support multi line label. This code allow user to lock the nodes knob. Once you lock the knobs, then you cant modify any sliders until you un-lock the knobs. This will save you from any accident changes. Hope this will help you guys.
Requirements:
11.0, 10.5, 10.0, 9.0, 8.0, 7.1, 7.0 or later
Linux, Mac, Windows
27 Jan 2018
282

Locking the nodes knobs (sliders) inside nuke very long waited future. It is requested many time with foundry but i don't think they going to add this unique future. So i have decided to create a python code for this function. Her is the solution.

This code allow user to lock the nodes knob. Once you lock the knobs, then you cant modify any sliders until you un-lock the knobs. This will save you from any accident changes. Hope this will help you guys.

Latest version support to write the info to your nuke script. So it will always locked if you close your nuke script and re-open it. I have used some cheat method to keep the node locked while user save their nuke script. I have tested many times and haven't faced any issues. Let me know if you faced any issues.


steps:

right mouse click on node property panel. You will get options 'lock_knobs' and 'unlock_knobs'.



Select 'lock_knobs'. This code will lock will the knobs and put Node_Locked text into node label. So user can easily identify the locked knob in UI.



If user selects 'unlock_knob'. This code will return knobs to active and remove the Node_Locked text from label.

Save your nuke script with nodes locked. Close nuke and re-open the script. You can find the locked node still locked.

mail to [email protected] for any bugs & reports.

Please login in order to download these files.

Comments   

 
# satheesh R 2015-05-22 17:41
import lockNode

nuke.menu("Properties").addCommand('lock_knobs', "lockNode.lock_knobs()")
nuke.menu("Properties").addCommand('unlock_knobs', "lockNode.unLock_knobs()")

def oc():
nodes = nuke.allNodes()
for selNode in nodes:
selNode.setSele cted(True)
allknobs=selNod e.allKnobs()
label = selNode['label' ].getValue()
labCheck = label.rsplit(No ne, 1)
if labCheck:
labCheck = labCheck[-1]
if labCheck == 'Node_Locked':
for knob in allknobs:
knob.setEnabled(False)
nuke.addOnScriptLoad(oc)
 
 
# Mohan Pugaz 2015-06-06 17:23
This is very usefull tool thanks a lot! :roll:
 
 
# Felix Serwir 2016-02-20 07:17
there is a typo in your script label.rsplit needs to be split

def oc():
nodes = nuke.allNodes()
for selNode in nodes:
selNode.setSele cted(True)
allknobs=selNod e.allKnobs()
label = selNode['label' ].getValue()
labCheck = label.split(Non e, 1)
if labCheck:
labCheck = labCheck[-1]
if labCheck == 'Node_Locked':
for knob in allknobs:
knob.setEnabled (False)
 
 
# satheesh R 2018-01-21 06:46
Thanks Felix. Updated the OC function code with fixes in this new version....

def oc():
nodes = nuke.allNodes()
for selNode in nodes:
allknobs=selNod e.allKnobs()
label = selNode['label' ].getValue()
if 'Node_Locked' in label:
for knob in allknobs:
knob.setEnabled (False)

for a in nuke.allNodes(' Group'):
for node in a.nodes():
allknobs=node.a llKnobs()
label = node['label' ].getValue()
if 'Node_Locked' in label:
for knob in allknobs:
knob.setEnabled (False)

nuke.addOnScriptLoad(oc)
nuke.addOnCreate(oc)
 
 
# satheesh R 2018-01-21 09:29
Example walk through video...

https://www.youtube.com/watch?v=yCFkQhJiCa0
 
 
# Remco Consten 2018-01-23 09:40
Is there a possibility in the script that I can asjust the position in the property panel to move downwards? I would like "Manage User Knobs" stay ontop and "lock" "unlock" to be at the bottom of the panel.

I keep locking my nodes because of muscle memory is kicking in while I actually like to manage the user knobs. ;-)
 
 
# satheesh R 2018-01-23 16:28
Even i faced same issue at the begining. Sadly indexing not supporting 'Properties' menu ?! I'm not sure i'm missing something. Any python or nuke guru's can reply the solution.
 
 
# Gary Couto 2018-01-31 16:41
If anyone has figured out a way to index the Properties Panel please share! Also, if anyone knows how to add to the Roto/RotoPaint/ Warping shapes menu properly with indexing.

If regards to Lock Nodes, if you don't mind, I'm going to see about modifying your script in order to add a working status button to the viewer window. Something in the vein of the Input Process Button. If I'm successful, I will share it here!
 
 
# satheesh R 2018-02-02 03:29
Hey Gary, Sure you can modify the code as per your requirement. Share with others one you succeed.

Regarding indexing, This is Bug in nuke. When you assign from inside nuke script editor indexing working for properties menu. But while sourced from menu.py indexing failed. Check following thread on nuke discussion forum.

https://community.foundry.com/discuss/topic/137886/indexing-not-working-with-properties-menu
 
 
# Gary Couto 2018-02-02 14:47
Thanks Satheesh!

Makes sense that it is a bug considering all other menus can be indexed.
If it works in the script editor, maybe pushing the menu creation into an OnCreate or OnUserCreate of Root or the Viewer might allow for you to index the the lock nodes menu as you wish? Just an idea.

Cheers!
G.
 
 
# satheesh R 2018-02-02 15:34
Never tried menu creation with OnCreation function. But good idea though ! Let me try and come back.

cheers!
 

You have no rights to post comments

We have 2310 guests and 65 members online