How to access multiple asset output in Engine 3.0

   214   2   0
User Avatar
9 posts
Joined: Nov. 2015
Hi everybody,

what is the common way in C++ to access multiple outputs of an asset that has been loaded into the houdini engine?

I created an asset that has 8 outputs with different geometries, these exists as OUT-nodes within the asset that are all marked as template. This was the way to do in Engine 2.0, now it seems that things have changed… in the end I need to save each output as an .obj file.

This is what I found in the documentation but the object list is zero. Node-id refers to the asset node (which as multiple outputs) that sits below a geo-node in the network.

int object_count;
HAPI_ComposeObjectList(NULL, node_id, nullptr, &object_count);

std::vector<HAPI_ObjectInfo> object_infos(object_count);
HAPI_GetComposedObjectList(NULL, node_id,, 0, object_count);

I also found different approaches by accessing child nodes, this way I can filter the child nodes down to the 8 outputs (using HAPI_NODEFLAGS_TEMPLATED) but I don't know how to get a geometry I can save from here.

Also I tried to connect Null-nodes to the outputs, here I found that HAPI_ConnectNodeInput doesn't even provide a way to select a specific output, it's like multiple outputs have disappeared in Engine 3.0, if so what's the new way?

Any help is appreciated
User Avatar
94 posts
Joined: Sept. 2016
Hi Daniel,

Sorry for the late reply, could you post a hip/hda file showing your setup?

HAPI_ComposeObjectList() / HAPI_GetComposedObjectList() will return the expected number of objects if each of your output is in a separate object network.

If you wanna keep using the templated flags, you should be able to access the templated nodes by calling
FHoudiniEngine::Get().GetSession(), ObjectNodeId,
true, &TempNodeCount );

and then HAPI_GetComposedChildNodeList()

You should then be able to get the templated node's geo by calling HAPI_GetGeoInfo() on the results of HAPI_ComposeChildNodeList().

Be sure to have the cookTemplatedGeos cook option set to true.
User Avatar
9 posts
Joined: Nov. 2015
Hi dpernuit,

thanks a lot for your reply. Here are three images of my file (the .hip file has been generated by the engine):

- one showing the Object level with my two input objects and the obj containing the asset.
- another image shows the insinde of the asset obj node that merges the two input nodes and pipes them into the asset node itself.
- the last images shows the out nodes inside my asset

As you can see my asset node has two inputs and two outputs, I would now like to access specifically one of these outputs without knowing what's happening within the asset.

I managed to read out the asset nodes geometry, which is basically what you would see in Houdini if you activate the node, in other words the node within the Asset that has the Display flag set.

Your method of using HAPI_ComposeChildNodeList() with HAPI_NODEFLAGS_TEMPLATED works in the sense that I get references to the two template nodes. But this is not really save, since from having references to these nodes I don't know which one is linkes to output 1 and which one stands for output 2. I can filter these nodes by their names, but since these nodes live inside my asset and can potentially change in a new version that would be a very bad style.

Isn't there a way of saying “here's a node ID (of my asset), give me the geo behind output #2” ?

Imagine what you would do if you were working in the Houdini GUI: in order to see the second output, you would probably create a NULL node, set the Display flag here and attach it to output 2. I could do the same in the engine and then just read out whatever geo i have on this NULL node - BUT I can't seem to be able to connect a node to a certain output, the function only lets me decide to which input I want to connect…. see my problem?

AssetNode.png (36.6 KB)
ObjNode.png (19.0 KB)
AssetOuts.png (29.4 KB)

  • Quick Links