Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import nuke
- import nukescripts
- import threading
- class renderWrites(threading.Thread):
- def __init__(self, writenode):
- # Start threading...
- threading.Thread.__init__(self)
- # Get the currently selected Write node from the dropdown knob...
- self.writeNode = nuke.toNode(writenode)
- def run(self):
- try:
- nuke.executeInMainThread(nuke.execute, args=self.writeNode, kwargs={'continueOnError':True} )
- except Exception as e:
- print "ERROR: %s" % e
- class RenderWritesPanel(nukescripts.PythonPanel):
- def __init__(self):
- self.write_nodes = []
- for n in nuke.allNodes():
- if n.Class() == 'Write':
- name = n.name()
- self.write_nodes.append(name)
- nukescripts.PythonPanel.__init__(self, "Render Writes Panel")
- self.writes = nuke.Enumeration_Knob("writes", "writes", self.write_nodes)
- self.render = nuke.PyScript_Knob("render", "render")
- for i in [self.writes, self.render]:
- self.addKnob(i)
- def knobChanged(self, knob):
- if knob is self.render:
- t = renderWrites(self.writes.value())
- t.start()
- RenderWritesPanel().show()
Advertisement
Add Comment
Please, Sign In to add comment