Houdini Engine 1.9
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Groups

About Houdini Groups

Houdini groups can contain primitives and points. Edge groups are also supported but Houdini Engine does not currently expose that functionality. Primitives can be whole polygon meshes, single polygons, volumes, curves, spheres, and so on. It is possible, for example, to have a single group contain some of the ploygons from one mesh, some of the polygons from another mesh, a volume, and a curve, all at the same time.

It is up to the asset maker to use groups as they see fit but the most common use case for primitive groups is assigning multiple textures to the same polygon mesh. This is the reason why we by default split polygon meshes by group. See Parts for more information on this splitting.

Query Group Information

You query information on groups by first getting a list of group names per Geo and per HAPI_GroupType, using HAPI_GetGroupNames(). The number of groups on a geo can be found by calling HAPI_GeoInfo_GetGroupCountByType() on it's HAPI_GeoInfo or directly from:

You then get the membership information for the groups you're interested in, per Part this time, using HAPI_GetGroupMembership(). The membership information is a list of integers, one for each element (according to HAPI_GroupType), where 1 means the element is contained in the group while 0 means the element is not contained in the group. The size of this array is the same as HAPI_PartInfo_GetElementCountByGroupType() given the HAPI_PartInfo of the part you queried and the HAPI_GroupType.

Adding Groups

You can only add groups and set group memberships on input assets. See Marshalling Geometry Into Houdini.

To add a group to an input asset call HAPI_AddGroup() and give it the desired HAPI_GroupType and group name. Then, set the group's membership using HAPI_SetGroupMembership(), with the same HAPI_GroupType and group name as well as an integer array containing the memberships. This array should be the size given by HAPI_PartInfo_GetElementCountByGroupType() on the HAPI_PartInfo you used with HAPI_SetPartInfo() and your HAPI_GroupType.

For a full source sample on groups, see the Groups Sample.