Houdini Engine 7.0
|
Parts contain the actual mesh/geometry/attribute data you're interested in.
Parts are computed based on the use of primitive groups within the geometry in Houdini. There will be 1 part per primitive group, plus another part containing all geometry that is not in a primitive group unless all primitives are part of at least one group. If within a primitive group there are multiple Houdini primitives, additional parts will be created per primitive. This splitting can be disabled via HAPI_CookOptions::splitGeosByGroup when passed in to HAPI_Initialize() or HAPI_CookNode(), among other APIs.
To get the HAPI_PartInfo, just call HAPI_GetPartInfo() with the HAPI_NodeId of the geo (SOP) node and the HAPI_PartId. The HAPI_PartId is just an index into the list of parts which can change order and size after every cook.
The total number of parts in a geo is given by HAPI_GeoInfo::partCount.
You can get the array of face counts, where the nth integer in the array is the number of vertices the nth face has, by calling HAPI_GetFaceCounts() with 0 and HAPI_PartInfo::faceCount as your max range.
You can get the array containing the vertex-point associations, where the ith element in the array is the point index to the ith vertex associates with, by calling HAPI_GetVertexList() with 0 and HAPI_PartInfo::vertexCount as your max range. As an example, if the first face had 3 vertices, the second face had 4 vertices and the third face had 5 vertices, then the first 3 integers in the vertex_list are the point indices belonging to the first face, the next 4 integers are those belonging to the second face, and the next 5 integers to the third face.
The vertex list contains only the indices to the points because vertices share points. There is a separate list of points, which are a list of 3 vectors, and the vertices index into this list of points. Thus the integers you retrieve from the vertex list are indices into the point list.
The actual point position information, along with all other geometry meta-data, is stored as Houdini attributes. See Attributes.
There are a couple of special part types to be aware of. The HAPI_PartType is given by HAPI_PartInfo::type. Here are some part types of note:
true
.true
.