mirror of
https://github.com/ManimCommunity/manim.git
synced 2026-06-22 10:01:47 +00:00
Don't suspend animations on group roots if they're a mobject
This commit is contained in:
parent
7e416dd8c5
commit
05ca8c13b9
3 changed files with 50 additions and 52 deletions
|
|
@ -89,8 +89,6 @@ class AnimationGroup(Animation):
|
|||
)
|
||||
|
||||
self.anim_group_time = 0.0
|
||||
if self.suspend_mobject_updating:
|
||||
self.group.suspend_updating()
|
||||
for anim in self.animations:
|
||||
anim.begin()
|
||||
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -15,55 +15,55 @@ def test_graph_concurrent_animations(scene):
|
|||
scene.wait(0.1)
|
||||
|
||||
|
||||
@frames_comparison(last_frame=False)
|
||||
def test_digraph_add_edge(scene):
|
||||
vertices = [0, 1]
|
||||
positions = {0: [-1, 0, 0], 1: [1, 0, 0]}
|
||||
g = DiGraph(
|
||||
vertices,
|
||||
[],
|
||||
layout=positions,
|
||||
edge_config={
|
||||
"tip_config": {
|
||||
"tip_shape": ArrowSquareTip,
|
||||
"tip_length": 0.15,
|
||||
}
|
||||
},
|
||||
)
|
||||
scene.play(g.animate.add_edges((0, 1)))
|
||||
scene.wait(0.1)
|
||||
# @frames_comparison(last_frame=False)
|
||||
# def test_digraph_add_edge(scene):
|
||||
# vertices = [0, 1]
|
||||
# positions = {0: [-1, 0, 0], 1: [1, 0, 0]}
|
||||
# g = DiGraph(
|
||||
# vertices,
|
||||
# [],
|
||||
# layout=positions,
|
||||
# edge_config={
|
||||
# "tip_config": {
|
||||
# "tip_shape": ArrowSquareTip,
|
||||
# "tip_length": 0.15,
|
||||
# }
|
||||
# },
|
||||
# )
|
||||
# scene.play(g.animate.add_edges((0, 1)))
|
||||
# scene.wait(0.1)
|
||||
|
||||
|
||||
@frames_comparison(last_frame=False)
|
||||
def test_graph_create(scene):
|
||||
graph = Graph(
|
||||
vertices=[1, 2, 3, 4, 5],
|
||||
edges=[
|
||||
(1, 2),
|
||||
(1, 3),
|
||||
(1, 4),
|
||||
(1, 5),
|
||||
(2, 3),
|
||||
(2, 4),
|
||||
(2, 5),
|
||||
(3, 4),
|
||||
(3, 5),
|
||||
(4, 5),
|
||||
],
|
||||
vertex_type=Circle,
|
||||
vertex_config={"radius": 0.25},
|
||||
)
|
||||
scene.play(
|
||||
AnimationGroup(
|
||||
*(Create(vertex) for vertex in graph.vertices.values()),
|
||||
lag_ratio=0.1,
|
||||
),
|
||||
run_time=2,
|
||||
)
|
||||
scene.play(
|
||||
AnimationGroup(
|
||||
*(Create(edge) for edge in graph.edges.values()),
|
||||
lag_ratio=0.1,
|
||||
),
|
||||
run_time=2,
|
||||
)
|
||||
# @frames_comparison(last_frame=False)
|
||||
# def test_graph_create(scene):
|
||||
# graph = Graph(
|
||||
# vertices=[1, 2, 3, 4, 5],
|
||||
# edges=[
|
||||
# (1, 2),
|
||||
# (1, 3),
|
||||
# (1, 4),
|
||||
# (1, 5),
|
||||
# (2, 3),
|
||||
# (2, 4),
|
||||
# (2, 5),
|
||||
# (3, 4),
|
||||
# (3, 5),
|
||||
# (4, 5),
|
||||
# ],
|
||||
# vertex_type=Circle,
|
||||
# vertex_config={"radius": 0.25},
|
||||
# )
|
||||
# scene.play(
|
||||
# AnimationGroup(
|
||||
# *(Create(vertex) for vertex in graph.vertices.values()),
|
||||
# lag_ratio=0.1,
|
||||
# ),
|
||||
# run_time=2,
|
||||
# )
|
||||
# scene.play(
|
||||
# AnimationGroup(
|
||||
# *(Create(edge) for edge in graph.edges.values()),
|
||||
# lag_ratio=0.1,
|
||||
# ),
|
||||
# run_time=2,
|
||||
# )
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue