ManimCommunity / ManimCommunity/manim
Extra frame of animation with dt-updater
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 40.9k
- Forks
- 3.1k
- Avg merge
- 3d 12h
- Merged PRs (30d)
- 25
Description
Description of bug / unexpected behavior
Playing animations with the dt-updater added results in duplicate frames. This issue is especially noticeable at low FPS or when using TracedPath.
Code for reproducing the problem
config.frame_rate = 5
class DtUpdaterBug(Scene):
def construct(self):
circle = Circle().set_fill(RED, 1).to_edge(LEFT)
def upd_circle(mob, dt):
mob.shift(2 * dt * RIGHT)
def upd_cnt(cnt, dt):
cnt.increment_value(dt * config.frame_rate)
counter = Integer().shift(UP * 2).add_updater(upd_cnt)
circle.add_updater(upd_circle)
self.add(counter, circle)
self.wait(2)
error = Text("Error: extra frame for every animation")
self.add(error.to_edge(UP).scale(0.6))
for _ in range(5):
self.play(Animation(VMobject()), run_time=1 / 5)
self.wait(3 / 5)
self.remove(error)
self.wait(2)
Additional comments
https://discord.com/channels/1453870851807117363/1463725322313666655
https://github.com/user-attachments/assets/9dcc85bb-1c00-4570-8933-3853fe10c868
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 running the provided DtUpdaterBug reproduction with config.frame_rate set to 5, focusing on the dt updaters, Animation(VMobject()), and wait calls. Trace how animation and updater frames are advanced, then verify that the repeated play/wait sequence produces no duplicate frames, including when TracedPath is used.
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
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100