This is when we actually check for valid licenses.
The next step is to call hapi.getAvailableAssetCount to get the number of assets contained in the library using the returned library_id. Then call hapi.getAvailableAssets to get the list of available assets by name. Use the asset names with hapi.createNode to actually create one of these nodes in the Houdini scene and get back an asset_id.
The HIP file saved using hapi.saveHIPFile will only have an absolute path reference to the loaded OTL meaning that if the OTL is moved or renamed the HIP file won’t load properly. It also means that if you change the OTL using the saved HIP scene the same OTL file will change as the one used with Houdini Engine. See hapi.saveHIPFile.
Usage ¶
loadAssetLibraryFromFile(session
: hapi.Session, file_path
: str
, allow_overwrite
: bool
) → int
Loads a Houdini asset library (OTL) from a .otl file. It does NOT create anything inside the Houdini scene.
session
The session of Houdini you are interacting with. See hapi.Session for more on sessions. Pass None to just use the default in-process session.
file_path
Absolute path to the .otl file.
allow_overwrite
With this true, if the library file being loaded contains asset definitions that have already been loaded they will overwrite the existing definitions. Otherwise, a library containing asset definitions that already exist will fail to load, returning a hapi.result of hapi.result.AssetDefAlreadyLoaded.
Returns library_id as a int
.