Skip to content

Manim 0.18.1: Updaters don't work with objects which have been added using LaggedStart() #3950

Open
@uwezi

Description

@uwezi

Description of bug / unexpected behavior

When adding an object to a scene using LaggedStart() no updaters are recognized:

  • not when using .add_updater() before adding to the scene
  • not always_redraw() objects
  • not when using .add_updater() after adding to the scene

Expected behavior

well, updaters should be executed... Especially when added afterwards

How to reproduce the issue

Code for reproducing the problem
class laggingUpdater(Scene):
    def construct(self):
        vt = ValueTracker(0)
        dot1a = Dot().shift(3*UP)
        dot2a = Dot().shift(2*UP)
        dot3a = always_redraw(lambda:
            Dot().shift(1*UP+vt.get_value()*RIGHT)
        )
        dot1b = Dot().shift(1*DOWN)
        dot2b = Dot().shift(2*DOWN)
        dot3b = always_redraw(lambda:
            Dot().shift(3*DOWN+vt.get_value()*RIGHT)
        )
        def updater(mobj):
            mobj.set_x(vt.get_value())
        dot1a.add_updater(updater)
        dot1b.add_updater(updater)
        self.play(
            LaggedStart(
                Create(dot1a),
                Create(dot2a),
                Create(dot3a)
            )
        )
        self.play(
            Create(dot1b),
            Create(dot2b),
            Create(dot3b)
        )
        dot2a.add_updater(updater)
        dot2b.add_updater(updater)
        self.wait()
        self.play(vt.animate.set_value(7),run_time=4)
        self.wait()

Additional media files

Rendered video
laggingUpdater.mp4

System specifications

System Details
  • OS: Windows 10
  • RAM: enough
  • Python version: 3.11.6
  • Manim v0.18.1
    PASTE HERE
</details>



## Additional comments
https://discord.com/channels/581738731934056449/1293588131999907851/1293588131999907851

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    🆕 New

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions