SHARE
TWEET

Untitled

a guest Sep 16th, 2011 482 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #import examples
  2. import nuke
  3.  
  4.  
  5. def shuffleLayer(node, layer):
  6.         shuffleNode = nuke.nodes.Shuffle( label=layer, inputs=[node] )
  7.         name=str(layer)
  8.         shuffleNode['in'].setValue(name)
  9.         shuffleNode['postage_stamp'].setValue( True )
  10.         return nuke.nodes.Dot( inputs=[ shuffleNode ] )
  11.  
  12.  
  13. def autoComper():
  14.         node = nuke.selectedNode()
  15.         channels = node.channels()
  16.         layers = list( set([c.split('.')[0] for c in channels]) )
  17.         layers.sort()
  18.         new_layers = []
  19.         for l in layers:
  20.                 if '_' in l:
  21.                         stripped_l = '_'.join(l.split('_')[2:])
  22.                         nuke.Layer(l).setName(stripped_l)
  23.                         new_layers.append(stripped_l)
  24.  
  25.         diffuse=nuke.Layer('Diffus')
  26.         spec=nuke.Layer('Glanzlicht')          
  27.         shd=nuke.Layer('Schatten')
  28.         env=nuke.Layer('Umgebung')
  29.         refl=nuke.Layer('Spiegelung')
  30.         refr=nuke.Layer('Refraktion')
  31.  
  32.         diffNode = shuffleLayer( node, diffuse )
  33.         specNode = shuffleLayer( node, spec )
  34.         shdNode = shuffleLayer( node, shd )
  35.         envNode = shuffleLayer( node, env )
  36.         reflNode = shuffleLayer( node, refl )
  37.         refrNode = shuffleLayer( node, refr )
RAW Paste Data
Top