I used this for the bypass node


n.knob('tile_color').setValue( int('%02x%02x%02x%02x' % (255,255,0,0),16))

which was for yellow so for white


n.knob('tile_color').setValue( int('%02x%02x%02x%02x' % (255,255,255,0),16))

ie multiply *255 your values and plug in

Not that you like multi line code but you could do

 
c=[(255,255,0,0), (255,0,0,0)]p=0 

for n in nuke.selectedNodes():
v=int('%02x%02x%02x%02x' % c[p],16)
    n.knob('tile_color').setValue(v) 
p+=1
print v


which would allow you to build up a list for c and and apply to nodes
Bound to be neater ways to do this I'm sure



Howard



>________________________________
>From: Ron Ganbar <[email protected]>
>To: Nuke Python discussion <[email protected]>
>Sent: Saturday, 29 October 2011, 11:23
>Subject: [Nuke-python] tile_color
>
>
>Hi all,
>So a while back Frank created Marcie in the node graph using some clever 
>python scripting. For one of my lessons I want to do something similar.
>For that I need to set the tile_color. However, tile_color doesn't take RGB 
>values. It's takes a 10 digit number.
>Any idea how to convert between a nice list [1, 1, 1, 0] to whatever 
>tile_color accepts?
>
>
>
>Thanks,
>Ron Ganbar
>email: [email protected]
>tel: +44 (0)7968 007 309 [UK]
>     +972 (0)54 255 9765 [Israel]
>url: http://ronganbar.wordpress.com/
>
>_______________________________________________
>Nuke-python mailing list
>[email protected], http://forums.thefoundry.co.uk/
>http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
>
>
>
_______________________________________________
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