Skip to content

Instantly share code, notes, and snippets.

@greenvfx
Created January 18, 2018 12:35
Show Gist options
  • Save greenvfx/2272c28d677366b317fd159c3cd2a3dd to your computer and use it in GitHub Desktop.
Save greenvfx/2272c28d677366b317fd159c3cd2a3dd to your computer and use it in GitHub Desktop.
Duplication of selectrd nodes with inputs.
def duplicate_selected_node_with_inputs():
sn = nuke.selectedNode()
nuke.nodeCopy(nukescripts.edit.cut_paste_file())
nodes = nuke.allNodes();
for i in nodes:
i.knob("selected").setValue(False)
dupNode = nuke.nodePaste(nukescripts.edit.cut_paste_file())
for i in xrange(sn.inputs()):
dupNode.setInput(i, sn.input(i) )
return
duplicate_selected_node_with_inputs()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment