Thanks Jep, very helpful. I was able to get something like that going
manually, but I decided I wanted to stay away from expressions so I didn't
get the little "e's" or green lines mucking up my dots.
baking the top node tile_color into the dots would be just the thing, and
not have it be a live link. for what I'm doing, I rarely change the top
nodes after the fact, i just need to know what stream the dots are coming
from since there's about 5 "streams" visible in the script at once. it
gets a little confusing but color coding a dot down the chain every now and
then helped map things out better.
so the script I'm trying to get going would allow you to select a boatload
of nodes, then it would filter out the dots and one by one set them to the
respective top node color.
I've got a start to it but haven't hit gold yet. I was having a hard time
getting the top node tile_color to evaluate so I could pass it into the dot
node tile_color.
I took a look at where I left off and I was trying a command like this:
[python nuke.thisNode().knob('tile_color').value( [value
[topnode].tile_color])]
which is wrong on so many levels... ha, it looks like I was trying to mix
TCL and Python in the same command. as usual, I'm a little out of my league
and just resort to trial and erroring (mostly erroring).
is there a python equivalent to get the [topnode] ?
I also thought about just adding a python script button to the standard dot
node, which might be cool. could just pop open it's panel and hit the
button to set it to the top node color. that might work too for my
purposes.
I didn't get very far with that either. left off with something like this:
set cut_paste_input [stack 0]
version 6.3 v6
push $cut_paste_input
Dot {
name Dot1
tile_color {{"\[value \[topnode].tile_color]" 0}}
selected true
xpos 897
ypos 245
addUserKnob {20 User}
addUserKnob {22 test T "def dotTopColor():\n
d=nuke.thisNode()\n hexcolor=\[value \[topnode].tile_color]\n
d\['tile_color'].setValue('hexcolor')\n\ndotTopColor()" +STARTLINE}
}
any ideas or different approaches would be awesome!
On Sat, Feb 4, 2012 at 3:24 PM, Jep Hill <[email protected]> wrote:
> Hi Bill,
>
> The dot node will take a tile color however, I've only been able to
> successfully set an expression to the tile_color via python -- not to say
> it isn't possible via tcl, I'm just not sure how.
>
> When setting an expression via python 2 things happen:
>
> 1. The dot node gets the green "e" badge showing there is an expression
> attached -- that may not be an issue for you.
> 2. The dot node then links a green expression arrow to the node directly
> above it -- yes, you can turn these off, so again, it may not be an issue.
>
> * I'm not aware of a way to turn off node badges and expression arrows on
> a case-by-case basis -- that would be cool...
>
> I may have achieved what you are looking for with the following function
> and callback -- note: it's assuming your dot node is named "_dot_".
>
> def dotTopColor():
> d=nuke.toNode('_dot_')
> d['tile_color'].setExpression('[value [topnode].tile_color]')
>
> nuke.addUpdateUI(dotTopColor)
>
> Hope this helps...
>
> Cheers,
> Jep_______________________________________________
> 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