Turn live stream related configurations into constants

This commit is contained in:
Mehmet Mert Yildiran 2018-10-30 18:30:34 +03:00
parent a4a5e79ddf
commit 312c2b0243
3 changed files with 6 additions and 20 deletions

View file

@ -211,3 +211,6 @@ PALETTE = list(COLOR_MAP.values())
locals().update(COLOR_MAP) locals().update(COLOR_MAP)
for name in [s for s in list(COLOR_MAP.keys()) if s.endswith("_C")]: for name in [s for s in list(COLOR_MAP.keys()) if s.endswith("_C")]:
locals()[name.replace("_C", "")] = locals()[name] locals()[name.replace("_C", "")] = locals()[name]
IS_LIVE_STREAMING = True
LIVE_STREAM_NAME = "LiveStream"

View file

@ -8,8 +8,7 @@ class Manim():
def __new__(cls): def __new__(cls):
kwargs = { kwargs = {
"file": "example_file.py", "scene_name": LIVE_STREAM_NAME,
"scene_name": "LiveStream",
"open_video_upon_completion": False, "open_video_upon_completion": False,
"show_file_in_finder": False, "show_file_in_finder": False,
# By default, write to file # By default, write to file
@ -22,12 +21,12 @@ class Manim():
"quiet": True, "quiet": True,
"ignore_waits": False, "ignore_waits": False,
"write_all": False, "write_all": False,
"name": "LiveStream", "name": LIVE_STREAM_NAME,
"start_at_animation_number": 0, "start_at_animation_number": 0,
"end_at_animation_number": None, "end_at_animation_number": None,
"skip_animations": False, "skip_animations": False,
"camera_config": HIGH_QUALITY_CAMERA_CONFIG, "camera_config": HIGH_QUALITY_CAMERA_CONFIG,
"frame_duration": PRODUCTION_QUALITY_FRAME_DURATION, "frame_duration": PRODUCTION_QUALITY_FRAME_DURATION,
"is_live_streaming": True, "is_live_streaming": IS_LIVE_STREAMING
} }
return Scene(**kwargs) return Scene(**kwargs)

View file

@ -1,22 +1,6 @@
from big_ol_pile_of_manim_imports import * from big_ol_pile_of_manim_imports import *
from manim import Manim from manim import Manim
class Shapes(Scene):
#A few simple shapes
def construct(self):
circle = Circle()
square = Square()
line = Line(np.array([3,0,0]),np.array([5,0,0]))
triangle = Polygon(np.array([0,0,0]),np.array([1,1,0]),np.array([1,-1,0]))
self.add(line)
self.play(ShowCreation(circle))
self.play(FadeOut(circle))
self.play(GrowFromCenter(square))
self.play(Transform(square,triangle))
#python3 extract_scene.py test1.py Shapes -r 1080
manim = Manim() manim = Manim()