Motion design in code
Source: @seeconvm, "Motion Design with Fable 5.2: From One Prompt to a Finished Film" (Nov 2026).
Core idea
A precise model given a vague brief produces a precise default. Every decision left unmade gets made generically. Always work from a director's brief, and replace adjectives with numbers.
The brief (fill every slot before building)
WHAT what it is and who it's for, in one sentence
SIZE 1920x1080 (16:9 default) | 1080x1920 | 1080x1350, 60 fps; plays once or loops seamlessly
LOOK background, text and ONE accent as hex; fonts by name, weight, size, tracking
TIMELINE one line per moment with seconds: 0.0-1.0 s ..., 1.0-3.0 s ...
MOTION nothing moves in a straight line at constant speed; entrances ease out,
exits ease in; every bounce settles within 0.4 s
HOLDS text stays still while read: 0.3 s per word + 0.5 s
BANS named defaults to avoid: glow orbs, purple gradients, lens flares, fade-in on everything,
labels or subheaders not listed
QA stills to check (times), plus the motion checks below
Only the text listed in the brief appears on screen. The model tends to add labels, so ban that.
Numbers, not adjectives
| Adjective | Write instead |
|---|
| smooth | cubic-bezier(0.16, 1, 0.3, 1) |
| premium | roughness 0.38, clearcoat 0.35 |
| cool light | key 3200 K, rim 7500 K |
| modern | 35 mm, f/2.8, cut on the beat |
| bouncy | spring, damping 0.5, 2 bounces |
| fast cuts | on the beat: frames per beat = fps x 60 / BPM |
- Ease in (entrance): cubic-bezier(0.16, 1, 0.3, 1).
- Ease out (exit): cubic-bezier(0.7, 0, 0.84, 0), 40-50% shorter than the entrance.
- Pop: cubic-bezier(0.34, 1.56, 0.64, 1).
- Durations: UI feedback 100-200 ms; hero reveal 600-900 ms.
- Stagger: letters 1 frame, words 60-120 ms, list items 40-80 ms. The next move starts at 30-50% of the last one.
- Springs: damping ratio = c / (2 * sqrt(k * m)).
- 1.0: no overshoot (text, UI, anything read).
- 0.8: one bounce (logos, cards, products).
- 0.5: two bounces (characters, comedy).
- Squash and stretch: crouch 1.2x0.75, takeoff 0.85x1.28, landing 1.25x0.75 (volume kept). Follow-through lags 4-6 frames.
- Camera: 35 mm room, 50 mm action, 85 mm face. Focus follows the subject. Energy comes from cuts on the beat, not zooms or whip pans. Hold a beautiful angle for a whole beat. Shake only on impact. Text fully in frame or fully out. The last frame is the image.
- Hero size: the subject is at least 170 px wide at 1080p in every main shot. Measure it.
The clock: timing first
- One master list of times (
timing.json, or a list in the render script) drives every cut, move and sound hit; nothing is timed by hand.
- Work on a beat grid. For any edit, detect the BPM first (librosa) and snap animation in/out points to beat frames.
- A sound hit lands 1 frame after its picture event.
- Every frame is a pure function of t:
renderAt(t), closed-form springs, no accumulated state, no unseeded random. Seeking to any frame cold must equal rendering it in sequence.
- Loops: render frames 0..N-1 (never N). Frame N-1 flows into frame 0 in pose, speed, camera and light.
- Design bugs out (separate planes, no possible collisions) instead of fixing them later.
Pipeline options
- Python/numpy/PIL/OpenCV frames piped to ffmpeg: my default for overlays on footage.
- HTML/GSAP/three.js page with
window.renderAt(t) and window.__ready: render with Playwright screenshots per frame piped to ffmpeg. Never screen-record.
- Remotion (React video, official agent skills) or HyperFrames (HTML to video) for templated, repeatable graphics. Blender headless by script for real 3D:
blender -b --factory-startup -P scene.py.
- Motion blur: average 8-32 sub-frames per frame.
Rhythm, carry and taste (from onetake, huashu-motion, Lemo-Opuscar, Nov 2026)
Films get rejected as "PPT" (a slideshow) for two separate reasons. Check both.
- Measure the reference first. Get its energy map: cuts, % of dead-still frames, bursts, shot-length spread. Write the numbers down and match them. (onetake's accepted reference was 34% dead-still, with 7 hard cuts in two bursts.)
- Rhythm:
- Shot lengths vary at least 4x (0.25 s words next to 2.5 s holds); coefficient of variation at least 0.25, or it's a metronome.
- At least 25% of frames still, and at least one stretch of 1 s or more of near-silence in picture and sound.
- At least one burst: 3 or more big changes inside 1.5 s, not at a uniform interval.
- Never end two shots in a row the same way (alternate spring-out, blur-out and hard cut).
- Carry: at every section boundary, name the thing that survives and moves into the next beat: the subject, a container that becomes the next scene, an iris that opens from the subject, a push-in through a frame until it is the scene, a cast that gathers into the end lockup. If nothing survives, it's a slide change whatever the rhythm. Keep the subject in the same screen position across a cut, then bring new elements in.
- Three concepts before building, each one sentence about the picture, not the topic. Options: one element transforms through everything; one camera move through scale; a before/after split; a chain reaction where each beat causes the next; a physical metaphor. Give each its hook frame, what carries every boundary, and its look. The user picks.
- Three tests, in the order films fail them:
- Is it this subject? Real material, real words, its own colors. Cover the logo: could it be a competitor's?
- Does the energy have a shape? Hook inside 3 s, a burst, one stop, a peak, a landing. Plot motion per second; a flat line is a flat film.
- Is any stretch a slide? A thing on a ground with a caption under it is a slide however well it eases. Every stretch gets its own shot scale and move.
- Frame 0 is the poster: the subject is already in it, never a black or empty frame.
- Meaning beats decoration: build the idea into the artwork rather than labelling it. Kill any flourish that isn't the subject's own behavior (confetti, sparkles, specks).
- Show the mechanism: for documentary or BTS work, make the argument with editing (Kino montage). A document or line collides with the footage it leaves out (A + B = idea), counts are driven by cuts, and the music drops out so a real diegetic sound drives an accelerating cut.
- Real places: satisfy the "real b-roll for every real place" rule with real footage or a map move. MapLibre (free) or Mapbox in Remotion: dive from orbit, draw the line along its true course, label in the brand font.
Style and tool library (open source; clone from GitHub when a job calls for it)
- lemomo-ai/lemo-opuscar: 99 code-film styles, each with STYLE.md, a shot table and a score plan. Useful for brand and documentary work: kino-montage, halftone-dossier, newsreel, scratch-film, silent-film, archive-lighttable, text-flash-cuts, map-explainer, security-xray, double-exposure, risograph, swiss-motion. Read one style's STYLE.md and DEMO.md for technique; never reuse its story or timings.
- feitangyuan/onetake: one-take product films.
scripts/analyze_ref.py ref.mp4 gives an energy map, cuts, stillness and contact sheets; references/rhythm.md covers rhythm and carry. Noncommercial license.
- alchaincyf/huashu-motion: HTML+GSAP films with a studio.
om beats reads a track's BPM, bars and drops; om qa --sheet gives a motion curve, dead time, single-frame pops and a 4 fps sheet; punch-up.md diagnoses a weak film with numbers.
- remotion-dev/skills: official Remotion agent skills (create, best-practices, maps, multimedia).
- heygen-com/hyperframes: HTML to video, including a reverse-any-video skill.
- Vincentwei1021/anything2explainer: narrated explainer pipeline in Remotion: one example context throughout, glitch only on the key term per shot, at least 120 frames per shot, facts sourced.
- Design floor for any frames or pages: Nutlope/hallmark, Leonxlnx/taste-skill and pbakaus/impeccable. They ban the AI look: purple-blue gradients, card-in-card, emoji icons, invented metrics, tracked-caps eyebrows. Treat them as a polish pass.
- Hand-drawn and diagram looks: excalidraw/excalidraw (sketch boards and flow diagrams an agent can generate as JSON, then animate), rough-stuff/rough (Rough.js: makes any SVG or canvas line, box or chart look hand-drawn; set roughness and seed once per film so it doesn't jitter between frames unless you want it to).
- Math and data explainers: ManimCommunity/manim (3Blue1Brown-style equations, graphs and transforms rendered straight to MP4; use for numbers, charts and "how it works" inserts).
- UI motion: magicuidesign/magicui (ready-made animated React UI pieces: marquees, number tickers, shimmer buttons, bento grids) and nextlevelbuilder/ui-ux-pro-max-skill (about 80 matched styles, palettes and font pairings an agent can pick from). Run the design-floor pass above on anything taken from them.
- Also: GSAP (timelines), three.js (3D), Blender MCP (Claude drives Blender), ComfyUI (image generation), getopenscreen/openscreen (polished screen-recording demos), storytold/effectcraft (VFX toolkit), FFmpeg (export).
- More animation engines (from @WasimShips' open-source list, Nov 2026); clone only what the job needs:
- Video-native timelines: motion-canvas/motion-canvas (TypeScript, generator-based scenes with exact timing, renders frames; strong for explainers and code/diagram animation, an alternative to Remotion).
- Tweening for HTML/React pages driven by
renderAt(t): motiondivision/motion (Motion, formerly Framer Motion; springs and layout animation in React/JS), juliangarnier/anime (anime.js; light timelines, staggers, SVG path drawing and morphing), jeremyckahn/shifty (tiny tween engine, easy to drive from a fixed clock), CreateJS/TweenJS, franciscop/ola (smooth interpolation of changing numbers, good for counters and tickers). Use them seeked to t, never as free-running real-time animation.
- 2D drawing: jonobr1/two.js (one API for SVG, canvas and WebGL; flat vector shapes and line art), konvajs/konva (canvas scene graph with layers, groups and hit areas; collage and cut-out layouts).
- Vector animation files: airbnb/lottie-web (plays After Effects/Lottie JSON; use for imported AE assets or exporting a lightweight animated logo or icon).
- Particles: drawcall/Proton (emitters for sparks, dust, smoke and confetti on canvas or WebGL; seed it so frames are repeatable, and keep the 'no decorative confetti' rule).
- 3D beyond three.js: BabylonJS/Babylon.js (full web 3D engine with PBR and physics), lume/lume (3D through HTML custom elements), godotengine/godot (game engine; for interactive or simulation-heavy scenes rendered to frames). Blender stays the default for photoreal 3D.
- GIF output: mattdesl/gifenc (fast GIF encoder in JS; for looping stickers, previews and social GIFs straight from canvas frames).
- From @Y0urDumble's 16-repo list (Nov 2026); the rest of that list is already above:
- Keyframe editing: theatre-js/theatre (Theatre.js; a visual keyframe and curve editor in the browser for three.js or DOM scenes; save the state JSON and play it back seeked to
t for frame-exact renders).
- 3D as React: pmndrs/react-three-fiber (R3F, plus drei helpers; three.js scenes written as React components; pairs with Remotion through @remotion/three for 3D shots in a React video).
- Open AI video models (only for b-roll, textures, atmosphere or backgrounds; never real people's likenesses, never fake footage presented as real): Wan-Video/Wan2.1 (text/image to clip), Tencent-Hunyuan/HunyuanVideo (cinematic clips), Lightricks/LTX-Video (fast, near real time). They need a strong NVIDIA GPU on the user's PC and can't run in the cloud workspace. Check the GPU and VRAM first; run them through ComfyUI workflows where possible, then grade and cut the output like any other footage.
- Pick by look: sketch/whiteboard → Excalidraw + Rough.js; math/data → Manim; app or SaaS UI → Magic UI + ui-ux-pro-max in Remotion or HyperFrames; launch film to music → huashu-motion; 3D → three.js or Blender MCP (Babylon.js if it needs physics, React Three Fiber inside Remotion); hand-tuned keyframes → Theatre.js; generated b-roll → Wan 2.1 / HunyuanVideo / LTX-Video via ComfyUI on a GPU; explainers with exact timing → Motion Canvas or Manim; flat vector or collage → two.js or Konva; After Effects assets → lottie-web; particles → Proton (seeded); looping GIFs → gifenc. The flow is always idea → shape → motion → polish → export (FFmpeg).
Motion QA: stills lie (run before saying done)
One pipeline shipped about 100 of 160 seconds frozen after 5 still-based reviews passed it. So:
- Freeze detect:
ffmpeg -i out.mp4 -vf freezedetect=n=-60dB:d=0.5 -map 0:v:0 -f null -. Any unplanned freeze is a bug.
- Motion graph: mean absolute frame-to-frame difference per frame. 30 consecutive frames under 0.5 means frozen. Every planned move must show as a bump.
- Black and corrupt frames:
blackdetect=d=0.1:pix_th=0.05, plus a contact sheet every 0.25 s around transitions.
- Seam check for loops; seek check (frame 300 cold equals frame 300 after 299).
- Hero width per shot; text fully in frame, readable at 50% size.
5b. Rhythm numbers: shot-length coefficient of variation (at least 0.25), % still frames, burst count, and the motion-per-second curve compared with the reference's energy map. Also check for single-frame pops (an element visible for exactly one frame by accident).
- A reviewer that didn't build it tries to break it. Report each check with its number, never "looks good". Do one fix round on stills before the full render.
Export (X, YouTube, socials)
-c:v libx264 -profile:v high -pix_fmt yuv420p -crf 16-18 -movflags +faststart -c:a aac -b:a 192k+.
Audio: -14 LUFS with true peak at or below -2 dBTP, measured after the AAC encode (-af ebur128=peak=true), because AAC raises peaks. Music sits lower than you think.
Sizes: 16:9 is 1920x1080; 4:5 is 1080x1350; 9:16 is 1080x1920 (keep text in the middle 1080x1350 so the 4:5 crop works); 1:1 is 1080x1080.
Follow-ups: what's wrong, where, and the number
Good: "From 3 to 6 s slow everything by 30%." "Title 30% bigger, hold 1.5 s." "Frame 1 must already be moving." "Every word at least 80 px inside the frame." "Use exactly #FAE420, no other yellow." Change one or two things per round. Keep versions (v2, v3) rather than overwriting.
Finishing work
Done means the full-length MP4 renders, every QA check passes with its number, and the notes list what changed. Failed renders, timeouts and missing fonts are ordinary obstacles: fix them and continue. Stop only for something only the user can provide.
Effort and cost
Iterate on medium (storyboards, stills, notes) and build on high. Max effort rarely helps visuals. Fix on stills, not renders.