# Clips

> Aego 0.12.5 · development; docs build `4a32b816933e02930662f6a443cb25abe6050d090c55e237cbff5c44ae9b25f8`. [Build manifest](/docs-build.json).

A clip is an `.aeanim` file in the assets folder. It has a length in seconds, a loop mode (`once`, `loop`, `pingPong`) and tracks:

    anim version=1 length=0.6 loop=loop {
      frames "" fps=10 {
        sprites=[asset("…run_0"), asset("…run_1"), asset("…run_2")]
      }
      track "" prop="SpriteRenderer.tint" kind=color {
        key t=0 v=[1, 1, 1, 1] interp=linear {}
        key t=0.3 v=[1, 0.6, 0.6, 1] {}
      }
      track "Arm" prop="transform.rotation" kind=float32 authority=simulation {
        key t=0 v=0 {}
        key t=0.3 v=0.8 tangent=linear {}
      }
      event t=0.3 name="Hit" payload=1 {}
    }

| Part | Meaning |
|---|---|
| label of `track` | the node, as a path from the player's node; `""` is the node itself |
| `prop` | the property, with the paths of tweens: `Component.Field`, `Component.Field.a`, `transform.position`, `script/Name.Field` |
| `kind` | the value type: `float32`, `int32`, `bool`, `enum`, `vec2`, `vec3`, `vec4`, `color`, `rect`, `quat`, `assetRef` |
| `authority` | `presentation` (default) or `simulation`, see [Time and authority](/animation/time.md) |
| `onEnd` | `hold` keeps the last value when the clip ends or stops, `restore` puts back the value from before Play |
| `root=true` | only on `""` with `prop="transform.position"` and `kind=vec2`: the track is not written; an Animator with Root Motion moves the node by its change instead |
| `key` | `t`, `v`, and `interp=bezier` (default), `linear` or `step`; `tangent=auto`, `linear` or `free` with `in` and `out` |
| `frames` | sprite frames: `sprites` and `fps` or `durations`, `flipX` optional; it becomes step tracks on `SpriteRenderer.sprite` and `SpriteRenderer.flipX` |
| `event` | an event at `t` with a declared `name`, an optional `payload` and `mode` |

Numbers, vectors and colors interpolate; rotations as quaternions take the short arc; `int` steps unless the track has `numeric=true`; `bool`, `enum` and asset references step. Sprites are sprite assets, usually members of an atlas group.

The engine ships four clips for tests and sketches: `engine/anim/run`, eight frames of a running figure (`engine/sprites/runner_0` to `_7`) with two `Footstep` presentation events; `engine/anim/bob`, a simulation sway of `transform.rotation` with a `Hit` gameplay event at the right turn; `engine/anim/jump`, the runner's stride pose; and `engine/anim/hit`, one 0.3 s swing of `transform.rotation`. The built-in controller plays jump in its Jump state and hit in its Hit state.

A clip that does not import keeps its last good version, and the error is in Problems: [ANM001](/diagnostics.html#ANM001.md) for a track or file the importer cannot read, [ANM002](/diagnostics.html#ANM002.md) for a key or event outside the length, [ANM003](/diagnostics.html#ANM003.md) for an event that is not declared.
