mirror of
https://github.com/3b1b/manim.git
synced 2025-08-05 16:49:03 +00:00
Minor clean up
This commit is contained in:
parent
1d14bae092
commit
361d9d0652
2 changed files with 6 additions and 9 deletions
|
@ -11,13 +11,12 @@ if TYPE_CHECKING:
|
||||||
|
|
||||||
|
|
||||||
# TODO, it feels a bit unprincipled to have some global constants
|
# TODO, it feels a bit unprincipled to have some global constants
|
||||||
# depend on the output of this function, all for all that configuration
|
# depend on the output of this function, and for all that configuration
|
||||||
# code to be run merely upon importing from this file
|
# code to be run merely upon importing from this file.
|
||||||
CAMERA_CONFIG = get_camera_config()
|
CAMERA_CONFIG = get_camera_config()
|
||||||
|
|
||||||
# Sizes relevant to default camera frame
|
# Sizes relevant to default camera frame
|
||||||
ASPECT_RATIO: float = CAMERA_CONFIG['pixel_width'] / CAMERA_CONFIG['pixel_height']
|
ASPECT_RATIO: float = CAMERA_CONFIG['pixel_width'] / CAMERA_CONFIG['pixel_height']
|
||||||
# FRAME_HEIGHT: float = 8.0
|
|
||||||
FRAME_WIDTH: float = FRAME_HEIGHT * ASPECT_RATIO
|
FRAME_WIDTH: float = FRAME_HEIGHT * ASPECT_RATIO
|
||||||
FRAME_SHAPE: tuple[float, float] = (FRAME_WIDTH, FRAME_HEIGHT)
|
FRAME_SHAPE: tuple[float, float] = (FRAME_WIDTH, FRAME_HEIGHT)
|
||||||
FRAME_Y_RADIUS: float = FRAME_HEIGHT / 2
|
FRAME_Y_RADIUS: float = FRAME_HEIGHT / 2
|
||||||
|
|
|
@ -82,7 +82,7 @@ def get_scenes_to_render(all_scene_classes, scene_config, run_config):
|
||||||
if run_config["write_all"]:
|
if run_config["write_all"]:
|
||||||
return [sc(**scene_config) for sc in all_scene_classes]
|
return [sc(**scene_config) for sc in all_scene_classes]
|
||||||
|
|
||||||
names_to_classes = {sc.__name__ : sc for sc in all_scene_classes}
|
names_to_classes = {sc.__name__: sc for sc in all_scene_classes}
|
||||||
scene_names = run_config["scene_names"]
|
scene_names = run_config["scene_names"]
|
||||||
|
|
||||||
for name in set.difference(set(scene_names), names_to_classes):
|
for name in set.difference(set(scene_names), names_to_classes):
|
||||||
|
@ -116,11 +116,9 @@ def get_scene_classes_from_module(module):
|
||||||
|
|
||||||
|
|
||||||
def main(scene_config, run_config):
|
def main(scene_config, run_config):
|
||||||
module = run_config["module"]
|
if run_config["module"] is None:
|
||||||
if module is None:
|
|
||||||
# If no module was passed in, just play the blank scene
|
# If no module was passed in, just play the blank scene
|
||||||
return [BlankScene(**scene_config)]
|
return [BlankScene(**scene_config)]
|
||||||
|
|
||||||
all_scene_classes = get_scene_classes_from_module(module)
|
all_scene_classes = get_scene_classes_from_module(run_config["module"])
|
||||||
scenes = get_scenes_to_render(all_scene_classes, scene_config, run_config)
|
return get_scenes_to_render(all_scene_classes, scene_config, run_config)
|
||||||
return scenes
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue