Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

Really dumb copy-pasting of extract_scene.py and scene.py from master to get what I want. Not sure what's going on here.

Grant Sandersonec610a9152c2
diff --git a/extract_scene.py b/extract_scene.py
index 0d21e8a74..bbc17b916 100644
--- a/extract_scene.py
+++ b/extract_scene.py
@@ -18,7 +18,6 @@ from camera import Camera
HELP_MESSAGE = """
Usage:
python extract_scene.py <module> [<scene name>]
-
-p preview in low quality
-s show and save picture of last frame
-w write result to file [this is default if nothing else is stated]
@@ -35,7 +34,6 @@ SCENE_NOT_FOUND_MESSAGE = """
CHOOSE_NUMBER_MESSAGE = """
Choose number corresponding to desired scene/arguments.
(Use comma separated list for multiple entries)
-
Choice(s): """
INVALID_NUMBER_MESSAGE = "Fine then, if you don't want to give a valid number I'll just quit"
@@ -95,6 +93,7 @@ def get_configuration():
"save_pngs" : args.save_pngs,
#If -t is passed in (for transparent), this will be RGBA
"saved_image_mode": "RGBA" if args.transparent else "RGB",
+ "movie_file_extension" : ".mov" if args.transparent else ".mp4",
"quiet" : args.quiet or args.write_all,
"ignore_waits" : args.preview,
"write_all" : args.write_all,
@@ -237,6 +236,7 @@ def main():
"write_to_movie",
"output_directory",
"save_pngs",
+ "movie_file_extension",
"start_at_animation_number",
"end_at_animation_number",
]
@@ -260,4 +260,4 @@ def main():
if __name__ == "__main__":
- main()
+ main()
\ No newline at end of file
diff --git a/scene/scene.py b/scene/scene.py
index 6dc31d5f0..5168db254 100644
--- a/scene/scene.py
+++ b/scene/scene.py
@@ -82,7 +82,7 @@ class Scene(Container):
def setup(self):
"""
This is meant to be implement by any scenes which
- are commonly subclassed, and have some common setup
+ are comonly subclassed, and have some common setup
involved before the construct method is called.
"""
pass
@@ -366,7 +366,6 @@ class Scene(Container):
Each arg can either be an animation, or a mobject method
followed by that methods arguments (and potentially follow
by a dict of kwargs for that method).
-
This animation list is built by going through the args list,
and each animation is simply added, but when a mobject method
s hit, a MoveToTarget animation is built using the args that
@@ -387,7 +386,7 @@ class Scene(Container):
animations.pop()
#method should already have target then.
else:
- mobject.target = mobject.deepcopy()
+ mobject.generate_target()
#
if len(state["method_args"]) > 0 and isinstance(state["method_args"][-1], dict):
method_kwargs = state["method_args"].pop()
@@ -578,17 +577,12 @@ class Scene(Container):
FFMPEG_BIN,
'-y', # overwrite output file if it exists
'-f', 'rawvideo',
- '-vcodec','rawvideo',
'-s', '%dx%d'%(width, height), # size of one frame
'-pix_fmt', 'rgba',
'-r', str(fps), # frames per second
'-i', '-', # The imput comes from a pipe
'-an', # Tells FFMPEG not to expect any audio
- '-vcodec', 'mpeg',
- '-c:v', 'libx264',
- '-pix_fmt', 'yuv420p',
'-loglevel', 'error',
- temp_file_path,
]
if self.movie_file_extension == ".mov":
# This is if the background of the exported video
@@ -624,4 +618,3 @@ class EndSceneEarlyException(Exception):
-