From 77096bc8dc200a506c832fd467947b933732a30e Mon Sep 17 00:00:00 2001 From: Darylgolden Date: Wed, 24 Mar 2021 17:30:37 +0800 Subject: [PATCH 1/5] Flake8 fix --- manim/renderer/cairo_renderer.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/manim/renderer/cairo_renderer.py b/manim/renderer/cairo_renderer.py index 372f343014..c7e600f34f 100644 --- a/manim/renderer/cairo_renderer.py +++ b/manim/renderer/cairo_renderer.py @@ -84,6 +84,19 @@ 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 @@ -239,7 +252,7 @@ def save_static_frame_data( typing.Iterable[Mobject] the static image computed. """ - if not static_mobjects: + if static_mobjects is None or len(static_mobjects) == 0: self.static_image = None return self.update_frame(scene, mobjects=static_mobjects) From 00c7bff33cab1c9325ffb053bc32faa0bd87847c Mon Sep 17 00:00:00 2001 From: Darylgolden Date: Wed, 24 Mar 2021 17:37:11 +0800 Subject: [PATCH 2/5] Revert "Flake8 fix" This reverts commit fc1a083be5b0ab88382b62703ea90c8abb3c43eb. --- manim/renderer/cairo_renderer.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/manim/renderer/cairo_renderer.py b/manim/renderer/cairo_renderer.py index c7e600f34f..2b316af5e6 100644 --- a/manim/renderer/cairo_renderer.py +++ b/manim/renderer/cairo_renderer.py @@ -91,8 +91,9 @@ def play(self, scene, *args, **kwargs): ) 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}, ) + 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}" @@ -252,7 +253,7 @@ def save_static_frame_data( typing.Iterable[Mobject] the static image computed. """ - if static_mobjects is None or len(static_mobjects) == 0: + if static_mobjects == None or len(static_mobjects) == 0: self.static_image = None return self.update_frame(scene, mobjects=static_mobjects) From 09f4b823cfc815405d1da5358d5c06e6fc7ec9cb Mon Sep 17 00:00:00 2001 From: Darylgolden Date: Sun, 18 Apr 2021 10:52:15 +0800 Subject: [PATCH 3/5] Create test.py --- test.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 test.py diff --git a/test.py b/test.py new file mode 100644 index 0000000000..f7c85ee40f --- /dev/null +++ b/test.py @@ -0,0 +1,15 @@ +from manim import * + +class MovingVertices(ThreeDScene): + def construct(self): + self.set_camera_orientation(phi=75 * DEGREES, theta=30 * DEGREES) + vertices = [1, 2, 3, 4] + edges = [(1, 2), (2, 3), (3, 4), (1, 3), (1, 4)] + g = Graph(vertices, edges) + self.play(Create(g)) + self.wait() + self.play(g[1].animate.move_to([1, 1, 1]), + g[2].animate.move_to([-1, 1, 2]), + g[3].animate.move_to([1, -1, -1]), + g[4].animate.move_to([-1, -1, 0])) + self.wait() \ No newline at end of file From c17699754e3c18f90bb8afdc8dcde6cf329ce83a Mon Sep 17 00:00:00 2001 From: Darylgolden Date: Sun, 25 Apr 2021 07:52:49 +0800 Subject: [PATCH 4/5] Update test.py --- test.py | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/test.py b/test.py index f7c85ee40f..1c067180ce 100644 --- a/test.py +++ b/test.py @@ -1,15 +1,6 @@ from manim import * -class MovingVertices(ThreeDScene): +class TestScene(Scene): def construct(self): - self.set_camera_orientation(phi=75 * DEGREES, theta=30 * DEGREES) - vertices = [1, 2, 3, 4] - edges = [(1, 2), (2, 3), (3, 4), (1, 3), (1, 4)] - g = Graph(vertices, edges) - self.play(Create(g)) - self.wait() - self.play(g[1].animate.move_to([1, 1, 1]), - g[2].animate.move_to([-1, 1, 2]), - g[3].animate.move_to([1, -1, -1]), - g[4].animate.move_to([-1, -1, 0])) - self.wait() \ No newline at end of file + a = Circle() + self.add(a) \ No newline at end of file From b6f73506dedcaf26e74dbdeb52435aa119c0c999 Mon Sep 17 00:00:00 2001 From: Darylgolden Date: Thu, 11 Nov 2021 20:08:49 +0800 Subject: [PATCH 5/5] Replaced link to notebook --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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.