mirror of
https://github.com/3b1b/manim.git
synced 2025-04-13 09:47:07 +00:00
Have Scene.remove look at extended ancestry
This commit is contained in:
parent
40b432a29b
commit
01f0dd30d0
1 changed files with 3 additions and 3 deletions
|
@ -322,9 +322,9 @@ class Scene(object):
|
|||
the desired behavior is for the scene to then include m2 and m3 (ungrouped).
|
||||
"""
|
||||
for mob in mobjects:
|
||||
# First restructure list so that parents/grandparents/etc. are replaced
|
||||
# with their children
|
||||
for ancestor in reversed(mob.get_ancestors()):
|
||||
# First restructure self.mobjects so that parents/grandparents/etc. are replaced
|
||||
# with their children, likewise for all ancestors in the extended family.
|
||||
for ancestor in mob.get_ancestors(extended=True):
|
||||
self.replace(ancestor, *ancestor.submobjects)
|
||||
self.mobjects = list_difference_update(self.mobjects, mob.get_family())
|
||||
return self
|
||||
|
|
Loading…
Add table
Reference in a new issue