Houdini Engine 1.9
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Creating Assets From Python

Sometimes clients find it useful to be creating nodes through the use of Python scripts that run as part of an asset. While this is convenient and useful, normally nodes created this way are not supported in Houdini Engine, as it did not go through the HAPI interface, so the HAPI layer doesn't know anything about the newly created nodes. However, we have now added limited support for this feature. If the newly created nodes are at the /OBJ level, there are now functions you can call to cause HAPI to sync up with the new state of things, so that newly created nodes are recognized as HAPI assets:

To sync Houdini Engine with Python created assets at the /OBJ level:

  1. Create nodes at the /OBJ level using python.
  2. Get the number of assets that were created using HAPI_CheckForNewAssets().
  3. The the asset ids using HAPI_GetNewAssetIds().
  4. You will need to iterate through the assets load and call HAPI_CookAsset() on each.
  5. Assets loaded this way will behave exactly the same as regular OTL assets.