Houdini Parameter Interface, add dynamically menu items

   15917   7   0
User Avatar
Member
101 posts
Joined: 12月 2012
Offline
How can i dynamically populate a drop-down-menu in a nodes User-Interface ? I want to do a request to get available files and put it as choices into a drop-down-menu. I couldn't find any information, just how to query menuitems()

hou.parm('/obj/geo2/python1/parm3').menuItems())

thanks
User Avatar
スタッフ
4435 posts
Joined: 7月 2005
Offline
On the Menu tab for the parameter, there is a sub-tab that says “Menu Script” where you can write a script in hscript or python to dynamically generate your menu contents. See
http://www.sidefx.com/docs/houdini15.0/hom/locations#parameter_menu_scripts [sidefx.com]
for an example.

Mark
User Avatar
Member
101 posts
Joined: 12月 2012
Offline
Awesome! Thanks! that works, one more question. How can i trigger a script (to update a second drop-down-menu) when item of first drop down selected?
User Avatar
Member
3 posts
Joined: 11月 2013
Offline
add a callback script to the function/method used to populate menu2, and evaluate menu1 in that function/method. If you tell me the context in which you are populating your menus I will write you an example.

-Nathan
User Avatar
Member
101 posts
Joined: 12月 2012
Offline
i am in sop context, would appreciate an example.
User Avatar
Member
3 posts
Joined: 11月 2013
Offline
Here is a sop that has 3 menus, it reads your user houdini folder and if you select a folder, you can keep selecting more. I'm sure theres a way to do this cleaner, i just wanted to throw something together so you could understand, hope this helps.

-Nathan

Attachments:
menuexample.hda (5.3 KB)

User Avatar
Member
55 posts
Joined: 7月 2011
Offline
Hi there,

I'm not a coder, but looking to create a row of toggles with only one being on at any one time.
Can't seem to find a resource which goes through the parameter interface creation option at a time.

Not sure how this was done but it's brilliant - how to create those teal icon buttons?


thank you
User Avatar
Member
1 posts
Joined: 12月 2016
Offline
Nathan Arbuckle
Here is a sop that has 3 menus, it reads your user houdini folder and if you select a folder, you can keep selecting more. I'm sure theres a way to do this cleaner, i just wanted to throw something together so you could understand, hope this helps.

-Nathan

Hi Nathan

2 years too late, but if you're seeing this, could you make a quick example on how to load menus using a file parameter? I have a file parameter and depending on the number of lines in the text file that I select, I need the menu to update. Is that possible?
  • Quick Links