Search code examples
pythonpython-3.xmanim

Issue w/ play() function in manim


I run this code:

from manimlib import *

class SquareToCircle(Scene):
    def construct(self):
        circle = Circle()
        self.play(ShowCreation(circle))
        self.play(circle.animate.shift(2 * RIGHT), circle.animate.scale(0.25))

It's shortened example from https://3b1b.github.io/manim/getting_started/quickstart.html. However, the circle doesn't shift right as specified with circle.animate.shift(2 * RIGHT) as seen here.


Solution

  • I found a correct way to do both animations at the same time

    from manimlib import *
    
    class SquareToCircle(Scene):
        def construct(self):
            circle = Circle()
            self.play(ShowCreation(circle))
            self.play(circle.animate.shift(2 * RIGHT).scale(0.25))
    
    

    https://youtu.be/dwovjxTcvEk