Updated: Dec 25, 2019
This script duplicates the selected nodes and keeps all their inputs to nodes that are not in the selection.
You cut either duplicate the nodes directly or copy them first and then paste them later in another place of the script.
It is very handy when using the same node setup multiple times in the same comp.
If you have for example a 3d setup that uses one shot cam and one matchmove geometry that is in another place in your comp, you could duplicate the setup without the need to reconnect the camera and geometry.
Get it on nukepedia:
Copy script from Pastebin:
Place the 'duplicateWithInputs.py' in your .nuke folder or any other user-defined plugin path.
Add this to your menu.py:
nuke.menu('Nuke').addCommand('Scripts/Duplicate with Inputs/copy','duplicateWithInputs.copyWithInputs()', 'ctrl+alt+c') nuke.menu('Nuke').addCommand('Scripts/Duplicate with Inputs/paste','duplicateWithInputs.pasteWithInputs()', 'ctrl+alt+v') nuke.menu('Nuke').addCommand('Scripts/Duplicate with Inputs/duplicate','duplicateWithInputs.duplicateWithInputs()', 'ctrl+alt+x')
- added copy and paste functionality
- all nodes are now selected after the duplication
- fixed an error caused by a non ASCII character
Tested with Nuke 10 and newer versions, but it could also work in older ones.
Feel free to comment for any questions and suggestions.