Creating 3Blue1Brown-Style Animated Videos with Hermes Agent's Manim Skill
Manim CE animations: 3Blue1Brown math/algo videos.
Written by Neura Market from the official Hermes Agent documentation for Manim Video. Commands, paths, and version numbers are reproduced from the source unchanged.
Read the official documentationThis skill turns a prompt into a programmatic animation pipeline using Manim Community Edition. You describe a concept, equation, algorithm, or data story, and the agent produces a Python script that renders into a polished explainer video. It is for anyone who needs to communicate technical ideas through motion and geometry, not for editing raw footage or compositing live action.
What it does
The Manim Video skill generates 3Blue1Brown-style educational animations. It handles the full pipeline from planning to final MP4: narrative design, scene coding, rendering, stitching, and optional voiceover. The output is a single Python file with one class per scene, each independently renderable, plus a plan file and a stitched video.
You can produce concept explainers, equation derivations, algorithm visualizations, data stories, architecture diagrams, paper explainers, and 3D visualizations. The skill enforces a creative standard: every frame should teach, every animation should reveal structure, and the first render should be visually cohesive without revision rounds.
Before you start
Run scripts/setup.sh to verify all dependencies. You need:
- Python 3.10+
- Manim Community Edition v0.20+ (
pip install manim) - LaTeX:
texlive-fullon Linux,mactexon macOS, or MiKTeX on Windows - ffmpeg
The reference docs are tested against Manim CE v0.20.1. The skill runs on Linux, macOS, and Windows. No GPU is required.
Pipeline overview
The skill follows a six-step pipeline. Every project goes through these stages in order.
PLAN --> CODE --> RENDER --> STITCH --> AUDIO (optional) --> REVIEW
- PLAN - Write
plan.mdwith narrative arc, scene list, visual elements, color palette, voiceover script - CODE - Write
script.pywith one class per scene, each independently renderable - RENDER -
manim -ql script.py Scene1 Scene2 ...for draft,-qhfor production - STITCH - ffmpeg concat of scene clips into
final.mp4 - AUDIO (optional) - Add voiceover and/or background music via ffmpeg. See
references/rendering.md - REVIEW - Render preview stills, verify against plan, adjust
Project structure
Each project lives in its own directory with this layout:
project-name/
plan.md # Narrative arc, scene breakdown
script.py # All scenes in one file
concat.txt # ffmpeg scene list
final.mp4 # Stitched output
media/ # Auto-generated by Manim
videos/script/480p15/
Modes
The skill supports seven modes. Each mode maps to a different input type and output style.
| Mode | Input | Output | Reference |
|---|---|---|---|
| Concept explainer | Topic/concept | Animated explanation with geometric intuition | references/scene-planning.md |
| Equation derivation | Math expressions | Step-by-step animated proof | references/equations.md |
| Algorithm visualization | Algorithm description | Step-by-step execution with data structures | references/graphs-and-data.md |
| Data story | Data/metrics | Animated charts, comparisons, counters | references/graphs-and-data.md |
| Architecture diagram | System description | Components building up with connections | references/mobjects.md |
| Paper explainer | Research paper | Key findings and methods animated | references/scene-planning.md |
| 3D visualization | 3D concept | Rotating surfaces, parametric curves, spatial geometry | references/camera-and-3d.md |
Creative direction
Color palettes
| Palette | Background | Primary | Secondary | Accent | Use case |
|---|---|---|---|---|---|
| Classic 3B1B | #1C1C1C | #58C4DD (BLUE) | #83C167 (GREEN) | #FFFF00 (YELLOW) | General math/CS |
| Warm academic | #2D2B55 | #FF6B6B | #FFD93D | #6BCB77 | Approachable |
| Neon tech | #0A0A0A | #00F5FF | #FF00FF | #39FF14 | Systems, architecture |
| Monochrome | #1A1A2E | #EAEAEA | #888888 | #FFFFFF | Minimalist |
Animation speed
| Context | run_time | self.wait() after |
|---|---|---|
| Title/intro appear | 1.5s | 1.0s |
| Key equation reveal | 2.0s | 2.0s |
| Transform/morph | 1.5s | 1.5s |
| Supporting label | 0.8s | 0.5s |
| FadeOut cleanup | 0.5s | 0.3s |
| "Aha moment" reveal | 2.5s | 3.0s |
Typography scale
| Role | Font size | Usage |
|---|---|---|
| Title | 48 | Scene titles, opening text |
| Heading | 36 | Section headers within a scene |
| Body | 30 | Explanatory text |
| Label | 24 | Annotations, axis labels |
| Caption | 20 | Subtitles, fine print |
Fonts
Use monospace fonts for all text. Manim's Pango renderer produces broken kerning with proportional fonts at all sizes. See references/visual-design.md for full recommendations.
MONO = "Menlo" # define once at top of file
Text("Fourier Series", font_size=48, font=MONO, weight=BOLD) # titles
Text("n=1: sin(x)", font_size=20, font=MONO) # labels
MathTex(r"\nabla L") # math (uses LaTeX)
Minimum font_size=18 for readability.
Per-scene variation
Never use identical config for all scenes. For each scene:
- Different dominant color from the palette
- Different layout - don't always center everything
- Different animation entry - vary between Write, FadeIn, GrowFromCenter, Create
- Different visual weight - some scenes dense, others sparse
Workflow
Step 1: Plan (plan.md)
Before any code, write plan.md. See references/scene-planning.md for the comprehensive template.
Step 2: Code (script.py)
One class per scene. Every scene is independently renderable.
from manim import *
BG = "#1C1C1C"
PRIMARY = "#58C4DD"
SECONDARY = "#83C167"
ACCENT = "#FFFF00"
MONO = "Menlo"
class Scene1_Introduction(Scene):
def construct(self):
self.camera.background_color = BG
title = Text("Why Does This Work?", font_size=48, color=PRIMARY, weight=BOLD, font=MONO)
self.add_subcaption("Why does this work?", duration=2)
self.play(Write(title), run_time=1.5)
self.wait(1.0)
self.play(FadeOut(title), run_time=0.5)
Key patterns:
- Subtitles on every animation:
self.add_subcaption("text", duration=N)orsubcaption="text"onself.play() - Shared color constants at file top for cross-scene consistency
self.camera.background_colorset in every scene- Clean exits - FadeOut all mobjects at scene end:
self.play(FadeOut(Group(*self.mobjects)))
Step 3: Render
manim -ql script.py Scene1_Introduction Scene2_CoreConcept # draft
manim -qh script.py Scene1_Introduction Scene2_CoreConcept # production
Step 4: Stitch
cat > concat.txt << 'EOF'
file 'media/videos/script/480p15/Scene1_Introduction.mp4'
file 'media/videos/script/480p15/Scene2_CoreConcept.mp4'
EOF
ffmpeg -y -f concat -safe 0 -i concat.txt -c copy final.mp4
Step 5: Review
manim -ql --format=png -s script.py Scene2_CoreConcept # preview still
Critical implementation notes
Raw strings for LaTeX
# WRONG: MathTex("\frac{1}{2}")
# RIGHT:
MathTex(r"\frac{1}{2}")
buff >= 0.5 for edge text
label.to_edge(DOWN, buff=0.5) # never < 0.5
FadeOut before replacing text
self.play(ReplacementTransform(note1, note2)) # not Write(note2) on top
Never animate non-added mobjects
self.play(Create(circle)) # must add first
self.play(circle.animate.set_color(RED)) # then animate
Performance targets
| Quality | Resolution | FPS | Speed |
|---|---|---|---|
-ql (draft) | 854x480 | 15 | 5-15s/scene |
-qm (medium) | 1280x720 | 30 | 15-60s/scene |
-qh (production) | 1920x1080 | 60 | 30-120s/scene |
Always iterate at -ql. Only render -qh for final output.
When not to use it
This skill is not for editing existing video, compositing live action, or creating non-educational content. If you need to splice together camera footage, add filters to a recording, or produce a marketing sizzle reel, a traditional video editor is the right tool. The skill also assumes you want programmatic, reproducible animations. If you need hand-drawn or organic motion, this pipeline will fight you.
Limits and gotchas
- The skill enforces a monospace font rule. Proportional fonts break kerning in Manim's Pango renderer. Stick to Menlo or another monospace face.
- LaTeX strings must use raw Python strings (
r"..."). A regular string will interpret backslashes as escape sequences and produce broken equations. - Every scene must set
self.camera.background_color. The default is black, but explicit is better. - Text placed at the edge of the screen needs
buff >= 0.5to avoid clipping. - Always use
ReplacementTransformwhen updating text, notWriteon top of existing text. - A mobject must be added to the scene before you animate it. Calling
self.play(Create(circle))without first adding it will raise an error. - The first render should be visually cohesive. If something looks cluttered, poorly timed, or like "AI-generated slides," it is wrong.
- Every animation needs a
self.wait()after it. The viewer needs time to absorb what just appeared. Never rush from one animation to the next.
Creative divergence (use only when user requests experimental/creative/unique output)
If the user asks for creative, experimental, or unconventional explanatory approaches, select a strategy and reason through it BEFORE designing the animation.
- SCAMPER - when the user wants a fresh take on a standard explanation
- Assumption Reversal - when the user wants to challenge how something is typically taught
SCAMPER transformation
Take a standard mathematical/technical visualization and transform it:
- Substitute: replace the standard visual metaphor (number line to winding path, matrix to city grid)
- Combine: merge two explanation approaches (algebraic + geometric simultaneously)
- Reverse: derive backward - start from the result and deconstruct to axioms
- Modify: exaggerate a parameter to show why it matters (10x the learning rate, 1000x the sample size)
- Eliminate: remove all notation - explain purely through animation and spatial relationships
Assumption reversal
- List what's "standard" about how this topic is visualized (left-to-right, 2D, discrete steps, formal notation)
- Pick the most fundamental assumption
- Reverse it (right-to-left derivation, 3D embedding of a 2D concept, continuous morphing instead of steps, zero notation)
- Explore what the reversal reveals that the standard approach hides
Related references
These files live in the skill's references/ directory and cover specific topics in depth:
| File | Contents |
|---|---|
references/animations.md | Core animations, rate functions, composition, .animate syntax, timing patterns |
references/mobjects.md | Text, shapes, VGroup/Group, positioning, styling, custom mobjects |
references/visual-design.md | 12 design principles, opacity layering, layout templates, color palettes |
references/equations.md | LaTeX in Manim, TransformMatchingTex, derivation patterns |
references/graphs-and-data.md | Axes, plotting, BarChart, animated data, algorithm visualization |
references/camera-and-3d.md | MovingCameraScene, ThreeDScene, 3D surfaces, camera control |
references/scene-planning.md | Narrative arcs, layout templates, scene transitions, planning template |
references/rendering.md | CLI reference, quality presets, ffmpeg, voiceover workflow, GIF export |
references/troubleshooting.md | LaTeX errors, animation errors, common mistakes, debugging |
references/animation-design-thinking.md | When to animate vs show static, decomposition, pacing, narration sync |
references/updaters-and-trackers.md | ValueTracker, add_updater, always_redraw, time-based updaters, patterns |
references/paper-explainer.md | Turning research papers into animations - workflow, templates, domain patterns |
references/decorations.md | SurroundingRectangle, Brace, arrows, DashedLine, Angle, annotation lifecycle |
references/production-quality.md | Pre-code, pre-render, post-render checklists, spatial layout, color, tempo |