diff --git a/manimlib/constants.py b/manimlib/constants.py index 40b6f8e8..7850796c 100644 --- a/manimlib/constants.py +++ b/manimlib/constants.py @@ -11,13 +11,12 @@ if TYPE_CHECKING: # TODO, it feels a bit unprincipled to have some global constants -# depend on the output of this function, all for all that configuration -# code to be run merely upon importing from this file +# depend on the output of this function, and for all that configuration +# code to be run merely upon importing from this file. CAMERA_CONFIG = get_camera_config() # Sizes relevant to default camera frame ASPECT_RATIO: float = CAMERA_CONFIG['pixel_width'] / CAMERA_CONFIG['pixel_height'] -# FRAME_HEIGHT: float = 8.0 FRAME_WIDTH: float = FRAME_HEIGHT * ASPECT_RATIO FRAME_SHAPE: tuple[float, float] = (FRAME_WIDTH, FRAME_HEIGHT) FRAME_Y_RADIUS: float = FRAME_HEIGHT / 2 diff --git a/manimlib/extract_scene.py b/manimlib/extract_scene.py index 5467d7a4..15dd3e13 100644 --- a/manimlib/extract_scene.py +++ b/manimlib/extract_scene.py @@ -82,7 +82,7 @@ def get_scenes_to_render(all_scene_classes, scene_config, run_config): if run_config["write_all"]: 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"] 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): - module = run_config["module"] - if module is None: + if run_config["module"] is None: # If no module was passed in, just play the blank scene return [BlankScene(**scene_config)] - all_scene_classes = get_scene_classes_from_module(module) - scenes = get_scenes_to_render(all_scene_classes, scene_config, run_config) - return scenes + all_scene_classes = get_scene_classes_from_module(run_config["module"]) + return get_scenes_to_render(all_scene_classes, scene_config, run_config)