Docs

This walkthrough serves as a guide to getting started with Mscene.

Manim in Colab

Visit colab.new to create a new Colab notebook.

Installation

Install Mscene

%pip install -q mscene

View Usage

import mscene
%mscene -h
Mscene Usage
Usage: %mscene <command>

Commands
---------
manim               Install Manim with LaTeX
-l manim            Install Manim without LaTeX
manim==<ver>        Install specific Manim version
plugins             Add or update plugins
<filename>          Download source
-h                  View usage

Install Manim

The session will restart to apply changes.

Manim without LaTeX

import mscene
%mscene -l manim

Manim with LaTeX

import mscene
%mscene manim

Import Manim

from mscene.manim import *

Rendering

Manim CLI

Manim Scene
%%manim -ql ManimScene

class ManimScene(Scene):
    def construct(self):
        banner = ManimBanner()
        self.add(banner)

%%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

ManimScene is the scene class to render.

Manim Gallery

Example Scene

%%manim -qm ManimScene

class ManimScene(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.

Adding Plugins

Install Mscene

%pip install -q mscene

Add Plugins

import mscene
%mscene plugins

Install Mscene

pip install -q mscene

Add Plugins

mscene plugins

Import Plugins

from mscene.plugins import *

Mscene Plugins

Example Plugin

%%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)