-
Notifications
You must be signed in to change notification settings - Fork 109
mesh_anim
Format for mesh animation files.
\
Mesh animations, as discussed in this document will refer to animations scripted in Lightwave that apply to the hierarchical members of a mesh. These are not to be confused with procedural animations such as articulating gun meshes in the game currently.
\
Mesh animation files will be a simplified version of .NIS files. They will have a set of keyframes for a number of objects. Unlike NIS’s, these animations can be hierarchical and are designed to be used with mesh bindings, like the turret animation bindings currently in the game. They will not have camera animations, and will have multiple animation sequences (**) within a single file. They will have the extension .MAD.
\
First, a few notes on this format. Pointers are considered to be offsets from the start of the files, unless they are string pointers in which case, they are offsets from the start of the string block.
\
Now, on with the file format. It will start with a pretty familiar-looking header:
Name
Type
Purpose
Identifier
char[8]
Compared to “Mellonn” to verify file type
Version
Float
File version, starting with 1.0
StringBlockLength
Sdword
Length of string block.
StringBlock
Char *
Pointer to string block which will be used for fixing up bindings.
Length
Float
Length (in seconds) of all animations.
Nobjects
Sdword
Number of objects in animations
NkeyFrames
Sdword
Number of keyframes for all animations
Nanimations
Sdword
Number of separate animations in this file.
Times
Pointer to floats
List of times for keyframes.
Paths[6]
Pointers to lists of floats
Keyframes for the animation in the order of x, y, z, h, p, b
Animation
Array of structures
Animation information blocks
\
\
\
\
The format for animations is similar to the spaceobjpath structures used in .NIS files. It contains information on the length of the separate animations in the file.
\
Name
Type
Purpose
Name
Char *
Pointer to name of the object.
StartTime
Float
Time (seconds) of the start of the animation.
EndTime
Float
Time (seconds) of the end of the animation.
StartKeyFrame
Sdword
Index of starting keyframe
EndKeyFrame
Sdword
Index of last keyframe
\
\
\
\
The overall format of this file will be as follows:
-
Header, including animation info structures
-
Times data
-
Keyframe arrays
-
String data block
\
That’s it