SpiecsEngine
 
Loading...
Searching...
No Matches

◆ CookAndPrintNode()

static void HoudiniEngine::CookAndPrintNode ( HAPI_Session & session,
HAPI_CookOptions & co,
HAPI_NodeId nodeId,
HAPI_PackedPrimInstancingMode mode )
static

Definition at line 159 of file HoudiniTestSource.h.

160 {
161 switch (mode)
162 {
163 case HAPI_PACKEDPRIM_INSTANCING_MODE_DISABLED:
164 std::cout << "Using: HAPI_PACKEDPRIM_INSTANCING_MODE_DISABLED" << std::endl;
165 break;
166 case HAPI_PACKEDPRIM_INSTANCING_MODE_HIERARCHY:
167 std::cout << "Using: HAPI_PACKEDPRIM_INSTANCING_MODE_HIERARCHY" << std::endl;
168 break;
169 case HAPI_PACKEDPRIM_INSTANCING_MODE_FLAT:
170 std::cout << "Using: HAPI_PACKEDPRIM_INSTANCING_MODE_FLAT" << std::endl;
171 break;
172 }
173
174 co.packedPrimInstancingMode = mode;
175
176 HE_CHECK(HAPI_CookNode(&session, nodeId, &co))
177
178 int cookStatus;
179 HAPI_Result cookResult;
180
181 do
182 {
183 cookResult = HAPI_GetStatus(&session, HAPI_STATUS_COOK_STATE, &cookStatus);
184 }
185 while(cookStatus > HAPI_STATE_MAX_READY_STATE && cookResult == HAPI_RESULT_SUCCESS);
186
187 HE_CHECK(cookResult)
188 HE_CHECK_COOK(cookStatus)
189
190 HAPI_NodeInfo nodeInfo;
191 HE_CHECK(HAPI_GetNodeInfo(&session, nodeId, &nodeInfo))
192
193 int childCount;
194 HE_CHECK(HAPI_ComposeChildNodeList(&session, nodeId, HAPI_NODETYPE_SOP, HAPI_NODEFLAGS_ANY, false, &childCount))
195
196 std::vector<HAPI_NodeId> childIds(childCount);
197 HE_CHECK(HAPI_GetComposedChildNodeList(&session, nodeId, childIds.data(), childCount))
198
199 for (int i = 0; i < childCount; ++i)
200 {
201 HAPI_GeoInfo geoInfo;
202 HE_CHECK(HAPI_GetGeoInfo(&session, childIds[i], &geoInfo))
203 std::cout << "Part count for geo node " << i << ": " << geoInfo.partCount << std::endl;
204
205 for (int j = 0; j < geoInfo.partCount; ++j)
206 {
207 PrintPartInfo(session, childIds[i], j, "");
208 }
209 }
210 }
#define HE_CHECK_COOK(expr)
HoudiniEngine Check Cook macro. Verify HoudiniEngine Cook API Effectiveness.
Definition HoudiniCore.h:32
#define HE_CHECK(expr)
HoudiniEngine Check macro. Verify HoudiniEngine API Effectiveness.
Definition HoudiniCore.h:17
static void PrintPartInfo(HAPI_Session &session, HAPI_NodeId nodeId, HAPI_PartId partId, std::string indent)