ThomasPara Posted February 15, 2018 Share Posted February 15, 2018 Is it possible to recreate the Attribute dropdownlist where it finds all the attributes on the mesh, and add this to your own hda? Quote Link to comment Share on other sites More sharing options...
ThomasPara Posted February 15, 2018 Author Share Posted February 15, 2018 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){ removevalue(@pointattribs,name); } 1 Quote Link to comment Share on other sites More sharing options...
f1480187 Posted February 15, 2018 Share Posted February 15, 2018 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))) attributes_menu.hipnc 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). 3 Quote Link to comment Share on other sites More sharing options...
ThomasPara Posted February 15, 2018 Author Share Posted February 15, 2018 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(): result.append(attr.name()) result.append(attr.name()) return result Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.