Thanks Abigail. I'll take a look at this today.

One other question: In my plugin, I'm calling input0().hash().getHash() to fetch the incoming tree hash. This is being done in _validate, without any prior call to input(0)->validate(), and seems to be reliable so far (I'm using the hash to decide when to switch inputs in my node). However, I'm wondering if the hash is guaranteed to be 100% up-to-date without a call to input(0)->validate(), in case this ends up biting me down the road.

Thanks,

-Nathan

-----Original Message----- From: Abigail Brady
Sent: Friday, June 10, 2011 10:32 AM
To: Nuke plug-in development discussion
Subject: Re: [Nuke-dev] Using knob as a feedback device

The ArrayKnobI::ValueProvider interface in DDImage/ArrayKnobI.h is
designed for this sort of thing: it's how the world matrix output knobs
are implemented, so you can create a bool knob and then set a callback
to fetch its value out of your internal variable.

Calling set_value in _validate (or in later things) should be avoided.

On Thu, 2011-06-09 at 11:44 -0700, Nathan Rusch wrote:
I’d like to expose a sort of “status flag” from a plugin to the
interface level using a Boolean_knob, so it can be expression-linked,
etc. but not edited. My plugin currently has a member bool that is set
in _validate() and used to make decisions in request() and engine();
picture a Switch node where the switching decision is made
automatically, but you still want to expose some kind of a knob
indicating which one is actually being used.

The obvious choice seems to be to just piggy-back a new Boolean_knob
on that existing bool, but when I do this, the knob doesn’t update
when the bool changes (presumably because it doesn’t know it needs
to).

Is this a “safe” way to do things? If so, what’s the most efficient
way to force my knob to update from its “storage variable?” Or should
I just add another variable to store the knob’s state and call
set_value on the knob directly when it needs to change?

Thanks,

-Nathan


_______________________________________________
Nuke-dev mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev


--
Abigail Brady, Senior Architect
The Foundry, 6th Floor, 48 Leicester Square, London. WC2H 7LT
Tel: +44 20 7968 6828 * Fax: +44 20 7930 8906
Web: www.thefoundry.co.uk

The Foundry Visionmongers Ltd
Registered in England and Wales No: 4642027

_______________________________________________
Nuke-dev mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev
_______________________________________________
Nuke-dev mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev

Reply via email to