thumbnailer v3.0
This location is for Registered Users Only.
Perhaps you need to login or register.
6.0, 6.1, 6.2 or later
Linux, Mac, Windows


Prior to the built in support in Nuke 6.3, I found myself in a particularly bad situation of having several Read nodes in my script that were camera RAW images. That said, I found each time I changed frames, Nuke would get stuck in the mud as it had to load whatever 5k RAW files were visible in the DAG, rendering computer useless for several seconds while the RAWs were loaded & processed - and this wasn't at all for display in the viewer, this was literally just to update the little postage stamp in the DAG! Yikes!
This script was created to fix the problem and since putting it into use, I've been pleasantly surprised at the speed up to ALL of my scripts (even ones without RAW inputs) as a result and I've made it a part of my general workflow. I never realized how much unnecessary network traffic the Read nodes visible in the DAG created until now.
Kudos to Frank R for the help in putting this together, and Chris M & Bernhard K for help "nailing" it. Credit to Shake & Katana for the original idea, as this is basically how they dealt with thumbnail generation.
Invoking this script will do the following:
1) find all Read nodes in your selection or if no selection will run on your whole script
2) disable the postage stamp for each Read
3) create a Framehold node for each read, w/postage stamp set to the current frame. Finally it will name the framehold appropriately after the read node and position it directly above the aforementioned Read.
If you would like to use a different "poster frame" then just change the frame # in the corresponding framehold node. As you expand your script and add in new Reads, you can simply run this script at any time to catch the new reads that still have the default Nuke postage stamp and change them to a single frame "thumbnailed" version.
Hope others find it useful.
This is more or less obsolete in Nuke 6.3, since the put in the "static" preference for postage stamps.
Comments
two things i think would be useful:
- check if some read nodes are selected and if so apply the function only to these nodes.
- check if the read node(s) already have a thumbnail connected and if so, update the current one instead of adding a second.
++ chris
import nuke
def thumbnailer():
selection = nuke.selectedNo des()
if not selection:
for n in nuke.allNodes( 'Read' ):
n['postage_stam p'].setValue( False )
name = n.name() + '_stamp'
thumbnail = nuke.nodes.Fram eHold( name=name, postage_stamp=T rue, first_frame=nuk e.frame())
thumbnail.setIn put( 0, n )
thumbnail.setXY pos( n.xpos(), n.ypos()-80 )
else:
for n in selection:
n['postage_stam p'].setValue( False )
name = n.name() + '_stamp'
thumbnail = nuke.nodes.Fram eHold( name=name, postage_stamp=T rue, first_frame=nuk e.frame())
thumbnail.setIn put( 0, n )
thumbnail.setXY pos( n.xpos(), n.ypos()-80 )
You're right and heading in the right direction. if I tweak your script a little I can get it to work great if the reads (or in fact any/all nodes) are selected but it doesn't work so great if no nodes are selected (will only do the first node and leave the others postage stamp-less).
I still need to figure out the 2nd thing you mentioned, as you said, so I'll think about all that and try to get the script updated soon. I have a few ideas to bulletproof it.
import nuke
selection = nuke.selectedNo des()
if not selection:
for n in nuke.allNodes( 'Read' ):
n['postage_stam p'].setValue( False )
name = n.name() + '_stamp'
thumbnail = nuke.nodes.Fram eHold( name=name, postage_stamp=T rue, first_frame=nuk e.frame())
thumbnail.setIn put( 0, n )
thumbnail.setXY pos( n.xpos(), n.ypos()-80 )
else:
for n in nuke.selectedNo des( 'Read' ):
n['postage_stam p'].setValue( False )
name = n.name() + '_stamp'
thumbnail = nuke.nodes.Fram eHold( name=name, postage_stamp=T rue, first_frame=nuk e.frame())
thumbnail.setIn put( 0, n )
thumbnail.setXY pos( n.xpos(), n.ypos()-80 )
http://dl.dropbox.com/u/4067280/nuke/thumbnailer.py.zip
maybe the check if a framehold is already connected can be done with
nuke.toNode('n' ).dependent( nuke.INPUTS | nuke.HIDDEN_INP UTS )
?
i've added the check if a framehold is already connected and a few other little things:
http://pastebin.com/WsR45dYG
cheers!
thanks a lot
++ chris
i switched over to this and modified the script to update the postage stamp of the selected nodes to the current frame (and all postage frames if no node is selected):
import nuke
def updatePostageSt amp():
selNodes = []
selNodes = nuke.selectedNo des('Read')
if not selNodes:
selNodes = nuke.allNodes(' Read')
for readNode in selNodes:
readNode.knob(' postage_stamp_f rame').setValue ( nuke.frame() )
http://pastebin.com/eScaRbup
RSS feed for comments to this post