Why the current animation system isn't good enough. #1488
Replies: 4 comments 8 replies
-
All of the updater changes sound like good improvements to me, but the animation changes sound like a lot of extra complexity for a pretty niche use case. When would an async animation be preferable over a regular animation or updater? |
Beta Was this translation helpful? Give feedback.
-
I will be starting to work on these features today if there are no further ideas on what should be added related to this change 🙂 |
Beta Was this translation helpful? Give feedback.
-
So uuh just to add my little thought about it :
This, I .. don't really see the point. Why would an animation need to block everything ? I don't see any good reason to want this. By the way, there is no issue with both partial movie files and hashing if you chose to make a clear distinction between outer plays and "inner" plays call. If you don't, it won't work, since at each play call a FFmpeg pipe is opened, a file is written etc. it wouldn't be a good thing IMO to open several pipes in parallel. (for hashing, it shouldn't be a problem though) |
Beta Was this translation helpful? Give feedback.
-
Was there any attempt made ? |
Beta Was this translation helpful? Give feedback.
-
Starting to learn Manim is hard. We all know that. The way I see it a lot of that initial struggle could be removed with a few core adjustments to how the animation API is structured. Let me present my ideas on how to fix common issues:
add_updater
Mobject
, but also forScene
s. Sometimes updaters concerning the whole scene are added to mobjects just because you have to.use_time_difference
which isTrue
by default. In some situations it is much more practical to get the total time since adding the updater instead of the time difference since last calling it. I would also like it ifuse_time_difference
would be set toTrue
if the parameter of the given function is nameddt
but toFalse
if it was namedt
.Scene.play
As already mentioned in #1267 we should enable starting new animations using
Scene.play()
while others are running. Let me explain in detail how that could work:async:bool
). By default (and the way it is currently implemented) animations should be played synchronously, meaning the execution of the code in theScene.construct
method only continues once the animation is over. Playing an animation asynchronously would add the Animation to a list of currently active animations and return immediately to theScene.construct
execution. Only once a different synchonous animation call (or call toScene.wait
) is executed will the async animation be played in parallel.async
is set toFalse
explicitly, the new animation should block the current synchonous animation from continuing and play to finish before the first sync animations is continued.Scene.finish_animations
should be added. This should simply wait until all animation (async and sync) have finished.Mainly the changes to
Scene.play
would reduce the complexity of many scenes immensely. You would no longer have to plan more complex animations ahead of time using wired nestedAnimationGroup
s.Open problems
I have basically no clue how this could be implemented - I haven't even had a look into how the current implementation of
play
works. I think async animations could be implemented as self removing updaters. However, there are a few things that I believe could be problematic when trying to implement this:Please let me know what you think about these ideas. I strongly believe enhancing the animation api would greatly improve manims learning curve for beginners as well as the productivity of experienced users.
Beta Was this translation helpful? Give feedback.
All reactions