Create Attribute and Group pull-down list in digital assets

Tow week ago i create digital assets then i search everywhere about how can i Create Attribute and Group pull-down list in digital assets and there is an awesome Houdini artist name Elias in Think Procedural Discord website he show me this and it’s turn out it’s required python code and unfortunately i am not good with python maybe i will learn it after vex 🙂 anyway this is how you can do it.

1- Create your channel reference and make sure it’s string.

2- Go to Edit Parameter Interface.

3- click on your channel reference and from Parameter Description open Menu.

4- check Use Menu and change it to Toggle (Field + Multiple Selection Menu).

5- open Menu Script tab and type this python code

for Attribute :

result = []
try:
    geo = hou.pwd().inputs()[0].geometry()
    
    for attr in geo.pointAttribs():
        result.append(attr.name())
        result.append(attr.name())
except:
        result.append("")
        result.append("")

return result

for Group :

result = []
try:
geo = hou.pwd().inputs()[0].geometry()

for attr in geo.pointGroups():
result.append(attr.name())
result.append(attr.name())
except:
result.append("")
result.append("")

return result

6- now you will find this is only work for point Attribute and Group so what if you want primitive Attribute and Group you can fix it just by change it like this

for Attribute :

result = []
try:
    geo = hou.pwd().inputs()[0].geometry()
    
    for attr in geo.primAttribs():
        result.append(attr.name())
        result.append(attr.name())
except:
        result.append("")
        result.append("")

return result

for Group :

result = []
try:
geo = hou.pwd().inputs()[0].geometry()

for attr in geo.primGroups():
result.append(attr.name())
result.append(attr.name())
except:
result.append("")
result.append("")

return result

i think you know we only change the word point to prim in the code in this line

for attr in geo.primGroups():