Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

Added Mobject.become method

Grant Sandersonc520d0b517b9
diff --git a/mobject/mobject.py b/mobject/mobject.py
index ae707224a..2f6f39dcd 100644
--- a/mobject/mobject.py
+++ b/mobject/mobject.py
@@ -925,6 +925,15 @@ class Mobject(Container):
def pointwise_become_partial(self, mobject, a, b):
pass # To implement in subclass
+ def become(self, mobject):
+ """
+ Edit points, colors and submobjects to be idential
+ to another mobject
+ """
+ self.align_points(mobject)
+ self.interpolate(self, mobject, 1)
+ self.submobjects = [sm.copy() for sm in mobject.submobjects]
+
class Group(Mobject):
# Alternate name to improve readibility in cases where