From 6d0c55d2ba543dbb5263931e1c6963465f14a333 Mon Sep 17 00:00:00 2001 From: BillyLikesHacking <86190295+BillyLikesHacking@users.noreply.github.com> Date: Fri, 22 Oct 2021 20:00:27 +0800 Subject: [PATCH] Update mobject.py --- manimlib/mobject/mobject.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/manimlib/mobject/mobject.py b/manimlib/mobject/mobject.py index 79b489de..126ebdec 100644 --- a/manimlib/mobject/mobject.py +++ b/manimlib/mobject/mobject.py @@ -82,6 +82,15 @@ class Mobject(object): def __str__(self): return self.__class__.__name__ + def __add__(self, other : 'Mobject'): + assert(isinstance(other, Mobject)) + return Group(self, other) + + def __mul__(self, other : 'int'): + if isinstance(self, VMobject): + return VGroup(*[mob.copy() for mob in range(other)]) + return Group(*[mob.copy() for mob in range(other)]) + def init_data(self): self.data = { "points": np.zeros((0, 3)),