I am attempting to create a modal menu that updates it's contents based on the currently highlighted primitive in a viewer state.
The data on the node is a multiparm string menu of options, where each instance of the multiparm is driven by script. So each prim contains different options in the menu script;
prim0 = “OptionA”, “OptionB”
prim1 = “OptionA”
prim2 = “OptionC”, “MyOtherOption”
Is it possible to build a menu in a viewer state dynamically?
I have looked into onMenuPreOpen(), which gives me the access to setting parms on an existing menu, but I cannot seem to build/update an existing one with addRadioStripItem() as I can't grab the menu object.
Any thoughts? Any other approaches to look at? Could I bind a menu parm instead?
Cheers,
Aaron.
Python state dynamic menu - multiparm instances.
1782 5 1- aaronauty
- Member
- 39 posts
- Joined: Jan. 2012
- Offline
- mabelzile
- Staff
- 400 posts
- Joined: Feb. 2018
- Online
- aaronauty
- Member
- 39 posts
- Joined: Jan. 2012
- Offline
- mabelzile
- Staff
- 400 posts
- Joined: Feb. 2018
- Online
- julien-b
- Member
- 65 posts
- Joined: March 2017
- Offline
Hi mabelzile,
I was looking for something similar, could you explain how to implement this ?
I was also thinking that maybe I could implement a hou.parmTemplateType.String. When I right click on it I get “No Options Available”. Is there a way to dynamically populate Options for this ?
Thanks a lot in advance,
Julien
I was looking for something similar, could you explain how to implement this ?
I was also thinking that maybe I could implement a hou.parmTemplateType.String. When I right click on it I get “No Options Available”. Is there a way to dynamically populate Options for this ?
Thanks a lot in advance,
Julien
Edited by julien-b - April 28, 2020 17:38:11
VFX Supervisor @ MPC London
- mabelzile
- Staff
- 400 posts
- Joined: Feb. 2018
- Online
You can update the python state context menu with onMenuPreOpen which is called before the menu opens up when you RMB. For instance, you could create your context menu with all possible menu items you want to support. Then in onMenuPreOpen you can decide which menu items you want visible or change labels, etc… (see attached example)
State dynamic parameter menu is not yet supported.
Image Not Found
State dynamic parameter menu is not yet supported.
Edited by mabelzile - April 29, 2020 11:35:50
-
- Quick Links