# Bevy Animation Graph

Bevy ECS skill for animation blending.

- Repository: https://github.com/thedivergentai/Game-Dev-Agentic-Skills (917 stars)
- Category: Design
- License: LGPL-3.0
- Last updated: 2026-10-16
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add thedivergentai/Game-Dev-Agentic-Skills --skill bevy-animation-graph -g -a claude-code -y`
Codex: `npx skills add thedivergentai/Game-Dev-Agentic-Skills --skill bevy-animation-graph -g -a codex -y`
Cursor: `npx skills add thedivergentai/Game-Dev-Agentic-Skills --skill bevy-animation-graph -g -a cursor -y`
Gemini CLI: `npx skills add thedivergentai/Game-Dev-Agentic-Skills --skill bevy-animation-graph -g -a gemini-cli -y`

## Description

Bevy ECS skill for animation blending. Keywords: Bevy, AnimationGraph, blend, AnimationGraphHandle, AnimationNodeType.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Bevy animation graph

## When to use

Load this when clips must blend, add, or mask. Single-clip playback stays on bevy-animation.

## ECS shape

- **Assets:** `AnimationGraph` describes how clips blend. `add_clip` parents a clip node. `add_blend` parents a blend node. `add_clip_with_mask` stores a `u64` mask (bone groups you assign; `0` means no mask).
- **Components:** `AnimationGraphHandle` is a handle to the graph used by the `AnimationPlayer` on the same entity. `AnimationTransitions` crossfades between nodes.
- **Weights:** `ActiveAnimation::set_weight` on the player, after `play`, drives a node that is already in the graph.
- **Systems:** evaluation still runs through the animation player systems. Do not add a second player.

```rust
#[derive(Resource)]
struct LocomotionNodes {
    graph: Handle<AnimationGraph>,
    walk: AnimationNodeIndex,
    run: AnimationNodeIndex,
}

fn build_locomotion_graph(
    mut commands: Commands,
    asset_server: Res<AssetServer>,
    mut graphs: ResMut<Assets<AnimationGraph>>,
) {
    let mut graph = AnimationGraph::new();
    let blend = graph.add_blend(0.5, graph.root);
    let walk = graph.add_clip(
        asset_server.load(GltfAssetLabel::Animation(0).from_asset("models/fox.glb")),
        1.0,
        blend,
    );
    let run = graph.add_clip_with_mask(
        asset_server.load(GltfAssetLabel::Animation(1).from_asset("models/fox.glb")),
        0b0011,
        1.0,
        blend,
    );
    let handle = graphs.add(graph);
    commands.insert_resource(LocomotionNodes {
        graph: handle,
        walk,
        run,
    });
}
```

```rust
#[derive(Resource)]
struct LocomotionNodes {
    graph: Handle<AnimationGraph>,
    walk: AnimationNodeIndex,
    run: AnimationNodeIndex,
}

The rest: https://github.com/thedivergentai/Game-Dev-Agentic-Skills/blob/HEAD/skills/bevy-animation-graph/SKILL.md
