mirror of
https://github.com/jeertmans/manim-slides.git
synced 2025-05-23 21:46:49 +08:00
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.
This commit is contained in:
15
README.md
15
README.md
@ -51,14 +51,7 @@ pip install manim-slides
|
|||||||
|
|
||||||
### Install From Repository
|
### Install From Repository
|
||||||
|
|
||||||
An alternative way to install Manim Slides is to clone the git repository, and install from there:
|
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.
|
||||||
|
|
||||||
```bash
|
|
||||||
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
|
|
||||||
|
|
||||||
<!-- end install -->
|
<!-- end install -->
|
||||||
|
|
||||||
@ -97,14 +90,8 @@ class BasicExample(Slide):
|
|||||||
|
|
||||||
self.play(dot.animate.move_to(ORIGIN))
|
self.play(dot.animate.move_to(ORIGIN))
|
||||||
self.pause() # Waits user to press continue to go to the next slide
|
self.pause() # Waits user to press continue to go to the next slide
|
||||||
|
|
||||||
# Each slide MUST end with an animation
|
|
||||||
# -> self.wait is considered an animation with Manim, not ManimGL
|
|
||||||
self.play(dot.animate.move_to(LEFT))
|
|
||||||
```
|
```
|
||||||
|
|
||||||
You **must** end your `Slide` with a `self.play(...)` or a `self.wait(...)`.
|
|
||||||
|
|
||||||
First, render the animation files:
|
First, render the animation files:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
@ -31,10 +31,6 @@ class BasicExample(Slide):
|
|||||||
self.play(dot.animate.move_to(ORIGIN))
|
self.play(dot.animate.move_to(ORIGIN))
|
||||||
self.pause() # Waits user to press continue to go to the next slide
|
self.pause() # Waits user to press continue to go to the next slide
|
||||||
|
|
||||||
# Each slide MUST end with an animation
|
|
||||||
# -> self.wait is considered an animation with Manim, not ManimGL
|
|
||||||
self.play(dot.animate.move_to(LEFT))
|
|
||||||
|
|
||||||
|
|
||||||
class ConvertExample(Slide):
|
class ConvertExample(Slide):
|
||||||
"""WARNING: this example does not seem to work with ManimGL."""
|
"""WARNING: this example does not seem to work with ManimGL."""
|
||||||
|
@ -105,6 +105,11 @@ class Slide(Scene): # type:ignore
|
|||||||
|
|
||||||
def add_last_slide(self) -> None:
|
def add_last_slide(self) -> None:
|
||||||
"""Adds a 'last' slide to the end of slides."""
|
"""Adds a 'last' slide to the end of slides."""
|
||||||
|
|
||||||
|
if self.current_animation == self.slides[-1].end_animation:
|
||||||
|
self.slides[-1].type = SlideType.last
|
||||||
|
return
|
||||||
|
|
||||||
self.slides.append(
|
self.slides.append(
|
||||||
SlideConfig(
|
SlideConfig(
|
||||||
type=SlideType.last,
|
type=SlideType.last,
|
||||||
|
Reference in New Issue
Block a user