
* fix(ci): add Ubuntu dep and change pip install * fix(ci): typo * fix(ci): add missing deps for Ubuntu * fix(ci): typo in pkg name * fix(ci): trying to install manimpango * fix(ci): append bin to path on MacOS * fix(ci): install Python setup tool * try(ci): trying some stuff * fix(ci): remove useless pkgs * fix(ci): check manimpango and remove pyopengl * try(ci): try fix * try(ci): cleaner workflow * fix(ci): missing dollar * try(ci): minimal platform * try(ci): test * fix(ci): reset offscreen option * fix(ci): add opengl dep * fix(ci): xvfb for pyglet * fix(ci): correctly set env var * try(ci): set DISPLAY env var at the beginning * test(ci): switch minimal to offscreen * test(ci): remove QT debug env var * try(ci): fixing manimgl issue * Revert "try(ci): fixing manimgl issue" This reverts commit f76c05897013bd804810c7153953bde4c8715af7. * try(ci): manimgl to manim-render * try(ci): verbose * fix(ci): update linux deps * fix(ci): typo * fix(ci): typo in deps * fix(ci): typo * fix(ci): test other deps * test(ci): install manimpango * try(ci): test * test(ci): print help * test(ci): reset verbose mode * fix(ci): typo * chore(setup): use poetry * chore(setup): cache installs * fix(ci): swap order * fix(ci): poetry install * chore(setup): add manim/manimgl to dev-deps * try(ci): some test * try(ci): import two maybe conflicting packages * fix(ci): typo in cmd * fix(ci): only check if manimgl * fix(ci): remove useless check
Manim Slides
Tool for live presentations using either Manim (community edition) or ManimGL. Manim Slides will automatically detect the one you are using!
NOTE: This project extends the work of
manim-presentation
, with a lot more features!
Installation
While installing Manim Slides and its dependencies on your global Python is fine, I recommend using a virtual environment (e.g., venv) for a local installation.
Dependencies
Manim Slides requires either Manim or ManimGL to be installed. Having both packages installed is fine too.
If none of those packages are installed, please refer to their specific installation guidelines:
Pip Install
The recommended way to install the latest release is to use pip:
pip install manim-slides
Install From Repository
An alternative way to install Manim Slides is to clone the git repository, and install from there:
git clone https://github.com/jeertmans/manim-slides
pip install -e .
Note: the
-e
flag allows you to edit the files, and observe the changes directly when using Manim Slides
Usage
Using Manim Slides is a two-step process:
- Render animations using
Slide
(resp.ThreeDSlide
) as a base class instead ofScene
(resp.ThreeDScene
), and add calls toself.pause()
everytime you want to create a new slide. - Run
manim-slides
on rendered animations and display them like a Power Point presentation.
The command-line documentation is available online.
Basic Example
Wrap a series of animations between self.start_loop()
and self.stop_loop()
when you want to loop them (until input to continue):
# example.py
from manim import *
# or: from manimlib import *
from manim_slides import Slide
class Example(Slide):
def construct(self):
circle = Circle(radius=3, color=BLUE)
dot = Dot()
self.play(GrowFromCenter(circle))
self.pause() # Waits user to press continue to go to the next slide
self.start_loop() # Start loop
self.play(MoveAlongPath(dot, circle), run_time=2, rate_func=linear)
self.end_loop() # This will loop until user inputs a key
self.play(dot.animate.move_to(ORIGIN))
self.pause() # Waits user to press continue to go to the next slide
self.wait()
You must end your Slide
with a self.play(...)
or a self.wait(...)
.
First, render the animation files:
manim example.py
# or
manimgl example.py
To start the presentation using Scene1
, Scene2
and so on simply run:
manim-slides [OPTIONS] Scene1 Scene2...
Or in this example:
manim-slides Example
Key Bindings
The default key bindings to control the presentation are:
You can run the configuration wizard to change those key bindings:
manim-slides wizard
A default file can be created with:
manim-slides init
NOTE:
manim-slides
uses key codes, which are platform dependent. Using the configuration wizard is therefore highly recommended.
Other Examples
Other examples are available in the example.py
file, if you downloaded the git repository.
Below is a small recording of me playing with the slides back and forth.
Features and Comparison with original manim-presentation
Below is a non-exhaustive list of features:
Feature | manim-slides |
manim-presentation |
---|---|---|
Support for Manim | ✔️ | ✔️ |
Support for ManimGL | ✔️ | ✖️ |
Configurable key bindings | ✔️ | ✔️ |
Configurable paths | ✔️ | ✖️ |
Play / Pause slides | ✔️ | ✔️ |
Next / Previous slide | ✔️ | ✔️ |
Replay slide | ✔️ | ✔️ |
Reverse slide | ✔️ | ✖️ |
Multiple key per actions | ✔️ | ✖️ |
One command line tool | ✔️ | ✖️ |
Robust config file parsing | ✔️ | ✖️ |
Support for 3D Scenes | ✔️ | ✖️ |
Documented code | ✔️ | ✖️ |
Tested on Unix, macOS, and Windows | ✔️ | ✖️ |
Hide mouse cursor | ✔️ | ✖️ |
F.A.Q
How to increase quality on Windows
On Windows platform, one may encounter a lower image resolution than expected. Usually, this is observed because Windows rescales every application to fit the screen. As found by @arashash, in #20, the problem can be addressed by changing the scaling factor to 100%:
in Settings->Display.
Contributing
Contributions are more than welcome!