Repository navigation
feat: animate mobjects to a target state with animate - #18
Merged
Merged
Conversation
- Add `animate(m, f)` (Rust `fastanim_core::animate`/`animate_group`) that morphs a mobject from its state at play time to `f` of that state, path and style together - The target is computed at plan time, so steps in a `sequence` start where the last one ended - Python `m.animate` now chains on shapes and groups, adding `color`, `opacity`, `fill_opacity` and `stroke_opacity` - Groups gain `fill`, `stroke`, `color`, `opacity` and the opacity setters; `VState::opacity` is added - Port manim's MovingAround and switch BooleanOperations from `transform` to `animate` - Update the book, reference and roadmap to match
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
animate(m, f)in core, Rhai and Python. It morphs a mobject from its state when played tofof that state, moving geometry and style together (manim's.animate,MoveToTargetand animatedbecome).sequenceeach begin where the previous one ended. Previously Python's.animatecomputed its target at build time, so twoshift(RIGHT)steps in asequenceended at x=1 instead of x=2.fas a group of their shapes. Groups gainfill,stroke,color,opacity,fill_opacityandstroke_opacity. Shapes gaincolorandopacity. The Python.animatechain gainscolor,opacity,fill_opacityandstroke_opacity.animate(...).run_time(0.0).animatein place of its fourtransforms to hand-built targets.docs/ROADMAP.md(item 4 marked done), the animations and gotchas pages of the book, and the hand-maintainedreference.mdand_native.pyistubs.animatemoves each point in a straight line, so a large angle shrinks the shape on the way. The docs point torotate(m, angle)for a rigid turn.Testing
cargo testforfastanim-core: new tests cover sequenced animate steps planning from the last state, style blending, group animation about a joint center, andrun_time(0.0)acting as an instant become.cargo test -p fastanim-script: new tests coveranimatefrom the start state, groups, and the MovingAround port.cargo test -p fastanim-py: 25 passed. This includes MovingAround and BooleanOperations matching their Rhai versions frame by frame, a stub check, and parity tests for the chained.animatemethods andanimate.cargo fmt --allandcargo clippy --all-targetson core, script and py: clean.moldand some ALSA/udev dev packages, so the build usedlldand system library paths set through environment variables only. No repo config was changed.