MCPcopy
hub / github.com/ManimCommunity/manim / wait

Method wait

manim/scene/scene.py:1209–1243  ·  view source on GitHub ↗

Plays a "no operation" animation. Parameters ---------- duration The run time of the animation. stop_condition A function without positional arguments that is evaluated every time a frame is rendered. The animation only stops when

(
        self,
        duration: float = DEFAULT_WAIT_TIME,
        stop_condition: Callable[[], bool] | None = None,
        frozen_frame: bool | None = None,
    )

Source from the content-addressed store, hash-verified

1207 )
1208
1209 def wait(
1210 self,
1211 duration: float = DEFAULT_WAIT_TIME,
1212 stop_condition: Callable[[], bool] | None = None,
1213 frozen_frame: bool | None = None,
1214 ) -> None:
1215 """Plays a "no operation" animation.
1216
1217 Parameters
1218 ----------
1219 duration
1220 The run time of the animation.
1221 stop_condition
1222 A function without positional arguments that is evaluated every time
1223 a frame is rendered. The animation only stops when the return value
1224 of the function is truthy, or when the time specified in ``duration``
1225 passes.
1226 frozen_frame
1227 If True, updater functions are not evaluated, and the animation outputs
1228 a frozen frame. If False, updater functions are called and frames
1229 are rendered as usual. If None (the default), the scene tries to
1230 determine whether or not the frame is frozen on its own.
1231
1232 See also
1233 --------
1234 :class:`.Wait`, :meth:`.should_mobjects_update`
1235 """
1236 duration = self.validate_run_time(duration, self.wait, "duration")
1237 self.play(
1238 Wait(
1239 run_time=duration,
1240 stop_condition=stop_condition,
1241 frozen_frame=frozen_frame,
1242 )
1243 )
1244
1245 def pause(self, duration: float = DEFAULT_WAIT_TIME) -> None:
1246 """Pauses the scene (i.e., displays a frozen frame).

Callers 15

test_scene_timeFunction · 0.95
test_subcaptionFunction · 0.95
pauseMethod · 0.95
wait_untilMethod · 0.95
constructMethod · 0.80
constructMethod · 0.80
constructMethod · 0.80
constructMethod · 0.80

Calls 3

validate_run_timeMethod · 0.95
playMethod · 0.95
WaitClass · 0.85