From 6a4a180b6c5bbb80463cf81c34736015ade2c507 Mon Sep 17 00:00:00 2001 From: Benjamin Hackl Date: Sun, 17 Aug 2025 15:24:48 +0200 Subject: [PATCH] make sure that if updating is suspended for a parent mobject, children are still updated --- manim/mobject/mobject.py | 15 +++++++-------- manim/mobject/opengl/opengl_mobject.py | 11 +++++------ 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/manim/mobject/mobject.py b/manim/mobject/mobject.py index ec1e83079c..0df565ffbf 100644 --- a/manim/mobject/mobject.py +++ b/manim/mobject/mobject.py @@ -892,16 +892,15 @@ def update(self, dt: float = 0, recursive: bool = True) -> Self: :meth:`get_updaters` """ - if self.updating_suspended: - return self - for updater in self.updaters: - if "dt" in inspect.signature(updater).parameters: - updater(self, dt) - else: - updater(self) + if not self.updating_suspended: + for updater in self.updaters: + if "dt" in inspect.signature(updater).parameters: + updater(self, dt) + else: + updater(self) if recursive: for submob in self.submobjects: - submob.update(dt, recursive) + submob.update(dt, recursive=recursive) return self def get_time_based_updaters(self) -> list[TimeBasedUpdater]: diff --git a/manim/mobject/opengl/opengl_mobject.py b/manim/mobject/opengl/opengl_mobject.py index 5fd7def78f..f00b8b9dd8 100644 --- a/manim/mobject/opengl/opengl_mobject.py +++ b/manim/mobject/opengl/opengl_mobject.py @@ -1466,12 +1466,11 @@ def init_updaters(self) -> None: self.updating_suspended = False def update(self, dt: float = 0, recurse: bool = True) -> Self: - if not self.has_updaters or self.updating_suspended: - return self - for updater in self.time_based_updaters: - updater(self, dt) - for updater in self.non_time_updaters: - updater(self) + if self.has_updaters and not self.updating_suspended: + for updater in self.time_based_updaters: + updater(self, dt) + for updater in self.non_time_updaters: + updater(self) if recurse: for submob in self.submobjects: submob.update(dt, recurse)