Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Get the display SOP node (inside the asset node)
- HAPI_NodeId display_node_id;
- int node_count;
- ENSURE_SUCCESS(HAPI_ComposeChildNodeList(NULL, g_asset_id, HAPI_NODETYPE_SOP, HAPI_NODEFLAGS_DISPLAY, true, &node_count));
- // If there are SOP children
- if (node_count > 0)
- {
- std::vector<HAPI_NodeId> child_nodes(node_count);
- ENSURE_SUCCESS(HAPI_GetComposedChildNodeList(NULL, g_asset_id, child_nodes.data(), node_count));
- display_node_id = child_nodes[0]; // Pick first display SOP node (could also inspect others)
- }
- else
- {
- std::cerr << "No display SOP node found in the HDA." << std::endl;
- return 1;
- }
- // Cook the SOP node if needed
- ENSURE_SUCCESS(HAPI_CookNode(NULL, display_node_id, &cookOptions));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement