Saturday 14 September 2019

Building Menus Dynamically in Houdini

When you are making your own tools in Houdini, building menus dynamically can be very useful. There is a bit of coding needed so I've included the project file to make it easier to follow along.

edit: Koen Vroeijenstijn pointed out that it's must faster to use the string table for an attribute and then you don't have to check for duplicates. Here is a code snippet:

geo=hou.node("./IN_shapes").geometry()

menuList=[]

attrib=geo.findPointAttrib("name")
names=attrib.strings()


for name in names:
    menuList.append(name)
    menuList.append(name)


return menuList

https://www.dropbox.com/s/95ikzajj4zmxtad/menu.hiplc?dl=0



No comments:

Post a Comment