I'm creating a custom dynamic button strip menu on my HDA, no issues : I get one button per dynamic entry as instructed.
The issue I have is that I can't then, using a callback, retrieve the list of tokens, as noted by the doc, as such :
def strip_to_tokens(parm): # Takes a reference to a button/icon strip parameter # instance and returns a list of tokens corresponding # to the buttons that are on bitfield = parm.eval() tokens = parm.parmTemplate().menuItems() return [token for n, token in enumerate(tokens) if bitfield & (1 << n)]
This will return an empty list.
The thing is that when setting up a fixed menu using the 'menu items' tab instead of 'menu script', this little bit of code will correctly return the tokens. It seems the dynamic nature of my button strip parameter is the culprit, and both parmTemplate().menuItems() and parmTemplate().menuLabels() are returning empty strings.
Is there something I'm missing ?
It looks like I'll have to also rebuild the source list in the callback.