59 {
60 std::cout << "Object" << objectNode << ", Geo" << geoNode << ", Part" << partId << std::endl;
61
62 HAPI_PartInfo partInfo;
63 HE_CHECK(HAPI_GetPartInfo(&session, geoNode, partId, &partInfo))
64
65 std::vector<HAPI_StringHandle> attributeNameSh(partInfo.attributeCounts[HAPI_ATTROWNER_POINT]);
66 HE_CHECK(HAPI_GetAttributeNames(&session, geoNode, partInfo.id, HAPI_ATTROWNER_POINT, attributeNameSh.data(), partInfo.attributeCounts[HAPI_ATTROWNER_POINT]))
67
68 for (int attribIndex = 0; attribIndex < partInfo.attributeCounts[HAPI_ATTROWNER_POINT]; ++attribIndex)
69 {
70 std::string attribName =
GetString(session, attributeNameSh[attribIndex]);
71 std::cout << " " << attribName << std::endl;
72 }
73
74 std::cout << "Point Positions: " << std::endl;
75
76 ProcessFloatAttrib(session, assetInfo, objectNode, geoNode, partId, HAPI_ATTROWNER_POINT, "P");
77
78 std::cout << "Number of Faces: " << partInfo.faceCount << std::endl;
79
80 if (partInfo.type != HAPI_PARTTYPE_CURVE)
81 {
82 std::vector<int> faceCounts(partInfo.faceCount);
83
84 HE_CHECK(HAPI_GetFaceCounts(&session, geoNode, partId, faceCounts.data(), 0, partInfo.faceCount))
85
86 for (int ii = 0; ii < partInfo.faceCount; ++ii)
87 {
88 std::cout << faceCounts[ii] << ", ";
89 }
90
91 std::cout << std::endl;
92
93 std::vector<int> vertexList(partInfo.vertexCount);
94 HE_CHECK(HAPI_GetVertexList(&session, geoNode, partId, vertexList.data(), 0, partInfo.vertexCount))
95
96 std::cout << "Vertex Indices into Points array: " <<
std::endl;
97 int currIndex = 0;
98 for (int ii = 0; ii < partInfo.faceCount; ii++)
99 {
100 for (int jj = 0; jj < faceCounts[ii]; jj++)
101 {
102 std::cout << "Vertex: " << currIndex << ", belonging to face: "
103 << ii << ", index: "
104 << vertexList[currIndex] << "of points array\n";
105 currIndex++;
106 }
107 }
108 }
109 }
#define HE_CHECK(expr)
HoudiniEngine Check macro. Verify HoudiniEngine API Effectiveness.
static std::string GetString(HAPI_Session &session, HAPI_StringHandle stringHandle)