I remember having this problem and I end up using the TCL equivalent in a knob 
using expressions to solve my problem quickly. But if you'd ask me the sample 
command is a tricky no so reliable bastard in both python and TCL flavors.

Have you tried to trigger it from the update UI just to see what happens?

On 25/04/2012, at 20:33, Christopher Horvath <[email protected]> wrote:

> Hey Folks,
> 
> When I call 'sample' on a node from inside a knobChanged callback in python, 
> it only returns new values occasionally. I'm printing out the x,y sample 
> location that I'm getting out of the position knob, and it's changing 
> smoothly - but the rgb values that I'm getting returned from my sample calls 
> don't change smoothly. I'm assuming this an evaluation problem. Here's my 
> sampling code:
> 
> 
>             scolR = groupIdImage.sample( 'red', origXY[0], origXY[1] )
>             scolG = groupIdImage.sample( 'green', origXY[0], origXY[1] )
>             scolB = groupIdImage.sample( 'blue', origXY[0], origXY[1] )
> 
> Does anybody have success with this sort of thing in python callbacks?
> 
> 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

Reply via email to