Jump to content

Custom parameter - Attribute dropdown list

Recommended Posts

Is it possible to recreate the Attribute dropdownlist where it finds all the attributes on the mesh, and add this to your own hda?


Share this post

Link to post
Share on other sites

Did some more searching and i found an older topic here that had what i needed - 

Setting the list to Multiple Selection Menu instead of Single i could make a list of the attributes i didnt want with the following vex-code:

s[]@pointattribs = detailintrinsic(0,"pointattributes");
string attriblist = chs("../attribtrans"); //Multiple Selection Menu
string alist[] = split(attriblist);
foreach(string name; alist){



Share this post

Link to post
Share on other sites

General way is to use Python as Menu script:

from itertools import chain

node = hou.pwd()
geo = node.geometry()
attribs = [a.name() for a in geo.pointAttribs()]

return list(chain(*zip(attribs, attribs)))


It is possible to avoid it in many cases. When you promote parameter it will usually pick the menu script (if it exist) from the node. It is not necessary to have such menu on the target node, as you may promote parameter from a different node (example).

  • Thanks 2

Share this post

Link to post
Share on other sites

Yeah, i use Python in the menu, but i needed the list in vex aswell. And having it pull the attributes from the target node was a bad idea since the attributes i removed also got removed from the list itself.

And the reason i couldnt promote the parameter is because it doesnt exist on the wrangle itself, i could have made a dummy node instead and promoted that.

My menuscript ended up like this:

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

for attr in geo.pointAttribs():
return result


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now