mirror of
https://github.com/3b1b/manim.git
synced 2025-07-30 05:24:22 +08:00
Moved more of animation cleanup handling to the animations themselves
This commit is contained in:
@ -55,6 +55,12 @@ class Transform(Animation):
|
||||
submob.interpolate(start, end, alpha, self.path_func)
|
||||
return self
|
||||
|
||||
def clean_up(self, surrounding_scene = None):
|
||||
Animation.clean_up(self, surrounding_scene)
|
||||
if self.replace_mobject_with_target_in_scene and surrounding_scene is not None:
|
||||
surrounding_scene.remove(self.mobject)
|
||||
surrounding_scene.add(self.original_target_mobject)
|
||||
|
||||
class ReplacementTransform(Transform):
|
||||
CONFIG = {
|
||||
"replace_mobject_with_target_in_scene" : True,
|
||||
@ -147,7 +153,8 @@ class FadeOut(Transform):
|
||||
target.set_fill(opacity = 0)
|
||||
Transform.__init__(self, mobject, target, **kwargs)
|
||||
|
||||
def clean_up(self):
|
||||
def clean_up(self, surrounding_scene = None):
|
||||
Transform.clean_up(self, surrounding_scene)
|
||||
self.update(0)
|
||||
|
||||
class FadeIn(Transform):
|
||||
|
Reference in New Issue
Block a user