Manim Engine

Overview Engines Pipeline Values Roadmap

What is Manim?

Manim (Mathematical Animation Engine) is an open-source Python library originally created by 3Blue1Brown for making math explainer videos on YouTube. It lets you write code that produces smooth, precise animations — shapes morphing, text appearing, graphs drawing themselves.

TKK uses Manim Community Edition v0.20 because every frame is defined in code, which means videos are reproducible, tweakable, and can be generated without any manual work.

How a Screenplay Works

Each video is a single Python file ({topic}_manim.py, ~600 lines) containing:

Each Scene class has a construct() method that creates objects (text, shapes, images) and plays animations timed to the narration. A DURATION constant on each scene controls its allocated time slice.

Zone Layout System

The frame is 9x16 (1080x1920). Content must fill the full vertical space using 5 named zones. All positioning uses safe_place(mob, "ZONE") from anim_primitives.py.

ZoneY CenterUse
TITLE6.2Scene label pills
UPPER3.5Hero visual top
MID0.0Central focal point
LOWER-3.5Supporting visuals
FOOTER-6.0Captions, source labels

Animation Verbs

Common Manim animations used in TKK screenplays:

FadeIn / FadeOut
Opacity transitions, optionally with direction shift
GrowFromCenter
Scale up from zero at center point
Write / Unwrite
Handwriting-style text appearance
LaggedStart
Stagger multiple animations with delay
Transform
Morph one object into another
Create / Uncreate
Draw/undraw strokes of a shape
CountingAnimation
Animate a number counting up/down
AnimatedBoundary
Glowing animated border effect

QA Pipeline

Three automated checks run on every screenplay before final render:

Strengths & Weaknesses

Strengths

  • Precision — every pixel is code-defined
  • Proven — 44+ published videos
  • Mature QA — 3 automated checkers
  • Rich animation vocabulary
  • Reproducible — same code = same video

Weaknesses

  • ~600 lines of Python per video
  • 1-2 min render time
  • High code complexity per video
  • Harder to iterate quickly
  • Each video is a bespoke program