Skip to content

Conversation

@huguesdevimeux
Copy link
Member

List of Changes

Explanation for Changes

I modified the mechanism behind -n flag. Before, manim rendered all the partial movie files and selected only the ones with the index between i and j (where i and j are integreers passed with -n flag, eg -n 5,6).
Now, it skips the entire process if an animation is outside the [i,j] interval and creates partial movies files otherwise.

Testing Status

Created a test for n flag in test_scene_rendering/test_cli_flags.py

@huguesdevimeux huguesdevimeux mentioned this pull request Sep 8, 2020
@huguesdevimeux huguesdevimeux self-assigned this Sep 8, 2020
@huguesdevimeux huguesdevimeux added pr:bugfix Bug fix for use in PRs solving a specific issue:bug pr:easy review There is nothing particular (i.e, it's about a general/small thing) to know for review! labels Sep 8, 2020
Copy link
Contributor

@leotrs leotrs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Question tho: you mention you added a test to test_cli_flags, but I don't see that file in the diff.

fw_config["skip_animations"] = any(
[fw_config["save_last_frame"], fw_config["from_animation_number"]]
)
fw_config["skip_animations"] = fw_config["save_last_frame"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: can you explain why this change is necessary?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because, setting skip_animation to True here because of from_animation_number here does not make any sense, as skip_animation is set in consequence of this flag already in update_skipping_status,

Furthermore, (this is a particular case) when one is trying to start from the Animation 0 with -n 0,2 manim will skip the first animation as skip_animations would have been set to True here.

pass
self.tear_down()
# We have to reset these settings in case of multiple renders.
file_writer_config["skip_animations"] = False
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Issue: It should be reset to self.original_skipping_status, not to False.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm fair point, I disagree. scene.original_skipping_status value is set to the one of file_writer_config[skip_animations] at the beginning of __init__, so it will be set to False in the next scene instantiation.

My concern is when scene.original_skipping_status has been changed for a reason or another. If it is the case and we do your suggestion, then scene.original_skipping_status will never be set to False again, for the reason above.

"""

def wrapper(self, *args, **kwargs):
self.update_skipping_status()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please explain why it is not necessary here to update the skipping status?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because now it will be done before, in handle_caching_play or handle_caching_wait !

@huguesdevimeux
Copy link
Member Author

Thanks! Question tho: you mention you added a test to test_cli_flags, but I don't see that file in the diff.

@leotrs THis is weird. Git is doing crazy things. Nvm, I fixed that :D

Copy link
Member

@Aathish04 Aathish04 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved!

Co-authored-by: Aathish Sivasubrahmanian <[email protected]>
@huguesdevimeux
Copy link
Member Author

Approved!

Thanks !

@huguesdevimeux huguesdevimeux merged commit 1a516db into ManimCommunity:master Sep 14, 2020
@huguesdevimeux huguesdevimeux deleted the fix-n-flag-2 branch September 14, 2020 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:bugfix Bug fix for use in PRs solving a specific issue:bug pr:easy review There is nothing particular (i.e, it's about a general/small thing) to know for review!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Manim scene caching does not play well with the -n flag

3 participants