diff --git a/manim.py b/manim.py index 26459d05..c6cf2292 100644 --- a/manim.py +++ b/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, } diff --git a/scene/scene.py b/scene/scene.py index a152334d..f116cf52 100644 --- a/scene/scene.py +++ b/scene/scene.py @@ -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: diff --git a/test1.py b/test1.py index 23613c18..6ec41557 100644 --- a/test1.py +++ b/test1.py @@ -6,8 +6,8 @@ class Shapes(Scene): 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])) + 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)) @@ -18,6 +18,18 @@ class Shapes(Scene): #python3 extract_scene.py test1.py Shapes -r 1080 -if __name__ == '__main__': - manim = Manim() - Shapes(**manim.config) +manim = Manim() +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()