Jump to content
Sign in to follow this  

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

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

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
Sign in to follow this