Lock and unLock node settings in nuke

Lock and unLock node knobs

Nuke doesn't have inbuilt function for lock the node settings( knobs, sliders), Like fusion's node lock function. While working with bigger scripts most of the time we accidentally  adjust the node sliders with out knowing which node is selected. ( what the hell is happening i didn't adjust anything..... ????!!!!! )

This code lock selected nodes knobs. So no worrier’s about accident changes.




Right click on the nodes property panel. You will get knobLock & unlock short-cut key.




menu.py:
import lockNode
nuke.menu("Properties").addCommand('lock_Knobs', 'lockNode.lockNode(True)')
nuke.menu("Properties").addCommand('unlock_Knobs', 'lockNode.lockNode(False)')

Download: locknode.py

Hope this will help you friends.

Comments

  1. Thank you! It's important for big scripts!

    ReplyDelete
  2. Replies
    1. Hey pankaj its working fine. I think you have to check with your menu.py

      Delete
  3. kaushal@movingframes.com
    Just open ur menu.py and copy > paste below stuff....... and save :))

    ## Lock ur Nodes

    import nuke

    def lockknob(nodes,state):
    for node in nodes :
    allknobs=node.allKnobs()
    for knob in allknobs:
    knob.setEnabled(state)
    nuke.toNode(node.name()).setSelected(False)
    nuke.toNode(node.name()).setSelected(True)

    def lockNode(state):
    a=nuke.selectedNodes()
    lockknob(a,not state)

    toolbar = nuke.toolbar("Nodes")
    myMenu = toolbar.addMenu('Lock ur Nodes', icon = 'Modify.png')
    myMenu.addCommand('Lock','lockNode(True)', '+i')
    myMenu.addCommand('Unlock','lockNode(False)', '#i')

    ReplyDelete
    Replies
    1. Lock shortcut is Shift i
      and
      Unlock shortcut is Alt i

      Delete
    2. name 'lockNode' is not defined ERROR

      Delete
    3. Here its work fine pankaj. Chack your menu.py. If you cant figure out send your menu.py file via Mail.

      Delete

Post a Comment

Popular posts from this blog

Export Nuke's retime information

Working with UV pass inside NUKE

DeepEdgeSmoother