mirror of
https://github.com/3b1b/manim.git
synced 2025-07-30 05:24:22 +08:00
Fixed bugs in Succession and AnimationGroup, and also created purely virtual Container class from which both Scene and MObject derive (conceptually unifying their remove/add methods)
This commit is contained in:
@ -7,10 +7,11 @@ from colour import Color
|
||||
|
||||
from helpers import *
|
||||
|
||||
from container import *
|
||||
|
||||
#TODO: Explain array_attrs
|
||||
|
||||
class Mobject(object):
|
||||
class Mobject(Container):
|
||||
"""
|
||||
Mathematical Object
|
||||
"""
|
||||
@ -22,7 +23,7 @@ class Mobject(object):
|
||||
"target" : None,
|
||||
}
|
||||
def __init__(self, *submobjects, **kwargs):
|
||||
digest_config(self, kwargs)
|
||||
Container.__init__(self, *submobjects, **kwargs)
|
||||
if not all(map(lambda m : isinstance(m, Mobject), submobjects)):
|
||||
raise Exception("All submobjects must be of type Mobject")
|
||||
self.submobjects = list(submobjects)
|
||||
|
Reference in New Issue
Block a user