Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
16 changes: 15 additions & 1 deletion manim/renderer/cairo_renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
6 changes: 6 additions & 0 deletions test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from manim import *

class TestScene(Scene):
def construct(self):
a = Circle()
self.add(a)