From 5e8a2c8901b3a72bec561dbab063c8197d18cd3a Mon Sep 17 00:00:00 2001 From: Mehmet Mert Yildiran Date: Tue, 30 Oct 2018 07:37:32 +0300 Subject: [PATCH] Add the top-level manim module and Manim class --- manim.py | 46 ++++++++++++++++++++++++++++++++++++++++++++++ test1.py | 6 ++++++ 2 files changed, 52 insertions(+) create mode 100644 manim.py diff --git a/manim.py b/manim.py new file mode 100644 index 00000000..26459d05 --- /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 5fca056b..23613c18 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)