mirror of
https://github.com/3b1b/manim.git
synced 2025-09-01 00:48:45 +00:00
Change convention for how camera_qualities are represented in default_config.yml
This commit is contained in:
parent
25de729bb3
commit
dd5d239971
2 changed files with 18 additions and 25 deletions
|
@ -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:
|
||||
|
|
|
@ -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
|
Loading…
Add table
Reference in a new issue