mirror of
https://github.com/3b1b/manim.git
synced 2025-08-05 16:49:03 +00:00
Turn live stream related configurations into constants
This commit is contained in:
parent
a4a5e79ddf
commit
312c2b0243
3 changed files with 6 additions and 20 deletions
|
@ -211,3 +211,6 @@ PALETTE = list(COLOR_MAP.values())
|
|||
locals().update(COLOR_MAP)
|
||||
for name in [s for s in list(COLOR_MAP.keys()) if s.endswith("_C")]:
|
||||
locals()[name.replace("_C", "")] = locals()[name]
|
||||
|
||||
IS_LIVE_STREAMING = True
|
||||
LIVE_STREAM_NAME = "LiveStream"
|
||||
|
|
7
manim.py
7
manim.py
|
@ -8,8 +8,7 @@ class Manim():
|
|||
|
||||
def __new__(cls):
|
||||
kwargs = {
|
||||
"file": "example_file.py",
|
||||
"scene_name": "LiveStream",
|
||||
"scene_name": LIVE_STREAM_NAME,
|
||||
"open_video_upon_completion": False,
|
||||
"show_file_in_finder": False,
|
||||
# By default, write to file
|
||||
|
@ -22,12 +21,12 @@ class Manim():
|
|||
"quiet": True,
|
||||
"ignore_waits": False,
|
||||
"write_all": False,
|
||||
"name": "LiveStream",
|
||||
"name": LIVE_STREAM_NAME,
|
||||
"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,
|
||||
"is_live_streaming": True,
|
||||
"is_live_streaming": IS_LIVE_STREAMING
|
||||
}
|
||||
return Scene(**kwargs)
|
||||
|
|
16
test1.py
16
test1.py
|
@ -1,22 +1,6 @@
|
|||
from big_ol_pile_of_manim_imports import *
|
||||
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()
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue