WaveCraft
Make flags and fabric wave in After Effects, with a few sliders.
Working Available to download. Below, a browser demo on sample data.
The problem
Animating a waving flag by hand is slow, and every change means doing it again.
What I built
An After Effects script that makes any shape wave, controlled by a few sliders. You can change it any time, and your artwork stays as it is.
- A few sliders for every shape
- The edge on the pole stays put
- Loops smoothly, with no jump
Download for After EffectsTry the browser demo
Features and limits
Built and tested
- One controller for every shape: wave height, number of waves, speed, and how gently the motion starts at the pinned edge.
- The pinned edge never moves, like cloth fixed to a pole.
- Flag mode, where the cloth also bunches slightly as it waves, and ribbon mode, where it only travels up and down.
- The motion repeats exactly, so it loops without a jump.
- Three presets: Calm flag, Windy flag and Ribbon.
- Save the current frame as SVG.
Limits
- Tested in After Effects 26.5.0 on macOS 27.0.1, on a sample flag. Not tested on Windows yet.
- You pick a preset in a dialog when the script runs. There is no dockable panel yet.
- In the browser demo, curved (Bezier) shapes are drawn as points.
Planned
A dockable panel for presets, and testing on Windows.
How to use
- Pick a preset or move the sliders.
- Turn the pinned edge on and off to see the difference.
- Pause, then save the frame as SVG.
How it works
- Each point moves by height × weight × sin(2π(waves × position − speed × time)). Position runs from 0 at the pinned edge to 1 at the free edge.
- The weight is the position raised to the edge protection value: 0 at the pole, 1 at the tip. Protection 0 moves the whole shape.
- The motion depends only on the original points and the time, so scrubbing and looping are exact.
- For visitors who ask for reduced motion, the demo starts paused.
Tested versions & limits
- Pass Unit: pinned edge never moves (left and right) Node 22, Linux
- Pass Unit: motion bounded by amplitude Node 22, Linux
- Pass Unit: seamless loop at 1/speed Node 22, Linux
- Pass Unit: originals untouched, closed path, bad input rejected Node 22, Linux
- Pass Browser: animates, pause holds, presets set controls Chromium (Playwright)
- Pass Host expression equals the page's wave() for every preset, both pin sides and phase (evaluated in Node) Node 22, Linux
- Pass Host script on a mock After Effects comp: one controller with the preset, expression on every path, no path value changed Node 22, Linux
- Pass Host: the expression rig waves a shape path inside After Effects, matching the page After Effects 26.5.0, macOS 27.0.1
Last verified 2026-11-01.
The wave logic and controls are built and tested. The After Effects script (a controller null and a path expression with the same math) ran in After Effects 26.5.0 on macOS 27.0.1: on a fictional flag every vertex matched the page within 0.005 px under three presets, the pinned edge stayed still and the original path was unchanged. Evidence: labs/host-tests/results/2026-10-31-mac-t01-run2.
Details
- Input
- Vector shapes in an After Effects comp
- Output
- A wave animation you can keep editing
- Runs in
- An After Effects script, tested in After Effects 26.5.0 on macOS 27.0.1. The demo on this page runs in your browser.
- Source
- Original, rebuilt from scratch