Skip to content

Allow negative animation indices in -n render - #2531

Open
brunerm99 wants to merge 1 commit into
3b1b:masterfrom
brunerm99:negative-animation-indices
Open

brunerm99 wants to merge 1 commit into
3b1b:masterfrom
brunerm99:negative-animation-indices

Conversation

@brunerm99

Copy link
Copy Markdown

Adds -n -1 to render just the last animation, or -n -3 for the last three. Works with ranges too, like -n=-3,-1. Both play() and wait() count.

Uses the existing pre-run to count animations, then converts the negative indices to positive ones. This runs the scene code an extra time.

All 13 tests pass. Also checked that renders match their positive-index equivalents.

Btw, thanks for making manim. It's had a huge impact on my life and I'm very grateful.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant