Houdini Engine 7.0
|
In Houdini, nodes have direct inputs that only accept nodes of the same type (usually). For example, OBJ nodes accept only other OBJ nodes as direct (node -> line -> node) connections. With OBJ nodes, these connections are essentially transform parentings. A SOP geometry node can as well only accept SOP connections. However, you can have a node accept a different type of node via an exposed Operator Path parameter.
For example, an OBJ node can reference a SOP node and use its geometry by using Object Merge SOP nodes:
This is the parameter on the bject Merge SOP node the should be exposed:
More generally, any Operator Path parameter can be used to point to any other node:
Once you do this on your asset node, you can simply get or set the node being referenced by the Operator Path parameter using HAPI_GetParmNodeValue() and HAPI_SetParmNodeValue().
Geometry from the host can be marshalled into Houdini as a node to be connected as input to other existing nodes.
The process is as follows:
Detail attributes are different than point, vertex, or primitive attributes in the sense that there is only 1 detail for each geometry. Whereas one can have many points, vertices, and primitives, there is only 1 detail - so when marshalling detail attributes, the HAPI_AttributeInfo::count in the HAPI_AttributeInfo struct must always be set to 1. If one wants to attach multiple entries on the detail, one must make use of the HAPI_AttributeInfo::tupleSize field instead. The snippet below shows the marshalling of 3 strings onto the detail attribute:
With a slight variation of the above, point clouds can now be marshalled in. Simply set the HAPI_PartInfo::vertexCount and HAPI_PartInfo::faceCount fields to 0.
Remember that assets are just nodes. To connect assets to other assets or nodes directly, that is, not via a parameter but via a node connection, just use HAPI_ConnectNodeInput() and HAPI_DisconnectNodeInput(). See Connecting Nodes.