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:
Sridhar Ramesh
2018-01-29 13:34:06 -08:00
parent ad14222d1c
commit 55a723a284
3 changed files with 56 additions and 23 deletions

View File

@ -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)