mirror of
https://github.com/3b1b/manim.git
synced 2025-04-13 09:47:07 +00:00
Make it so that FadeTransform returns moving mobject to its original state
This commit is contained in:
parent
b22f1ab715
commit
494f1899fd
1 changed files with 2 additions and 0 deletions
|
@ -64,6 +64,7 @@ class FadeTransform(Transform):
|
|||
|
||||
def __init__(self, mobject, target_mobject, **kwargs):
|
||||
self.to_add_on_completion = target_mobject
|
||||
mobject.save_state()
|
||||
super().__init__(
|
||||
Group(mobject, target_mobject.copy()),
|
||||
**kwargs
|
||||
|
@ -96,6 +97,7 @@ class FadeTransform(Transform):
|
|||
def clean_up_from_scene(self, scene):
|
||||
Animation.clean_up_from_scene(self, scene)
|
||||
scene.remove(self.mobject)
|
||||
self.mobject[0].restore()
|
||||
scene.add(self.to_add_on_completion)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue