Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] manimgl and self.wait() breaks presentation #527

Open
4 tasks done
KarolisRam opened this issue Jan 31, 2025 · 1 comment
Open
4 tasks done

[BUG] manimgl and self.wait() breaks presentation #527

KarolisRam opened this issue Jan 31, 2025 · 1 comment
Labels
bug Something isn't working manimgl Exclusive to ManimGL question Further information is requested

Comments

@KarolisRam
Copy link

KarolisRam commented Jan 31, 2025

Terms

Describe the issue

I use manimlib and wanted to convert a large video I've been working on to manim-slides. It had a lot of self.wait() commands which break the presentation.

A minimal example:

from manim_slides import Slide
from manimlib import *


class BasicExample(Slide):
    def construct(self):

        for i in range(3):
            text = Text(str(i), font_size=360)
            self.play(Write(text))
            self.wait(2.0)
            self.remove(text)
            self.next_slide()
manim-slides render --GL test.py BasicExample
manim-slides BasicExample

The above will produce slides that terminate on text with number "1", not "2":

Image

I know there is this warning:

"IMPORTANT: when using ManimGL, 'self.wait()' is not considered "
"to be an animation, so prefer to directly use 'self.play(...)'."

So, I fixed it by overriding the self.wait() with a dummy self.play():

from manim_slides import Slide
from manimlib import *


class CustomSlide(Slide):
    def wait(self, duration=1.0, **kwargs):
        self.play(Write(Text("")), run_time=duration, **kwargs)


class BasicExample(CustomSlide):
    def construct(self):

        for i in range(3):
            text = Text(str(i), font_size=360)
            self.play(Write(text))
            self.wait(2.0)
            self.remove(text)
            self.next_slide()

Is there a better way to solve it?

Command

manim-slides render --GL test.py BasicExample; manim-slides BasicExample

Python version

3.12.3

Python environment

Manim Slides version: 5.4.2
Python executable: /home/karolis/k/manim/venv-manim/bin/python
Manim bindings:
        manim not found
        manimgl (version: 1.7.2)
Qt API: pyside6 (version: 6.8.1)

What is your platform?

Linux

@KarolisRam KarolisRam added the bug Something isn't working label Jan 31, 2025
@jeertmans jeertmans added question Further information is requested manimgl Exclusive to ManimGL labels Jan 31, 2025
@jeertmans
Copy link
Owner

Hi @KarolisRam, thanks for reaching out! I am not aware of any better workaround than playing an invisible animations. In presentation, slides with only a call to « wait » are quite rare, imo, and it is relatively fast to render. You chose an empty text, but there might be even faster ways like an invisible line, or a dot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working manimgl Exclusive to ManimGL question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants