Updating menu items in a multiparm block with Python

   615   2   2
User Avatar
Member
2 posts
Joined: Aug. 2023
Offline
Hi great friends,
I'm trying to figure out how to update/populate a menu based on the selection of another menu in a multiparm block.
As you see in the picture I'd like to populate the menu namespace with the matching namespaces based on the selection of the asset type.
It seems that the good old `parmTemplateGroup().replace()` doesn't work here.
It seems that I can only replace the original parameter but not the one that is instanced.
I was able to access the template of the instanced parameter using `hou.Parm.multiParmInstances()` and `parmTemplate()` but couldn't figure out how to replace it in the multiparm block.

Any ideas ?

Have a great day.

Yann
Edited by ydrevon - Aug. 30, 2023 11:29:22

Attachments:
rgreceiver_TsngTpKshG.png (30.5 KB)

User Avatar
Member
900 posts
Joined: Feb. 2016
Offline
I think you could use menu scripts for this dynamic situation.

The pontential issue here is about responsiveness of the UI, that can be affected by the use of menu scripts and multiparms.
How many multiparm instances will be created by the user, on average?
User Avatar
Member
2 posts
Joined: Aug. 2023
Offline
Hey Andr,
Thanks for you answer !
We can expect a lot of multiparm instances, for some scene I have 30+. But on average I would say 10+.
  • Quick Links