You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Created a virtual environment in which I can reproduce my bug;
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()
"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()
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.
Terms
Describe the issue
I use
manimlib
and wanted to convert a large video I've been working on tomanim-slides
. It had a lot ofself.wait()
commands which break the presentation.A minimal example:
The above will produce slides that terminate on text with number "1", not "2":
I know there is this warning:
manim-slides/manim_slides/config.py
Lines 267 to 268 in ccbe9d5
So, I fixed it by overriding the
self.wait()
with a dummyself.play()
: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
What is your platform?
Linux
The text was updated successfully, but these errors were encountered: