Conversation
| uses wall-clock time to pace its live preview. | ||
| """ | ||
|
|
||
| def _animation_cache_identity(self, scene: Scene) -> tuple[str, Any]: ... |
|
|
||
| def _animation_cache_identity(self, scene: Scene) -> tuple[str, Any]: ... | ||
|
|
||
| def _start_animation(self) -> None: ... |
|
|
||
| def _start_animation(self) -> None: ... | ||
|
|
||
| def _prepare_animation(self, scene: Scene) -> None: ... |
|
|
||
| def render( | ||
| self, scene: Scene, frame_offset: float, moving_mobjects: list[Mobject], / | ||
| ) -> None: ... |
| self, scene: Scene, frame_offset: float, moving_mobjects: list[Mobject], / | ||
| ) -> None: ... | ||
|
|
||
| def get_frame(self) -> RGBAPixelArray: ... |
|
|
||
| def get_frame(self) -> RGBAPixelArray: ... | ||
|
|
||
| def _present_frame(self, scene: Scene, frame_offset: float) -> None: ... |
|
|
||
| def _present_frame(self, scene: Scene, frame_offset: float) -> None: ... | ||
|
|
||
| def _present_frozen_frame(self, scene: Scene, duration: float) -> None: ... |
behackl
force-pushed
the
refactor/manager-execution
branch
from
September 10, 2026 08:24
d3f4185 to
dacb6b9
Compare
Excluded plays (-n, skipped sections, still output) advanced the clock by the raw requested run time, while cached plays advanced by the frames a render would produce. Fractional run times therefore shifted every later play by up to one frame interval, so segments rendered under -n were never reused by a full render and anything reading scene.time rendered differently. Both shortcuts now advance by the sampled duration, and they advance after the single evaluation step rather than before it, so begin() observes the play's start time and finish() the consumed span, as in a rendered play. Skipped waits with a stop condition are stepped per frame like rendered ones, which also fixes wait_until consuming its whole max_time when skipped. Cache keys embed the play's start time, so the corrected clock invalidates existing partial movie files once.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview: What does this pull request change?
Stacked on #5002.
This PR moves animation playback and the animation clock into
Manager, using one play loop for Cairo and OpenGL.Sceneprepares animations and updates mobjects; renderers draw frames and display the live preview; the manager decides what to play, advances time, and sends frames to the writer.time,num_plays, andskip_animationsworking by forwarding them to the manager's state, including values set before the manager was attached.Scene.play_internaland the separate OpenGL caching decorator. The rendererplay()methods delegate to the manager rather than implementing another scheduler.Motivation and Explanation: Why and how do your changes improve the library?
Previously, playback was split between the scene and two renderer implementations, and the backends advanced time differently. In Cairo, advancing time depended on frame output; OpenGL generally exposed the play call's start time until the animation ended. A common loop lets updaters and stop conditions use the same clock on either backend and separates animation progress from producing pixels.
Timing and compatibility changes
Scene.play()remains the normal entry point. Integrations that overrideScene.play_internalor rely on the renderer'splay()being called by the scene need updating. Direct renderer drawing no longer writes movie frames or advances animation time.This is preparation for evaluation without rendering, not that evaluation API itself. No no-raster mode, timeline export, or targeted-frame API is added here.
Links to added or changed documentation pages
docs/source/guides/deep_dive.rst, including a frame-timing table and configuration example.