Guest User

Untitled

a guest
Apr 24th, 2014
421
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import nuke
  2. import nukescripts
  3. import threading
  4.  
  5. class tmpPanel(nukescripts.PythonPanel):
  6.  
  7.     def __init__(self):
  8.  
  9.         nukescripts.PythonPanel.__init__(self, "tmp panel")
  10.         self.writes = nuke.Enumeration_Knob("writes", "writes", [node.name() for node in self.getWrites()])
  11.         self.render = nuke.PyScript_Knob("render", "render")
  12.  
  13.         for i in [self.writes, self.render]:
  14.             self.addKnob(i)
  15.  
  16.     def knobChanged(self, knob):
  17.  
  18.         if knob is self.render:
  19.             self.renderWrites()
  20.  
  21.     def renderWrites(self):
  22.  
  23.         writeNode = self.writes.value()
  24.         node = nuke.toNode(writeNode)
  25.         threading.Thread(target = nuke.execute, args= (node , 1, 5, 1)).start()
  26.  
  27.     def getWrites(self):
  28.        
  29.         return (node for node in nuke.allNodes() if node.Class() == "Write")
  30.        
  31. tmpPanel().show()
Advertisement
Add Comment
Please, Sign In to add comment