manim: Problems with cached data in a scene with .add_updater [SCENE CACHING]

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    

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 16 (16 by maintainers)

Most upvoted comments

My hunch is that the scene cacher only saw the positions of the Dot before and after, not taking into consideration the path that it travelled.