One blend track of an animation graph. A track is an
independent slot that plays clips. It holds the clip that plays now, the clip that
fades out, and a queue of clips that wait. A clip names its track with
mTrackDataName. A clip that starts on a track replaces the clip that was there, and
the track cross-fades between the two (see AnimationGraphData.mBlendDataTable).
A track is active while it plays a clip or still fades one out. Each frame the
client combines the active tracks into one pose:
- No active track: the bind pose.
- One active track: the pose of that track, unchanged. The clip's
mask,
mBlendWeight and mBlendMode are not applied.
- Two or more active tracks: the client goes through the tracks in ascending
mPriority. Every joint starts with a weight budget of 1. For each joint, a
normal track asks for a weight: the mask weight of its clip, times the fade weight
of the clip, times mBlendWeight. The track gets that weight or what is left of the
budget, whichever is smaller, and the remainder stays for the tracks after it. An
additive track adds its pose on top of the result so far and takes nothing from the
budget.
So where two normal tracks move the same joint, the track with the lower
mPriority wins. A later track shows only on joints where the earlier tracks left
some of the budget, for example joints that their masks set to 0. When no joint has
budget left, the client skips the remaining normal tracks.
When a clip ends. A clip that is not looping and has nothing queued behind it
leaves its track. The track fades it out, and during the fade it shows the clip's last
frame with a falling weight, so the tracks after it take over. On a normal track that
is the only active normal track there is no fade: the pose changes at once to the bind
pose and any additive tracks. The track does not start another clip by itself; the
game asks for the next clip, see AnimationGraphData.