Skip to content

Commit

Permalink
Have Animation keep track of whether a mobject had had it's updating …
Browse files Browse the repository at this point in the history
…suspended before resuming it at the end
  • Loading branch information
3b1b committed Nov 6, 2023
1 parent 916ab94 commit f4778b5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion manimlib/animation/animation.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,15 @@ def begin(self) -> None:
# It is, however, okay and desirable to call
# the internal updaters of self.starting_mobject,
# or any others among self.get_all_mobjects()
self.mobject_was_updating = not self.mobject.updating_suspended
self.mobject.suspend_updating()
self.families = list(self.get_all_families_zipped())
self.interpolate(0)

def finish(self) -> None:
self.interpolate(self.final_alpha_value)
self.mobject.set_animating_status(False)
if self.suspend_mobject_updating:
if self.suspend_mobject_updating and self.mobject_was_updating:
self.mobject.resume_updating()

def clean_up_from_scene(self, scene: Scene) -> None:
Expand Down

0 comments on commit f4778b5

Please sign in to comment.