Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

Add the top-level manim module and Manim class

Mehmet Mert Yildiran5e8a2c8901b3
diff --git a/manim.py b/manim.py
new file mode 100644
index 000000000..26459d05f
--- /dev/null
+++ b/manim.py
@@ -0,0 +1,46 @@
+#!/usr/bin/python3
+
+import sys
+import argparse
+# import imp
+import importlib
+import inspect
+import itertools as it
+import os
+import subprocess as sp
+import traceback
+
+from constants import *
+
+from scene.scene import Scene
+from utils.sounds import play_error_sound
+from utils.sounds import play_finish_sound
+
+from colour import Color
+
+
+class Manim():
+
+ def __init__(self):
+ self.config = {
+ "file": "example_file.py",
+ "scene_name": "LiveStream",
+ "open_video_upon_completion": False,
+ "show_file_in_finder": False,
+ # By default, write to file
+ "write_to_movie": True,
+ "show_last_frame": False,
+ "save_pngs": False,
+ # If -t is passed in (for transparent), this will be RGBA
+ "saved_image_mode": "RGB",
+ "movie_file_extension": ".mp4",
+ "quiet": True,
+ "ignore_waits": False,
+ "write_all": False,
+ "name": "LiveStream",
+ "start_at_animation_number": 0,
+ "end_at_animation_number": None,
+ "skip_animations": False,
+ "camera_config": HIGH_QUALITY_CAMERA_CONFIG,
+ "frame_duration": PRODUCTION_QUALITY_FRAME_DURATION,
+ }
diff --git a/test1.py b/test1.py
index 5fca056b3..23613c18b 100644
--- a/test1.py
+++ b/test1.py
@@ -1,4 +1,5 @@
from big_ol_pile_of_manim_imports import *
+from manim import Manim
class Shapes(Scene):
#A few simple shapes
@@ -15,3 +16,8 @@ class Shapes(Scene):
self.play(Transform(square,triangle))
#python3 extract_scene.py test1.py Shapes -r 1080
+
+
+if __name__ == '__main__':
+ manim = Manim()
+ Shapes(**manim.config)