Jump to content

eval() and menu items


gregoconn

Recommended Posts

Hi All

I'm pretty fresh to creating HDA's, so I'm sure I'm doing something wrong. However getting some strange behavior in a previously working asset. 

I'm querying a menu to see what menu item is selected with:

def menuUpdate(node):

    selection = node.parm("menu1").eval()
    #correctly defines value for selection variable but also sets the menu items for "menu2" to "menu1"
    print selection
    # prints as expected
    
    #below is ignored.
    menu = [5,5,6,6]
    return menu

Which I'm calling using:

node = kwargs["node"]
menuStuff =  node.hdaModule().menuUpdate(node)
print menuStuff # returns expected [5,5,6,6]
return menuStuff # has no effect 

The essentially, the menu items of menu2 are being set when I run node.parm("menu1").eval() to the same menu items of menu1. It still returns the correct value for selection, however the values that I return for menu2 are ignored. Any insight on why this is would be appreciated. 

go_menusEval.hdalc

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