Skip to content
/ manim Public
forked from 3b1b/manim

Animation engine for explanatory math videos

License

Notifications You must be signed in to change notification settings

Bubbl3Bi/manim

 
 

Repository files navigation

MIT License Manim Subreddit Manim Discord docs

Manim is an engine for precise programatic animations, designed for creating explanatory math videos.

Note, there are two versions of manim. This repository began as a personal project by the author of 3Blue1Brown for the purpose of animating those videos, with video-specific code available here. In 2020 a group of devlopers forked it into what is now the community edition, with a goal of being more stable, better tested, quicker to respond to community contributions, and all around friendlier to get started with. You can engage with that community by joining the discord.

Since the fork, this version has evolved to work on top of OpenGL, and allows real-time rendering to an interactive window before scenes are finalized and written to a file.

Installation

Manim runs on Python 3.8.

System requirements are FFmpeg, OpenGL, LaTeX (optional, if you want to use LaTeX) and cairo (optional, if you want to use Text).

For more options, take a look at the Using manim sections further below.

Directly

If you want to hack on manimlib itself, clone this repository and in that directory execute:

# Install python requirements
pip install -r requirements.txt

# Try it out
python manim.py example_scenes.py OpeningManimExample

Mac OSX

  1. Install FFmpeg, LaTeX, Cairo in terminal using homebrew.

    brew install ffmpeg mactex cairo
  2. Install latest version of manim using these command.

    git clone https://github.com/3b1b/manim.git
    cd manim
    pip install -r requirements.txt
    python manim.py example_scenes.py OpeningManimExample

Directly (Windows)

  1. Install FFmpeg.
  2. Install a LaTeX distribution. MiKTeX is recommended.
  3. Install the remaining Python packages.
    git clone https://github.com/3b1b/manim.git
    cd manim
    pip install -r requirements.txt
    python manim.py example_scenes.py OpeningManimExample

Anaconda Install

  • Install latex as above.
  • Create a conda environment using conda env create -f environment.yml

Using virtualenv and virtualenvwrapper

After installing virtualenv and virtualenvwrapper

git clone https://github.com/3b1b/manim.git
mkvirtualenv -a manim -r requirements.txt manim
python -m manim example_scenes.py OpeningManimExample

Using manim

Try running the following:

python -m manim example_scenes.py OpeningManimExample

This should pop up a window playing a simple scene.

Some useful flags include:

  • -w to write the scene to a file
  • -o to write the scene to a file and open the result
  • -s to skip to the end and just show the final frame.
    • -so will save the final frame to an image and show it
  • -n <number> to skip ahead to the n'th animation of a scene.
  • -f to make the playback window fullscreen

Take a look at custom_defaults.yml for further configuration. To add your customization, you can either edit this file, or add another file by the same name "custom_defaults.yml" to whatever directory you are running manim from. For example this is the one for 3blue1brown videos. There you can specify where videos should be output to, where manim should look for image files and sounds you want to read in, and other defaults regarding style and video quality.

Look through the example scenes to get a sense of how it is used, and feel free to look through the code behind 3blue1brown videos for a much larger set of example. Note, however, that developments are often made to the library without considering backwards compatibility with those old videos. To run an old project with a guarantee that it will work, you will have to go back to the commit which completed that project.

Documentation

Documentation is in progress at 3b1b.github.io/manim. And there is also a Chinese version maintained by @manim-kindergarten: manim.ml (in Chinese).

manim-kindergarten wrote and collected some useful extra classes and some codes of videos in manim_sandbox repo.

Contributing

Is always welcome. As mentioned above, the community edition has the most active ecosystem for contributions, with testing and continuous integration, but pull requests are welcome here too. Please explain the motivation for a given change and examples of its effect.

License

This project falls under the MIT license.

About

Animation engine for explanatory math videos

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 94.4%
  • GLSL 5.4%
  • TeX 0.2%