Hey,
Not sure if it's the smartest way, but I'm in the habit of doing
exactly this in the fist few lines of most of my callback functions:
tn = nuke.thisNode()
# Filter out unwanted knobs
if tn.name() in ['xpos', 'ypos', 'selected']:
return
I always make sure to put it at the very beginning of my function and
it helps limit the slowdowns you're talking about. I'm not aware of a
way to filter out knobs outside of the callback function itself, or
even if that would result in much speed boost.
If I want to limit the number of times a callback is triggered, I make
a hidden boolean knob and check whether to return or not depending on
its value at the very start of the function.
Pretty sure both these practices are fairly standard among the
pipeline TDs out there.
Hope that helped.
Cheers,
-Ean
On Jun 10, 2012, at 12:28 PM, "jrab" <[email protected]> wrote:
> Hey there -
>
> Just wondering if there is a smart way to easily limit the number of times
> the knobChangeds callbacks are pinged - for instance, I really don't want the
> callback to even think about being run if the knobChanged is a select or xpos
> or ypos. It seems like if there are more than a few knobChangeds callbacks,
> these can add up in wasted cycles and bog the UI a bit, even if each function
> specifies which knob to use.
>
> Specifically, I have one callback that needs to generate the list of knobs
> used each time after it's called, since there are a bunch of dynamically
> created knobs that change with each node. If I could turn off the call to the
> callback for all the default knobs, it seems like it could help speed up
> things a little bit. Maybe as a starter, is there a simple way to get the
> default gizmo knobs and exclude them?
>
> thanks
> JRAB
> _______________________________________________
> 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