I made this class : 50 points of a spiral change to a cirle.
But the animation is sequential and I would like to start it at the same time.
class SpiralToCircle(Scene):
def construct(self):
vertices1 = range(50)
vertices2 = range(50)
edges = [(48, 49),(3, 4)]
g1 = Graph(vertices1, edges, layout="spiral")
g2 = Graph(vertices2, edges, layout="circular")
# self.add(graph)
self.play(Create(g1))
self.wait(5)
for i in vertices1:
self.play(g1[i].animate.move_to(g2[i]))
self.wait()
I thought about this trick, but I returns an error :
self.play((g1[i].animate.move_to(g2[i])) for i in vertices1)
TypeError: Unexpected argument <generator object GraphCircular.construct.. at 0x00000229667509E0> passed to Scene.play().
This should work:
self.play([g1[i].animate.move_to(g2[i]) for i in vertices1])
The play function can take a list of animations.