> For the complete documentation index, see [llms.txt](https://docs.aethercube.fr/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.aethercube.fr/developers/fr/content-packs/animations.md). Agents can also search and read this documentation through its [MCP server](https://docs.aethercube.fr/~gitbook/mcp).

# Animations

Cette page explique comment donner des clips par keyframes à un modèle et comment le client les joue. Elle sert aux auteurs de packs.

Un pack peut donner à un modèle des clips par keyframes. Un clip remplace la pose intégrée d'un état, pour les nœuds dont il a des pistes.

## La table

`data/animations.json` associe un modèle à ses états, et chaque état à un fichier de clip :

```json
{
  "version": 1,
  "models": {
    "skyglass:keel_drifter": {
      "idle": "animations/drifter_idle.json",
      "walk": "animations/drifter_drift.json",
      "fly": "animations/drifter_drift.json",
      "hit": "animations/drifter_hit.json",
      "death": "animations/drifter_death.json"
    }
  }
}
```

États : `idle`, `walk`, `run`, `jump`, `fall`, `land`, `attack`, `hit`, `death`, `cast`, `interact`, `swim`, `fly`.

## Un clip

```json
{
  "format": 1,
  "duration": 1.2,
  "loop": true,
  "tracks": {
    "left_leg": [
      { "t": 0.0, "rotate": [ 30, 0, 0] },
      { "t": 0.6, "rotate": [-30, 0, 0] },
      { "t": 1.2, "rotate": [ 30, 0, 0] }
    ],
    "body": [
      { "t": 0.0, "move": [0, 0.05, 0] },
      { "t": 0.6, "move": [0, 0, 0] }
    ]
  }
}
```

| Champ      | Sens                                                                                        |
| ---------- | ------------------------------------------------------------------------------------------- |
| `format`   | `1`.                                                                                        |
| `duration` | Durée en secondes, 0,05 à 60.                                                               |
| `loop`     | Si le clip se répète.                                                                       |
| `tracks`   | Nom du nœud vers une liste de clés. Une piste porte le nom d'un nœud du modèle.             |
| `t`        | Instant d'une clé en secondes. Les clés sont triées par `t`, de 0 à `duration`.             |
| `rotate`   | `[x, y, z]` en degrés, appliqué Y, puis X, puis Z, relativement à la pose de repos du nœud. |
| `move`     | Décalage `[x, y, z]` en blocs.                                                              |

Limites : 64 pistes par clip au maximum et 256 clés par piste.

Entre deux clés, le client interpole les rotations par slerp et les décalages linéairement. Un nœud sans piste reste là où la pose de l'état le placerait.

## Cadence

| État                         | Comment le clip se joue                                                                        |
| ---------------------------- | ---------------------------------------------------------------------------------------------- |
| `walk`, `run`, `swim`, `fly` | Il suit la foulée (la phase de la démarche).                                                   |
| `idle`, `jump`, `fall`       | Il boucle dans le temps. `jump` est la partie en l'air d'un saut, pas son impulsion.           |
| Les autres                   | Il se joue une fois sur la durée de l'action. `attack` se joue aussi à chaque coup d'un combo. |

## Repli

Un clip ne remplace la pose intégrée de son état que pour les nœuds dont il a des pistes. Les autres nœuds gardent la pose intégrée. Un état sans clip garde l'animation intégrée du rig du modèle. Un `prop` n'a pas d'animation intégrée. Les clips s'enchaînent en fondu, comme les états intégrés.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.aethercube.fr/developers/fr/content-packs/animations.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
