|
HAPI_DECL | HAPI_LoadAssetLibraryFromFile (const HAPI_Session *session, const char *file_path, HAPI_Bool allow_overwrite, HAPI_AssetLibraryId *library_id) |
| Loads a Houdini asset library (OTL) from a .otl file. It does NOT create anything inside the Houdini scene. More...
|
|
HAPI_DECL | HAPI_LoadAssetLibraryFromMemory (const HAPI_Session *session, const char *library_buffer, int library_buffer_length, HAPI_Bool allow_overwrite, HAPI_AssetLibraryId *library_id) |
| Loads a Houdini asset library (OTL) from memory. It does NOT create anything inside the Houdini scene. More...
|
|
HAPI_DECL | HAPI_GetAvailableAssetCount (const HAPI_Session *session, HAPI_AssetLibraryId library_id, int *asset_count) |
| Get the number of assets contained in an asset library. You should call HAPI_LoadAssetLibraryFromFile() prior to get a library_id. More...
|
|
HAPI_DECL | HAPI_GetAvailableAssets (const HAPI_Session *session, HAPI_AssetLibraryId library_id, HAPI_StringHandle *asset_names_array, int asset_count) |
| Get the names of the assets contained in an asset library. More...
|
|
HAPI_DECL | HAPI_GetAssetInfo (const HAPI_Session *session, HAPI_NodeId node_id, HAPI_AssetInfo *asset_info) |
| Fill an asset_info struct from a node. More...
|
|
HAPI_DECL | HAPI_GetAssetDefinitionParmCounts (const HAPI_Session *session, HAPI_AssetLibraryId library_id, const char *asset_name, int *parm_count, int *int_value_count, int *float_value_count, int *string_value_count, int *choice_value_count) |
| Get the number of asset parameters contained in an asset library, as well as the number of parameter int, float, string, and choice values. More...
|
|
HAPI_DECL | HAPI_GetAssetDefinitionParmInfos (const HAPI_Session *session, HAPI_AssetLibraryId library_id, const char *asset_name, HAPI_ParmInfo *parm_infos_array, int start, int length) |
| Fill an array of HAPI_ParmInfo structs with parameter information for the specified asset in the specified asset library. More...
|
|
HAPI_DECL | HAPI_GetAssetDefinitionParmValues (const HAPI_Session *session, HAPI_AssetLibraryId library_id, const char *asset_name, int *int_values_array, int int_start, int int_length, float *float_values_array, int float_start, int float_length, HAPI_Bool string_evaluate, HAPI_StringHandle *string_values_array, int string_start, int string_length, HAPI_ParmChoiceInfo *choice_values_array, int choice_start, int choice_length) |
| Fill arrays of parameter int values, float values, string values, and choice values for parameters in the specified asset in the specified asset library. More...
|
|
HAPI_DECL | HAPI_GetAssetDefinitionParmTagName (const HAPI_Session *session, HAPI_AssetLibraryId library_id, const char *asset_name, HAPI_ParmId parm_id, int tag_index, HAPI_StringHandle *tag_name) |
|
HAPI_DECL | HAPI_GetAssetDefinitionParmTagValue (const HAPI_Session *session, HAPI_AssetLibraryId library_id, const char *asset_name, HAPI_ParmId parm_id, const char *tag_name, HAPI_StringHandle *tag_value) |
|
HAPI_DECL | HAPI_GetLoadedAssetLibraryCount (const HAPI_Session *session, int *count) |
| Gets the number of HDAs that have been loaded by Houdini. More...
|
|
HAPI_DECL | HAPI_GetAssetLibraryIds (const HAPI_Session *session, HAPI_AssetLibraryId *asset_library_ids_array, int start, int length) |
| Gets the HAPI_AssetLibraryId's for HDAs that are loaded in Houdini. More...
|
|
HAPI_DECL | HAPI_GetAssetLibraryFilePath (const HAPI_Session *session, HAPI_AssetLibraryId asset_library_id, HAPI_StringHandle *file_path_sh) |
| Gets the HAPI_StringHandle for the file path of a loaded asset library. More...
|
|
HAPI_DECL HAPI_GetAssetDefinitionParmCounts |
( |
const HAPI_Session * |
session, |
|
|
HAPI_AssetLibraryId |
library_id, |
|
|
const char * |
asset_name, |
|
|
int * |
parm_count, |
|
|
int * |
int_value_count, |
|
|
int * |
float_value_count, |
|
|
int * |
string_value_count, |
|
|
int * |
choice_value_count |
|
) |
| |
Get the number of asset parameters contained in an asset library, as well as the number of parameter int, float, string, and choice values.
This does not create the asset in the session. Use this for faster querying of asset parameters compared to creating the asset node and querying the node's parameters.
This does require HAPI_LoadAssetLibraryFromFile() to be called prior, in order to load the asset library and acquire library_id. Then HAPI_GetAvailableAssetCount and HAPI_GetAvailableAssets should be called to get the asset_name.
- Parameters
-
[in] | session | The session of Houdini you are interacting with. See Sessions for more on sessions. Pass NULL to just use the default in-process session. |
[in] | library_id | Returned by HAPI_LoadAssetLibraryFromFile(). |
[in] | asset_name | Name of the asset to get the parm counts for. |
[out] | parm_count | The number of parameters in the asset library. |
[out] | int_value_count | The number of int values for parameters in the asset library. |
[out] | float_value_count | The number of float values for parameters in the asset library. |
[out] | string_value_count | The number of string values for parameters in the asset library. |
[out] | choice_value_count | The number of choice values for parameters in the asset library. |
HAPI_DECL HAPI_GetAssetDefinitionParmValues |
( |
const HAPI_Session * |
session, |
|
|
HAPI_AssetLibraryId |
library_id, |
|
|
const char * |
asset_name, |
|
|
int * |
int_values_array, |
|
|
int |
int_start, |
|
|
int |
int_length, |
|
|
float * |
float_values_array, |
|
|
int |
float_start, |
|
|
int |
float_length, |
|
|
HAPI_Bool |
string_evaluate, |
|
|
HAPI_StringHandle * |
string_values_array, |
|
|
int |
string_start, |
|
|
int |
string_length, |
|
|
HAPI_ParmChoiceInfo * |
choice_values_array, |
|
|
int |
choice_start, |
|
|
int |
choice_length |
|
) |
| |
Fill arrays of parameter int values, float values, string values, and choice values for parameters in the specified asset in the specified asset library.
This does not create the asset in the session. Use this for faster querying of asset parameters compared to creating the asset node and querying the node's parameters. Note that only default values are retrieved.
This does require HAPI_LoadAssetLibraryFromFile() to be called prior, in order to load the asset library and acquire library_id. HAPI_GetAssetDefinitionParmCounts should be called prior to acquire the counts for the sizes of the values arrays.
- Parameters
-
[in] | session | The session of Houdini you are interacting with. See Sessions for more on sessions. Pass NULL to just use the default in-process session. |
[in] | library_id | Returned by HAPI_LoadAssetLibraryFromFile(). |
[in] | asset_name | Name of the asset to get the parm counts for. |
[out] | int_values_array | Array of ints at least the size of int_length. |
[in] | int_start | First index of range for int_values_array. Must be at least 0 and at most int_value_count - 1 acquired from HAPI_GetAssetDefinitionParmCounts. |
[in] | int_length | Must be at least 0 and at most int_value_count - int_start acquired from HAPI_GetAssetDefinitionParmCounts. |
[out] | float_values_array | Array of floats at least the size of float_length. |
[in] | float_start | First index of range for float_values_array. Must be at least 0 and at most float_value_count - 1 acquired from HAPI_GetAssetDefinitionParmCounts. |
[in] | float_length | Must be at least 0 and at most float_value_count - float_start acquired from HAPI_GetAssetDefinitionParmCounts. |
[in] | string_evaluate | Whether or not to evaluate the string expressions. For example, the string "$F" would evaluate to the current frame number. So, passing in evaluate = false would give you back the string "$F" and passing in evaluate = true would give you back "1" (assuming the current frame is 1). |
[out] | string_values_array | Array of HAPI_StringHandle at least the size of string_length. |
[in] | string_start | First index of range for string_values_array. Must be at least 0 and at most string_value_count - 1 acquired from HAPI_GetAssetDefinitionParmCounts. |
[in] | string_length | Must be at least 0 and at most string_value_count - string_start acquired from HAPI_GetAssetDefinitionParmCounts. |
[out] | choice_values_array | Array of HAPI_ParmChoiceInfo at least the size of choice_length. |
[in] | choice_start | First index of range for choice_values_array. Must be at least 0 and at most choice_value_count - 1 acquired from HAPI_GetAssetDefinitionParmCounts. |
[in] | choice_length | Must be at least 0 and at most choice_value_count - choice_start acquired from HAPI_GetAssetDefinitionParmCounts. |
Get the names of the assets contained in an asset library.
The asset names will contain additional information about the type of asset, namespace, and version, along with the actual asset name. For example, if you have an Object type asset, in the "hapi" namespace, of version 2.0, named "foo", the asset name returned here will be: hapi::Object/foo::2.0
However, you should not need to worry about this detail. Just pass this string directly to HAPI_CreateNode() to create the node. You can then get the pretty name using HAPI_GetAssetInfo().
You should call HAPI_LoadAssetLibraryFromFile() prior to get a library_id. Then, you should call HAPI_GetAvailableAssetCount() to get the number of assets to know how large of a string handles array you need to allocate.
- Parameters
-
[in] | session | The session of Houdini you are interacting with. See Sessions for more on sessions. Pass NULL to just use the default in-process session. |
[in] | library_id | Returned by HAPI_LoadAssetLibraryFromFile(). |
[out] | asset_names_array | Array of string handles (integers) that should be at least the size of asset_count. |
[in] | asset_count | Should be the same or less than the value returned by HAPI_GetAvailableAssetCount(). |
Loads a Houdini asset library (OTL) from memory. It does NOT create anything inside the Houdini scene.
- Note
- This is when we actually check for valid licenses.
Please note that the performance benefit of loading a library from memory are negligible at best. Due to limitations of Houdini's library manager, there is still some disk access and file writes because every asset library needs to be saved to a real file. Use this function only as a convenience if you already have the library file in memory and don't wish to have to create your own temporary library file and then call HAPI_LoadAssetLibraryFromFile().
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.
- Note
- The saved HIP file using HAPI_SaveHIPFile() will contain the OTL loaded as part of its Embedded OTLs. This means that you can safely move or rename the original OTL file and the HIP will continue to work but if you make changes to the OTL while using the saved HIP the changes won't be saved to the original OTL. See Saving a HIP File.
- Parameters
-
[in] | session | The session of Houdini you are interacting with. See Sessions for more on sessions. Pass NULL to just use the default in-process session. |
[in] | library_buffer | The memory buffer containing the asset definitions in the same format as a standard Houdini .otl file. |
[in] | library_buffer_length | The size of the OTL memory buffer. |
[in] | 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_ASSET_DEF_ALREADY_LOADED. |
[out] | library_id | Newly loaded otl id to be used with HAPI_GetAvailableAssetCount() and HAPI_GetAvailableAssets(). |