# 3b1b Videos: Manim Scene Source Code Behind 3Blue1Brown's Math Animations

> The 3b1b/videos repository holds the Python source code for every scene in 3Blue1Brown's math video library, organized by year from 2015 to 2026. The scenes are built with the 3b1b/manim library, not the separately maintained ManimCommunity fork, and require a specific interactive authoring workflow with Sublime Text, LaTeX, and custom keyboard shortcuts. The code is licensed under CC BY-NC-SA 4.0, which prohibits commercial use.

**3b1b/videos** — Code for the manim-generated scenes used in 3blue1brown videos

- Repository: https://github.com/3b1b/videos
- Stars: 11,287 · Forks: 2,090
- Language: Python
- License: NOASSERTION
- Published: 2026-09-21 · Updated: 2026-09-21 · Language: en
- Canonical page: https://hysenlabs.com/projects/3b1b-videos

## What 3b1b/videos Contains and Who Should Clone It

The repository holds Python code that generates the math animations published on the 3Blue1Brown YouTube channel. Each scene is a Python file that imports from the Manim animation library and defines one or more scene classes. Running a scene file with manimgl produces the animation as either an interactive preview or a rendered video file.

The README describes the repository as belonging to 3Blue1Brown and states that the code covers scenes generated using the Manim library. This is reference material for anyone who wants to understand how a specific animation was constructed, learn from the code behind a video they found useful, or study how the library author himself writes and structures Manim scenes.

The primary use case is not end-user viewing but code study and reuse. Educators building their own animated explanations may find specific techniques in the scenes useful. Developers extending or contributing to the 3b1b/manim library may find the videos repository useful for understanding the kinds of constructs the library needs to support. The repository also includes a CLAUDE.md file in the root, which documents something about the codebase for AI assistant context, though its contents are not reproduced in the README.

## Year-Based Directory Structure from _2015 to _2026

The repository root contains year-based directories: _2015/, _2016/, _2017/, _2018/, _2019/, _2020/, _2021/, _2022/, _2023/, _2024/, _2025/, and _2026/. Each year directory holds the Python scene files for videos produced that year. Additional directories at the root include custom/, once_useful_constructs/, outside_videos/, and sublime_custom_commands/ for the Sublime Text plugin files.

The year-based layout is a direct mapping of the production timeline. Videos from 2015 use older Manim APIs that may no longer exist in the current version of the library. The README notes this explicitly: older projects may have code dependent on older versions of manim and so may not run out of the box. This is a meaningful caveat for anyone who wants to execute specific older scenes. A scene from _2023 or later is more likely to run cleanly with the current manimgl than one from _2015 or _2016.

The custom/ directory and the manim_imports_ext.py file at the repository root handle imports and shared utilities that many scenes reference. Adding these to the Python path is a required step before running any scene, as the README explains with the sys.path setup shown in its worked example.

## Installing manimgl from Source and Setting Up LaTeX

The README gives a clear instruction about installation: install manimgl from source rather than from PyPI, because the latest version published to PyPI is not up to date. Detailed installation instructions for manimgl live in the 3b1b/manim repository's README, not in 3b1b/videos.

After installing manimgl, LaTeX must be present on the system. The README gives apt-based install commands for Ubuntu:

```sh
sudo apt install texlive
sudo apt install texlive-latex-extra
sudo apt install texlive-fonts-extra
sudo apt install texlive-science
```

These four packages cover the LaTeX distributions that Manim uses to render mathematical typesetting in scenes. Missing any of them may cause certain scenes to fail during rendering when LaTeX typesetting is invoked.

Once manimgl and LaTeX are in place, clone the repository:

```sh
git clone git@github.com:3b1b/videos.git
cd videos
```

The clone uses the SSH URL shown in the README. Before running a scene from a specific year directory, the README instructs adding the repository root and parent directories to sys.path. The example navigates to the _2023/optics_puzzles directory and adds path entries to the scene file:

```python
import sys
sys.path.append(".")
sys.path.append("..")
sys.path.append("../..")
```

This is a manual step rather than a configured package path, which means it must be repeated for each scene file in a new directory. The README suggests this as a workaround for users who do not want to modify their system Python path.

## Running a Scene and the -se Interactive Mode

With the path configured, running a scene file is a single manimgl command. The README gives two forms: running all scenes in a file, or running a specific named scene.

```sh
manimgl e_field.py
```

```sh
manimgl e_field.py WavesIn3D
```

The second form, naming the specific scene class WavesIn3D, renders or previews only that scene without iterating through all scenes defined in the file.

For interactive development, the -se flag followed by a line number drops into an interactive mode at that specific line, similar to a debugger, with an iPython terminal attached. The README describes this as a core part of the authoring workflow: instead of re-rendering a full scene after every code change, the author enters interactive mode at a particular line, makes changes through the terminal, and sees the results immediately.

Within the interactive terminal, calling checkpoint_paste() runs whatever code is currently in the clipboard. The first time a particular comment appears at the top of the pasted code, the system saves the scene state at that point. On subsequent calls with the same comment, the scene resets to that saved state before running the new code. The argument skip runs the pasted code at time zero without animating, and record captures the result as a rendered video. This checkpoint mechanism means the author can iterate on a specific part of a scene without re-executing all the earlier animation steps from the beginning.

