Jump to content

Getting the token of an ordered menu made by python menu script


defc0n1

Recommended Posts

Hey everyone

I have an ordered menu in my HDA that gets populated by a python script based on an attribute. The name of the menu is data_source:

if (geo.attribValue('nHDU') > 1):
    return ("0", "Primary", "1", "Extension")
else:
    return ("0", "Primary")

I'm trying to access this token value from an internal python node using this:

value = hou.evalParm("../data_source")

Now I know for sure that the nHDU value is >1 and the two menu items are being populated. Problem is, no matter what I select on the menu, I always get a value 0. It works if I add it directly to the ordered menu without using a script. But that defeats the purpose because it should depend on the attribute nHDU. Could someone tell me what's happening  here? Thanks.

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...