EvilEngine/ANIM

ANIM Importer
These are scripts to import most .ANIM files into 3ds Max. Note: they may look a little wonky or broken.

Format
Animation assets are stored using the SKB format. The overall format looks like this:

Header
The header is defined by an iAnimSKBHeader struct:


 * Magic is always 'SKB1'.
 * Flags
 * BoneCount is the number of bones in the model.
 * TimeCount is the number of times (frames) in the animation.
 * KeyCount is the total number of keyframes in the animation.
 * Scale

Keys
Each keyframe in the keys array is defined by an iAnimSKBKey struct:


 * TimeIndex is an index into the times array
 * Quat represents an quaternion rotation (X, Y, Z, W) for a bone at this keyframe.
 * Tran represents an offset position (X, Y, Z) for a bone at this keyframe.

Times
The times array maps each frame of the animation to a time in seconds. Typically this starts at 0 and increases by a multiple of 0.01666... (1/60th of a second). The last time in the animation can be interpreted as the length of the animation in seconds.

Offsets
The offsets array maps each bone in the model to a starting index in the keys array, for each time (frame) in the animation (except for the last one, because it signifies the end of the animation and doesn't have a keyframe associated with it).

For example, if a model has 3 bones, and each bone has a keyframe on every time (so 3 keyframes per time), then the offsets array would look like this: