Maybe you could work around it using knob.getValue() instead, since that should always return the current index from the list of values.
print k.values()[int(k.getValue())] On Mon, May 2, 2011 at 8:30 AM, Hugh Macdonald <[email protected]>wrote: > Hi, > > I'm sure I must be missing something here, but I can't for the life of me > figure it out... > > I want to be able to query a knob's flags to find out what is set... > > My issue is that I need to be able to query the value of an > Enumeration_Knob without knowing in advance if SAVE_MENU is set or not. > > Right now, if I run the following code, I get exactly the same result from > value() each time. And sure, this is a very edge case - I could always just > check for {\d} at the start of the result, but I want this to be solid. > > > k.setFlag(nuke.SAVE_MENU) > k.setValues(["abc", "def"]) > print k.value() > # {0} abc def > k.clearFlag(nuke.SAVE_MENU) > k.setValues(['{0} abc def']) > print k.value() > # {0} abc def > > > Cheers > > Hugh Macdonald > *n**vizible** – VISUAL EFFECTS > * > [email protected] > +44(0) 207 659 2038 > +44(0) 7773 764 708 > > www.nvizible.com > > > _______________________________________________ > Nuke-python mailing list > [email protected] > http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python > >
_______________________________________________ Nuke-python mailing list [email protected] http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
