-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Render image automatically if no animation is played in a scene #1261
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
Conversation
Should I remove the condition that the image is only generated if attempting to preview/open-file-location for the video? coz without -p or -f, you will still see that error. |
I don't think so, but the error should be suppressed in favor of a logging error message. (I don't think it would fit in this PR though, up to you). By the way, could you add a log message when an image is displayed by default ? |
Ok I added some logging warnings and also |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On second thought, I don't think the logging warnings should exist. I think the expected behavior for manim -ql [FILE]
and manim -pql [FILE]
should be to output some file if possible. There should only be a warning if the user explicitly asks for a filetype that isn't possible (e.g. user passes --format
option expecting mp4/mov/gif file but there's no animations -- a PNG will always be possible since blank background image)
The issues with the documentation should now be resolved; it might take a while until it manages to run the build (people are working on too many PRs in parallel, which is nice on another level 😄). If it passes, I believe that this can be merged. Thank you very much for your contribution; I'll wait with my approval until the pipeline passes. |
Ahh... I had a hunch the fix was something to do with |
Changelog / Overview
self.play(Animation())
withself.add()
in tests (without changing control data)Explanation for changes
As we already know, there is a lot of confusion when new users try to render scenes without animations and getting weird errors. After the scene is finished, just before writing the file, we can check if there are any animations in the scene, if not it changes
config["save_last_frame"]
to True, andconfig["write_to_movie"]
to False.fixes #1052 #869 and ManimCommunity/manim-website#7
Tests
Passing
Checklist
Reviewer Checklist