ManimCommunity / ManimCommunity/manim

Transform chain in Succesion unexpected behavior

Open
#1,797 2 comments 1 reaction 0 assignees View on GitHub
issue:bug
Dominant language
Python
Stars
40.9k
Forks
3.1k
Avg merge
3d 12h
Merged PRs (30d)
25

Description

Here is the code:
```py
class TransformTest(Scene):
def construct(self):
sq = Square().set_color(RED)
cir = Circle().set_color(GREEN)
tr = Polygon(LEFT, UP * 2, RIGHT).set_color(BLUE)
VGroup(sq, cir, tr).arrange()
self.play(
Succession(
ReplacementTransform(sq, cir),
ReplacementTransform(cir, tr),
)
)
```
# It produces this animation:

https://user-images.githubusercontent.com/61829487/125676096-cc3a2bba-c4b5-444c-ab6e-f8fe911a3fa4.mp4

I wanna transform the square into a circle and then the circle into a triangle.
But the circle is already added to the Scene when the Succession runs.
I'd expect the result of Succession to be similar to two different plays, to something like this:
```py
class TransformTestFixed(Scene):
def construct(self):
sq = Square().set_color(RED)
cir = Circle().set_color(GREEN)
tr = Polygon(LEFT, UP * 2, RIGHT).set_color(BLUE)
VGroup(sq, cir, tr).arrange()
self.play(
ReplacementTransform(sq, cir),
)
self.play(
ReplacementTransform(cir, tr),
)
```
This actually works like expected.
# Expected result:

https://user-images.githubusercontent.com/61829487/125677054-dd72db3e-da14-4489-af3f-a33c7ab52746.mp4

Contributor guide

Open the contributing guide

Research direction

Start by running the TransformTest example from the issue and compare its Succession behavior with the two separate ReplacementTransform plays in TransformTestFixed. Trace the Succession and ReplacementTransform entry points to determine why the circle remains in the scene, then verify that the chained animation matches the expected result without changing the separate-play behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
computer-graphics
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.