mirror of
https://github.com/3b1b/manim.git
synced 2025-08-30 05:02:28 +00:00
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:
parent
f878537814
commit
84fa3de435
1 changed files with 3 additions and 2 deletions
|
@ -627,7 +627,7 @@ class Mobject(object):
|
||||||
mobject = pickle.load(fp)
|
mobject = pickle.load(fp)
|
||||||
return mobject
|
return mobject
|
||||||
|
|
||||||
def become(self, mobject: Mobject):
|
def become(self, mobject: Mobject, match_updaters=False):
|
||||||
"""
|
"""
|
||||||
Edit all data and submobjects to be idential
|
Edit all data and submobjects to be idential
|
||||||
to another mobject
|
to another mobject
|
||||||
|
@ -647,7 +647,8 @@ class Mobject(object):
|
||||||
if isinstance(value, Mobject) and value in family2:
|
if isinstance(value, Mobject) and value in family2:
|
||||||
setattr(self, attr, family1[family2.index(value)])
|
setattr(self, attr, family1[family2.index(value)])
|
||||||
self.refresh_bounding_box(recurse_down=True)
|
self.refresh_bounding_box(recurse_down=True)
|
||||||
self.match_updaters(mobject)
|
if match_updaters:
|
||||||
|
self.match_updaters(mobject)
|
||||||
return self
|
return self
|
||||||
|
|
||||||
def looks_identical(self, mobject: Mobject):
|
def looks_identical(self, mobject: Mobject):
|
||||||
|
|
Loading…
Add table
Reference in a new issue