Tool for live presentations using manim
Project description
manim-presentation
Tool for live presentations using manim
Install
pip install manim-presentation opencv-python
Usage
Use the class Slide
as your scenes base class
from manim_presentation import Slide
class Example(Slide):
def construct(self):
...
call self.pause()
when you want to pause the playback and wait for an input to continue (check the keybindings)
Wrap a series of animations between self.start_loop()
and self.stop_loop()
when you want to loop them (until input to continue)
from manim import *
from manim_presentation import Slide
class Example(Slide):
def construct(self):
circle = Circle(radius=3, color=BLUE)
dot = Dot()
self.play(GrowFromCenter(circle))
self.pause()
self.start_loop()
self.play(MoveAlongPath(dot, circle), run_time=2, rate_func=linear)
self.end_loop()
self.play(dot.animate.move_to(ORIGIN))
self.pause()
self.wait()
You must end your Slide
with a self.play(...)
or a self.wait(..)
To start the presentation using Scene1
, Scene2
and so on simply run:
manim_presentation Scene1 Scene2...
Default Keybindings
Default keybindings to control the presentation
Keybinding | Action |
---|---|
Right Arrow | Continue/Next Slide |
Left Arrow | Previous Slide |
R | Re-Animate Current Slide |
Spacebar | Play/Pause |
Q | Quit |
You can specify different keybindings creating a file named manim-presentation.json
with the keys: QUIT_KEY
CONTINUE_KEY
BACK_KEY
REWIND_KEY
and PLAYPAUSE_KEY
manim-presentation
uses cv2.waitKeyEx()
to wait for keypresses
Run Example
Clone this repository
git clone https://github.com/galatolofederico/manim-presentation.git
cd manim-presentation
Create a virtualenv
virtualenv --python=python3.7 env
. ./env/bin/activate
Install manim
and manim_presentation
pip install manim manim-presentation opencv-python
Render the example scene
manim -qh example.py
Run the presentation
manim_presentation Example
Contributions and license
The code is released as Free Software under the GNU/GPLv3 license. Copying, adapting and republishing it is not only consent but also encouraged.
For any further question feel free to reach me at federico.galatolo@ing.unipi.it or on Telegram @galatolo
Project details
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
Hashes for manim_presentation-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a3e487c874c51c49a50d6c63fea28800ab38c006c7802bf701d7978b46bb482 |
|
MD5 | 0b58e09fc6f71ed6c426e7fa64fb827b |
|
BLAKE2b-256 | d045b3b325c2486dd49b34ebc8e5d538b3254952d035f2d06a5e8bfcbd97ac0b |