LC #42 Pipers Alley

View Full Version : set bit depth (datatype) for write knob with script?

12-14-2011, 08:01 PM
I have this script that someone helped write but I need to change the PNG bit depth to 16-bit and my attempts failed. Is there a glossary for these terms?

import sys
r = nuke.nodes.Read(file = sys.argv[1])

g = nuke.nodes.Vectorfield()
g.setInput( 0, r )

w = nuke.nodes.Write(file = 'cubeListHere.png')
w.setInput(0, g)
nuke.execute("Write1", 1,1)

12-15-2011, 12:49 AM
Not sure if you can do it in one line, but this should work:

w = nuke.nodes.Write(file = 'cubeListHere.png', file_type = 'png')

I generally query help: help(w) for whatever node I'm dealing with in Nuke, but you can get the documentation for all of the classes and methods in the Nuke Python Reference (, but if you're just starting out, the Python developer guide ( is pretty handy and easy to read.

12-15-2011, 01:25 AM
awesome - that works. thanks

CGTalk Moderation
12-15-2011, 01:25 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.