mirror of
https://github.com/3b1b/manim.git
synced 2025-08-21 05:44:04 +00:00
Update mobject.py
This commit is contained in:
parent
6d0c55d2ba
commit
487f582302
1 changed files with 9 additions and 0 deletions
|
@ -1596,6 +1596,15 @@ class Group(Mobject):
|
||||||
raise Exception("All submobjects must be of type Mobject")
|
raise Exception("All submobjects must be of type Mobject")
|
||||||
Mobject.__init__(self, **kwargs)
|
Mobject.__init__(self, **kwargs)
|
||||||
self.add(*mobjects)
|
self.add(*mobjects)
|
||||||
|
def __add__(self, other : 'Mobject' or 'Group'):
|
||||||
|
assert(isinstance(other, Mobject))
|
||||||
|
if other in self:
|
||||||
|
return Group(*self, other.copy())
|
||||||
|
if isinstance(other, (Group, VGroup)):
|
||||||
|
if all([isinstance(i, VMobject) for i in Group(*self, *other)]):
|
||||||
|
return VGroup(*self, *other)
|
||||||
|
return Group(*self, *other)
|
||||||
|
return Group(*self, other)
|
||||||
|
|
||||||
|
|
||||||
class Point(Mobject):
|
class Point(Mobject):
|
||||||
|
|
Loading…
Add table
Reference in a new issue