Update menu UI on other parm change

   331   0   0
User Avatar
Member
29 posts
Joined: 8月 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 - 2024年6月26日 15:44:27
  • Quick Links