Houdini Engine 1.9
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Geometry Caching

Houdini supports saving geometry data to a variety of files, and this functionality can now be accessed through Houdini Engine. Given a unique set of asset, object, and geo ids that identifies a geometry, the data in the geometry may be dumped to either a file or a memory buffer. A corresponding load function can later read the file or memory and put the geometry back onto a node.

Saving and Loading Files

The HAPI_SaveGeoToFile() function takes a file name and saves the geometry to the file. The format of the file will be determined by its extension. Supported formats include:

  • abc
  • bhclassic.lzma
  • bhclassic.bz2
  • bgeo
  • bgeo.bz2
  • bgeo.lzma
  • dxf
  • eps, ai
  • geo.bx2
  • geo.lzma
  • hclassic.bz2
  • hclassic.lzma
  • iges, igs
  • lw, lwo
  • obj
  • ply
  • stl, bstl
  • pc, pmap To load a geometry file back, use the HAPI_LoadGeoFromFile() function.

Saving and Loading Memory buffers

To Save to memory, first use the HAPI_GetGeoSize() function to get the size of the buffer required to store the geometry in the format you requested. Note that this operation is stateful, as it will cache the geometry in memory. When the HAPI_SaveGeoToMemory() function is called next, the cached geometry will be copied into the buffer provided. HAPI_LoadGeoFromMemory() is the loading counterpart to put the data back onto a SOP node. Finally, note that as only the bgeo format is native to Houdini, it is the most efficient to save and load. All other formats require an internal conversion mechanism, and the architecture of that system is designed to hit the file system - so those operations will be much slower than saving and loading the bgeo format.