ManimCommunity / ManimCommunity/manim

Single Mobject's sequential animate does not support succession

Open
#4,275 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

  • #3502 by @MrDiver — closed without merging
Dominant language
Python
Stars
40.9k
Forks
3.1k
Avg merge
3d 12h
Merged PRs (30d)
25

Description

## Description of bug / unexpected behavior

When applying multiple .animate calls to a single Mobject inside a Succession, only the final animation takes effect.
This is because Mobject.animate is based on a target, and that target is overwritten by subsequent .animate calls before the actual MoveToTarget happens.
As a result, chaining animations like Succession(circle.animate.shift(RIGHT), circle.animate.shift(UP)) does not work as intuitively expected.

## Expected behavior

Each animate expression should resolve to an independent animation that can be executed in sequence.
In a Succession(above example), I expect the first `.animate` to shift the object right, and then the second to shift it upward — just like two MoveToTarget calls with distinct target states.

## How to reproduce the issue

Code for reproducing the problem

```py
from manim import *

class test(Scene):
def construct(self):
text = Text("Hello World")

self.add(text)
self.wait()

self.play(Succession(text.animate.shift(RIGHT), text.animate.shift(UP)))
FadeIn(text)
```

## Additional media files

Images/GIFs

https://github.com/user-attachments/assets/f7a4e6d2-1104-4c69-80be-7c77a0178296

## Logs
Terminal output

```
PASTE HERE OR PROVIDE LINK TO https://pastebin.com/ OR SIMILAR
```

## System specifications

System Details

- OS (with version, e.g., Windows 10 v2004 or macOS 10.15 (Catalina)):
- RAM:
- Python version (`python/py/python3 --version`):
- Installed modules (provide output from `pip list`):
```
PASTE HERE
```

LaTeX details

+ LaTeX distribution (e.g. TeX Live 2020):
+ Installed LaTeX packages:

## Additional comments
It seems that the issue arises because the target is initialized immediately when .animate is accessed — and since there's only one target attribute per Mobject, subsequent calls overwrite the previous state before the animation is built.
Perhaps this could be addressed by deferring the generate_target() call — instead of creating the target at the .animate access time, it could be queued and resolved during animation building.
That way, each animation gets its own fresh target, and sequential composition becomes possible.

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 from the Mobject.animate behavior described in the issue and reproduce the case with Succession(text.animate.shift(RIGHT), text.animate.shift(UP)). Compare it with the stated MoveToTarget behavior; done means each animate expression executes independently in sequence rather than only the final target taking effect.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.