Skip to main content

Tool for live presentations using manim

Project description

Manim Slides Logo

Latest Release Python version PyPI - Downloads

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:

  1. Render animations using Slide (resp. ThreeDSlide) as a base class instead of Scene (resp. ThreeDScene), and add calls to self.pause() everytime you want to create a new slide.
  2. 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:

manim-wizard

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 :heavy_check_mark: :heavy_check_mark:
Support for ManimGL :heavy_check_mark: :heavy_multiplication_x:
Configurable key bindings :heavy_check_mark: :heavy_check_mark:
Configurable paths :heavy_check_mark: :heavy_multiplication_x:
Play / Pause slides :heavy_check_mark: :heavy_check_mark:
Next / Previous slide :heavy_check_mark: :heavy_check_mark:
Replay slide :heavy_check_mark: :heavy_check_mark:
Reverse slide :heavy_check_mark: :heavy_multiplication_x:
Multiple key per actions :heavy_check_mark: :heavy_multiplication_x:
One command line tool :heavy_check_mark: :heavy_multiplication_x:
Robust config file parsing :heavy_check_mark: :heavy_multiplication_x:
Support for 3D Scenes :heavy_check_mark: :heavy_multiplication_x:
Documented code :heavy_check_mark: :heavy_multiplication_x:
Tested on Unix, macOS, and Windows :heavy_check_mark: :heavy_multiplication_x:
Hide mouse cursor :heavy_check_mark: :heavy_multiplication_x:

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%:

Windows Fix Scaling

in Settings->Display.

Contributing

Contributions are more than welcome!

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

manim_slides-4.7.1.tar.gz (41.2 kB view details)

Uploaded Source

File details

Details for the file manim_slides-4.7.1.tar.gz.

File metadata

  • Download URL: manim_slides-4.7.1.tar.gz
  • Upload date:
  • Size: 41.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.15

File hashes

Hashes for manim_slides-4.7.1.tar.gz
Algorithm Hash digest
SHA256 962086d81a279009027f4e3b5e752d487ad20d9d39e6718b930abb1bb5aed8d4
MD5 2cbb0989ae826cbdbc5e594a3cfd8ad9
BLAKE2b-256 5e7269eea0dc04a1586a685e4d2e0626bf7ca23ffc0f30295073019ff4dc0143

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page