# Animation Sequencer

Blends multiple animation clips in a keyframed sequence with smooth transitions and multi-track layering capability.

{% hint style="success" %}
To add an Animation Sequencer, from the Quick Menu (Shift+T) select Add Behavior/Animation Sequencer

\
Alternatively, right-click an object in the Timeflow view and select Add Channel/Animation/Animation Sequencer
{% endhint %}

<figure><img src="https://2067910529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC3dOuetlQfYgK5FPUKgn%2Fuploads%2FbMGxgUHSDUhL4rLtxrFr%2Fimage.png?alt=media&#x26;token=43b12927-6f29-4e66-9e0a-fe153c2c2f03" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
An **Animator** component is required to use Animation Sequencer, though an Animator Controller is optional.
{% endhint %}

## When to Use

Animation Sequencer is best suited for creating smooth transitions between multiple animation clips. If you only need to play individual clips one at a time, use the [Animation Clips](https://axongenesis.gitbook.io/timeflow/reference/behaviors/animation/animation-clips) behavior, which also provides the ability to time remap the clip using keyframes.

{% hint style="success" %}
**Example Scenes**

Assets/AxonGenesis/Timeflow/Examples/Scenes/Animation/AnimationSequencer.unity
{% endhint %}

{% hint style="warning" %}
**Known Conflicts**

The components Animation Sequencer and Animation Clips cannot be used simultaneously on the same object. This is because the Animation Clips behavior completely disables and bypasses the Animator component, which is required by Animation Sequencer.&#x20;
{% endhint %}

## Inspector Overview

<figure><img src="https://2067910529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC3dOuetlQfYgK5FPUKgn%2Fuploads%2FHQMqaT894t3ywab3yVT0%2Fimage.png?alt=media&#x26;token=4bf1765e-955f-463c-b446-50cc28167c97" alt=""><figcaption></figcaption></figure>

### Time Scale

Scales playback speed for the entire sequence of clips. Use this to speed up or slow down the overall animation. This is combined with the time scale inherited through the Timeflow hierarchy.

### Avatar Mask

Optional filter that limits which transforms the sequencer drives. This applies to all animation clips played by the sequencer.\\

* &#x20;Humanoid: mask by body parts (upper body, hands, head…)
* Generic: mask by transform paths (ensure names match your rig)

For more information see the Unity documentation for [Avatar Masks](https://docs.unity3d.com/Manual/class-AvatarMask.html#Humanoid).

{% hint style="info" %}
Avatar Masks can also be applied to each layer track.
{% endhint %}

### Apply Root Motion

Toggles [Animator.applyRootMotion](https://docs.unity3d.com/ScriptReference/Animator-applyRootMotion.html) while the sequencer is active. This also allows Animation Sequencer to modify when root motion is applied with the following setting:

#### &#xD;Single Track Only

When enabled, root motion is applied only if exactly one track contributes to prevent drift from multi-track blends.

### &#xD;Blend Weight

Controls the overall blend between the base Animator (0.0) and the Animation Sequencer (1.0). This is only applicable if the Animator Controller has animation (underlying the Animation Sequencer).

* 0.0 = base Animator only
* 0.5 = equal blend
* 1.0 = sequencer animation overrides base Animator

### Additive

Enable Additive mode if you want to blend the Animation Sequencer with the base Animator animation. Or turn this off for the sequencer to overwrite the Animator. With either Additive enabled or not, mixing with the base Animator is also affected by the [#blend-weight](#blend-weight "mention")

### Animation Clips

This section lists all of the animation clips available to the sequencer. Animation clips are automatically added from the Animator component when the Animation Sequencer is first applied. You may also add more individually by pressing the + button.

<figure><img src="https://2067910529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC3dOuetlQfYgK5FPUKgn%2Fuploads%2F8ymmCvQBbqLxIrsDY04p%2Fimage.png?alt=media&#x26;token=346cdcfc-49c3-4a70-88c2-16bc2866ee7d" alt=""><figcaption></figcaption></figure>

After a new slot is created by pressing the + button, assign an Animation Clip asset by dragging and dropping it from the Project window, or click the target icon on the right to search the project for a clip.

#### Clear All

Removes all animation clips from the list.&#x20;

{% hint style="warning" %}
Clearing all animation clips will also cause any sequencer keyframes to lose their animation clip assignments.
{% endhint %}

#### Sort

Sorts the list of animations alphabetically. This only affects the display in the inspector and does not impact sequencer keyframes.

#### Reload

Click this button to repopulate the list of animation clips with those used in the Animator Controller.

## Track Layers

In the Timeflow view, animation clip sequences are created using keyframes on a Clip Track. Multiple tracks may be added as need to layer animation.&#x20;

<figure><img src="https://2067910529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC3dOuetlQfYgK5FPUKgn%2Fuploads%2FJYo8HsurGhPYME3mezwo%2Fimage.png?alt=media&#x26;token=347cbc92-95fa-4b43-9a61-909c42010e18" alt=""><figcaption></figcaption></figure>

### Adding Tracks

To create a new clip track, right click on any existing track and select Add Animation Sequencer Track.

<figure><img src="https://2067910529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC3dOuetlQfYgK5FPUKgn%2Fuploads%2FVByfIWhHvtenvvFLm0o8%2Fimage.png?alt=media&#x26;token=584d26f8-8d8a-4aba-8505-dca9a0c04906" alt=""><figcaption></figcaption></figure>

### Track Weight

Each clip track has a weight value determining how much it mixes with the layers below it. The weight for each track may be adjusted in the info panel in the lower left.

<figure><img src="https://2067910529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC3dOuetlQfYgK5FPUKgn%2Fuploads%2FnE7iBELJFiQrTUH1uTCv%2Fimage.png?alt=media&#x26;token=c57cbd64-98ad-49a1-960c-8cd99814ec39" alt=""><figcaption></figcaption></figure>

Or alternatively the weight may be adjusted in the inspector in the Tracks section.

<figure><img src="https://2067910529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC3dOuetlQfYgK5FPUKgn%2Fuploads%2F2xNleJYwXek6ewMB3p4O%2Fimage.png?alt=media&#x26;token=40e13857-850f-4177-a6cd-796d64416d5b" alt=""><figcaption></figcaption></figure>

## Keyframes

Each keyframe on a clip track defines an animation to play with options to adjust playback and create a smooth transition from the preceding clip.

<figure><img src="https://2067910529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC3dOuetlQfYgK5FPUKgn%2Fuploads%2FUv5brnmEJ55FmrG8za0F%2Fimage.png?alt=media&#x26;token=ecee0154-74a0-4842-b0a1-957edbf1c5f9" alt=""><figcaption></figcaption></figure>

### Animation Clip

Select an animation clip from the drop down menu. To add and manage animation clips, see the Animation Clips section in the inspector.

### Mix

This specifies a duration in seconds to transition from the previous clip to the current one. This is visualized in the track view by a ramp, which can either be linear or eased depending on the keyframe interpolation set.

<figure><img src="https://2067910529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC3dOuetlQfYgK5FPUKgn%2Fuploads%2FpBHPdjDjuYDKg3BUOxwp%2Fimage.png?alt=media&#x26;token=ff0d56e5-e307-44fe-9fe2-533a805775b4" alt=""><figcaption></figcaption></figure>

The mix duration can also be set interactively by dragging the square handle in the track view. While the primary keyframe (depicted as a circle in eased mode, or diamond in linear mode) may be dragged to move it in time.

<figure><img src="https://2067910529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC3dOuetlQfYgK5FPUKgn%2Fuploads%2FEbz0pmArAsv2w6XgGio9%2Fimage.png?alt=media&#x26;token=d00e3c1e-805a-48c2-b5c0-7ea3cb8475b0" alt=""><figcaption></figcaption></figure>

### Loop

Enable looping for clips to keep them repeating indefinitely.&#x20;

### Speed

This sets the playback speed of the animation clip for each keyframe individually. The final speed is combined with the Time Scale of the Animation Sequencer and the object it is applied to.

### Offset

Adjusts the starting time of the animation clip relative to the keyframe.

### Duration

The length in seconds of the animation clip. In the Track View, the duration of each animation clip is drawn as a box, which is repeated if Loop is enabled.&#x20;

<figure><img src="https://2067910529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC3dOuetlQfYgK5FPUKgn%2Fuploads%2Fyk8ilRymoRQzvSOhhGeX%2Fimage.png?alt=media&#x26;token=48cc66fe-e800-4132-b275-c7e6c986fcbb" alt=""><figcaption></figcaption></figure>

## Animating Track Weights

Each Clip Track has a weight value that may optionally be animated (with support up to 10 tracks) using a standard keyframe channel. Below is an example which animates the blend weight of Clip Track 1 to smoothly transition the character from walking to idle, then walking again.

<figure><img src="https://2067910529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC3dOuetlQfYgK5FPUKgn%2Fuploads%2FJ4zirwwEc17RkXcjqCJB%2Fimage.png?alt=media&#x26;token=b2bf7477-3f25-424d-aa3a-b3404f455ff5" alt=""><figcaption></figcaption></figure>

The weights are exposed as values named BlendWeight00, BlendWeight01, ... BlendWeight09.&#x20;

{% hint style="success" %}
To add a blend weight channel, right click on the object and select the corresponding weight index from the menu:\
Add Animation/Channel/AnimationSequencer/BlendWeight01

\
Alternatively, enable [Auto Keyframing](https://axongenesis.gitbook.io/timeflow/user-guide/timeflow-view/toolbar/auto-keyframing) and then adjust the blend weight slider for any clip track to capture a keyframe for that channel.
{% endhint %}

{% hint style="warning" %}
If clip tracks are reordered or changed, it may affect which blend weight index it is mapped to.
{% endhint %}
