PDA

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


cgbeige
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 )
g['vfield_file'].setValue('cubeListHere')

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

fezz
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')
w['datatype'].setValue('16')

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 (http://docs.thefoundry.co.uk/nuke/63/pythonreference/), but if you're just starting out, the Python developer guide (http://docs.thefoundry.co.uk/products/nuke/developers/63/pythondevguide/) is pretty handy and easy to read.

cgbeige
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.