Update menu UI on other parm change

   366   0   0
User Avatar
Member
29 posts
Joined: Aug. 2013
Offline
I have a menu in an HDA that I am setting from a script that depends on some parms on the local and referenced nodes. When the referenced node updates, it seems to recook the state for the menu and the UI updates properly. But when I change the parm on the same node it does not update the UI. Calling hou.Parm.rawValueon it returns the correct value, but you the displayed value is still the previous state. You have to click on the menu to get the correct values to show.
Here is the code I am using to generate the menu. hou.pwd().parm("engine")acts as an override for the target node behavior.
rendergpu = hou.phm().check_rendergpu(hou.pwd().parm("target").evalAsNode())
if not hou.pwd().parm("engine").isDisabled():
    rendergpu = hou.pwd().parm("engine").rawValue() == "xpu"
cpugpu = filter(lambda x: x["gpu"] == rendergpu, hou.phm().retrieveData())
menuList = []
for item in cpugpu:
    menuList.append(item["id"])
    menuList.append(item["name"])
return menuList

I have been trying to figure out if I can have something on hou.pwd().parm("engine")as a callback that would force the menu to redraw, but no dice yet.
Edited by Adam Ferestad - June 26, 2024 15:44:27
  • Quick Links