motion-canvas
Skill77 starsChanged 41 days agoApache-2.0View on GitHub
Motion Canvas framework reference covering project setup, core concepts (generators, signals, refs, scene hierarchy, timing, utilities), and 2D components (shapes, paths, text, media, layout, camera, transitions, custom components). Use when building or editing Motion Canvas scenes.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- naman10parikh/pixeltheir own version, first seen Oct 25, 2026
- dracohu2025-cloud/draco-skills-collectiontheir own version, first seen May 6, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- dracohu2025-cloud/draco-skills-collection★ 227same name
- naman10parikh/pixel★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository2 other files it gives its agents.
- animation-basicsSkill
- motion-canvas-agentSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 295
Add the new scene's content before yield* slideTransition(...).
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Motion Canvas
Base Scene Template
import {makeScene2D} from '@motion-canvas/2d';
export default makeScene2D(function* (view) {
});Generator Functions & Animation Flow
function*defines a generator functionyieldpauses until next frameyield*delegates to another generator (composition)
export default makeScene2D(function* (view) {
const circle = createRef<Circle>();
view.add(<Circle ref={circle} width={100} height={100} fill={'red'} />);
yield* circle().position.x(300, 1);
yield* circle().position.x(-300, 1);
});Reusable animation pattern:
function* flicker(circle: Circle, duration: number): ThreadGenerator {
const colors = ['#e13238', '#e6a700', '#99C47A'];
for (const color of colors) {
circle.fill(color);
yield* waitFor(duration);
}
}
yield* flicker(myCircle(), 0.5);Signals System
import {createSignal} from '@motion-canvas/core';
const radius = createSignal(3);
radius(); // Get → 3
radius(5); // Set → 5
yield* radius(4, 2); // Tween to 4 over 2 secondsComputed signals:
const area = createSignal(() => Math.PI * radius() * radius());Signals in JSX:
<Circle width={() => radius() * 2} height={() => radius() * 2} />
yield* radius(200, 1); // Circle updates automaticallyVector signals:
const position = Vector2.createSignal(Vector2.up);
yield* position(Vector2.zero, 1);Reset to default:
import {DEFAULT} from '@motion-canvas/core';
signal(DEFAULT); // Instant reset
yield* signal(DEFAULT, 2); // Tween to defaultReferences (Refs)
createRef (single node):
const circle = createRef<Circle>();
<Circle ref={circle} width={100} height={100} fill={'red'} />
yield* circle().scale(2, 0.3);makeRef (arrays):
const circles: Circle[] = [];
{range(10).map(index => (
<Circle ref={makeRef(circles, index)} x={index * 50} width={40} height={40} />
))}
yield* all(...circles.map(c => c.scale(1.5, 0.5)));createRefMap (keyed):
const labels = createRefMap<Txt>();
<Txt ref={labels.a} text="Label A" />
<Txt ref={labels.b} text="Label B" />
yield* labels.a().text('Updated A', 0.3);Scene Hierarchy
view.add(<Circle />); // Add to view
container().add(<Circle />); // Add to node
container().insert(<Circle />, 0); // Insert at index
circle().remove(); // Remove
container().removeChildren(); // Remove all children
circle().reparent(newParent()); // Move to new parentZ-order: moveUp(), moveDown(), moveToTop(), moveToBottom(), moveTo(2)
Querying:
import {is} from '@motion-canvas/2d';
const textNodes = view.findAll(is(Txt));
const firstCircle = view.findFirst(is(Circle));Save / Restore State
circle().save(); // synchronous: snapshots the current state
yield* all(circle().position.x(300, 1), circle().scale(2, 1));
yield* circle().restore(1); // Animate back to saved stateTime Events & Waiting
import {waitFor, waitUntil, useDuration} from '@motion-canvas/core';
yield* waitFor(2); // Wait 2 seconds
yield* waitUntil('voice-line-2'); // Wait for named event
const dur = useDuration('segment'); // Get event durationUtilities
Random: useRandom(42) → .nextInt(10, 100), .nextFloat(0, 1)
Logging: useLogger() → .debug(), .info(), .warn(), .error(); also debug('msg')
Hooks: useScene() → .getSize(); useTime()
Range: range(5) → [0,1,2,3,4]; range(2,5) → [2,3,4]
Threads:
// Spawn a background thread (do NOT yield — spawn starts it automatically)
const task = spawn(function* () {
yield* loop(Infinity, function* () {
yield* circle().rotation(360, 2);
circle().rotation(0);
});
});
// Cancel a running thread
cancel(task);
// Wait for a thread to finish
yield* join(task);spawn(a()); // run a in the background without waiting for it
yield* waitFor(0.5); // wait 0.5s
yield* b(1); // run bShape Components
Circle:
<Circle width={200} height={200} fill={'#e13238'} stroke={'#fff'} lineWidth={4}
startAngle={0} endAngle={270} closed={false} />Rect:
<Rect width={300} height={200} fill={'#68ABDF'} radius={10} smoothCorners cornerSharpness={0.6} />Line:
<Line points={[[0,0],[100,100],[200,50]]} stroke={'#fff'} lineWidth={4}
lineDash={[20,10]} lineCap={'round'} lineJoin={'round'} startArrow endArrow arrowSize={12} />Polygon:
<Polygon sides={6} size={200} fill={'#99C47A'} />Grid:
import {Grid} from '@motion-canvas/2d';
<Grid width={'100%'} height={'100%'} stroke={'#333'} lineWidth={1} spacing={80} start={0} end={1} />Animate with start/end (0-1) for drawing/erasing effects.
Path (SVG path data):
import {Path} from '@motion-canvas/2d';
<Path data={'M 0 -100 L 29 -40 L 95 -31 Z'} stroke={'#e6a700'} lineWidth={3} />Supports morphing: yield* path().data(newPathData, 1);
Filters
import {blur, brightness, grayscale, sepia, contrast, saturate, hue, invert} from '@motion-canvas/2d';
<Rect filters={[blur(5), brightness(1.5)]} />
yield* rect().filters([blur(0), grayscale(1)], 1); // AnimatedSee Filters for full details.
Gradients
import {Gradient} from '@motion-canvas/2d';
const grad = new Gradient({
type: 'linear',
from: [-100, 0], to: [100, 0],
stops: [{offset: 0, color: '#e13238'}, {offset: 1, color: '#68ABDF'}],
});
<Rect fill={grad} />See Gradients for radial and conic types.
Path Components
Ray: <Ray from={[0,0]} to={[300,200]} endArrow /> — animate with start(1,1) / end(0,1)
CubicBezier: <CubicBezier p0={..} p1={..} p2={..} p3={..} />
QuadBezier: <QuadBezier p0={..} p1={..} p2={..} />
Spline: <Spline points={[..]} smoothness={0.4} /> — smooth curves; smoothness controls how round the curve is
Knot: <Spline><Knot position={[-200,0]} /><Knot position={[0,0]} startHandle={[-50,0]} /><Knot position={[200,0]} /></Spline> — explicit control points with optional handles
Text Rendering
See Txt for full details.
<Txt text={'Hello World'} fontSize={64} fill={'#ffffff'} textWrap={true} />Custom Components
export class Switch extends Node {
@initial(false) @signal()
public declare readonly initialState: SimpleSignal<boolean, this>;
public constructor(props?: SwitchProps) {
super({...props});
}
public *toggle(duration: number) { /* animation logic */ }
}Decorators (import from @motion-canvas/2d): @signal(), @initial(value), @colorSignal(), @vector2Signal()
import {Node, NodeProps, initial, signal} from '@motion-canvas/2d';Scene Transitions
import {slideTransition, fadeTransition, Direction, Origin} from '@motion-canvas/core';
yield* slideTransition(Direction.Left);All transitions (from @motion-canvas/core):
slideTransition(Direction.Left, duration?)— slide in from a direction (orslideTransition(Origin.TopLeft)to slide in from a corner)fadeTransition(duration?)— cross-fadezoomInTransition(area, duration?)— zoom into a BBox areazoomOutTransition(area, duration?)— zoom out from a BBox areawaitTransition(duration?)— wait without visual transition
Directions: Direction.Top, Bottom, Left, Right. For diagonals, pass an Origin (Origin.TopLeft, Origin.BottomRight, …).
Add the new scene's content before yield* slideTransition(...); otherwise it pops in after the transition.
Custom:
import {createSignal, useTransition} from '@motion-canvas/core';
const progress = createSignal(0);
// useTransition returns a function that ENDS the transition. It is not a generator.
const endTransition = useTransition(
ctx => { ctx.globalAlpha = progress(); }, // before the current scene renders
ctx => { /* before the previous scene renders */ },
);
yield* progress(1, 0.6);
endTransition();Advanced Patterns
Conditional: if (cond()) yield* a(); else yield* b();
Reactive: <Circle fill={() => val() > 150 ? 'red' : 'blue'} />
State machines: while/switch pattern with enum states
References
- Setup — Project creation, installation, troubleshooting
- Flow Control — all, any, chain, delay, sequence, loop
- Tweening — Property tweens, easing, interpolation
- Springs — Physics-based spring animations
- Transforms — Coordinates, positioning, matrix operations
- Presentation Mode — Slide-based playback
- Txt — Text rendering, dynamic text, multi-line
- Layout — Flexbox, cardinal directions, offset
- LaTeX — Mathematical equations
- Media — Images, icons, video
- SVG — Animatable SVG component
- Icons — Iconify icon usage and catalog
- Camera — Pan, zoom, follow
- Filters — blur, brightness, contrast, grayscale, sepia, hue, saturate, invert
- Gradients — Linear, radial, conic gradient fills
- Effects — createEffect, createDeferredEffect
- Rendering — Rendering settings and output configuration
- Sounds — Programmable sound playback (@alpha)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

