Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate :class:.Animation and :class:.Scene #3685

Closed

Conversation

JasonGrace2282
Copy link
Member

@JasonGrace2282 JasonGrace2282 commented Apr 9, 2024

Motivation

  • Long term goal of experimental is to render animations in parallel
    • A big part of this is removing the direct usage a Scene in an Animation.
  • Also it helps to be able to know the bare minimum amount of methods needed to animate something, so I got started with a simple AnimationProtocol.

Implementation

TL;DR: an Animation stores what actions it wants to do to the Scene. During the start of the animation and end of animation, the Scene checks those actions and applies them.

Long Explanation: attached to each Animation object is a buffer attribute (of type SceneBuffer: you can think of this as an extremely simplified proxy of Scene that stores add and remove operations). Whenever an animation wants to, say add a mobject to the scene they would do self.buffer.add(Square()).
For each animation in a self.play call, the Scene will call the begin method and then "apply the buffer". It is at this time that the adding/removing of mobjects actually happens. Likewise with when the animation finishes.

TODO

  • Implement core SceneBuffer stuff
  • Fix subclasses
  • Finish AnimationProtocol

@JasonGrace2282 JasonGrace2282 added refactor Refactor or redesign of existing code experimental labels Apr 9, 2024
@JasonGrace2282 JasonGrace2282 marked this pull request as ready for review April 11, 2024 03:35
@JasonGrace2282 JasonGrace2282 deleted the branch ManimCommunity:experimental April 12, 2024 01:00
@JasonGrace2282 JasonGrace2282 deleted the experimental branch April 12, 2024 01:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
experimental refactor Refactor or redesign of existing code
Projects
Status: Rejected
Development

Successfully merging this pull request may close these issues.

1 participant