HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Caching

Functions

HAPI_DECL HAPI_GetActiveCacheCount (const HAPI_Session *session, int *active_cache_count)
 Get the number of currently active caches. More...
 
HAPI_DECL HAPI_GetActiveCacheNames (const HAPI_Session *session, HAPI_StringHandle *cache_names_array, int active_cache_count)
 Get the names of the currently active caches. More...
 
HAPI_DECL HAPI_GetCacheProperty (const HAPI_Session *session, const char *cache_name, HAPI_CacheProperty cache_property, int *property_value)
 Lets you inspect specific properties of the different memory caches in the current Houdini context. More...
 
HAPI_DECL HAPI_SetCacheProperty (const HAPI_Session *session, const char *cache_name, HAPI_CacheProperty cache_property, int property_value)
 Lets you modify specific properties of the different memory caches in the current Houdini context. This includes clearing caches, reducing their memory use, or changing how memory limits are respected by a cache. More...
 
HAPI_DECL HAPI_SaveGeoToFile (const HAPI_Session *session, HAPI_NodeId node_id, const char *file_name)
 Saves a geometry to file. The type of file to save is to be determined by the extension ie. .bgeo, .obj. More...
 
HAPI_DECL HAPI_LoadGeoFromFile (const HAPI_Session *session, HAPI_NodeId node_id, const char *file_name)
 Loads a geometry file and put its contents onto a SOP node. More...
 
HAPI_DECL HAPI_SaveNodeToFile (const HAPI_Session *session, HAPI_NodeId node_id, const char *file_name)
 Saves the node and all its contents to file. The saved file can be loaded by calling HAPI_LoadNodeFromFile. More...
 
HAPI_DECL HAPI_LoadNodeFromFile (const HAPI_Session *session, const char *file_name, HAPI_NodeId parent_node_id, const char *node_label, HAPI_Bool cook_on_load, HAPI_NodeId *new_node_id)
 Loads and creates a previously saved node and all its contents from given file. The saved file must have been created by calling HAPI_SaveNodeToFile. More...
 
HAPI_DECL HAPI_GetGeoSize (const HAPI_Session *session, HAPI_NodeId node_id, const char *format, int *size)
 Cache the current state of the geo to memory, given the format, and return the size. Use this size with your call to HAPI_SaveGeoToMemory() to copy the cached geo to your buffer. It is guaranteed that the size will not change between your call to HAPI_GetGeoSize() and HAPI_SaveGeoToMemory(). More...
 
HAPI_DECL HAPI_SaveGeoToMemory (const HAPI_Session *session, HAPI_NodeId node_id, char *buffer, int length)
 Saves the cached geometry to your buffer in memory, whose format and required size is identified by the call to HAPI_GetGeoSize(). The call to HAPI_GetGeoSize() is required as HAPI_GetGeoSize() does the actual saving work. More...
 
HAPI_DECL HAPI_LoadGeoFromMemory (const HAPI_Session *session, HAPI_NodeId node_id, const char *format, const char *buffer, int length)
 Loads a geometry from memory and put its contents onto a SOP node. More...
 

Detailed Description

Functions for working with memory and file caches

Function Documentation

HAPI_DECL HAPI_GetActiveCacheCount ( const HAPI_Session session,
int active_cache_count 
)

Get the number of currently active caches.

Parameters
[in]sessionThe session of Houdini you are interacting with. See HAPI_Sessions for more on sessions. Pass NULL to just use the default in-process session.
[out]active_cache_countThe number of currently active caches.
HAPI_DECL HAPI_GetActiveCacheNames ( const HAPI_Session session,
HAPI_StringHandle cache_names_array,
int  active_cache_count 
)

Get the names of the currently active caches.

Requires a valid active cache count which you get from: HAPI_GetActiveCacheCount().

Parameters
[in]sessionThe session of Houdini you are interacting with. See HAPI_Sessions for more on sessions. Pass NULL to just use the default in-process session.
[out]cache_names_arrayString array with the returned cache names. Must be at least the size of active_cache_count.
[in]active_cache_countThe count returned by HAPI_GetActiveCacheCount().
HAPI_DECL HAPI_GetCacheProperty ( const HAPI_Session session,
const char *  cache_name,
HAPI_CacheProperty  cache_property,
int property_value 
)

Lets you inspect specific properties of the different memory caches in the current Houdini context.

Parameters
[in]sessionThe session of Houdini you are interacting with. See HAPI_Sessions for more on sessions. Pass NULL to just use the default in-process session.
[in]cache_nameCache name from HAPI_GetActiveCacheNames().
[in]cache_propertyThe specific property of the cache to get the value for.
[out]property_valueReturned property value.
HAPI_DECL HAPI_GetGeoSize ( const HAPI_Session session,
HAPI_NodeId  node_id,
const char *  format,
int size 
)

