thank ... I had just figured this out when I was about to let the list know and 
saw your response ... thanks anyway !!!!

From: [email protected] 
[mailto:[email protected]] On Behalf Of Ean Carr
Sent: Tuesday, August 02, 2011 1:17 PM
To: Nuke Python discussion
Subject: Re: [Nuke-python] New Channel Layes with Python

Hi Mike,

You have the syntax a little off. The first argument to nuke.Layer is the layer 
name. The second argument should be a list/tuple  where each item is 
<layer>.<channel name>

So, in your example, I'm not sure what's assigned to your variable 'read_node', 
but I'm guessing it's a node object, but should be a string. In your list, 
you're not specifying which layer to add your channels to. That would explain 
being able to see the layer in the viewer drop-down but not a Copy node, which 
only shows you channels.

So, for example, if you want to add a layer called 'mylayer' and red, green, 
blue and alpha channels to that layer, you'd do:

nuke.Layer('mylayer', ['mylayer.red', 'mylayer.green', 'mylayer.blue', 
'mylayer.alpha'])

At first I was confused by this, too. I thought you could leave off the layer 
name from each item in your tuple/list and nuke.Layer would assume the layer in 
the first arg, but it looks like that's not the case.

-Ean
On Mon, Aug 1, 2011 at 8:12 PM, Mike Donovan 
<[email protected]<mailto:[email protected]>> wrote:
Hey Guys,

I am trying to create a script that make new channel layers .. I am using the 
nuke.Layer() function to do this. The layers are getting created (I can see 
them in the viewer drop down) but I can't see them in my 'copy' nodes ... here 
is a snippet. Any thoughts would be great.

#add new channel for each read node
nuke.Layer( read_node, ['red', 'green', 'blue'] ) # new channel layer

if item_count > 0 : # if the read node is not the first in the collection ... 
make a copy node

       prev_copy_node = nuke.selectedNode() # get the current copy node
       rn_copy = nuke.createNode("Copy") # make a new copy node
       rn_copy.setName('cp_'+read_node) # name it to match the read node
       x = nuke.toNode(read_node) # assign the read node to x
       nuke.toNode(rn_copy.name<http://rn_copy.name>())
       rn_copy.setInput(0, prev_copy_node) # set the input from the previous 
copy node
       rn_copy.setInput(1, nuke.toNode(read_node)) # set the input from teh 
read node
       nuke.toNode(rn_copy.name<http://rn_copy.name>())
       rn_copy.knob("from0") .setValue('rgba.red')
       rn_copy.knob("to0") .setValue(read_node+'.red')
       rn_copy.knob("from1") .setValue('rgba.green')
       rn_copy.knob("to1") .setValue(read_node+'.green')
       rn_copy.knob("from2") .setValue('rgba.blue')
       rn_copy.knob("to2") .setValue(read_node+'.blue')

M

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________
_______________________________________________
Nuke-python mailing list
[email protected]<mailto:[email protected]>,
 http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python


________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________
_______________________________________________
Nuke-python mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python

Reply via email to