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
