19.12.2021, 19:12 fxtd

This is a simple python script to change file paths in selected Read and Write nodes. You can select part of the Nuke script, and if the selected nodes have a “file” knob, it will be changed:

replace_from = 'short'
replace_to = 'medium'

for node in nuke.selectedNodes():
    if node.knob('file'):
        node['file'].setValue(node['file'].value().replace(replace_from, replace_to))


04.06.2020, 23:16 fxtd

This is a simple python script to print filenames in all Write nodes from Nuke:

print "========================"
for node in nuke.allNodes():
    if 'Write' in node['name'].value():
        print node['file'].value()

To run this script you can save it to file .py and run from File/Run Script menu (Alt + X).
The result will be printed in the Script Editor (right click to any content menu, Windows/Script Editor).
You can change Write to Read to print all comp’s references:

print "========================"
for node in nuke.allNodes():
    if 'Read' in node['name'].value():
        print node['file'].value()

To find the filenames with specific location run next script:

print "========================"
location = '/LOCATION_PATH/'
for n in nuke.allNodes():
    if 'Read' in n['name'].value() or 'Write' in n['name'].value():
        if location in n['file'].value():
            print n['file'].value()