Starting Animations using Scene.play while others are running #2788
Replies: 3 comments
-
You are correct in judging this a feature and not a bug report - as far as I know we don't expect From an interface perspective, I think it makes a lot of sense to enable this - perhaps with a flag indicating it's a non-blocking animation (i.e, set the animation to start and then return from the function, don't go forward in the animation within that call to Edge case: what happens when in an updater starts an animation near the end of the other animation? Perhaps we should add something that tells the scene to wait for all unblocking animations to finish? |
Beta Was this translation helpful? Give feedback.
-
capable to set/unset animation blocking means a lot. And yes, it seems have no need of entire rewriting of the animations part. |
Beta Was this translation helpful? Give feedback.
-
probably not, but I'd love to see a PR for it. |
Beta Was this translation helpful? Give feedback.
-
First of all: This might just as well be a bug report - I am unsure...
Motivation
Look at the following scene:
WantedScene.mp4
Swiping a line across the Scene and playing a Flash as soon as it hits a dot... Or more generally: Animate one thing and play additional animations based on the state of the animated thing. Sounds like a job for an update function. Consider the following code:
However, this results in
ValueError: write to closed file
.Description of proposed feature
The feature request is quite simple, but I think it is hard to implement: Allow using
Scene.play()
while an Animation is running.Additional comments
I have seen quite a few different workarounds for this problem, even in 3b1b's code. Some are based on splitting the animation at each new event, others are based on precalculating all timings in advance - but all of them have one thing in common: They are tedious and error-prone. In case you are wondering, how I created the example Scene: Have a look at this mess...
Beta Was this translation helpful? Give feedback.
All reactions