Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

Camera background is opacity 0 when -t is passed in, otherwise 1

Grant Sandersonf9ce36c6f6e1
diff --git a/camera/camera.py b/camera/camera.py
index ba0e6c72d..568006832 100644
--- a/camera/camera.py
+++ b/camera/camera.py
@@ -39,7 +39,7 @@ class Camera(object):
"frame_width": FRAME_WIDTH,
"frame_center": ORIGIN,
"background_color": BLACK,
- "background_opacity": 0,
+ "background_opacity": 1,
# Points in vectorized mobjects with norm greater
# than this value will be rescaled.
"max_allowable_norm": FRAME_WIDTH,
diff --git a/extract_scene.py b/extract_scene.py
index 1471cb1d2..e0a26790e 100644
--- a/extract_scene.py
+++ b/extract_scene.py
@@ -106,16 +106,23 @@ def get_configuration():
"start_at_animation_number": args.start_at_animation_number,
"end_at_animation_number": None,
}
+
+ # Camera configuration
+ config["camera_config"] = {}
if args.low_quality:
- config["camera_config"] = LOW_QUALITY_CAMERA_CONFIG
+ config["camera_config"].update(LOW_QUALITY_CAMERA_CONFIG)
config["frame_duration"] = LOW_QUALITY_FRAME_DURATION
elif args.medium_quality:
- config["camera_config"] = MEDIUM_QUALITY_CAMERA_CONFIG
+ config["camera_config"].update(MEDIUM_QUALITY_CAMERA_CONFIG)
config["frame_duration"] = MEDIUM_QUALITY_FRAME_DURATION
else:
- config["camera_config"] = PRODUCTION_QUALITY_CAMERA_CONFIG
+ config["camera_config"].update(PRODUCTION_QUALITY_CAMERA_CONFIG)
config["frame_duration"] = PRODUCTION_QUALITY_FRAME_DURATION
+ if args.transparent:
+ config["camera_config"]["background_opacity"] = 0
+
+ # Arguments related to skipping
stan = config["start_at_animation_number"]
if stan is not None:
if "," in stan:
diff --git a/scene/scene.py b/scene/scene.py
index a49edea4b..61e9b21a2 100644
--- a/scene/scene.py
+++ b/scene/scene.py
@@ -591,7 +591,7 @@ class Scene(Container):
# This is if the background of the exported video
# should be transparent.
command += [
- '-vcodec', 'png',
+ '-vcodec', 'qtrle',
]
else:
command += [