Skip to content

Commit e9d28dc

Browse files
authored
feat(lib): remove constraint on last animation and update readme (#117)
This removes the constraint that required a Slide class to end with a animation. This was actually not needed, and could lead to confusion since `self.wait` is not an animation with ManimGL, but well with Manim. This fix, however, still means that a calls to `self.wait` with ManimGL, after last `self.pause` call, will be ignored.
1 parent 70b5ee3 commit e9d28dc

File tree

3 files changed

+6
-18
lines changed

3 files changed

+6
-18
lines changed

README.md

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,7 @@ pip install manim-slides
5151

5252
### Install From Repository
5353

54-
An alternative way to install Manim Slides is to clone the git repository, and install from there:
55-
56-
```bash
57-
git clone https://github.com/jeertmans/manim-slides
58-
pip install -e .
59-
```
60-
61-
> *Note:* the `-e` flag allows you to edit the files, and observe the changes directly when using Manim Slides
54+
An alternative way to install Manim Slides is to clone the git repository, and install from there: read the [contributing guide](https://eertmans.be/manim-slides/contributing/workflow.html) to know how.
6255

6356
<!-- end install -->
6457

@@ -97,14 +90,8 @@ class BasicExample(Slide):
9790

9891
self.play(dot.animate.move_to(ORIGIN))
9992
self.pause() # Waits user to press continue to go to the next slide
100-
101-
# Each slide MUST end with an animation
102-
# -> self.wait is considered an animation with Manim, not ManimGL
103-
self.play(dot.animate.move_to(LEFT))
10493
```
10594

106-
You **must** end your `Slide` with a `self.play(...)` or a `self.wait(...)`.
107-
10895
First, render the animation files:
10996

11097
```bash

example.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@ def construct(self):
3131
self.play(dot.animate.move_to(ORIGIN))
3232
self.pause() # Waits user to press continue to go to the next slide
3333

34-
# Each slide MUST end with an animation
35-
# -> self.wait is considered an animation with Manim, not ManimGL
36-
self.play(dot.animate.move_to(LEFT))
37-
3834

3935
class ConvertExample(Slide):
4036
"""WARNING: this example does not seem to work with ManimGL."""

manim_slides/slide.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,11 @@ def pause(self) -> None:
105105

106106
def add_last_slide(self) -> None:
107107
"""Adds a 'last' slide to the end of slides."""
108+
109+
if self.current_animation == self.slides[-1].end_animation:
110+
self.slides[-1].type = SlideType.last
111+
return
112+
108113
self.slides.append(
109114
SlideConfig(
110115
type=SlideType.last,

0 commit comments

Comments
 (0)