By default, don't let Mobject.become match updaters

This causes the use of Mobject.become in an updater function to make the mobject immediately lose its updater.

https://github.com/3b1b/manim/issues/1877
This commit is contained in:
Grant Sanderson
2022-11-03 16:35:41 -07:00
parent f878537814
commit 84fa3de435

View File

@ -627,7 +627,7 @@ class Mobject(object):
mobject = pickle.load(fp)
return mobject
def become(self, mobject: Mobject):
def become(self, mobject: Mobject, match_updaters=False):
"""
Edit all data and submobjects to be idential
to another mobject
@ -647,7 +647,8 @@ class Mobject(object):
if isinstance(value, Mobject) and value in family2:
setattr(self, attr, family1[family2.index(value)])
self.refresh_bounding_box(recurse_down=True)
self.match_updaters(mobject)
if match_updaters:
self.match_updaters(mobject)
return self
def looks_identical(self, mobject: Mobject):