Load/Store HumanIK Objects

Module description

This section describes the functions provided for saving HumanIK objects to files on disk, and for loading HumanIK objects into memory from saved files.

See also Saving and Loading HumanIK Objects.

Functions

void HIKDefaultAlignedFree (void *pAligned, HIKFree pFree)
 Frees a data block allocated using HIKDefaultAlignedMalloc(). More...
 
void * HIKDefaultAlignedMalloc (size_t pSize, size_t pAlignment, HIKMalloc pMalloc)
 Allocates a data block aligned to the pAlignment pointer boundary. More...
 
HIKCharacterHIKLoadCharacter (const char *pFileName, const char *pValidationString, HIKMalloc pMalloc)
 Load file pFileName, and create an HIKCharacter object from its contents. More...
 
HIKCharacterStateHIKLoadCharacterState (const char *pFileName, HIKCharacter *pCharacter, HIKMalloc pMalloc)
 Load file pFileName, and create an HIKCharacterState object from its contents. More...
 
void * HIKLoadDataBlock (const char *pFileName, HIKDataDescription &pDataDesc, HIKMalloc pMalloc)
 Load file pFileName, and create a data set from its contents according to the data description provided in the pDataDesc argument. More...
 
HIKEffectorSetStateHIKLoadEffectorState (const char *pFileName, HIKMalloc pMalloc)
 Load file pFileName, and create an HIKEffectorSetState object from its contents. More...
 
HIKPropertySetStateHIKLoadPropertySetState (const char *pFileName, HIKMalloc pMalloc)
 Load file pFileName, and create an HIKPropertySetState object from its contents. More...
 
bool HIKSaveCharacter (const char *pFileName, HIKCharacter *pCharacter, HIKMalloc pMalloc, HIKFree pFree, float pUnitScale=1.0f)
 Save HIKCharacter pCharacter to file pFileName. More...
 
bool HIKSaveCharacterState (const char *pFileName, HIKCharacter *pCharacter, HIKCharacterState *pState, int pTransformMode, float pUnitScale=1.0f)
 Save HIKCharacterState pState to file pFileName. More...
 
void HIKSaveDataBlock (const char *pFileName, const HIKDataDescription &pDataDesc, const void *pDataBlock)
 Save the data set located in memory at pDataBlock to file pFileName. More...
 
bool HIKSaveEffectorState (const char *pFileName, HIKEffectorSetState *pState, float pUnitScale=1.0f)
 Save HIKEffectorSetState pState to file pFileName. More...
 
bool HIKSavePropertySetState (const char *pFileName, HIKPropertySetState *pState, float pUnitScale=1.0f)
 Save HIKPropertySetState pState to file pFileName. More...
 

Function Documentation

void HIKDefaultAlignedFree ( void *  pAligned,
HIKFree  pFree 
)
inline

Frees a data block allocated using HIKDefaultAlignedMalloc().

Parameters
pAlignedPointer allocated using HIKDefaultAlignedMalloc().
pFreePointer to a memory de-allocation function. If you do not have a custom memory de-allocation function, use &free.
void * HIKDefaultAlignedMalloc ( size_t  pSize,
size_t  pAlignment,
HIKMalloc  pMalloc 
)
inline

Allocates a data block aligned to the pAlignment pointer boundary.

This allocator is used in HIKSaveDataBlock() to align the resulting dataset to 16 bytes.

Parameters
pSizeSize of the block of data to allocate.
pAlignmentRequired address alignment.
pMallocPointer to a memory allocation function. If you do not have a custom memory allocation function, use &malloc.
Returns
A void pointer to the aligned block. You must use HIKDefaultAlignedFree() to free this memory.
HIKCharacter * HIKLoadCharacter ( const char *  pFileName,
const char *  pValidationString,
HIKMalloc  pMalloc 
)
inline

Load file pFileName, and create an HIKCharacter object from its contents.

Parameters
pFileNamePath and file name of the file to load.
pValidationStringThe customer identification string given to you by Autodesk to license the use of HumanIK in your project.
pMallocPointer to a memory allocation function. If you do not have a custom memory allocation function, use &malloc.
Returns
An HIKCharacter object if the file is valid, otherwise NULL.
HIKCharacterState * HIKLoadCharacterState ( const char *  pFileName,
HIKCharacter pCharacter,
HIKMalloc  pMalloc 
)
inline

Load file pFileName, and create an HIKCharacterState object from its contents.

