jeertmans / manim-slides

Tool for live presentations using manim
https://manim-slides.eertmans.be
MIT License
433 stars 48 forks source link

[QUESTION] Canvas not flushed after `.next_slide()` #455

Closed kjczarne closed 2 months ago

kjczarne commented 2 months ago

Description

Hi,

I am using a setup where each method call invokes a slide:

    def prior_works(self):
        t = Text("Prior Works", font_size=50, color=BLUE).to_edge(UP, buff=0.5)
        t2 = Text("Prior works blah blah...").next_to(t, DOWN, buff=0.5)
        t3 = Text("...until 2020").next_to(t2, DOWN, buff=0.5)
        self.play(Create(t), run_time=0.5)
        self.wait(1)
        self.play(Create(t2), run_time=0.5)
        self.wait(1)
        self.play(Create(t3), run_time=0.5)
        self.next_slide()

This is then used as follows:

    def construct(self):
        self.camera.background_color = "#f0f0f0"
        Text.set_default(color=BLACK)
        Tex.set_default(color=BLACK)
        BulletedList.set_default(color=BLACK, fill_color=BLACK, stroke_color=BLACK)
        self.title_slide()
        self.problem_statement()
        self.prior_works()
        self.the_problem_with_prior_works()
        self.the_idea()

I would expect the canvas to be wiped clean every time a new slide starts. This is not the case and I get content from one slide overlapping with the content from another file. I am not sure if I'm doing something wrong here or if this is a legitimate bug.

Version

5.1.7

Platform

macOS (Apple Sillicon)

Screenshots

No response

Additional information

No response

jeertmans commented 2 months ago

Hello, I am not sure of what you mean, but do you expect a clean slide after each call to next_slide? If so, this method does not do that because a slide is simply a pause between two animations, nothing more.

If you want to clean the canvas, then checkout the Wipe and self.wipe functions: https://manim-slides.eertmans.be/latest/reference/api.html#manim_slides.slide.Slide.wipe.

kjczarne commented 2 months ago

Ahh I see, that was my misunderstanding of the behavior of the slide transition. Thank you so much for clarifying! 😄

jeertmans commented 2 months ago

You are welcome 😁