Skip to content

Commit

Permalink
Fixing AnimationGroup remover behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
MrDiver committed Nov 27, 2024
1 parent 85db7ac commit 4ea40d2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 6 additions & 0 deletions manim/animation/composition.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ def __init__(
**kwargs,
) -> None:
arg_anim = flatten_iterable_parameters(animations)

self.animations = [prepare_animation(anim) for anim in arg_anim]
self.rate_func = rate_func
self.group = group
Expand Down Expand Up @@ -87,6 +88,8 @@ def begin(self) -> None:
)

for anim in self.animations:
if self.introducer:
anim.introducer = True
anim.begin()
self.process_subanimation_buffer(anim.buffer)

Expand All @@ -100,6 +103,9 @@ def finish(self) -> None:
self.anims_begun[:] = True
self.anims_finished[:] = True
for anim in self.animations:
if self.remover:
anim.remover = True
anim.finish()
self.process_subanimation_buffer(anim.buffer)

if self.suspend_mobject_updating:
Expand Down
1 change: 0 additions & 1 deletion tests/module/animation/test_composition.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ def test_succession_in_succession_timing():
)
assert nested_succession.get_run_time() == 5.0
assert succession.get_run_time() == 10.0
succession._setup_scene(MagicMock())
succession.begin()
succession.interpolate(0.1)
assert succession.active_index == 0
Expand Down

0 comments on commit 4ea40d2

Please sign in to comment.