View Full Version : Nuke python merge node help

07 July 2011, 09:16 AM
I am creating a python script in nuke to create a read node exr file that gets all my passes from Maya merged properly.

I am wondering how to setup operations in merge node from over to something else using python?

Also I am wanting to add notes in the node label via python as well.

I have used the help(nuke) and the nuke docs to get this far but I can't find how to change more specific attributes.

I am use to Mayas script editor where I can see everything going on by echoing all commands, is there a way to see what nuke is doing behind the scenes too?


07 July 2011, 07:41 AM
I got it but I'm wondering still how to change the inputs with a script.

robotRead=nuke.Read("file {/Users/inhousecc/Documents/robot_multipass.0001.exr}")
newMerge1.setInput(0, robotRead)
newMerge1.setInput(1, robotRead)
newMerge1. knob("A").setValue(4)

For some reason newMerge1. knob("A").setValue(4) doesn't change the input or channel A to the fourth value in the list like newMerge1.knob("operation").setValue(10) does.

But anyway I'll keep trying.


07 July 2011, 01:22 AM
I'm totally stumped.

The code directly below works as expected. It sets the value of operation (blend mode) to screen. Great stuff.

newMerge1. knob("operation").setValue(10)

The code below here should change the Achannels to rgb shouldn't it?

newMerge1. knob("Achannels").setValue(2)

Please if someone could explain why "Achannels" doesn't get changed the same way "operation" or "fringe" or any other knob in the Merge2 node?

Is setValue the wrong command for "Achannels" ?

How are we support to change the "Achannels" knob if not by this command?


07 July 2011, 06:41 PM
nuke.tcl("knob diffuse.Achannels diffuse")

did it.

Apparently 5.0 is limited in it's python stuff. Can i upgrade 5.0 to 5.2 still? Or do I need to buy 6.3 or nothing?


08 August 2011, 07:05 PM
upgraded to 6.2 all good.

08 August 2011, 03:44 PM
you know you can render multichannel EXR files from maya? (all channels in one file)



08 August 2011, 07:10 PM
yes that's what this script is for.

I got the python script to reassemble my passes in the right order with the right operation.

Now nuke is crashing heaps though.

Is 100 channels to many for nuke?

08 August 2011, 08:32 PM
on paper nuke can handle up to 1024 channels (or is it already unlimited?)

maybe its that you machine cant handle it? how much RAM do you have?

and what 100 channels do you render?

08 August 2011, 06:20 AM
got the upgrade to nuke 6.3 64 bit and all is good.

CGTalk Moderation
08 August 2011, 06:20 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.