From c94ebaa260c117875ab324dec97afd2568f0834f Mon Sep 17 00:00:00 2001 From: BillyLikesHacking <86190295+BillyLikesHacking@users.noreply.github.com> Date: Fri, 22 Oct 2021 20:03:58 +0800 Subject: [PATCH] Update vectorized_mobject.py --- manimlib/mobject/types/vectorized_mobject.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/manimlib/mobject/types/vectorized_mobject.py b/manimlib/mobject/types/vectorized_mobject.py index 1bf29d73..1037cc25 100644 --- a/manimlib/mobject/types/vectorized_mobject.py +++ b/manimlib/mobject/types/vectorized_mobject.py @@ -993,6 +993,16 @@ class VGroup(VMobject): raise Exception("All submobjects must be of type VMobject") super().__init__(**kwargs) self.add(*vmobjects) + + def __add__(self:'VGroup', other : 'VMobject' or 'VGroup'): + assert(isinstance(other, VMobject)) + if isinstance(other, VGroup): + return VGroup(*self, *other) + if isinstance(other, Mobject): + return Group(*self) + other + if other in self: + return self.add(other.copy()) + return self.add(other) class VectorizedPoint(Point, VMobject):