ManimCommunity / ManimCommunity/manim
[BUG-General] Updaters do not behave well with t values
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 40.9k
- Forks
- 3.1k
- Avg merge
- 3d 12h
- Merged PRs (30d)
- 25
Description
Consider this scene :
```python
RUN_TIME = 1
class Test(Scene):
def construct(self):
path = VMobject()
dot = Dot()
path.set_points_as_corners([dot.get_center(), dot.get_center()])
def update_path(path):
previus_path = path.copy()
previus_path.add_points_as_corners([dot.get_center()])
path.become(previus_path)
path.add_updater(update_path)
self.add(path, dot)
self.play(Rotating(dot, radians=PI, about_point=RIGHT, run_time=RUN_TIME))
self.play(dot.shift, UP)
```
Running normally (Rotating with RUN_TIME = 1, t values = 0,1/15,2/15 etc) :

When changing RUN_TIME to 0.1. there is therefore way less t values, and :

As you can see, it's not smooth at all.
When there is only one t = 1, (eg when rendering the last frame with -s ):

as you can see, the updaters are updated only if there is a t value. Although this can be seen as the normal processus, it causes trouble, for example here, when scene-cacher skips an animation (the t value is directly set to the end). One gets this :

This happens as the first animation (Rotating) is cached so it uses a partial movie file instead of playing the animation. When the second animation is played the t value is directly set to 1, and manim is tricked into drawing a straight path, when there should be several points correponding to all the t values.
This is seemingly quite impossible to fix, as it would mean refactoring the whole t values thing, which .. is simple.
Related to #339
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the provided Scene with a short RUN_TIME and with the cached animation path, then trace how updater callbacks receive t values during animation and skipped frames. Done means updater-driven paths remain correct and smooth when few t values are sampled or an animation jumps directly to t=1.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100