ManimCommunity / manim

A community-maintained Python framework for creating mathematical animations.
https://www.manim.community
MIT License
20.94k stars 1.52k forks source link

removing edges from Graph in an animatoin #2575

Closed vilasopher closed 2 years ago

vilasopher commented 2 years ago

Description of bug / unexpected behavior

If g is a Graph, calling g.animate.remove_edges(...) does not actually play an animation. Instead, the edges will all be removed instantaneously.

How to reproduce the issue

Code for reproducing the problem ```py class Test(Scene): def construct(self): g = Graph([1,2,3], [(1,2), (2,3), (3,1)]) self.add(g) self.wait() self.play(g.animate.remove_edges((1,2),(2,3))) self.wait() ```

Additional comments

I think that the problem has to do with this line of code. It seems like in the animation override method, the original method is called, which removes the edges before creating the animations.

behackl commented 2 years ago

The line you mention only removes the edges from the graph, not from the scene. I have identified and fixed the issue via #2576. :-)