ManimCommunity / ManimCommunity/manim
Reworking the update module
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 40.9k
- Forks
- 3.1k
- Avg merge
- 3d 12h
- Merged PRs (30d)
- 25
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 :slightly_smiling_face:
## 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 :)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the update module and the updater logic in the Mobject class, then review OpenGLMobject and Scene as possible reuse targets. Read the related discussions in #1520 and #1488, and define the revised updater APIs, factory functions, behavior, and documentation before implementation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100