No project description provided
Project description
Manim Community Edition 'interactive' plugin
Getting Started
Installation
There are several components that require installation:
manim(Community edition) - obviously- OpenGL for your machine (we use
--renderer=opengl) manim_interactive- this pluginmanimvsVScode extension
Further details
First you will want to install manim. Make sure it is the Manim Community edition, and not the original 3Blue1Brown Manim version.
In addition, we will be using the OpenGL renderer (which is not exactly the same as the regular Cairo renderer). The reason is that the Cairo one renders to video files fine, but isn't really intended for 'realtime/interactive' usage (unless you are prepared to wait for lots of video regeneration).
To install the essentials required for OpenGL (on Fedora), I needed to run (as root):
# For manim (base)
dnf install pango-devel texlive-dvisvgm texlive-standalone
# For manim OpenGL backend
dnf install mesa-libGL libglvnd-devel
# The latter of these packages was discovered by running:
dnf provides '*/libGL.so'
Then install this plugin pip install manim_interactive
(you can also use uv pip install manim_interactive) - or install from source (for debugging, see below).
Also install the manimvs extension in vscode.
I chose to base this plugin on that that extension, since it does not depend on 3b1t manim to run.
Debugging
This is only required if you want to debug this manim plugin : Normal usage should just require the installation steps above.
Install poetry module, to manage the development environment in a way that is compatible with the manim ecosystem.
For me, using Fedora (during development), I needed to do (as root):
dnf install poetry
Then use the Python environment defined through poetry (as user):
poetry shell
poetry install
The manim file I used during development was the simple testbed.py file included here.
Usage / Setting Up a Scene
Running this interactive session requires a few steps:
- import this plugin
- add a
self.embed()breakpoint to your scene - run
manimin a VScode terminal window - connect
manimvsextension to the terminal window - select the appropriate line(s) in vscode, and press the magic hotkeys
Further details
In the file that you want to interactively edit, please make sure you've included manim_interactive:
from manim import * # Already there
# ... other stuff
from manim_interactive import *
# ... etc
This will simply give you the checkpoint_paste() command in the interactive session.
Then, in that scene, before a comment starting a segment that you are building out (or refining), insert the following:
self.embed()
(See the testbed.py file here to see how it looks in practice).
Then, you can create a terminal in a separate window in VScode ("Create Terminal New Window = Ctrl-Shift-Alt-`", or create a Terminal session and right-click in its task bar to "Move Terminal to New Window"), and run there (updated for your file/scene):
manim testbed.py SimpleTest --renderer=opengl -p
to get an interactive scene.
Then, connect that terminal using the manimvs extension command Manimgl: Select terminal (Python3).
Then, go to the line(s) that you want to debug and use the manimvs extension command Manimgl: On Cursor Checkpoint Paste (it'll likely be helpful to bind this to a key combo, like Ctrl-m-Ctrl-p).
There are several modes of 'Checkpoint Paste' in the editor:
- editor cursor is on a line of code : This line is executed immediately
- editor has lines of code selected : These lines are executed immediately
- editor cursor in on a commented line : Saves a checkpoint (corresponding to the contents of the line), which you can reset the scene to by redoing this commented-line CheckpointPaste : This is the key time-saving feature! and then runs the block up until the next commented line
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file manim_interactive-0.1.0.tar.gz.
File metadata
- Download URL: manim_interactive-0.1.0.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.5 CPython/3.13.6 Linux/6.15.9-201.fc42.x86_64
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ab5a3314f9632eb5cfa62e93fb410db794eeafbd4dd2a8dff56018510f20b0de
|
|
| MD5 |
f27ff6b46db6c71c1a451bbcec1b3249
|
|
| BLAKE2b-256 |
3fec8dfa91c4d69862e2a9842163e7a5c7eb406044a874decf9465ace2ae56fb
|
File details
Details for the file manim_interactive-0.1.0-py3-none-any.whl.
File metadata
- Download URL: manim_interactive-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.5 CPython/3.13.6 Linux/6.15.9-201.fc42.x86_64
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
94ce2f07fd4c020b68ff52e44170267b0fa750f68b21a4c3b77d3ffa7cbeb4a5
|
|
| MD5 |
fcd07ea949043c30edffe5240efbd716
|
|
| BLAKE2b-256 |
597a2c7907149e87d8ab5d0e6467784d2585dad7b93e5b05bc641240a788aedb
|