Skip to content

Commit

Permalink
Change convention for how camera_qualities are represented in default…
Browse files Browse the repository at this point in the history
…_config.yml
  • Loading branch information
3b1b committed May 15, 2022
1 parent 25de729 commit dd5d239
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 25 deletions.
22 changes: 11 additions & 11 deletions manimlib/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,31 +415,31 @@ def get_configuration(args):

def get_camera_configuration(args, custom_config):
camera_config = {}
camera_qualities = get_custom_config()["camera_qualities"]
camera_resolutions = get_custom_config()["camera_resolutions"]
if args.low_quality:
quality = camera_qualities["low"]
resolution = camera_resolutions["low"]
elif args.medium_quality:
quality = camera_qualities["medium"]
resolution = camera_resolutions["med"]
elif args.hd:
quality = camera_qualities["high"]
resolution = camera_resolutions["high"]
elif args.uhd:
quality = camera_qualities["ultra_high"]
resolution = camera_resolutions["4k"]
else:
quality = camera_qualities[camera_qualities["default_quality"]]
resolution = camera_resolutions[camera_resolutions["default_resolution"]]

if args.resolution:
quality["resolution"] = args.resolution
if args.frame_rate:
quality["frame_rate"] = int(args.frame_rate)
frame_rate = int(args.frame_rate)
else:
frame_rate = get_custom_config()["frame_rate"]

width_str, height_str = quality["resolution"].split("x")
width_str, height_str = resolution.split("x")
width = int(width_str)
height = int(height_str)

camera_config.update({
"pixel_width": width,
"pixel_height": height,
"frame_rate": quality["frame_rate"],
"frame_rate": frame_rate,
})

try:
Expand Down
21 changes: 7 additions & 14 deletions manimlib/default_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,10 @@ full_screen: False
# easier when working with the broken up scene, which
# effectively has cuts at all the places you might want.
break_into_partial_movies: False
camera_qualities:
low:
resolution: "854x480"
frame_rate: 15
medium:
resolution: "1280x720"
frame_rate: 30
high:
resolution: "1920x1080"
frame_rate: 30
ultra_high:
resolution: "3840x2160"
frame_rate: 60
default_quality: "high"
camera_resolutions:
low: "854x480"
med: "1280x720"
high: "1920x1080"
4k: "3840x2160"
default_resolution: "high"
frame_rate: 30

0 comments on commit dd5d239

Please sign in to comment.