Houdini Engine for Unity
|
The plug-in can be used programmatically instead of just through the UI. This allows to create custom tools and workflows around Houdini Engine, but does require knowledge of C# scripting within Unity.
There are several layers of programmatic interfaces available, ordered from high to low levels of access:
The layers are described below. Note that these layers are loosely defined and can be used together if needed.
As of Houdini 19, all classes and functions intended to be a part of the public API (With the exception of PDG-related classes) inherit from interface classes, prefixed by I. Here are examples of some of some interfaces that you may find useful to look over:
This is the highest programming interface layer available, and is used by the plug-in's own user interface to query and interact with Houdini Engine. It is recommended to use this layer if working with HDAs for simple parameter querying and manipulation.
The layer covers several classes:
An example of using this layer can be found in Plugins/HoudiniEngineUnity/Scripts/Examples/HEU_ExampleEvergreenQuery.cs. Another great example is the HEU_HoudiniAsset::DuplicateAsset function which instantiates an HDA, and copies data from another HDA.
This is considered a mid-level programming interface layer, and is widely used by the plug-in to interact with the Houdini Engine. It is recommended to use this layer if working with HDAs, nodes, connections, and building more complex networks dynamically.
The layer covers several utility classes:
An example of using this layer can be found in Plugins/HoudiniEngineUnity/Scripts/Examples/HEU_ScriptMeshInputUVLayoutExample.cs. It shows how to create input node, upload mesh data, connect to a UVLayout node, and generate the output mesh as a copy or replace it.
This is the lowest programming interface layer in the plug-in. This is essentially directly interacting with Houdini Engine API (HAPI) using the imported native functions and data structures. It is recommended to use this layer if need full control over the use of Houdini Engine within Unity, and wanting to forego the use of the plug-in.
The layer consists of just the import classes:
A good reference for usage of this layer is the Houdini Engine API documentation. Another good reference would be the plug-in code itself, such as the higher level layers described above.