Docs

A step-by-step walkthrough to get started with Mscene.

Manim in Colab

Open Google Colab

Create a new notebook: colab.new.

Install & Import Mscene

%pip install mscene
import mscene

View Commands

%mscene -h

Install Manim

The session will restart to apply changes.

Manim without LaTeX

%mscene -l manim

Manim with LaTeX

%mscene manim

Import Manim

from mscene.manim import *
View Manim CLI
Scene Render

%%manim -ql NewScene is a cell command.

%%manim runs code cells with manim in a subprocess.

-ql sets the render quality to 480p at 15fps.
  -qm — 720p, 30fps
  -qh — 1080p, 60fps
  -qp — 1440p, 60fps
  -qk — 2160p, 60fps

NewScene is the scene class to be rendered.

View Manim Gallery
%%manim -qm ExampleScene
class ExampleScene(Scene):
    def construct(self):
        banner = ManimBanner()
        self.play(banner.create())
        self.play(banner.expand())
        self.wait(1.5)

Mscene Plugins

Plugins extend Manim with additional features.

Add Plugins

In Google Colab or Jupyter Notebook, execute the notebook command in a code cell or run the terminal command directly in the terminal to add or update plugins. Alternatively, the plugins can be downloaded from GitHub.

import mscene
%mscene plugins
mscene plugins

Import Plugins

from mscene.plugins import *
View Mscene Plugins
%%manim -qm FractalScene
class FractalScene(Scene):
    def construct(self):
        ks = KochSnowflake(level=2)
        self.add(ks)
        self.play(ks.animate.next_level())
        self.wait(1.5)
        self.play(ks.animate.prev_level())
        self.wait(1.5)