mirror of
https://github.com/3b1b/manim.git
synced 2025-04-13 09:47:07 +00:00
Make default_wait_time a piece of scene configuration
This commit is contained in:
parent
2c43d293a5
commit
c9b6ee57a8
3 changed files with 8 additions and 9 deletions
|
@ -34,10 +34,6 @@ DEFAULT_MOBJECT_TO_EDGE_BUFFER: float = GLOBAL_CONFIG["sizes"]["default_mobject_
|
||||||
DEFAULT_MOBJECT_TO_MOBJECT_BUFFER: float = GLOBAL_CONFIG["sizes"]["default_mobject_to_mobject_buff"]
|
DEFAULT_MOBJECT_TO_MOBJECT_BUFFER: float = GLOBAL_CONFIG["sizes"]["default_mobject_to_mobject_buff"]
|
||||||
|
|
||||||
|
|
||||||
# In seconds
|
|
||||||
DEFAULT_WAIT_TIME: float = GLOBAL_CONFIG["default_wait_time"]
|
|
||||||
|
|
||||||
|
|
||||||
# Standard vectors
|
# Standard vectors
|
||||||
ORIGIN: Vect3 = np.array([0., 0., 0.])
|
ORIGIN: Vect3 = np.array([0., 0., 0.])
|
||||||
UP: Vect3 = np.array([0., 1., 0.])
|
UP: Vect3 = np.array([0., 1., 0.])
|
||||||
|
|
|
@ -58,6 +58,8 @@ scene:
|
||||||
# but defaults can be set here
|
# but defaults can be set here
|
||||||
show_animation_progress: False
|
show_animation_progress: False
|
||||||
leave_progress_bars: False
|
leave_progress_bars: False
|
||||||
|
# How long does a scene pause on Scene.wait calls
|
||||||
|
default_wait_time: 1.0
|
||||||
style:
|
style:
|
||||||
tex_template: "default"
|
tex_template: "default"
|
||||||
font: "Consolas"
|
font: "Consolas"
|
||||||
|
@ -142,8 +144,6 @@ colors:
|
||||||
light_pink: "#DC75CD"
|
light_pink: "#DC75CD"
|
||||||
green_screen: "#00FF00"
|
green_screen: "#00FF00"
|
||||||
orange: "#FF862F"
|
orange: "#FF862F"
|
||||||
# How long does a scene pause on Scene.wait calls
|
|
||||||
default_wait_time: 1.0
|
|
||||||
# What command to use for ffmpeg
|
# What command to use for ffmpeg
|
||||||
ffmpeg_bin: "ffmpeg"
|
ffmpeg_bin: "ffmpeg"
|
||||||
universal_import_line: "from manimlib import *"
|
universal_import_line: "from manimlib import *"
|
||||||
|
|
|
@ -18,7 +18,6 @@ from manimlib.camera.camera_frame import CameraFrame
|
||||||
from manimlib.config import get_camera_config
|
from manimlib.config import get_camera_config
|
||||||
from manimlib.config import get_file_writer_config
|
from manimlib.config import get_file_writer_config
|
||||||
from manimlib.constants import ARROW_SYMBOLS
|
from manimlib.constants import ARROW_SYMBOLS
|
||||||
from manimlib.constants import DEFAULT_WAIT_TIME
|
|
||||||
from manimlib.event_handler import EVENT_DISPATCHER
|
from manimlib.event_handler import EVENT_DISPATCHER
|
||||||
from manimlib.event_handler.event_type import EventType
|
from manimlib.event_handler.event_type import EventType
|
||||||
from manimlib.logger import log
|
from manimlib.logger import log
|
||||||
|
@ -80,14 +79,16 @@ class Scene(object):
|
||||||
show_animation_progress: bool = False,
|
show_animation_progress: bool = False,
|
||||||
leave_progress_bars: bool = False,
|
leave_progress_bars: bool = False,
|
||||||
presenter_mode: bool = False,
|
presenter_mode: bool = False,
|
||||||
|
default_wait_time: float = 1.0,
|
||||||
):
|
):
|
||||||
self.skip_animations = skip_animations
|
self.skip_animations = skip_animations
|
||||||
self.always_update_mobjects = always_update_mobjects
|
self.always_update_mobjects = always_update_mobjects
|
||||||
self.start_at_animation_number = start_at_animation_number
|
self.start_at_animation_number = start_at_animation_number
|
||||||
self.end_at_animation_number = end_at_animation_number
|
self.end_at_animation_number = end_at_animation_number
|
||||||
|
self.show_animation_progress = show_animation_progress
|
||||||
self.leave_progress_bars = leave_progress_bars
|
self.leave_progress_bars = leave_progress_bars
|
||||||
self.presenter_mode = presenter_mode
|
self.presenter_mode = presenter_mode
|
||||||
self.show_animation_progress = show_animation_progress
|
self.default_wait_time = default_wait_time
|
||||||
|
|
||||||
self.camera_config = merge_dicts_recursively(
|
self.camera_config = merge_dicts_recursively(
|
||||||
get_camera_config(), # Global default
|
get_camera_config(), # Global default
|
||||||
|
@ -593,11 +594,13 @@ class Scene(object):
|
||||||
|
|
||||||
def wait(
|
def wait(
|
||||||
self,
|
self,
|
||||||
duration: float = DEFAULT_WAIT_TIME,
|
duration: Optional[float] = None,
|
||||||
stop_condition: Callable[[], bool] = None,
|
stop_condition: Callable[[], bool] = None,
|
||||||
note: str = None,
|
note: str = None,
|
||||||
ignore_presenter_mode: bool = False
|
ignore_presenter_mode: bool = False
|
||||||
):
|
):
|
||||||
|
if duration is None:
|
||||||
|
duration = self.default_wait_time
|
||||||
self.pre_play()
|
self.pre_play()
|
||||||
self.update_mobjects(dt=0) # Any problems with this?
|
self.update_mobjects(dt=0) # Any problems with this?
|
||||||
if self.presenter_mode and not self.skip_animations and not ignore_presenter_mode:
|
if self.presenter_mode and not self.skip_animations and not ignore_presenter_mode:
|
||||||
|
|
Loading…
Add table
Reference in a new issue