Skip to content

Instantly share code, notes, and snippets.

@daltonbr
Created October 14, 2020 11:14
Show Gist options
  • Save daltonbr/ffc9abca9928c1b69d2d15f371403562 to your computer and use it in GitHub Desktop.
Save daltonbr/ffc9abca9928c1b69d2d15f371403562 to your computer and use it in GitHub Desktop.
Lock & Unlock nodes in Maya with Python
import maya.cmds as cmds
cmds.LockNode('Locked_Node', lock=False)
# another approach
# grab all selected nodes
selection = cmds.ls(selection=True)
# unlock and delete them
for node in selection:
cmds.lockNode(node, lock=False)
cmds.delete(node)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment