An invitation to Manim

PART 1

Things to know before you start

History is complicated: different versions!

  • CAUTION: There are several incompatible versions of Manim floating around.
    • Manim: the community maintained version
    • 3b1b/manim – manimgl – manimlib: the original version, developed + maintained mainly by Grant "3b1b" Sanderson
  • This video is about the community maintained version!

How do I install Manim?

  • Two ingredients: FFmpeg and Python (3.7+)
  • Optional (but useful): a LaTeX distribution like MiKTeX / TeXLive
  • Caution: most installation videos are outdated!
Go to docs.manim.community and follow installation instructions for your OS!

Help and other resources?

PART 2

Basic anatomy of Manimations

Learning by Doing!

from manim import *

class FirstExample(Scene):
    def construct(self):
        blue_circle = Circle(color=BLUE, fill_opacity=0.5)
        green_square = Square(color=GREEN, fill_opacity=0.8)
        green_square.next_to(blue_circle, RIGHT)
        self.add(blue_circle, green_square)
Generating Output ...
... the "normal" way:
  • Write code in file.py
  • Then run manim -qm -p file.py FirstExample in terminal
... with Jupyter:
  • Import manim, put code for scene in a cell
  • %%manim -qm FirstExample at beginning of cell, then run it

Scene, Mobjects, global constants

  • Scene: animation canvas
  • Mobjects: Manim objects – Circle, Square, ...
  • Mobjects have properties – color, fill_opacity, ...
  • Some global constants: colors (BLUE, GREEN, ...) and directions (UP, DOWN, RIGHT, ...)
The reference manual at docs.manim.community lists all available classes and functions!

PART 3

Moving Pictures!

add, wait, play – Animations!

  • Scene.add adds Mobjects immediately to the scene
  • Scene.wait adds a pause
  • Scene.play plays animations
  • Animations can ...
    • add mobjects (Create, FadeIn, ...)
    • change mobjects (Transform, ...)
    • emphasize mobjects (Indicate, Circumscribe, ...)
    • remove mobejcts (Uncreate, FadeOut, ...)