Description
Enhancement proposal
The update module currently contains the following:
- UpdateFromFunc
- UpdateFromAlphaFunc
- MaintainPositionRelativeTo
UpdateFromFunc and UpdateFromAlphaFunc
Just like Mobject.add_updater
accepts callables with or without second parameter, so should UpdateFromFunc. That would render UpdateFromAlphaFunc useless.
Additionally I would like a parameter range
for what currently is UpdateFromAlphaFunc. This would simply map the given value linearly. This might seem useless, but I find myself remapping the alpha value every single time I use UpdateFromAlphaFunc - so why not add a quality of life feature?
MaintainPositionRelativeTo
Why is this an animation? Maintaining relative position is the prime example of where you should use an updater.
I do however not suggest to only deprecate this feature: It should instead be replaced by an "updater factory function" returning an updater. In the same vain we might even want to add more factory functions for useful updaters that get used regularly.
Updater logic
The updater logic is not too simple and would even be quite a bit more complex after #1520. It would be nice to move some of that logic from the Mobject class to this module - this would also make it easier to reuse parts of it in OpenGLMobject (and maybe Scene in the future, see #1488)
Docs docs docs
This is one of the less documented modules - they should of course not be neglected when refurbishing that module 🙂
Additional comments
Please let me know your ideas for common updaters this module could include.
Also please add a comment if you want to work on this issue, as it may well be I already started doing so :)
Metadata
Metadata
Assignees
Labels
Type
Projects
Status