mirror of
https://github.com/3b1b/manim.git
synced 2025-11-14 06:27:46 +00:00
Add is_live_streaming control flow to idle the scene generation pipe for interactive shell usage purpose
This commit is contained in:
parent
5e8a2c8901
commit
80256013ea
3 changed files with 20 additions and 5 deletions
1
manim.py
1
manim.py
|
|
@ -43,4 +43,5 @@ class Manim():
|
|||
"skip_animations": False,
|
||||
"camera_config": HIGH_QUALITY_CAMERA_CONFIG,
|
||||
"frame_duration": PRODUCTION_QUALITY_FRAME_DURATION,
|
||||
"is_live_streaming": True,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -67,6 +67,8 @@ class Scene(Container):
|
|||
self.setup()
|
||||
if self.write_to_movie:
|
||||
self.open_movie_pipe()
|
||||
if self.is_live_streaming:
|
||||
return None
|
||||
try:
|
||||
self.construct(*self.construct_args)
|
||||
except EndSceneEarlyException:
|
||||
|
|
|
|||
16
test1.py
16
test1.py
|
|
@ -18,6 +18,18 @@ class Shapes(Scene):
|
|||
#python3 extract_scene.py test1.py Shapes -r 1080
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
manim = Manim()
|
||||
Shapes(**manim.config)
|
||||
scene1 = Scene(**manim.config)
|
||||
|
||||
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]))
|
||||
|
||||
scene1.add(line)
|
||||
scene1.play(ShowCreation(circle))
|
||||
scene1.play(FadeOut(circle))
|
||||
scene1.play(GrowFromCenter(square))
|
||||
scene1.play(Transform(square,triangle))
|
||||
|
||||
scene1.close_movie_pipe()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue