How to create a multi-select menu with check to HDA?

   2475   12   4
User Avatar
Member
23 posts
Joined: Oct. 2021
Offline
I am trying to add a multi-select menu to my HDA, similar to the Group Name parameter of the Group node.
But I found that the Group node's menu is prompted with a checkmark, how do I implement this?

Group node:



My node:
Edited by misakacirno - April 18, 2023 03:05:51

Attachments:
mynode.png (3.1 KB)
groupnode.png (2.9 KB)

User Avatar
Member
4685 posts
Joined: Feb. 2012
Offline
Hi,

You can do it with this option:

Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]

youtube.com/@pragmaticvfx | patreon.com/animatrix | pragmaticvfx.gumroad.com
User Avatar
Member
23 posts
Joined: Oct. 2021
Offline
animatrix_
Hi,

You can do it with this option:


Thanks for your reply, that's the method I'm using, but I want the selected item to have a tick mark to indicate it is selected like the Group node, is there any way to do that?
User Avatar
Member
118 posts
Joined: Dec. 2013
Offline
You could use an import block to bring in the Group node and then set what you don't want to Invisible. https://www.sidefx.com/forum/topic/76409 [www.sidefx.com]

Glen
Edited by GlenD - April 18, 2023 04:35:47
User Avatar
Member
4685 posts
Joined: Feb. 2012
Offline
misakacirno
animatrix_
Hi,

You can do it with this option:


Thanks for your reply, that's the method I'm using, but I want the selected item to have a tick mark to indicate it is selected like the Group node, is there any way to do that?

From what I know the checkmark only shows for single selection options, not the multi selection ones. So try using Replace ( Field + Single Selection Menu) option.
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]

youtube.com/@pragmaticvfx | patreon.com/animatrix | pragmaticvfx.gumroad.com
User Avatar
Member
23 posts
Joined: Oct. 2021
Offline
GlenD
You could use an import block to bring in the Group node and then set what you don't want to Invisible. Your text to link here... [www.sidefx.com]

Glen
Thank you for your answer, but instead of referencing the Group node's parameter in my HDA panel, I want to create a String parameter and have a similar menu with the "√" symbol.
User Avatar
Member
23 posts
Joined: Oct. 2021
Offline
animatrix_
misakacirno
animatrix_
Hi,

You can do it with this option:


Thanks for your reply, that's the method I'm using, but I want the selected item to have a tick mark to indicate it is selected like the Group node, is there any way to do that?

From what I know the checkmark only shows for single selection options, not the multi selection ones. So try using Replace ( Field + Single Selection Menu) option.

I tried it, and neither seemed to have the same effect.

Attachments:
Replace.png (62.0 KB)
Toggle.png (65.0 KB)

User Avatar
Member
85 posts
Joined: April 2014
Offline
I am having the same issue, was anyone able to figure this out?
User Avatar
Member
8038 posts
Joined: Sept. 2011
Offline
Tyler Britton2
I am having the same issue, was anyone able to figure this out?

When building the menu script, put a checkmark character at the end of the label for the item if it's the current value of the parameter.
User Avatar
Member
85 posts
Joined: April 2014
Offline
Awesome, thanks. I am dynamically building the menu through Python, I guess I would have to query the parameter, find which one is selected, then add the checkmark to the label, is that correct?
Do you happen to have any code for this?
User Avatar
Member
8038 posts
Joined: Sept. 2011
Offline
Tyler Britton2
Awesome, thanks. I am dynamically building the menu through Python, I guess I would have to query the parameter, find which one is selected, then add the checkmark to the label, is that correct?

That's what I was thinking.

Tyler Britton2
Do you happen to have any code for this?

Sorry, just a random thought, not tested.
User Avatar
Member
1 posts
Joined: Dec. 2023
Offline
misakacirno
I am trying to add a multi-select menu to my HDA, similar to the Group Name parameter of the Group node.
But I found that the Group node's menu is prompted with a checkmark, how do I implement this?

Group node:
Image Not Found



My node:
Image Not Found
cc
User Avatar
Member
119 posts
Joined: Dec. 2019
Offline
Checkmarks seem to be available on menus built with HDK only (I only see them on compiled nodes), I couldn't find a way to do this when building an HDA, in many cases the trick is to promote a parameter that already has that menu with checkmark (group parameter in most cases).

As said by @jsmack, a checkmark string can help here, I tried this and it works fine :

a = ("a", "A")
b = ("b", "B")

pairs = [a, b]

menu = []
for p in pairs:
    menu.append(p[0])
    if p[0] in hou.evalParm("my_list").split(" "):
        menu.append(p[1] + " ✓")
    else:
        menu.append(p[1])

return menu

Attachments:
menu_checkmark.png (155.0 KB)
menu_checkmark_2.png (45.1 KB)

Houdini Pipeline Supervisor @ TAT Studio
  • Quick Links