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

Function test_SpeedModifier

tests/test_graphical_units/test_speed.py:10–36  ·  view source on GitHub ↗
(scene)

Source from the content-addressed store, hash-verified

8
9@frames_comparison(last_frame=False)
10def test_SpeedModifier(scene):
11 a = Dot().shift(LEFT * 2 + 0.5 * UP)
12 b = Dot().shift(LEFT * 2 + 0.5 * DOWN)
13 c = Dot().shift(2 * RIGHT)
14 ChangeSpeed.add_updater(c, lambda x, dt: x.rotate_about_origin(PI / 3.7 * dt))
15 scene.add(a, b, c)
16 scene.play(ChangeSpeed(Wait(0.5), speedinfo={0.3: 1, 0.4: 0.1, 0.6: 0.1, 1: 1}))
17 scene.play(
18 ChangeSpeed(
19 AnimationGroup(
20 a.animate(run_time=0.5, rate_func=linear).shift(RIGHT * 4),
21 b.animate(run_time=0.5, rate_func=rush_from).shift(RIGHT * 4),
22 ),
23 speedinfo={0.3: 1, 0.4: 0.1, 0.6: 0.1, 1: 1},
24 affects_speed_updaters=False,
25 ),
26 )
27 scene.play(
28 ChangeSpeed(
29 AnimationGroup(
30 a.animate(run_time=0.5, rate_func=linear).shift(LEFT * 4),
31 b.animate(run_time=0.5, rate_func=rush_into).shift(LEFT * 4),
32 ),
33 speedinfo={0.3: 1, 0.4: 0.1, 0.6: 0.1, 1: 1},
34 rate_func=there_and_back,
35 ),
36 )

Callers

nothing calls this directly

Calls 10

DotClass · 0.85
ChangeSpeedClass · 0.85
WaitClass · 0.85
AnimationGroupClass · 0.85
shiftMethod · 0.45
add_updaterMethod · 0.45
rotate_about_originMethod · 0.45
addMethod · 0.45
playMethod · 0.45
animateMethod · 0.45

Tested by

no test coverage detected