Seems to behave odd
This works, though not as neat.
Howard
set cut_paste_input [stack 0]
version 6.3 v6
Constant {
inputs 0
color {0.2061092257 0.1723236144 1 1}
name Constant3
selected true
xpos -1798
ypos 419
}
ColorWheel {
inputs 0
gamma 0.45
name ColorWheel1
selected true
xpos -2072
ypos 410
}
MergeExpression {
inputs 2
expr0 Ar==Br?1:0
expr1 Ag==Bg?1:0
expr2 Ab==Bb?1:0
channel3 none
expr3 0
name MergeExpression1
selected true
xpos -2060
ypos 561
}
Expression {
channel3 alpha
expr3 max(r,g,b)
name Expression1
selected true
xpos -2060
ypos 623
}
>________________________________
> From: Christopher Horvath <[email protected]>
>To: Nuke Python discussion <[email protected]>
>Sent: Tuesday, 24 April 2012, 22:04
>Subject: [Nuke-python] Simple color-select
>
>
>Hello Nuke,
>
>
>I need to do something extremely simple, and am running into difficulty. I
>just want to create an alpha channel from an rgb, where the alpha is 1 where
>the rgb exactly matches (within some tiny precision) a target color, and the
>alpha is 0 where the rgb is other.
>
>
>I tried doing this with an Expression node, and it works, but sometimes the
>resulting alpha channel is offset in space (but not always). The expression
>that I'm using is:
>
>
>(r==targetColor.r && g==targetColor.g && b==targetColor.b) ? 1 : 0
>
>
>where targetColor is a user variable.
>
>
>Is there some easier way to do this? This seems like a pretty basic color-key
>operation, I feel like I'm solving it the hard way.
>
>
>Chris
>
>--
>I think this situation absolutely requires that a really futile and stupid
>gesture be done on somebody's part. And we're just the guys to do it.
>
>_______________________________________________
>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