Jump to content

Call to Ordered menu item


Recommended Posts

This is how I've got it set up using python at least, not sure about hscript:

np = n.parm("nodeparm")
val = np.menuLabels()[np.eval()]

The "menuLables()" function gets all the labels in the ordered list and running "eval()" directly on the parameter gives you what index in the list the current selection is at.

However, if you want your text field to update every time you change the dropdown you will have to recalculate every time you change the dropdown by adding a callback function to it.

Hope it can still be useful!

Link to comment
Share on other sites

1 hour ago, underscoreus said:

This is how I've got it set up using python at least, not sure about hscript:


np = n.parm("nodeparm")
val = np.menuLabels()[np.eval()]

The "menuLables()" function gets all the labels in the ordered list and running "eval()" directly on the parameter gives you what index in the list the current selection is at.

However, if you want your text field to update every time you change the dropdown you will have to recalculate every time you change the dropdown by adding a callback function to it.

Hope it can still be useful!

ok thanks gonna try this :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...