Use dynamic knobs approach (Op::replace_knobs and Op::add_knobs functions), described in Nuke Developers' Guide ( http://docs.thefoundry.co.uk/nuke/63/ndkdevguide/knobs-and-handles/dynamic-knobs.html ).
Function Op::replace_knobs can delete some knobs and place another. You can actually show/hide or change knobs dynamically using it. 2011/7/27 mamouth <[email protected]> > > Hi! > > I found a single way to deal with Shuffle Op attributs: > > 1. I create a Shuffle in the constructor of my Op: > myshuffle = dynamic_cast(Iop::create("Shuffle")); > > 2. In knobs(), I then call: > myshuffle->knobs(f); > > 3. In validate(), I can do: > Knob *k = knob("green"); > if (k) k->from_script("red"); > > This works BUT: > > 1. I can't hide the Shuffle knobs from the attribut panel: > Neither k->hide() nor k->visible(false) works correctly. > > 2. I can't deal with multiple Shuffle Ops: > All their knobs are named the same ! > > There must be a way to get the appropriate fields of a Shuffle Op to set them > directly, no ? > > Thank your for your help ! > > mamouth wrote: > Hi! > > I can't get the way to modify the channels (red, green, etc.) of a Shuffle > Operator. > > I already know that the "red" knob exists, but not the field. The code below > returns NULL: > myShuffleOp->field("red") > > Thus, i suppose that the channels knobs are combined somehow into an other > field...? > > How could i know the relevant field name ? > And, more deeply, how could i get all the fields of an operator (if it is > possible) ? > > Thanks > _______________________________________________ > 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
