Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

Fixed GIF export feature.

Aathish Sivasubrahmanian6dbee5e1d018
diff --git a/manim/extract_scene.py b/manim/extract_scene.py
index b8a0ad96d..56c3bfe0a 100644
--- a/manim/extract_scene.py
+++ b/manim/extract_scene.py
@@ -31,6 +31,8 @@ def open_file_if_needed(file_writer, **config):
file_paths.append(file_writer.get_image_file_path())
if config["file_writer_config"]["write_to_movie"]:
file_paths.append(file_writer.get_movie_file_path())
+ if file_writer.save_as_gif:
+ file_paths.append(file_writer.gif_file_path)
for file_path in file_paths:
if current_os == "Windows":
diff --git a/manim/scene/scene_file_writer.py b/manim/scene/scene_file_writer.py
index 820e25ea8..0fc4efe39 100644
--- a/manim/scene/scene_file_writer.py
+++ b/manim/scene/scene_file_writer.py
@@ -494,6 +494,16 @@ class SceneFileWriter(object):
'-c', 'copy',
movie_file_path
]
+ if not self.save_as_gif:
+ commands+=[
+ "-c", "copy",
+ movie_file_path
+ ]
+ if self.save_as_gif:
+ movie_file_path=self.gif_file_path
+ commands += [
+ movie_file_path
+ ]
if not self.includes_sound:
commands.insert(-1, '-an')