top of page
  • satheesrev

Lock knob function for Nuke

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.





import lockNode



propertiesmenu = nuke.menu("Properties")


propertiesmenu.addSeparator()


propertiesmenu.addCommand('lock_knobs', "lockNode.lock_knobs()")


propertiesmenu.addCommand('unlock_knobs', "lockNode.unLoc k_knobs()")


def oc():


 nodes = nuke.allNodes()


 for selNode in nodes:


  allknobs=selNode.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.allKnobs()


   label = node['label' ].getValue()


   if 'Node_Locked' in label:


    for knob in allknobs:


     knob.setEnabled(False)  



nuke.addOnScriptLoad(oc)


nuke.addOnCreate(oc)

2 views0 comments

Recent Posts

See All

Automatically pin the Cornerpin in Nuke

This little code place the cornerPin nodes 4 pin's automatically based on the bbox. If your image dosen't have bbox add a crop node and crop it as per your need. import nuke def autoPinning(): selNode

Connect Roto to Tracker

This script lists all the available Tracker node in the script. It connects the transform value to the selected Roto node. import nuke def connectTrack(): for selRoto in nuke.selectedNodes('Roto'): if

Comments


bottom of page