ManimCommunity / ManimCommunity/manim

Succession should reuse more code of AnimationGroup

Open
#746 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

issue:bug
Dominant language
Python
Stars
40.9k
Forks
3.1k
Avg merge
3d 12h
Merged PRs (30d)
25

Description

## Enhancement proposal

The current implementation of `Succession` is wildly different from `AnimationGroup`; but I don't think that there are a lot of reasons for that. If `Succession` isn't already covered by creating an `AnimationGroup` with `lag_ratio=1` (maybe because this wouldn't give the correct output if the subanimations have different run lengths?), `AnimationGroup` should be made more flexible so that `Succession` can use the same code.

Old issue description below.

---

## Description of bug / unexpected behavior
`Succession` (sometimes?) seems to mess up initial states of mobjects included in the passed animations. See the example below.

## Expected behavior
The initial states should be respected (and in particular: mobjects should not appear before their creation animation is played).

## How to reproduce the issue
In the example below, the blue circle appears before its `FadeIn` animation is played, then disappears and fades in. It should not be visible before its animation.

Code for reproducing the problem

```py
from manim import *
from manim import color as C

class SuccessionTest(Scene):
def construct(self):
c1 = Circle(color=C.RED, fill_opacity=0.7)
c2 = Circle(color=C.BLUE, fill_opacity=0.7)
self.add(c1)
anim = Succession(
ApplyMethod(c1.shift, LEFT),
FadeIn(c2)
)
self.play(anim)
self.wait()
```

## Additional media files
Images/GIFs

![SuccessionTest](https://user-images.githubusercontent.com/11851593/99789031-45829400-2b22-11eb-95e3-cafe8a7423dc.gif)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the Succession and AnimationGroup implementations and run the SuccessionTest example from the issue. Determine whether AnimationGroup with lag_ratio=1 can preserve differing run lengths and initial mobject states; done means Succession reuses suitable shared logic and the blue circle remains hidden until FadeIn plays.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
computer-graphics
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.