-
Notifications
You must be signed in to change notification settings - Fork 2.2k
FIX : 472 / Small refactor of partial-movie-files handling #489
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
True that the animation doesn't have to be rendered, but the end result of it (the final svg) does. right? |
It depends on which animation you are talking about. If the animation is cached, then it should appear on the final video.if the animation is purposely skipped with for example -n, then it should not be on the final video. |
I think I adressed all the changes requests. Feel free to review ! |
Not entirely. |
then we've been in agreement all along but only just found out :D |
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.
I am not is a position to review the code itself, however I have tested the code and all my compilation errors have disappeared... i.e. the code seems to work :)
The only errors I found was when supplying a -n
flag with a number higher than the number of animations in the video. In other words, if my video has 6 animation and I run manim -pl -n 7
then, instead of exiting gracefully, I get the error:
/home/cobordism/Documents/renderings/videos/example2/480p15/partial_movie_files/TestZoom1/partial_movie_file_list.txt: Invalid data found when processing input
and then, instead of stopping, the -p
flag kicks in and proceeds to play the previously rendered video that is already in the media dir.
...but since that is a strange edge case for the -n flag, I think that is something we can address another PR
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
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.
There seems to be some problem with the pipeline on macOS, but these errors are unrelated to this PR.
Good to go!
List of Changes
Motivation
Explanation for Changes
#472 undercovers two issues :
animation_hashes
list of a scene. SceneFileWriter keeps its own index of partial movie files, independently of Scene. I think some code is better than my explanations : See get_next_partial_movie_file method, and scene_file_writer own index isself.index_partial_movie_file
.https://github.com/ManimCommunity/manim/blob/master/manim/scene/scene_file_writer.py#L189-L210
This is bad, very bad, in some particular cases, like when the first animation is skipped as already cached. Then, the list of partial movie file is updated, but as sceneFIleWriter has its own index, sceneFIleWriter will think it's the first animation instead of the second one. I know, it's tricky. I fixed this by getting rid of this index. The index is now
scene.num_plays
.scene.num_plays
) is not bigger thananimation_hashes
list.Testing Status
tests for -n flag exited with no issue.
It's impossible to proper test this, as we have no possibility to test caching yet.
Acknowledgement