ANM File Format
The ANM File format is a supplement to information containing information
about animations about an object. What the ANM file does is separates
data into logical components. The animation data is assumed to be skeletal
animation with all of the joints' keyframes being in a linear time space.
The ANM file breaks the joints into animation sets then breaks the linear
list of keyframes on those joints into different animations.
The associated file that the ANM supplements is called the Model File.
The Model File consists of a model with a skeleton consisting of a hierarchy
of joints and keyframes on these joints. Each bone has a name.
The ANM file format also inserts event information to parallel the keyframe
list. This data specifies events (callbacks) to occur at that time.
There are 6 types of lines in the ANM file format. The file format is
case-sensitive on all values and is parsed line-by-line. Strings/values
denoted by <> or [] must not have spaces or tabs in them, but may
have any amount of space or tab characters between them. <> means
a required value, [] is an optional value.
- Blank line - this line type is completely ignored.
- Line starting with hash (#) - also completely ignored. The rest of
the line is a comment.
- AS line - Animation Set. This line declares the start of a new animation
set. An animation set is a group of bones and a group of time ranges
to use as the source of the animations for those bones
- Format: as <SetName>
- SetName is the name of the set, can be any valid string
- Example: as Head_Animations
- Creates a new animation set called "Head_Animations"
- BL line - Bone List. This line adds a new set of bones to the animation
set. The bones specified are added by using a set union operation --
the current set of bones for an animation set is the set of its current
bones unioned with the specified set. Because bones are in a set, duplications
will not occur.
- Format: bl <BoneName> [+children] [+parent]
- BoneName is the name of the bone that must match the bone's
name in the Model File. This bone is included in the set.
- +chidren will include all of the specified bone's children
in the set
- +parent will include the specified bone's parent in the set.
- the children and parent tokens can be in either order.
- Example: bl lShoulder +children
- a bone list consisting of the lShoulder bone and all of its
children should be added into the bone set for the animation
set.
- EV line - Event. This line adds a new event to the animation data
specified in the Model File. While the Model File specifies keyframes,
model file formats typically do not have a way of specifying game events
in that data. It is important to note the time for the event is relative
to the global keyframe list and NOT to the specific animations.
- Format: ev <eventTime> <eventName>
- eventTime the time the event occurs in frames (24 frames/sec)
- eventName name for the event passed to the animation player.
- Example: ev 15 footstep
- At frame 15 the event footstep occurs
- AN line - Animation. This line adds an animation to the animation
set based on a time range. The animation pulls all keyframes and events
out of the data between the given time ranges, inclusive of start and
end time. The starting and ending time for the resulting animation is
not defined by the given time values, but by the first event/keyframe
and the last event/keyframe found.
- Format: an <startTime> <endTime> <animName>
- Example: an 5 10 walk
- The data for the walk animation is found in the time range from
5 to 10, inclusive.
Order
The ANM file consists of the previously defined 4 significant lines in
order defined by this finite state diagram:
Essentially, each ANM file consists of 1 or more animation sets, and
each animation set consists of 1 or more BL, 0 or more EV, and 1 or more
AN. For a given AS, all BLs for that set appear before all EVs that appear
before all AN lines.
Example
#lines starting with # and blank lines are ignored
as LeftArm
bl lShoulder +children
#for Cylindro, this would be the same as:
#bl lElbow +parent +children
ev 48 Hi
an 0 50 Hello
an 56 100 Wave
as Head
bl neck
bl head
an 0 50 Bobbing
as Legs
bl lHip +parent +children
bl rHip +children
ev 5 footstep_sound
ev 10 footstep_sound
an 0 24 walk
an 30 50 jog
an 55 100 run
This example is based on the Cylindro model whose skeleton is described
by the following tree:
All content on this web site is copyright © 1998-2020 by Jason Winnebeck, unless otherwise noted.