HumanIK supplies a set of functions for saving objects to files on disk, and for restoring those objects to memory from the saved files. Although it is unlikely that you will need to call these functions at runtime during the course of your game, these files can be an effective and efficient way to provide Autodesk Support with information in the event that you encounter a problem using HumanIK.
Several of the samples supplied with HumanIK use these functions internally. For example, the MayaHIK sample allows you to load HumanIK objects from saved files, which can help you to visualize the characterization pose maintained by an HIKCharacter, or the pose contained in an HIKCharacterState.
All of the functions for saving and loading objects are implemented inline in the hikdump.h file. You are free to redesign their approaches to file and memory management to suit your own development environment.
You can save and load the following object types using the functions listed in the table below:
| object type |
save function |
load function |
|---|---|---|
| HIKCharacter | see also HIKWriteToStream() |
see also HIKReadFromStream() |
| HIKCharacterState | ||
| HIKEffectorSetState | ||
| HIKPropertySetState | ||
| data set |
The default implementations of all of these file loading functions invoke the malloc function directly to allocate memory for the new object. When you are finished using the objects created by these file loading methods, you should destroy them using the functions described in Cleanup.
The file management functions described above transparently swap the endianness of the data files when necessary. If you save an object to a file on a big-endian platform, you can load that file on a little-endian platform such as a Windows machine, and vice-versa.