Jump to content

Recommended Posts

How can i get the ordered menu labels in VEX?

I know how to do this in Python but what about VEX?

Share this post


Link to post
Share on other sites

By default you will fetch the tokens if you use chs() on an ordered menu parameter.
if you use chi() it will give you the index in the list.

Do you need to have 2 strings (the token and the label separately) ?
If not you can just copy the label value to the token value.

For fetching the actual label string.. I'm actually not sure for VEX from the top of my head.

Share this post


Link to post
Share on other sites
menu = node.parm('parm') // get the parm
index = menu.evalAsInt() // get the current index
label = menu.menuLabels()[index] // get the label of the index
  

try this

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×