Skip to content

Problems with cached data in a scene with .add_updater [SCENE CACHING] #339

@kolibril13

Description

@kolibril13
class UpdaterExample(Scene):
    def construct(self):
        path = VMobject()
        dot = Dot()
        path.set_points_as_corners([dot.get_center(), dot.get_center()])

        def update_path(path):
            previus_path = path.copy()
            previus_path.add_points_as_corners([dot.get_center()])
            path.become(previus_path)

        path.add_updater(update_path)
        self.add(path, dot)
        self.play(Rotating(dot, radians=PI, about_point=RIGHT, run_time=2))
        self.play(dot.shift, UP)
        self.play(dot.shift, LEFT)

When I run this script the first time, I get this:

UpdaterExample
However, when I run it again, without any changes, I get this:
UpdaterExample
and the following output in the terminal:

INFO      Animation 0 : Using cached data (hash :                   scene.py:807
          64312035_2472655632_2531679001)                                       
INFO                                                    scene_file_writer.py:616
          File ready at /home/kolibril/Downloads/Upd                         
          aterExample.gif                                                       
                                                                                
INFO      Rendered UpdaterExample                                   scene.py:120
          Played 3 animations    

Metadata

Metadata

Labels

pr:bugfixBug fix for use in PRs solving a specific issue:bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions