manim
manim copied to clipboard
Implement :attr:`.Mobject.always`, and move builders to their own file
Motivation
Allows for syntax like
d = Dot()
s = Square()
d.always.next_to(s, UP)
self.add(s, d)
self.play(s.animate.to_edge(LEFT))
Changelog
- Implemented
_UpdaterBuilder - Moved
_AnimationBuilderand_UpdaterBuilderto their own file. - Made
_AnimationBuildergeneric in it's mobject, to match experimental
Note
I opted to allow imports of _UpdaterBuilder/_AnimationBuilder from Mobject itself, even though they're in their own file (manim.mobject.builders).
[!WARNING]
.alwaysis a thin wrapper aroundadd_updater, as such the usual caveats apply. If two updaters are added that affect the position, weird things could happen.
Documentation
https://manimce--3852.org.readthedocs.build/en/3852/reference/manim.mobject.mobject.Mobject.html#manim.mobject.mobject.Mobject.always
This is actually very interesting, huge +1 for the API; I like it a lot!
Will review in-depth over the weekend, but I strongly believe we should ship this with the next release. 🚀
Currently incomptaible with ValueTracker, on hold until ValueTracker is lazy!
I think it might be better just to get it merged in its current state. Valuetrackers can be added in a later PR, but I would love to have this in 0.19.0