## Sublime Text Keybindings and the Custom Plugin Layer

The authoring workflow described in the README is built around Sublime Text with the Terminus plugin. Terminus runs a terminal within Sublime, and the custom commands in the sublime_custom_commands/ directory use Sublime's cursor position and selection state to trigger manimgl commands without leaving the editor.

The README provides example keybindings from the author's own Sublime configuration:

```
{ "keys": ["shift+super+r"], "command": "manim_run_scene" },
{ "keys": ["super+r"], "command": "manim_checkpoint_paste" },
{ "keys": ["super+alt+r"], "command": "manim_recorded_checkpoint_paste" },
{ "keys": ["super+ctrl+r"], "command": "manim_skipped_checkpoint_paste" },
{ "keys": ["super+e"], "command": "manim_exit" },
{ "keys": ["super+option+/"], "command": "comment_fold"}
```

The manim_run_scene command reads the cursor position within Sublime: if the cursor is inside a scene's body, it drops into interactive mode at that line; if the cursor is on the class definition line, it copies the full render command to the clipboard. The manim_checkpoint_paste command copies the highlighted code and sends it to checkpoint_paste() in the terminal.

These keybindings are specific to macOS command key conventions. Anyone on Linux or Windows who wants to replicate the workflow needs to remap the super key and verify that the Terminus plugin commands behave identically on their platform. The README notes that the same functionality can be set up in other editors, but the sublime_custom_commands/ files in the repository are written specifically for Sublime with Terminus.

## Licence Constraint: CC BY-NC-SA 4.0 vs. Manim's MIT

The licence situation for this repository is split and worth stating plainly. The Manim library itself (at 3b1b/manim) is MIT-licensed, which permits unrestricted use including commercial applications. The contents of the 3b1b/videos repository are licensed differently: they use the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License (CC BY-NC-SA 4.0). The README states this explicitly and links to the licence.

CC BY-NC-SA 4.0 carries three conditions. Attribution requires crediting 3Blue1Brown when reusing the material. NonCommercial prohibits using the material for commercial purposes. ShareAlike requires derivative works to be distributed under the same or a compatible licence.

This distinction matters for anyone who wants to adapt a specific animation technique from the repository. Studying the code and learning from it is permitted. Using the code as a starting point for an educational tool published on YouTube without monetization is likely permissible under the NonCommercial clause. Using the code as part of a paid course, a commercial product, or a monetized channel requires separate permission from 3Blue1Brown, since CC BY-NC-SA 4.0 prohibits that use. The README does not document a contact or process for requesting commercial licences.

## The 3b1b Manim Fork vs. ManimCommunity

The README links to the community-maintained fork at ManimCommunity/manim as an alternative to the 3b1b/manim library. It notes explicitly that some functionality may differ between the two forks. This is a straightforward but important technical distinction for anyone who wants to run the 3b1b/videos code.

The ManimCommunity fork was created to provide a more stable, better-documented, and community-supported version of Manim. It has a dedicated documentation site, a structured release process, and a larger contributor base than the 3b1b fork. Many tutorials, YouTube channels, and courses teaching Manim use ManimCommunity rather than the original 3b1b fork.

However, the 3b1b/videos repository scenes are written against 3b1b/manim, not ManimCommunity/manim. The two forks diverged years ago, and constructs available in one may not exist in the other, or may have different names and calling conventions. Attempting to run 3b1b/videos scenes with the ManimCommunity version of the library will likely fail for scenes that use 3b1b-specific constructs, methods, or scene utilities. The README makes this clear by pointing users to install manimgl (the 3b1b version) from source rather than the community package.

For someone who wants to learn Manim in order to create their own animations, ManimCommunity is the better starting point because of its documentation and community support. For someone who specifically wants to run or study 3b1b/videos code, the 3b1b fork is required.

## Conclusion

Developers who want to understand how a specific 3Blue1Brown animation was built, or who want to study the Manim authoring workflow as practiced by the library's primary author, should clone 3b1b/videos and run scenes from a recent year directory. Anyone building original educational animations who plans to distribute or commercialize them must verify that the CC BY-NC-SA 4.0 licence permits their use case before using this code as a base. Older year directories may not run with the current manimgl version, so test a scene from the target year directory before depending on it for a project. Install manimgl from source rather than PyPI, as the README explicitly states the published version is not current.

## FAQ

### What licence covers the code in the 3b1b/videos repository?

The scenes are under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License (CC BY-NC-SA 4.0). This prohibits commercial use. The Manim library itself at 3b1b/manim is under the MIT licence, which is more permissive, but the video scene code in this repository is not.

### Why does the README say to install manimgl from source rather than from PyPI?

The README states that the latest version published to PyPI is not up to date. Installing from source using the 3b1b/manim repository ensures the version matches what the scenes in this repository were written against.

### How do I run a specific scene from the 3b1b/videos repository?

Navigate to the scene file's directory, add the repository root directories to sys.path in the file, then run manimgl followed by the filename and optionally the scene class name, for example manimgl e_field.py WavesIn3D.

## Sources

- [3b1b/videos on GitHub](https://github.com/3b1b/videos)
- [Issues](https://github.com/3b1b/videos/issues)
- [README](https://github.com/3b1b/videos/blob/master/README.md)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/3b1b-videos
