An animation event: something the client does at a given frame of a clip, such as
spawning a particle effect, playing a sound or hiding a submesh. Events are the values
of a clip's mEventDataMap (BlendableClipData.mEventDataMap,
SequencerClipData.mEventDataMap). This base class holds what all event kinds share:
when the event starts and ends.
Frames. Event frames are frames of the clip's own timeline. For an
AtomicClipData the frame is
time / mTickDuration + startFrame, the same frame number the pose uses. The clip's
time runs at the clip's playback speed, so a faster clip fires its events sooner, at
the same frames.
Start and end. An event starts on the first update in which the clip has reached
mStartFrame.
- With an
mEndFrame at or after mStartFrame, the event is active from the
start frame up to the end frame, and it ends when the clip reaches the end frame.
- With no
mEndFrame (the default -1), the event stays active until the clip loops
or stops.
Some event kinds do their work once, at the start. Others do it again on every frame
while the event is active. Only some kinds do something when the event ends: a
particle event stops its effect, and a
stop animation event lifts its block. For most
other kinds, what the event changed stays as it is.
Loops. When the clip loops, its events end and fire again on the next pass.
When the clip stops. A clip stops when it ends, or when another clip has replaced
it and the cross-fade is over. Each event that has started is then ended. While a clip
fades out it still runs, so its events still fire during the fade.
Skipped frames. If one update moves the clip past both frames of an event, the
event still starts and ends in that update.
A clip that starts in the middle. When a clip is started at a later position (a
condition clip that switches children can do this), events whose end frame has
already passed are skipped, and events whose range contains the position start at
once.