Cache the current state of the geo to memory, given the format, and return the size. Use this size with your call to HAPI_SaveGeoToMemory() to copy the cached geo to your buffer. It is guaranteed that the size will not change between your call to HAPI_GetGeoSize() and HAPI_SaveGeoToMemory().

Parameters
[in]sessionThe session of Houdini you are interacting with. See HAPI_Sessions for more on sessions. Pass NULL to just use the default in-process session.
[in]node_idThe node id.
[in]formatThe file format, ie. ".obj", ".bgeo.sc" etc.
[out]sizeThe size of the buffer required to hold the output.
HAPI_DECL HAPI_LoadGeoFromFile ( const HAPI_Session session,
HAPI_NodeId  node_id,
const char *  file_name 
)

Loads a geometry file and put its contents onto a SOP node.

Parameters
[in]sessionThe session of Houdini you are interacting with. See HAPI_Sessions for more on sessions. Pass NULL to just use the default in-process session.
[in]node_idThe node id.
[in]file_nameThe name of the file to be loaded
HAPI_DECL HAPI_LoadGeoFromMemory ( const HAPI_Session session,
HAPI_NodeId  node_id,
const char *  format,
const char *  buffer,
int  length 
)

Loads a geometry from memory and put its contents onto a SOP node.

Parameters
[in]sessionThe session of Houdini you are interacting with. See HAPI_Sessions for more on sessions. Pass NULL to just use the default in-process session.
[in]node_idThe node id.
[in]formatThe file format, ie. "obj", "bgeo" etc.
[in]bufferThe buffer we will read the geometry from.
[in]lengthThe size of the buffer passed in.
HAPI_DECL HAPI_LoadNodeFromFile ( const HAPI_Session session,
const char *  file_name,
HAPI_NodeId  parent_node_id,
const char *  node_label,
HAPI_Bool  cook_on_load,
HAPI_NodeId new_node_id 
)

Loads and creates a previously saved node and all its contents from given file. The saved file must have been created by calling HAPI_SaveNodeToFile.

Parameters
[in]sessionThe session of Houdini you are interacting with. See HAPI_Sessions for more on sessions. Pass NULL to just use the default in-process session.
[in]file_nameThe name of the file to be loaded
[in]parent_node_idThe parent node id of the Geometry object.
[in]node_labelThe name of the new Geometry object.
[in]cook_on_loadSet to true if you wish the nodes to cook as soon as they are created. Otherwise, you will have to call HAPI_CookNode() explicitly for each after you call this function.
[out]new_node_idThe newly created node id.
HAPI_DECL HAPI_SaveGeoToFile ( const HAPI_Session session,
HAPI_NodeId  node_id,
const char *  file_name 
)

Saves a geometry to file. The type of file to save is to be determined by the extension ie. .bgeo, .obj.

Parameters
[in]sessionThe session of Houdini you are interacting with. See HAPI_Sessions for more on sessions. Pass NULL to just use the default in-process session.
[in]node_idThe node id.
[in]file_nameThe name of the file to be saved. The extension of the file determines its type.
HAPI_DECL HAPI_SaveGeoToMemory ( const HAPI_Session session,
HAPI_NodeId  node_id,
char *  buffer,
int  length 
)

Saves the cached geometry to your buffer in memory, whose format and required size is identified by the call to HAPI_GetGeoSize(). The call to HAPI_GetGeoSize() is required as HAPI_GetGeoSize() does the actual saving work.

Also note that this call to HAPI_SaveGeoToMemory will delete the internal geo buffer that was cached in the previous call to HAPI_GetGeoSize(). This means that you will need to call HAPI_GetGeoSize() again before you can call this function.

Parameters
[in]sessionThe session of Houdini you are interacting with. See HAPI_Sessions for more on sessions. Pass NULL to just use the default in-process session.
[in]node_idThe node id.
[out]bufferThe buffer we will write into.
[in]lengthThe size of the buffer passed in.
HAPI_DECL HAPI_SaveNodeToFile ( const HAPI_Session session,
HAPI_NodeId  node_id,
const char *  file_name 
)

Saves the node and all its contents to file. The saved file can be loaded by calling HAPI_LoadNodeFromFile.

Parameters
[in]sessionThe session of Houdini you are interacting with. See HAPI_Sessions for more on sessions. Pass NULL to just use the default in-process session.
[in]node_idThe node id.
[in]file_nameThe name of the file to be saved. The extension of the file determines its type.
HAPI_DECL HAPI_SetCacheProperty ( const HAPI_Session session,
const char *  cache_name,
HAPI_CacheProperty  cache_property,
int  property_value 
)

Lets you modify specific properties of the different memory caches in the current Houdini context. This includes clearing caches, reducing their memory use, or changing how memory limits are respected by a cache.

Parameters
[in]sessionThe session of Houdini you are interacting with. See HAPI_Sessions for more on sessions. Pass NULL to just use the default in-process session.
[in]cache_nameCache name from HAPI_GetActiveCacheNames().
[in]cache_propertyThe specific property of the cache to modify.
[in]property_valueThe new property value.