mirror of
https://github.com/3b1b/manim.git
synced 2025-08-05 16:49:03 +00:00
Remove "preview" as a scene parameter, just look for whether window is None
This commit is contained in:
parent
2e49c60148
commit
dd251ab8c2
3 changed files with 4 additions and 8 deletions
|
@ -477,7 +477,6 @@ def get_scene_config(args: Namespace) -> dict:
|
|||
"skip_animations": args.skip_animations,
|
||||
"start_at_animation_number": start,
|
||||
"end_at_animation_number": end,
|
||||
"preview": not args.write_file,
|
||||
"presenter_mode": args.presenter_mode,
|
||||
"leave_progress_bars": args.leave_progress_bars,
|
||||
"show_animation_progress": args.show_animation_progress,
|
||||
|
@ -495,4 +494,5 @@ def get_run_config(args: Namespace):
|
|||
"quiet": args.quiet or args.write_all,
|
||||
"write_all": args.write_all,
|
||||
"window_config": window_config,
|
||||
"show_in_window": not args.write_file
|
||||
}
|
||||
|
|
|
@ -69,7 +69,7 @@ class ReloadManager:
|
|||
run_config = manimlib.config.get_run_config(self.args)
|
||||
|
||||
# Create or reuse window
|
||||
if scene_config["preview"] and not self.window: # TODO, this should be in run_config not scene_config
|
||||
if run_config["show_in_window"] and not self.window:
|
||||
self.window = Window(**run_config["window_config"])
|
||||
scene_config["window"] = self.window
|
||||
|
||||
|
|
|
@ -82,7 +82,6 @@ class Scene(object):
|
|||
start_at_animation_number: int | None = None,
|
||||
end_at_animation_number: int | None = None,
|
||||
leave_progress_bars: bool = False,
|
||||
preview: bool = True, # TODO, remove
|
||||
window: Optional[Window] = None,
|
||||
presenter_mode: bool = False,
|
||||
show_animation_progress: bool = False,
|
||||
|
@ -94,7 +93,6 @@ class Scene(object):
|
|||
self.start_at_animation_number = start_at_animation_number
|
||||
self.end_at_animation_number = end_at_animation_number
|
||||
self.leave_progress_bars = leave_progress_bars
|
||||
self.preview = preview
|
||||
self.presenter_mode = presenter_mode
|
||||
self.show_animation_progress = show_animation_progress
|
||||
self.embed_exception_mode = embed_exception_mode
|
||||
|
@ -212,8 +210,8 @@ class Scene(object):
|
|||
close_scene_on_exit: bool = True,
|
||||
show_animation_progress: bool = False,
|
||||
) -> None:
|
||||
if not self.preview:
|
||||
# Embed is only relevant with a preview
|
||||
if not self.window:
|
||||
# Embed is only relevant for interactive development with a Window
|
||||
return
|
||||
self.stop_skipping()
|
||||
self.update_frame(force_draw=True)
|
||||
|
@ -728,8 +726,6 @@ class Scene(object):
|
|||
scene_state.restore_scene(self)
|
||||
|
||||
def save_state(self) -> None:
|
||||
if not self.preview:
|
||||
return
|
||||
state = self.get_state()
|
||||
if self.undo_stack and state.mobjects_match(self.undo_stack[-1]):
|
||||
return
|
||||
|
|
Loading…
Add table
Reference in a new issue