Houdini Engine 7.0
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Presets

Functions

HAPI_DECL HAPI_GetPresetBufLength (const HAPI_Session *session, HAPI_NodeId node_id, HAPI_PresetType preset_type, const char *preset_name, int *buffer_length)
 Generate a preset blob of the current state of all the parameter values, cache it, and return its size in bytes. More...
 
HAPI_DECL HAPI_GetPreset (const HAPI_Session *session, HAPI_NodeId node_id, char *buffer, int buffer_length)
 Generates a preset for the given asset. More...
 
HAPI_DECL HAPI_SetPreset (const HAPI_Session *session, HAPI_NodeId node_id, HAPI_PresetType preset_type, const char *preset_name, const char *buffer, int buffer_length)
 Sets a particular asset to a given preset. More...
 
HAPI_DECL HAPI_GetPresetCount (const HAPI_Session *session, const char *buffer, int buffer_length, int *count)
 Gets the number of presets in an IDX file. When this method is called, the names of the presets are stored in a single internal buffer from which they can be retrieved by calling HAPI_GetPresetNames(). More...
 
HAPI_DECL HAPI_GetPresetNames (const HAPI_Session *session, const char *buffer, int buffer_length, HAPI_StringHandle *preset_names_array, int count)
 Gets the names of presets in an IDX file. HAPI_GetPresetCount() must be called before calling this method. See the HAPI_GetPresetCount() documentation for more information. More...
 

Detailed Description

Functions for working with Node presets

Function Documentation

HAPI_DECL HAPI_GetPreset ( const HAPI_Session session,
HAPI_NodeId  node_id,
char *  buffer,
int  buffer_length 
)

Generates a preset for the given asset.

Parameters
[in]sessionThe session of Houdini you are interacting with. See Sessions for more on sessions. Pass NULL to just use the default in-process session.
[in]node_idThe exposed node id.
[out]bufferBuffer to hold the preset data.
[in]buffer_lengthSize of the buffer. Should be the same as the length returned by HAPI_GetPresetBufLength().
HAPI_DECL HAPI_GetPresetBufLength ( const HAPI_Session session,
HAPI_NodeId  node_id,
HAPI_PresetType  preset_type,
const char *  preset_name,
int *  buffer_length 
)

Generate a preset blob of the current state of all the parameter values, cache it, and return its size in bytes.

Parameters
[in]sessionThe session of Houdini you are interacting with. See Sessions for more on sessions. Pass NULL to just use the default in-process session.
[in]node_idThe exposed node id.
[in]preset_typeThe preset type.
[in]preset_nameOptional. This is only used if the preset_type is HAPI_PRESETTYPE_IDX. If NULL is given, the preset name will be the same as the name of the node with the given node_id.
[out]buffer_lengthSize of the buffer.
HAPI_DECL HAPI_GetPresetCount ( const HAPI_Session session,
const char *  buffer,
int  buffer_length,
int *  count 
)

Gets the number of presets in an IDX file. When this method is called, the names of the presets are stored in a single internal buffer from which they can be retrieved by calling HAPI_GetPresetNames().

Note that calling HAPI_GetPresetCount() will overwrite the preset names that were previously stored in the internal buffer. Therefore, ensure that you have called HAPI_GetPresetNames() before calling HAPI_GetPresetCount() again.

Parameters
[in]sessionThe session of Houdini you are interacting with. See Sessions for more on sessions. Pass NULL to just use the default in-process session.
[in]bufferA buffer containing the raw binary data of the .idx file.
[in]buffer_lengthSize of the buffer.
[out]countNumber of presets in the file.
HAPI_DECL HAPI_GetPresetNames ( const HAPI_Session session,
const char *  buffer,
int  buffer_length,
HAPI_StringHandle preset_names_array,
int  count 
)

Gets the names of presets in an IDX file. HAPI_GetPresetCount() must be called before calling this method. See the HAPI_GetPresetCount() documentation for more information.

Parameters
[in]sessionThe session of Houdini you are interacting with. See Sessions for more on sessions. Pass NULL to just use the default in-process session.
[in]bufferA buffer containing the raw binary data of the .idx file. This should be the same buffer that was passed into HAPI_GetPresetCount().
[in]buffer_lengthSize of the buffer.
[out]preset_names_arrayArray of preset names to be filled
[in]countNumber of presets in the file. Should be the same as the count returned by HAPI_GetPresetCount()
HAPI_DECL HAPI_SetPreset ( const HAPI_Session session,
HAPI_NodeId  node_id,
HAPI_PresetType  preset_type,
const char *  preset_name,
const char *  buffer,
int  buffer_length 
)

Sets a particular asset to a given preset.

Parameters
[in]sessionThe session of Houdini you are interacting with. See Sessions for more on sessions. Pass NULL to just use the default in-process session.
[in]node_idThe exposed node id.
[in]preset_typeThe preset type.
[in]preset_nameOptional. This is only used if the preset_type is HAPI_PRESETTYPE_IDX. If NULL is give, the first preset in the IDX file will be chosen.
[in]bufferBuffer to hold the preset data.
[in]buffer_lengthSize of the buffer.