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

@ -20,8 +20,9 @@ from animation import Animation
from animation.animation import sync_animation_run_times_and_rate_funcs
from animation.transform import MoveToTarget
from animation.continual_animation import ContinualAnimation
from container import *
class Scene(object):
class Scene(Container):
CONFIG = {
"camera_class" : Camera,
"camera_config" : {},
@ -40,9 +41,9 @@ class Scene(object):
"skip_to_animation_number" : None,
}
def __init__(self, **kwargs):
digest_config(self, kwargs)
Container.__init__(self, **kwargs) # Perhaps allow passing in a non-empty *mobjects parameter?
self.camera = self.camera_class(**self.camera_config)
self.mobjects = []
self.mobjects = [] #TODO: fiddle with this line... to match name used in Container
self.continual_animations = []
self.foreground_mobjects = []
self.num_plays = 0