thumbnailer v3.0


 
This location is for Registered Users Only.
Perhaps you need to login or register.
Contributor: J Bills
This script optimizes the Read node postage stamps displayed in the DAG. Instead of allowing them to update with each frame change, this instead creates single frame versions of the postage stamps allowing them to be loaded once and never again.
Requirements:
6.0, 6.1, 6.2 or later
Linux, Mac, Windows
19 Jan 2012
289

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.

Please login in order to download these files.

Comments   

 
0 # chris menz 2010-10-12 01:52
very nice idea!

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
 
 
0 # chris menz 2010-10-12 02:16
managed to implement the fist idea in a crude way, i'm too dumb for the second one though ;-)


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 )
 
 
0 # J Bills 2010-10-22 12:17
hey chris - thanks, yep, it could use a little more love.

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 )
 
 
0 # chris menz 2010-10-22 15:56
hmm, weird, the script works fine here if no nodes are seleced. maybe a white space issue? here's what i use:
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 )
?
 
 
0 # Bernhard Kimbacher 2010-10-26 11:12
nice idea!
i've added the check if a framehold is already connected and a few other little things:
http://pastebin.com/WsR45dYG
cheers!
 
 
0 # chris menz 2010-10-26 13:09
perfect, works like a charm!

thanks a lot
++ chris
 
 
0 # J Bills 2010-10-28 19:26
Nice one, cheers Bernhard!
 
 
0 # J Bills 2010-11-29 16:11
upped to v3 - just tweaking how nodes are named and doing away with the hidden inputs (got tired of expression popups when deleting the reads).
 
 
0 # chris menz 2012-02-27 06:30
ah, completely missed the static preference.. that's much more elegant.
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() )
 
 
0 # chris menz 2012-02-27 06:34
oops, forgot about the code problems in the comments.. here with the proper formatting again
http://pastebin.com/eScaRbup
 

You have no rights to post comments

We have 2115 guests and 87 members online