Skip to content

A DSL for generating 2D animated movies entirely from code. Procedural characters, custom poses, body angle perspective, walk cycles, camera systems — no external assets needed. Text in, video out. Built as a vibe coding experiment: every line written by Claude Opus 4.6, zero human code.

Notifications You must be signed in to change notification settings

frankhart2018/animdsl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

animdsl

A domain-specific language for generating 2D animated movies entirely from code. Characters, scenes, poses, and all visuals are procedurally generated -- no external assets, no hand-drawn sprites, no animation tools. Just text in, video out.

The Experiment

This repository is an experiment in vibe coding taken to its logical extreme.

The question was simple: how far can you get building a complete animation system using nothing but an AI coding agent? Not as a co-pilot. Not with human intervention on the hard parts. The entire codebase -- the DSL grammar, the parser, the procedural character renderer, the animation pipeline, the demo scripts, the SVG backgrounds, the character definitions, even this README -- was generated by Claude Opus 4.6 (Anthropic) running inside OpenCode, an agentic coding CLI.

A human described what they wanted. The agent built it. When the output wasn't good enough, the human said so and the agent tried again. Three major iterations happened:

  1. V1: Rigid single-SVG characters sliding around. Puppet show quality.
  2. V2: Bone/rig-based system with separate SVG parts per body part. Still puppet-like with more joints.
  3. V3: Fully procedural character rendering. No SVGs for characters at all. Bodies drawn frame-by-frame from bezier curves with tapered limbs, organic torso shapes, facial expressions, body angle perspective, walk cycles with staggered joint timing, and damped-spring secondary motion on hair and clothing.

The DSL itself evolved too. Poses started as 9 hardcoded words in Rust (idle, angry, surprised...). Now they're fully user-defined in the .anim file with 23 controllable body/expression parameters. Overlap detection was added after characters kept walking through each other. Body angle rendering was added after every character looked like a flat paper cutout.

None of it is perfect. The characters still look like what they are -- procedurally generated cartoon figures drawn with math. But the point was never to rival Pixar. The point was to see what happens when you let an AI agent own an entire creative-technical project end to end.

Repository Policy

This repository only accepts agent-generated code. No human code contributions. If you want to improve the system, describe what you want to an AI agent and let it write the code. This isn't a philosophical stance -- it's the constraint that makes the experiment interesting. The moment a human touches the rendering math or fixes a parser edge case by hand, the experiment loses its meaning.

Bug reports and feature requests from humans are welcome. Implementation must come from agents.

What It Produces

The system takes .anim script files and renders them to MP4 video (via FFmpeg). Characters are defined in JSON files with parameters for body type, skin color, hair style, clothing, and accessories. Everything is drawn procedurally using tiny-skia -- no sprite sheets, no pre-rendered assets.

Current capabilities:

  • Procedural character rendering with 6 hair styles, 8 clothing types, 6 accessories
  • Custom pose definitions with 23 controllable joint/expression parameters
  • Body angle perspective (front, 3/4, profile, back views)
  • Walk cycles with staggered joint timing
  • Secondary motion (hair/clothing physics)
  • Facial expressions with eyebrow, eye, and mouth control
  • Camera system (wide, medium, close-up, zoom, pan, shake)
  • Scene transitions (fade, dissolve, wipe, cut)
  • Overlap detection (prevents characters from intersecting)
  • SVG backgrounds for sets

Quick Start

Prerequisites

  • Rust (2021 edition)
  • FFmpeg (for video encoding)

Build

cargo build --release

Validate a Script

cargo run --release -- check examples/the-last-barista.anim

Render

cargo run --release -- render examples/the-last-barista.anim -o output.mp4

Dump AST

cargo run --release -- dump examples/the-last-barista.anim

Examples

The primary demo is examples/the-last-barista.anim -- a 4-scene, ~90-second post-apocalyptic story about the last bag of coffee beans, featuring three procedurally generated characters (Zara the barista, Dex the scavenger, Nyx the warlord), two custom SVG backgrounds, and 15 custom poses.

// From "The Last Barista"
pose "brewing" {
    torso-bend: 10
    head-nod: 12
    arm-left-angle: -50
    arm-right-angle: 50
    elbow-left-bend: 0.75
    elbow-right-bend: 0.75
    mouth-smile: 0.3
}

scene "epilogue" (duration: 16s, set: cafe-ruins) {
    place zara at center facing right
    place nyx at right-third facing left
    place dex at left-third facing right

    camera wide
    wait 1.5s

    camera close-up zara
    zara pose "brewing"
    wait 2s

    camera close-up dex
    dex pose "sipping"
    wait 1.2s
    dex pose "savoring"
    wait 1.5s

    camera wide
    wait 2s
    transition fade-black 2s
}

Documentation

  • DSL.md -- Complete language specification. Every keyword, every construct, every field. The definitive reference for writing .anim files.
  • CONTRIBUTING.md -- Codebase architecture, module descriptions, data flow, build instructions, and step-by-step guides for adding new features. Written for AI agents contributing to the project.

Project Stats

Metric Value
Rust source ~7,665 lines
PEG grammar 345 lines
Largest module procedural/mod.rs (3,318 lines)
Character definitions 6
Set backgrounds 5
Demo scripts 5
Custom pose fields 23
Built-in fallback poses 9
Tests 6 passing
Dependencies 12 crates

License

This project is an experiment. Use it however you want.

About

A DSL for generating 2D animated movies entirely from code. Procedural characters, custom poses, body angle perspective, walk cycles, camera systems — no external assets needed. Text in, video out. Built as a vibe coding experiment: every line written by Claude Opus 4.6, zero human code.

Topics

Resources

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages