Skip to content

Conversation

@eulertour
Copy link
Member

@eulertour eulertour commented Dec 7, 2020

List of Changes

Update Scene.moving_mobjects in Scene.add(). Depends on #830 for its Scene refactoring.

Motivation

When a mobject is added by an updater in the middle of an animation, Scene.moving_mobjects isn't updated. As a result, the added mobject won't appear in the Scene.

Changelog Entry

Mobjects added during an updater are added to Scene.moving_mobjects.

Testing Status

As long as we can only test the final frame this change can't be tested.

Further Comments

The way that manim removes submobjects within a group by splitting the group apart and re-adding the parts that weren't removed is very strange. It make much more sense to me to remove submobjects by removing the reference in their parent's submobjects list and leave out the logic in Scene.restructure_mobjects() entirely. In particular, I've never encountered another graphics program that handles nested objects the way manim currently does.

Acknowledgements

@github-actions github-actions bot added the pr:dependent This PR or issue requires that another PR is merged first label Dec 7, 2020
@github-actions github-actions bot removed the pr:dependent This PR or issue requires that another PR is merged first label Dec 19, 2020
@github-actions
Copy link
Contributor

🎉 Great news! Looks like all the dependencies have been resolved:

💡 To add or remove a dependency please update this issue/PR description.

Brought to you by Dependent Issues (:robot: ). Happy coding!

@eulertour
Copy link
Member Author

These videos showcase the difference between the code with and without the fix; both were rendered from the same script.

not-fixed.mp4
fixed.mp4

Copy link
Member

@behackl behackl left a comment

Choose a reason for hiding this comment

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

LGTM. I also agree with your assessment that the removal of submobjects currently is ... unintuitive, and should be refactored eventually.

(I also checked the rendered animations in our documentation for good measure, they all still seem fine.)

Copy link
Member

@huguesdevimeux huguesdevimeux left a comment

Choose a reason for hiding this comment

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

SGTM.

A test would be useful IMO.

Copy link
Member

@huguesdevimeux huguesdevimeux left a comment

Choose a reason for hiding this comment

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

On second thought this actually needs a test.

COuld you create one?

@behackl behackl dismissed huguesdevimeux’s stale review December 29, 2020 15:28

A test has been added.

@behackl behackl merged commit f42bd05 into ManimCommunity:master Dec 30, 2020
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.

3 participants