mirror of
https://github.com/3b1b/manim.git
synced 2025-09-01 00:48:45 +00:00
Minor reorganization of ReloadManager.retrieve_scenes_and_run
This commit is contained in:
parent
667cfaf160
commit
cd744024ea
2 changed files with 10 additions and 10 deletions
|
@ -22,8 +22,7 @@ def main():
|
||||||
manimlib.utils.init_config.init_customization()
|
manimlib.utils.init_config.init_customization()
|
||||||
return
|
return
|
||||||
|
|
||||||
reload_manager = ReloadManager(args)
|
ReloadManager().run()
|
||||||
reload_manager.run()
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
|
@ -4,7 +4,7 @@ from typing import Any
|
||||||
from IPython.terminal.embed import KillEmbedded
|
from IPython.terminal.embed import KillEmbedded
|
||||||
|
|
||||||
|
|
||||||
import manimlib.config
|
from manimlib.config import get_global_config
|
||||||
import manimlib.extract_scene
|
import manimlib.extract_scene
|
||||||
|
|
||||||
from manimlib.window import Window
|
from manimlib.window import Window
|
||||||
|
@ -57,21 +57,22 @@ class ReloadManager:
|
||||||
|
|
||||||
def retrieve_scenes_and_run(self):
|
def retrieve_scenes_and_run(self):
|
||||||
"""
|
"""
|
||||||
Creates a new configuration based on the CLI args and runs the scenes.
|
Take the global configuration, which is based on CLI arguments,
|
||||||
|
modify it based on reloading status, then extract and run scenes
|
||||||
|
accordingly
|
||||||
"""
|
"""
|
||||||
# Args to Config
|
global_config = get_global_config()
|
||||||
scene_config = manimlib.config.get_scene_config()
|
scene_config = global_config["scene"]
|
||||||
scene_config.update(reload_manager=self)
|
run_config = global_config["run"]
|
||||||
|
|
||||||
run_config = manimlib.config.get_run_config()
|
scene_config.update(reload_manager=self)
|
||||||
run_config.update(is_reload=self.is_reload)
|
run_config.update(is_reload=self.is_reload)
|
||||||
if self.embed_line:
|
if self.embed_line:
|
||||||
run_config.update(embed_line=self.embed_line)
|
run_config.update(embed_line=self.embed_line)
|
||||||
|
|
||||||
# Create or reuse window
|
# Create or reuse window
|
||||||
if run_config["show_in_window"] and not self.window:
|
if run_config["show_in_window"] and not self.window:
|
||||||
window_config = manimlib.config.get_window_config()
|
self.window = Window(**global_config["window"])
|
||||||
self.window = Window(**window_config)
|
|
||||||
scene_config.update(window=self.window)
|
scene_config.update(window=self.window)
|
||||||
|
|
||||||
# Scenes
|
# Scenes
|
||||||
|
|
Loading…
Add table
Reference in a new issue