Add the top-level manim module and Manim class

This commit is contained in:
Mehmet Mert Yildiran 2018-10-30 07:37:32 +03:00
parent 7d534ab0d4
commit 5e8a2c8901
2 changed files with 52 additions and 0 deletions

46
manim.py Normal file
View file

@ -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,
}

View file

@ -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)