Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: skip part of an animation #2217

Open
tobiasBora opened this issue Oct 17, 2024 · 3 comments
Open

Feature request: skip part of an animation #2217

tobiasBora opened this issue Oct 17, 2024 · 3 comments
Labels

Comments

@tobiasBora
Copy link

Describe the feature request

I often start an animation from another animation (e.g. copy/pasting the code), and I want to start my new animation from, say, the middle of it (e.g. all objects I need are added and placed where I want), and do something else after. One solution is to use an external program to cut the first X seconds of the video, but not only it is not really practical, but it also takes quite some time and energy to generate this useless first part.

Would it be possible to add something like self.skip_animations() and self.resume_animations() so that I can skip this part in the final render?

@tobiasBora tobiasBora added the bug label Oct 17, 2024
@Varniex
Copy link
Contributor

Varniex commented Oct 17, 2024

If you want to skip the animations in the final render, use -n flag.
For example: -n n0,n1. ManimGL renders all scenes from n0 to n1. If n1 is unspecified, rendering starts from n0 until the end.

@tobiasBora
Copy link
Author

Interesting workaround, thanks. It's maybe not as nice to use (you need to count the number of animations etc which is maybe not always obvious… adding labels to animations from the code may be another nice improvement to make it a bit easier to use) but better than nothing. Can we embed this directly in the code so that I don't need to remember this from the commandline?

@3b1b
Copy link
Owner

3b1b commented Oct 17, 2024

One option is to set the Scene parameter ".skip_animations" to be True, then call "self.stop_skipping()" when desired.

During interactive development, I do this with by passing in "-se (line number)" to the call to manim, where the line number is what line of code I want to jump to. Within the interactive development, calling checkpoint_paste(skip=true) will run the pasted code, but skipping the animations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants