videos README

The project's README from github.com/3b1b/videos. As one markdown file: README.md.

This project contains the code used to generate the explanatory math videos found on 3Blue1Brown.

This almost entirely consists of scenes generated using the library Manim. See also the community maintained version at ManimCommunity.

Older projects may have code dependent on older versions of manim, and so may not run out of the box here.

Note, while the library Manim itself is open source software and under the MIT license, the contents of this repository are available under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

CC BY-NC-SA 4.0

Workflow

I made this video to show more of how I use manim. Note that I'm using 3b1b/manim, not the community edition, some functionality may differ between the two. Aside from installing manim itself, replicating the workflow involves some custom plugins with Sublime, the text editor I use.

If you use another text editor, the same functionality can be mimicked. The key is to make use of two facts.

For my own workflow, I set up some keyboard shortcuts to kick off each of these commands. For those who want to try it out themselves, here's what's involved.

Sublime-specific instructions

Install Terminus (via package control). This is a terminal run within sublime, and it lets us write some plugins that take the state in sublime, like where your cursor is, what's highlighted, etc., and use that to run a desired command line instruction.

Take the files in the "sublime_custom_commands" sub-directory of this repo, and copy them into the Packages/User/ directory of your Sublime Application. This should be a directory with a path that looks something like /wherever/your/sublime/lives/Packages/User/

Add some keybindings to reference these commands. Here's what I have inside my key_bindings file, you can find your own under the menu Sublime Text -> Settings -> Keybindings

    { "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"},

For example, I bind the "command + shift + R" to a custom "manim_run_scene" command. If the cursor is inside a line of a scene, this will drop you into the interactive mode at that point of the scene. If the cursor is on the line defining the scene, it will copy to the clipboard the command needed to render that full scene to file.

I bind "command + R" to a "manim_checkpoint_paste" command, which will copy whatever bit of code is highlighted, and run "checkpoint_paste()" in the interactive terminal.

Of course, you could set these to whatever keyboard shortcuts you prefer.

Installation

  1. Install manimgl from source since the latest version published is not up to date.
  2. Ensure Latex is installed, for example on Ubuntu
    sudo apt install texlive
    sudo apt install texlive-latex-extra
    sudo apt install texlive-fonts-extra
    sudo apt install texlive-science
    
  3. Clone this repository to run the video samples
    git clone [email protected]:3b1b/videos.git
    cd videos
    

Running a video

  1. Setup includes (if you don't want to modify your path)

    cd _2023/optics_puzzles
    vi e_field.py
    

    And add the following to the top

    import sys
    sys.path.append(".")
    sys.path.append("..")
    sys.path.append("../..")
    
  2. Run an example

    manimgl e_field.py
    

    Or

    manimgl e_field.py WavesIn3D
    

Copyright © 2026 3Blue1Brown

videos (3b1b/videos)

Searching Database…

11.4K ·GitHub
Что это?Это исходный код, стоящий за математическими объясняющими видео 3Blue1Brown: сцены на Python, построенные с библиотекой анимации manim, которые генерируют реальные визуальные эффекты, видимые в видео.
Это переиспользуемая библиотека или просто набор скриптов для отдельных видео?Это набор сцен-скриптов для отдельных видео, а не упакованная библиотека; он зависит от личного форка manim от 3b1b (3b1b/manim), который отличается от поддерживаемой сообществом версии ManimCommunity.
Как самому запустить сцену из одного из видео?Установите manimgl из исходников, убедитесь, что установлен LaTeX, склонируйте этот репозиторий, затем выполните команду вида manimgl (файл) (имя сцены), чтобы отрендерить её.
Что нужно установить перед этим?Нужен manimgl, собранный из исходников (опубликованная версия пакета устарела), и работающая установка LaTeX для рендеринга математического текста.
Старые сцены просто запустятся из коробки?Нет. Сцены из старых видео создавались под более ранние версии manim, поэтому могут не запуститься без изменений на текущей кодовой базе.
Кому этот репозиторий реально полезен?Он нацелен на тех, кто хочет изучать, воспроизводить или дорабатывать конкретные анимации из видео 3Blue1Brown, а не на универсальный набор анимационных инструментов для посторонних проектов.
Могу ли я использовать этот код в коммерческих целях?Нет. Хотя сама библиотека manim лицензирована под MIT, контент видео-сцен в этом репозитории лицензирован как Creative Commons Attribution-NonCommercial-ShareAlike 4.0, так что коммерческое переиспользование кода/контента сцен не допускается.
В чём разница между 3b1b/manim и версией ManimCommunity?Этот репозиторий работает на 3b1b/manim — личном форке Гранта Сандерсона, а не на поддерживаемом сообществом проекте ManimCommunity; кое-какая функциональность между этими двумя версиями различается.
Могу ли я залезть в сцену и править её на лету, а не рендерить заново с нуля?Да. Запуск manimgl с флагом -se погружает вас в интерактивную сессию iPython на заданной строке, а ввод checkpoint_paste() выполняет код из буфера обмена на сохранённом состоянии сцены, позволяя итерировать без перезапуска.
Нужен ли Sublime Text для этого воркфлоу?Нет, Sublime Text — это просто личный редактор автора с пользовательскими хоткеями для запуска команд manim; лежащую в основе функциональность интерактивного редактирования можно воспроизвести в любом текстовом редакторе.
Можно рендерить видео в файл, а не только смотреть интерактивное превью?Да, команда checkpoint_paste поддерживает аргумент record, который рендерит анимации, запускаемые этим блоком кода, прямо в видеофайл.
Creator
3b1b
Size
185 MB
Stars
11.4K
Updated
CommitSep 29
Age
5y
Commits · 90 Days