diff --git a/README.md b/README.md index f45908d4cc..67d65261ad 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ Manim is an animation engine for explanatory math videos. It's used to create pr Manim requires a few dependencies that must be installed prior to using it. If you want to try it out first before installing it locally, you can do so -[in our online Jupyter environment](https://mybinder.org/v2/gist/behackl/725d956ec80969226b7bf9b4aef40b78/HEAD?filepath=basic%20example%20scenes.ipynb). +[in our online Jupyter environment](https://try.manim.community/). For the local installation, please visit the [Documentation](https://docs.manim.community/en/stable/installation.html) and follow the appropriate instructions for your operating system. diff --git a/manim/renderer/cairo_renderer.py b/manim/renderer/cairo_renderer.py index 537b86b2f2..79293e7976 100644 --- a/manim/renderer/cairo_renderer.py +++ b/manim/renderer/cairo_renderer.py @@ -85,6 +85,20 @@ def play(self, scene, *args, **kwargs): scene.compile_animation_data(*args, **kwargs) + # If skip_animations is already True, we can skip all the caching process. + if not config["disable_caching"] and not self.skip_animations: + hash_current_animation = get_hash_from_play_call( + scene, self.camera, scene.animations, scene.mobjects + ) + if self.file_writer.is_already_cached(hash_current_animation): + logger.info( + f"Animation {self.num_plays} : Using cached data (hash : %(hash_current_animation)s)", + {"hash_current_animation": hash_current_animation}, + ) + self.skip_animations = True + else: + hash_current_animation = f"uncached_{self.num_plays:05}" + if self.skip_animations: logger.debug(f"Skipping animation {self.num_plays}") hash_current_animation = None @@ -240,7 +254,7 @@ def save_static_frame_data( typing.Iterable[Mobject] the static image computed. """ - if not static_mobjects: + if static_mobjects == None or len(static_mobjects) == 0: self.static_image = None return self.update_frame(scene, mobjects=static_mobjects) diff --git a/test.py b/test.py new file mode 100644 index 0000000000..1c067180ce --- /dev/null +++ b/test.py @@ -0,0 +1,6 @@ +from manim import * + +class TestScene(Scene): + def construct(self): + a = Circle() + self.add(a) \ No newline at end of file