Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

Deprecation: Deprecated ShowCreation in favor of Create, added logger warning (#1124)

Lionel Ray39351b020263
diff --git a/README.md b/README.md
index b98179475..173a3d723 100644
--- a/README.md
+++ b/README.md
@@ -64,7 +64,7 @@ class SquareToCircle(Scene):
square.rotate(-3 * TAU / 8)
circle.set_fill(PINK, opacity=0.5)
- self.play(ShowCreation(square))
+ self.play(Create(square))
self.play(Transform(square, circle))
self.play(FadeOut(square))
```
diff --git a/docs/source/examples.rst b/docs/source/examples.rst
index 2f87ed291..c234ee329 100644
--- a/docs/source/examples.rst
+++ b/docs/source/examples.rst
@@ -238,7 +238,7 @@ Animations
framebox1 = SurroundingRectangle(text[1], buff = .1)
framebox2 = SurroundingRectangle(text[3], buff = .1)
self.play(
- ShowCreation(framebox1),
+ Create(framebox1),
)
self.wait()
self.play(
@@ -468,7 +468,7 @@ Special Camera Settings
frame_text.next_to(frame, DOWN)
- self.play(ShowCreation(frame), FadeInFrom(frame_text, direction=DOWN))
+ self.play(Create(frame), FadeInFrom(frame_text, direction=DOWN))
self.activate_zooming()
self.play(self.get_zoomed_display_pop_out_animation(), unfold_camera)
@@ -614,7 +614,7 @@ Advanced Projects
=================
.. manim:: OpeningManim
- :ref_classes: Tex MathTex Write FadeInFrom LaggedStart NumberPlane ShowCreation
+ :ref_classes: Tex MathTex Write FadeInFrom LaggedStart NumberPlane Create
:ref_functions: NumberPlane.prepare_for_nonlinear_transform
class OpeningManim(Scene):
@@ -645,7 +645,7 @@ Advanced Projects
self.play(
FadeOut(title),
FadeInFrom(grid_title, direction=DOWN),
- ShowCreation(grid, run_time=3, lag_ratio=0.1),
+ Create(grid, run_time=3, lag_ratio=0.1),
)
self.wait()
diff --git a/docs/source/manim_directive.py b/docs/source/manim_directive.py
index 0575c1efa..e448b9e34 100644
--- a/docs/source/manim_directive.py
+++ b/docs/source/manim_directive.py
@@ -28,7 +28,7 @@ render scenes that are defined within doctests, for example::
<Color #fc6255>
>>> class DirectiveDoctestExample(Scene):
... def construct(self):
- ... self.play(ShowCreation(dot))
+ ... self.play(Create(dot))
Options
diff --git a/docs/source/tutorials/a_deeper_look.rst b/docs/source/tutorials/a_deeper_look.rst
index 1ac2d8f14..a606ddc9f 100644
--- a/docs/source/tutorials/a_deeper_look.rst
+++ b/docs/source/tutorials/a_deeper_look.rst
@@ -77,7 +77,7 @@ should look like this:
square.flip(RIGHT) # flip horizontally
square.rotate(-3 * TAU / 8) # rotate a certain amount
- self.play(ShowCreation(square)) # animate the creation of the square
+ self.play(Create(square)) # animate the creation of the square
self.play(Transform(square, circle)) # interpolate the square into the circle
self.play(FadeOut(square)) # fade out animation
diff --git a/docs/source/tutorials/quickstart.rst b/docs/source/tutorials/quickstart.rst
index 2049d6051..15eef9dde 100644
--- a/docs/source/tutorials/quickstart.rst
+++ b/docs/source/tutorials/quickstart.rst
@@ -51,7 +51,7 @@ and copy the following code in it.
def construct(self):
circle = Circle() # create a circle
circle.set_fill(PINK, opacity=0.5) # set the color and transparency
- self.play(ShowCreation(circle)) # show the circle on screen
+ self.play(Create(circle)) # show the circle on screen
Then open your command line, navigate to your project directory, and execute
the following command:
@@ -71,7 +71,7 @@ video playing the following animation.
def construct(self):
circle = Circle() # create a circle
circle.set_fill(PINK, opacity=0.5) # set the color and transparency
- self.play(ShowCreation(circle)) # show the circle on screen
+ self.play(Create(circle)) # show the circle on screen
If you see the video and it looks correct, congrats! You just wrote your first
manim scene from scratch. If you get an error message instead, or if do not
@@ -96,7 +96,7 @@ The first line
imports all of the contents of the library. This is the recommended way of
using manim, as usually in a single script you will be using quite a few names
from the manim namespace. In particular, this line includes all of the names
-used in the script: ``Scene``, ``Circle``, ``PINK`` and ``ShowCreation``.
+used in the script: ``Scene``, ``Circle``, ``PINK`` and ``Create``.
Now let's look at the next two lines.
@@ -116,12 +116,12 @@ The next two lines create a circle and set its color and opacity.
circle = Circle() # create a circle
circle.set_fill(PINK, opacity=0.5) # set the color and transparency
-Finally, the last line uses the animation :class:`.ShowCreation` to display the
+Finally, the last line uses the animation :class:`.Create` to display the
circle on screen.
.. code-block:: python
- self.play(ShowCreation(circle)) # show the circle on screen
+ self.play(Create(circle)) # show the circle on screen
.. tip:: Every animation must be contained within the :meth:`~.Scene.construct` method of a
class that derives from :class:`.Scene`. Other code, for example auxiliary
@@ -147,7 +147,7 @@ Our scene is a little basic, so let's add some bells and whistles. Modify the
square.flip(RIGHT) # flip horizontally
square.rotate(-3 * TAU / 8) # rotate a certain amount
- self.play(ShowCreation(square)) # animate the creation of the square
+ self.play(Create(square)) # animate the creation of the square
self.play(Transform(square, circle)) # interpolate the square into the circle
self.play(FadeOut(square)) # fade out animation
@@ -171,7 +171,7 @@ The output should look as follows.
square.flip(RIGHT) # flip horizontally
square.rotate(-3 * TAU / 8) # rotate a certain amount
- self.play(ShowCreation(square)) # animate the creation of the square
+ self.play(Create(square)) # animate the creation of the square
self.play(Transform(square, circle)) # interpolate the square into the circle
self.play(FadeOut(square)) # fade out animation
diff --git a/example_scenes/advanced_tex_fonts.py b/example_scenes/advanced_tex_fonts.py
index 04d8ce74c..c7d189a59 100644
--- a/example_scenes/advanced_tex_fonts.py
+++ b/example_scenes/advanced_tex_fonts.py
@@ -27,13 +27,11 @@ class TexFontTemplateManual(Scene):
def construct(self):
self.add(Tex("Tex Font Example").to_edge(UL))
- self.play(ShowCreation(FrenchCursive("$f: A \\longrightarrow B$").shift(UP)))
- self.play(
- ShowCreation(FrenchCursive("Behold! We can write math in French Cursive"))
- )
+ self.play(Create(FrenchCursive("$f: A \\longrightarrow B$").shift(UP)))
+ self.play(Create(FrenchCursive("Behold! We can write math in French Cursive")))
self.wait(1)
self.play(
- ShowCreation(
+ Create(
Tex(
"See more font templates at \\\\ http://jf.burnol.free.fr/showcase.html"
).shift(2 * DOWN)
@@ -64,7 +62,7 @@ class TexFontTemplateLibrary(Scene):
def construct(self):
def write_one_line(template):
x = Tex(template.description, tex_template=template).shift(UP)
- self.play(ShowCreation(x))
+ self.play(Create(x))
self.wait(1)
self.play(FadeOut(x))
@@ -132,7 +130,7 @@ class TexFontTemplateLibrary(Scene):
print("FAILURE on ", font.description, " - skipping.")
self.play(
- ShowCreation(
+ Create(
Tex(
"See more font templates at \\\\ http://jf.burnol.free.fr/showcase.html"
).shift(2 * DOWN)
diff --git a/example_scenes/basic.py b/example_scenes/basic.py
index 45200b355..67444be34 100644
--- a/example_scenes/basic.py
+++ b/example_scenes/basic.py
@@ -42,7 +42,7 @@ class OpeningManim(Scene):
self.play(
FadeOut(title),
FadeInFrom(grid_title, direction=DOWN),
- ShowCreation(grid, run_time=3, lag_ratio=0.1),
+ Create(grid, run_time=3, lag_ratio=0.1),
)
self.wait()
@@ -77,7 +77,7 @@ class SquareToCircle(Scene):
square.rotate(-3 * TAU / 8)
circle.set_fill(PINK, opacity=0.5)
- self.play(ShowCreation(square))
+ self.play(Create(square))
self.play(Transform(square, circle))
self.play(FadeOut(square))
diff --git a/example_scenes/opengl.py b/example_scenes/opengl.py
index 1f862a28f..d634e9680 100644
--- a/example_scenes/opengl.py
+++ b/example_scenes/opengl.py
@@ -15,7 +15,7 @@ class InteractiveDevelopment(Scene):
circle.set_stroke(BLUE_E, width=4)
square = OpenGLSquare()
- self.play(ShowCreation(square))
+ self.play(Create(square))
self.wait()
# This opens an iPython termnial where you can keep writing
@@ -98,7 +98,7 @@ class SurfaceExample(Scene):
self.play(
FadeIn(surface),
- ShowCreation(surface.mesh, lag_ratio=0.01, run_time=3),
+ Create(surface.mesh, lag_ratio=0.01, run_time=3),
)
for mob in surfaces:
mob.add(mob.mesh)
diff --git a/manim/animation/creation.py b/manim/animation/creation.py
index 42ce65bab..3470478f0 100644
--- a/manim/animation/creation.py
+++ b/manim/animation/creation.py
@@ -17,7 +17,7 @@ r"""Animate the display or removal of a mobject from a scene.
VGroup(s5, s6, s7).set_x(0).arrange(buff=2.6).shift(2 * DOWN)
t1 = Text("Write").scale(0.5).next_to(s1, UP)
t2 = Text("AddTextLetterByLetter").scale(0.5).next_to(s2, UP)
- t3 = Text("ShowCreation").scale(0.5).next_to(s3, UP)
+ t3 = Text("Create").scale(0.5).next_to(s3, UP)
t4 = Text("Uncreate").scale(0.5).next_to(s4, UP)
t5 = Text("DrawBorderThenFill").scale(0.5).next_to(s5, UP)
t6 = Text("ShowIncreasingSubsets").scale(0.45).next_to(s6, UP)
@@ -43,7 +43,7 @@ r"""Animate the display or removal of a mobject from a scene.
Write(texts[0]),
AddTextLetterByLetter(texts[1]),
# mobject creation
- ShowCreation(objs[0]),
+ Create(objs[0]),
Uncreate(objs[1]),
DrawBorderThenFill(objs[2]),
ShowIncreasingSubsets(objs[3]),
@@ -59,6 +59,7 @@ r"""Animate the display or removal of a mobject from a scene.
__all__ = [
"ShowPartial",
"ShowCreation",
+ "Create",
"Uncreate",
"DrawBorderThenFill",
"Write",
@@ -75,6 +76,8 @@ import typing
import numpy as np
from colour import Color
+from .. import logger
+
if typing.TYPE_CHECKING:
from manim.mobject.svg.text_mobject import Text
@@ -98,7 +101,7 @@ class ShowPartial(Animation):
See Also
--------
- :class:`ShowCreation`, :class:`~.ShowPassingFlash`
+ :class:`Create`, :class:`~.ShowPassingFlash`
"""
@@ -117,10 +120,10 @@ class ShowPartial(Animation):
)
def _get_bounds(self, alpha: float) -> None:
- raise NotImplementedError("Please use ShowCreation or ShowPassingFlash")
+ raise NotImplementedError("Please use Create or ShowPassingFlash")
-class ShowCreation(ShowPartial):
+class Create(ShowPartial):
"""Incrementally show a VMobject.
Parameters
@@ -135,11 +138,11 @@ class ShowCreation(ShowPartial):
Examples
--------
- .. manim:: ShowCreationScene
+ .. manim:: CreateScene
- class ShowCreationScene(Scene):
+ class CreateScene(Scene):
def construct(self):
- self.play(ShowCreation(Square()))
+ self.play(Create(Square()))
See Also
--------
@@ -154,8 +157,21 @@ class ShowCreation(ShowPartial):
return (0, alpha)
-class Uncreate(ShowCreation):
- """Like :class:`ShowCreation` but in reverse.
+class ShowCreation(Create):
+ """Deprecated. Use :class:`~.Create` instead."""
+
+ def __init__(self, mobject: VMobject, lag_ratio: float = 1.0, **kwargs) -> None:
+ logger.warning(
+ "ShowCreation has been deprecated in favor of Create. Please use Create instead!"
+ )
+ super().__init__(mobject, lag_ratio=lag_ratio, **kwargs)
+
+ def _get_bounds(self, alpha: float) -> typing.Tuple[int, float]:
+ return (0, alpha)
+
+
+class Uncreate(Create):
+ """Like :class:`Create` but in reverse.
Examples
--------
@@ -167,7 +183,7 @@ class Uncreate(ShowCreation):
See Also
--------
- :class:`ShowCreation`
+ :class:`Create`
"""
diff --git a/manim/animation/indication.py b/manim/animation/indication.py
index 253e722cf..9e68a327e 100644
--- a/manim/animation/indication.py
+++ b/manim/animation/indication.py
@@ -25,7 +25,7 @@ import numpy as np
from .. import config
from ..animation.animation import Animation
from ..animation.composition import AnimationGroup, Succession
-from ..animation.creation import ShowCreation, ShowPartial
+from ..animation.creation import Create, ShowPartial
from ..animation.fading import FadeOut
from ..animation.movement import Homotopy
from ..animation.transform import Transform
@@ -180,7 +180,7 @@ class ShowPassingFlash(ShowPartial):
See Also
--------
- :class:`~.ShowCreation`
+ :class:`~.Create`
"""
@@ -217,9 +217,7 @@ class ShowCreationThenDestruction(ShowPassingFlash):
class ShowCreationThenFadeOut(Succession):
def __init__(self, mobject: "Mobject", remover: bool = True, **kwargs) -> None:
- super().__init__(
- ShowCreation(mobject), FadeOut(mobject), remover=remover, **kwargs
- )
+ super().__init__(Create(mobject), FadeOut(mobject), remover=remover, **kwargs)
class AnimationOnSurroundingRectangle(AnimationGroup):
diff --git a/manim/mobject/geometry.py b/manim/mobject/geometry.py
index 24e4dc994..4d58ea44b 100644
--- a/manim/mobject/geometry.py
+++ b/manim/mobject/geometry.py
@@ -1193,7 +1193,7 @@ class ArcPolygon(VMobject):
{'angle': 20*DEGREES, 'color': BLUE},
{'radius': 1}])
ap_group = VGroup(ap1, ap2, ap3, ap4).arrange()
- self.play(*[ShowCreation(ap) for ap in [ap1, ap2, ap3, ap4]])
+ self.play(*[Create(ap) for ap in [ap1, ap2, ap3, ap4]])
self.wait()
For further examples see :class:`ArcPolygonFromArcs`.
@@ -1294,7 +1294,7 @@ class ArcPolygonFromArcs(VMobject):
after the arcpolygon has been initialized.
Also both the arcs contained in an :class:`~.ArcPolygonFromArcs`, as well as the
- arcpolygon itself are drawn, which affects draw time in :class:`~.ShowCreation`
+ arcpolygon itself are drawn, which affects draw time in :class:`~.Create`
for example. In most cases the arcs themselves don't
need to be drawn, in which case they can be passed as invisible.
@@ -1489,7 +1489,7 @@ class ArrowTip(VMobject):
>>> from manim import Scene
>>> class CustomTipExample(Scene):
... def construct(self):
- ... self.play(ShowCreation(arr))
+ ... self.play(Create(arr))
Using a class inherited from :class:`ArrowTip` to get a non-filled
tip is a shorthand to manually specifying the arrow tip style as follows::
diff --git a/manim/mobject/graph.py b/manim/mobject/graph.py
index 98e215807..7683f4e63 100644
--- a/manim/mobject/graph.py
+++ b/manim/mobject/graph.py
@@ -224,7 +224,7 @@ class Graph(VMobject):
vertices = [1, 2, 3, 4]
edges = [(1, 2), (2, 3), (3, 4), (1, 3), (1, 4)]
g = Graph(vertices, edges)
- self.play(ShowCreation(g))
+ self.play(Create(g))
self.wait()
self.play(g[1].animate.move_to([1, 1, 0]),
g[2].animate.move_to([-1, 1, 0]),
@@ -311,7 +311,7 @@ class Graph(VMobject):
G.add_nodes_from([0, 1, 2, 3])
G.add_edges_from([(0, 2), (0,3), (1, 2)])
graph = Graph(list(G.nodes), list(G.edges), layout="partite", partitions=[[0, 1]])
- self.play(ShowCreation(graph))
+ self.play(Create(graph))
The custom tree layout can be used to show the graph
by distance from the root vertex. You must pass the root vertex
@@ -337,7 +337,7 @@ class Graph(VMobject):
G.add_edge("Child_%i" % i, "Grandchild_%i" % i)
G.add_edge("Grandchild_%i" % i, "Greatgrandchild_%i" % i)
- self.play(ShowCreation(
+ self.play(Create(
Graph(list(G.nodes), list(G.edges), layout="tree", root_vertex="ROOT")))
"""
@@ -479,7 +479,7 @@ class Graph(VMobject):
class ImportNetworkxGraph(Scene):
def construct(self):
G = Graph.from_networkx(nxgraph, layout="spring", layout_scale=3.5)
- self.play(ShowCreation(G))
+ self.play(Create(G))
self.play(*[G[v].animate.move_to(5*RIGHT*np.cos(ind/7 * PI) +
3*UP*np.sin(ind/7 * PI))
for ind, v in enumerate(G.vertices)])
@@ -512,7 +512,7 @@ class Graph(VMobject):
layout={1: [-2, 0, 0], 2: [-1, 0, 0], 3: [0, 0, 0],
4: [1, 0, 0], 5: [2, 0, 0]}
)
- self.play(ShowCreation(G))
+ self.play(Create(G))
self.play(G.animate.change_layout("circular"))
self.wait()
"""
diff --git a/manim/mobject/mobject.py b/manim/mobject/mobject.py
index 341cf238b..ac0032776 100644
--- a/manim/mobject/mobject.py
+++ b/manim/mobject/mobject.py
@@ -162,7 +162,7 @@ class Mobject(Container):
class AnimateExample(Scene):
def construct(self):
s = Square()
- self.play(ShowCreation(s))
+ self.play(Create(s))
self.play(s.animate.shift(RIGHT))
self.play(s.animate.scale(2))
self.play(s.animate.rotate(PI / 2))
@@ -174,7 +174,7 @@ class Mobject(Container):
class AnimateChainExample(Scene):
def construct(self):
s = Square()
- self.play(ShowCreation(s))
+ self.play(Create(s))
self.play(s.animate.shift(RIGHT).scale(2).rotate(PI / 2))
self.play(Uncreate(s))
@@ -2220,7 +2220,7 @@ def override_animate(method):
.. manim:: AnimationOverrideExample
- from manim import Circle, Scene, ShowCreation, Text, Uncreate, VGroup
+ from manim import Circle, Scene, Create, Text, Uncreate, VGroup
class CircleWithContent(VGroup):
def __init__(self, content):
@@ -2244,7 +2244,7 @@ def override_animate(method):
def construct(self):
t = Text("hello!")
my_mobject = CircleWithContent(t)
- self.play(ShowCreation(my_mobject))
+ self.play(Create(my_mobject))
self.play(my_mobject.animate.clear_content())
self.wait()
diff --git a/manim/mobject/svg/brace.py b/manim/mobject/svg/brace.py
index 0ab119ed5..f2b5f10d7 100644
--- a/manim/mobject/svg/brace.py
+++ b/manim/mobject/svg/brace.py
@@ -41,8 +41,8 @@ class Brace(MathTex):
def construct(self):
circle = Circle()
brace = Brace(circle, direction=RIGHT)
- self.play(ShowCreation(circle))
- self.play(ShowCreation(brace))
+ self.play(Create(circle))
+ self.play(Create(brace))
self.wait(2)
"""
@@ -201,8 +201,8 @@ class BraceBetweenPoints(Brace):
p1 = [0,0,0]
p2 = [1,2,0]
brace = BraceBetweenPoints(p1,p2)
- self.play(ShowCreation(NumberPlane()))
- self.play(ShowCreation(brace))
+ self.play(Create(NumberPlane()))
+ self.play(Create(brace))
self.wait(2)
"""
diff --git a/manim/mobject/types/vectorized_mobject.py b/manim/mobject/types/vectorized_mobject.py
index 357bae570..f48d75504 100644
--- a/manim/mobject/types/vectorized_mobject.py
+++ b/manim/mobject/types/vectorized_mobject.py
@@ -1265,7 +1265,7 @@ class VMobject(Mobject):
cw = RegularPolygon(5)
cw.shift(RIGHT).reverse_direction()
- self.play(ShowCreation(ccw), ShowCreation(cw),
+ self.play(Create(ccw), Create(cw),
run_time=4)
"""
self.points = self.points[::-1]
@@ -1469,7 +1469,7 @@ class VDict(VMobject):
my_dict = VDict(pairs, show_keys=True)
# display it just like a VGroup
- self.play(ShowCreation(my_dict))
+ self.play(Create(my_dict))
self.wait()
text = Tex("Some text").set_color(GREEN).next_to(square, DOWN)
@@ -1514,12 +1514,12 @@ class VDict(VMobject):
vdict_from_plain_dict = VDict(plain_dict)
vdict_from_plain_dict.shift(1.5 * (UP + LEFT))
- self.play(ShowCreation(vdict_from_plain_dict))
+ self.play(Create(vdict_from_plain_dict))
# you can even use zip
vdict_using_zip = VDict(zip(["s", "c", "r"], [Square(), Circle(), Rectangle()]))
vdict_using_zip.shift(1.5 * RIGHT)
- self.play(ShowCreation(vdict_using_zip))
+ self.play(Create(vdict_using_zip))
self.wait()
"""
@@ -1605,7 +1605,7 @@ class VDict(VMobject):
--------
Normal usage::
- self.play(ShowCreation(my_dict['s']))
+ self.play(Create(my_dict['s']))
"""
submob = self.submob_dict[key]
return submob
@@ -1704,7 +1704,7 @@ class VDict(VMobject):
Normal usage::
for submob in my_dict.get_all_submobjects():
- self.play(ShowCreation(submob))
+ self.play(Create(submob))
"""
submobjects = self.submob_dict.values()
return submobjects
diff --git a/manim/scene/graph_scene.py b/manim/scene/graph_scene.py
index bfbff4893..926b0684e 100644
--- a/manim/scene/graph_scene.py
+++ b/manim/scene/graph_scene.py
@@ -49,7 +49,7 @@ __all__ = ["GraphScene"]
import itertools as it
from .. import config
-from ..animation.creation import Write, DrawBorderThenFill, ShowCreation
+from ..animation.creation import Write, DrawBorderThenFill, Create
from ..animation.transform import Transform
from ..animation.update import UpdateFromAlphaFunc
from ..constants import *
@@ -1007,7 +1007,7 @@ class GraphScene(Scene):
if animated:
self.play(
DrawBorderThenFill(triangle),
- ShowCreation(v_line),
+ Create(v_line),
Write(T_label, run_time=1),
**kwargs,
)
diff --git a/manim/scene/vector_space_scene.py b/manim/scene/vector_space_scene.py
index f0c7dbbe5..3aea2eab1 100644
--- a/manim/scene/vector_space_scene.py
+++ b/manim/scene/vector_space_scene.py
@@ -8,7 +8,7 @@ import numpy as np
from .. import config
from ..constants import *
from ..animation.animation import Animation
-from ..animation.creation import ShowCreation
+from ..animation.creation import Create
from ..animation.creation import Write
from ..animation.fading import FadeOut
from ..animation.growing import GrowArrow
@@ -60,7 +60,7 @@ class VectorScene(Scene):
Parameters
----------
animate : bool, optional
- Whether or not to animate the addition of the plane via ShowCreation.
+ Whether or not to animate the addition of the plane via Create.
**kwargs
Any valid keyword arguments accepted by NumberPlane.
@@ -71,7 +71,7 @@ class VectorScene(Scene):
"""
plane = NumberPlane(**kwargs)
if animate:
- self.play(ShowCreation(plane, lag_ratio=0.5))
+ self.play(Create(plane, lag_ratio=0.5))
self.add(plane)
return plane
@@ -82,13 +82,13 @@ class VectorScene(Scene):
Parameters
----------
animate : bool, optional
- Whether or not to animate the addition of the axes through ShowCreation.
+ Whether or not to animate the addition of the axes through Create.
color : bool, optional
The color of the axes. Defaults to WHITE.
"""
axes = Axes(color=color, tick_frequency=1)
if animate:
- self.play(ShowCreation(axes))
+ self.play(Create(axes))
self.add(axes)
return axes
@@ -402,7 +402,7 @@ class VectorScene(Scene):
lambda x: self.position_x_coordinate(x, x_line, vector), x_coord
)
)
- self.play(ShowCreation(x_line))
+ self.play(Create(x_line))
animations = [
ApplyFunction(
lambda y: self.position_y_coordinate(y, y_line, vector), y_coord
@@ -411,8 +411,8 @@ class VectorScene(Scene):
]
self.play(*animations)
y_coord, _ = [anim.mobject for anim in animations]
- self.play(ShowCreation(y_line))
- self.play(ShowCreation(arrow))
+ self.play(Create(y_line))
+ self.play(Create(arrow))
self.wait()
if clean_up:
self.clear()
@@ -458,9 +458,9 @@ class VectorScene(Scene):
brackets = array.get_brackets()
if show_creation:
- self.play(ShowCreation(arrow))
- self.play(ShowCreation(x_line), Write(x_coord_start), run_time=1)
- self.play(ShowCreation(y_line), Write(y_coord_start), run_time=1)
+ self.play(Create(arrow))
+ self.play(Create(x_line), Write(x_coord_start), run_time=1)
+ self.play(Create(y_line), Write(y_coord_start), run_time=1)
self.wait()
self.play(
Transform(x_coord_start, x_coord, lag_ratio=0),
diff --git a/scripts/template_docsting_with_example.py b/scripts/template_docsting_with_example.py
index e333bcfa8..e08c0186a 100644
--- a/scripts/template_docsting_with_example.py
+++ b/scripts/template_docsting_with_example.py
@@ -60,7 +60,7 @@ class SomeClass:
See Also
--------
- :class:`ShowCreation`, :class:`~.ShowPassingFlash`
+ :class:`Create`, :class:`~.ShowPassingFlash`
References
----------
diff --git a/tests/control_data/graphical_units_data/creation/ShowCreationTest.npz b/tests/control_data/graphical_units_data/creation/CreateTest.npz
similarity index 100%
rename from tests/control_data/graphical_units_data/creation/ShowCreationTest.npz
rename to tests/control_data/graphical_units_data/creation/CreateTest.npz
diff --git a/tests/test_graphical_units/test_creation.py b/tests/test_graphical_units/test_creation.py
index 240764a79..d2c8dcd26 100644
--- a/tests/test_graphical_units/test_creation.py
+++ b/tests/test_graphical_units/test_creation.py
@@ -5,10 +5,10 @@ from ..utils.testing_utils import get_scenes_to_test
from ..utils.GraphicalUnitTester import GraphicalUnitTester
-class ShowCreationTest(Scene):
+class CreateTest(Scene):
def construct(self):
square = Square()
- self.play(ShowCreation(square))
+ self.play(Create(square))
class UncreateTest(Scene):
diff --git a/tests/test_graphical_units/test_updaters.py b/tests/test_graphical_units/test_updaters.py
index 2ae745d2d..1afdfb892 100644
--- a/tests/test_graphical_units/test_updaters.py
+++ b/tests/test_graphical_units/test_updaters.py
@@ -30,7 +30,7 @@ class UpdateSceneDuringAnimationTest(Scene):
self.add(Square())
s = Circle().add_updater(f)
- self.play(ShowCreation(s))
+ self.play(Create(s))
class LastFrameWhenClearedTest(Scene):
diff --git a/tests/test_scene_rendering/simple_scenes.py b/tests/test_scene_rendering/simple_scenes.py
index 33b69f6d9..f77ff0f68 100644
--- a/tests/test_scene_rendering/simple_scenes.py
+++ b/tests/test_scene_rendering/simple_scenes.py
@@ -18,13 +18,13 @@ class SceneWithMultipleCalls(Scene):
class SceneWithMultipleWaitCalls(Scene):
def construct(self):
- self.play(ShowCreation(Square()))
+ self.play(Create(Square()))
self.wait(1)
- self.play(ShowCreation(Square().shift(DOWN)))
+ self.play(Create(Square().shift(DOWN)))
self.wait(1)
- self.play(ShowCreation(Square().shift(2 * DOWN)))
+ self.play(Create(Square().shift(2 * DOWN)))
self.wait(1)
- self.play(ShowCreation(Square().shift(3 * DOWN)))
+ self.play(Create(Square().shift(3 * DOWN)))
self.wait(1)