HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Houdini USD Integration

Plugins for Houdini's USD Library

Building a USD plugin to run with Houdini is exactly the same as building a USD plugin to run against any other USD library. When loading plugins, the USD library looks for plugInfo.json files in the path specified by the PXR_PLUGINPATH_NAME environment variable. In addition, Houdini will call PlugRegistry::GetInstance().RegisterPlugins() for any directory specified in the HOUDINI_USD_DSO_PATH environment variable. This value defaults to HOUDINI_DSO_PATH/usd_plugins, and HOUDINI_DSO_PATH defaults to HOUDINI_PATH/dso. So without any environment overrides, Houdini will load USD plugins from PXR_PLUGINPATH_NAME and the dso/usd_plugins subdirectory of each HOUDINI_PATH directory.

The USD library itself loads it own plugins, so standard Houdini mechanisms for reporting on plugin loading will not track the loading of USD plugins. Instead, USD plugin loading should be debugged by setting the environment variable TF_DEBUG=PLUG_*.

Houdini ships with all the headers and libraries for its USD library, which means it is possible to compile and link custom USD plugins against Houdini's USD library. Binary plugins built against any other USD library will not be compatible with Houdini's USD library, and will not load. Codeless USD schemas however will load (assuming they are compatible with the USD version included with Houdini).

The HDK ships with one example USD plugin - a very simple asset resolver. This asset resolver can be built simply using hcustom, but the installation of the built binaries and associated plugInfo.json file must be done manually. Other build systems can simplify this process, though no examples are included in the HDK.

Replacing Houdini's USD Library

It should be possible to build any USD plugin against Houdini's USD library, and so this form of extension should satisfy the vast majority of use cases. However, in situations where changes internal the the USD library itself have been made, it is possible to completely replace the USD library that ships with Houdini. In order to do this, all Houdini code that interacts with the USD library must be recompiled and linked against your USD build. The code for these portions of Houdini can be found in the HoudiniUsdBridge repository on github (https://github.com/sideeffects/HoudiniUsdBridge).

Instructions for building and installing the HoudiniUsdBridge are available on the github repository. This process is considerably more complex than rebuilding a few USD plugins, so this should be the option of last resort.

In addition to its primary purpose of allowing the replacement of Houdini's USD library, the HoudiniUsdBridge baseline also serves as an excellent reference for implementing USD algorithms in general, and LOP node capabilities in particular. It does not include the code for any actual LOP nodes, but it contains dozens of helper classes that are used by LOP nodes to perform manipulations of USD stages and SDF layers.