Print filenames from Nuke

A1 A2 17.11.2016 13:02 

It’s a simple python script to print filenames in all Write nodes from Nuke:

<br />
print &quot;========================&quot;<br />
for node in nuke.allNodes():<br />
    if &#8216;Write&#8217; in node[&#8216;name&#8217;].value():<br />
        print node[&#8216;file&#8217;].value()<br />

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:

<br />
print &quot;========================&quot;<br />
for node in nuke.allNodes():<br />
    if &#8216;Read&#8217; in node[&#8216;name&#8217;].value():<br />
        print node[&#8216;file&#8217;].value()<br />

To find the filenames with specific location run next script:
<br />
print &quot;========================&quot;<br />
location = &#8216;/LOCATION_PATH/&#8217;<br />
for n in nuke.allNodes():<br />
    if &#8216;Read&#8217; in n[&#8216;name&#8217;].value() or &#8216;Write&#8217; in n[&#8216;name&#8217;].value():<br />
        if location in n[&#8216;file&#8217;].value():<br />
            print n[&#8216;file&#8217;].value()<br />