Parameters
pFileNamePath and file name of the file to load.
pCharacterHIKCharacter used to create the HIKCharacterState loaded from the file.
pMallocPointer to a memory allocation function. If you do not have a custom memory allocation function, use &malloc.
Returns
An HIKCharacterState if the file is valid, otherwise NULL.
void * HIKLoadDataBlock ( const char *  pFileName,
HIKDataDescription pDataDesc,
HIKMalloc  pMalloc 
)
inline

Load file pFileName, and create a data set from its contents according to the data description provided in the pDataDesc argument.

For more information about data sets, see Setting and Retrieving Animation Data.

Parameters
pFileNamePath and file name of the file to load.
pDataDescData description that defines the memory layout of the data set contained in the file.
pMallocPointer to a memory allocation function. If you do not have a custom memory allocation function, use &malloc.
Returns
A void pointer to the new data set.
HIKEffectorSetState * HIKLoadEffectorState ( const char *  pFileName,
HIKMalloc  pMalloc 
)
inline

Load file pFileName, and create an HIKEffectorSetState object from its contents.

Parameters
pFileNamePath and file name of the file to load.
pMallocPointer to a memory allocation function. If you do not have a custom memory allocation function, use &malloc.
Returns
An HIKEffectorSetState if the file is valid, otherwise NULL.
HIKPropertySetState * HIKLoadPropertySetState ( const char *  pFileName,
HIKMalloc  pMalloc 
)
inline

Load file pFileName, and create an HIKPropertySetState object from its contents.

Parameters
pFileNamePath and file name of the file to load.
pMallocPointer to a memory allocation function. If you do not have a custom memory allocation function, use &malloc.
Returns
An HIKPropertySetState if the file is valid, otherwise NULL.
bool HIKSaveCharacter ( const char *  pFileName,
HIKCharacter pCharacter,
HIKMalloc  pMalloc,
HIKFree  pFree,
float  pUnitScale = 1.0f 
)
inline

Save HIKCharacter pCharacter to file pFileName.

Where possible, it is recommended that you use the HIKWriteToStream() function to export your HIKCharacter instead, as it saves more information about your character. See HIKWriteToStream() and HIKReadFromStream().

Parameters
pFileNamePath and file name of the file to create. If the file already exists, it is overwritten.
pCharacterHIKCharacter to be saved.
pMallocPointer to a memory allocation function. If you do not have a custom memory allocation function, use &malloc.
pFreePointer to a memory de-allocation function. If you do not have a custom memory de-allocation function, use &free.
Returns
True if the operation was succesful, otherwise false.
bool HIKSaveCharacterState ( const char *  pFileName,
HIKCharacter pCharacter,
HIKCharacterState pState,
int  pTransformMode,
float  pUnitScale = 1.0f 
)
inline

Save HIKCharacterState pState to file pFileName.

Parameters
pFileNamePath and file name of the file to create. If the file already exists, it is overwritten.
pCharacterThe HIKCharacter used to create the HIKCharacterState being saved.
pStateHIKCharacterState to save.
pTransformModeDetermines whether the Node transforms in the saved HIKCharacterState will be expressed in global space or local space. 0 = global space, 1 = local space.
Returns
True if the operation was succesful, otherwise false.
void HIKSaveDataBlock ( const char *  pFileName,
const HIKDataDescription pDataDesc,
const void *  pDataBlock 
)
inline

Save the data set located in memory at pDataBlock to file pFileName.

For more information about data sets, see Setting and Retrieving Animation Data.

Parameters
pFileNamePath and file name of the file to create. If the file already exists, it is overwritten.
pDataDescData description that defines the memory layout of the data set to be saved.
pDataBlockPointer to the beginning of the data set in memory.
bool HIKSaveEffectorState ( const char *  pFileName,
HIKEffectorSetState pState,
float  pUnitScale = 1.0f 
)
inline

Save HIKEffectorSetState pState to file pFileName.

Parameters
pFileNamePath and file name of the file to create. If the file already exists, it is overwritten.
pStateHIKEffectorSetState to save.
Returns
True if the operation was succesful, otherwise false.
bool HIKSavePropertySetState ( const char *  pFileName,
HIKPropertySetState pState,
float  pUnitScale = 1.0f 
)
inline

Save HIKPropertySetState pState to file pFileName.

Parameters
pFileNamePath and file name of the file to create. If the file already exists, it is overwritten.
pStateHIKPropertySetState to save.
Returns
True if the operation was succesful, otherwise false.