Animation blocks

A clip appears with an intro and leaves with an outro. Between the two, blocks animate it: a term arrives, another lights up, a line turns into the next. Each block is one animation, on some glyphs, for some seconds.

One clip with four blocks. A Write, an Indicate and a Wiggle run at the same time on different glyphs, each in a lane of its own; a Transform of the Wiggle’s glyphs comes later.

What a block is

A block is a coloured bar in the upper part of a clip on the timeline. It carries the icon of its animation, then its name and the number of glyphs it acts on: Wiggle · 2. A block too short for its name shows the icon alone; point at it and its tooltip gives the name. It has a start, a length in seconds, an easing, and, for most blocks, the glyphs it animates.

Two other kinds of animation are not blocks. A clip’s intro and outro are the hatched ends of the clip (see Appearing and disappearing), and a relation carries glyphs from one clip into another (see How relations work).

Blocks come in five families, each with its own colour on the timeline.

FamilyWhat it does, and what it acts on
Appear Brings glyphs on screen: Write, Create, FadeIn, GrowFromCenter, DrawBorderThenFill. It acts on the glyphs you pick.
Disappear Takes glyphs off screen: FadeOut, Unwrite, Uncreate, ShrinkToCenter. It acts on the glyphs you pick.
Transform Moves, scales, turns or recolours the whole formula, or some of its glyphs, the ones you pick.
Morph Turns glyphs of the formula into other glyphs of the same formula, in pairs that you choose.
Emphasis Draws attention to glyphs for a moment and leaves them as they were: Indicate, Wiggle, Circumscribe, Flash, FocusOn. It acts on the glyphs you pick.

Adding a block

From the timeline

Put the playhead at the moment the animation should start (click the ruler there), then right-click the clip, in a place where no block lies. The Add animation menu opens. Its header says which clip it is for and where the block will start: at the playhead, with its time. When the playhead is not on the clip, the block starts where you clicked instead, and the header says so: the playhead is outside this clip.

The block lasts as long as its animation does by default: one second for most, two for DrawBorderThenFill, Wiggle and FocusOn. If other animations of its glyphs are in the way, it goes to the nearest free time, shortened when it must be. When it was to start at the playhead, a notice, No room at the playhead, says where it starts and what was in the way: the intro, another block, or the end of the clip. If there is no room at all, a notice says why and nothing is added.

From the Animations panel

Select the clip, open the Timing tab and press Add animation in the Animations section: the same menu opens, for the time the playhead is at, wherever the playhead is. The section lists the clip’s blocks below the button.

The Timing tab of the Animations panel for a clip, with the Add animation button of its Animations section marked 1.
Add animation (1) adds a block at the playhead.

From the keyboard, Tab reaches a clip on the timeline, and Shift+F10 (or the Menu key) opens the same menu: at the playhead when it is on the clip, else at the clip’s start.

In a region of the timeline

To say when a block starts and when it ends before making it, mark a region on the timeline’s ruler first. While a region is marked, a block added from either menu takes it whole, wherever the playhead is: it starts where the region starts and lasts until it ends. The header of the menu says so: region 1.00–3.00 s.

A block that does not fit in the region is not added, and a notice says why: the clip does not hold the region, or other animations of its glyphs are in it. Nothing moves the block to a free time nearby. Move the region, or remove it with Esc to add at the playhead again.

Which glyphs a new block takes

A new Appear or Disappear block takes every glyph it can: all the glyphs that wait to arrive, or all those on screen. Added where other blocks already run, it names only the glyphs they leave, so moving either block later changes nothing for the other.

Every card plays a few seconds of a small example while it is on screen. Press a card to pause it, and drag its time bar to look at a moment closely. Each family ends with the project behind its cards, which opens in the app.

Appear: bringing glyphs on screen

An Appear block brings on screen the glyphs it names. They wait off screen until it runs, whether the clip starts with them hidden or not: the intro leaves them alone. A glyph a Disappear took away comes back the same way. In these cards the right side of y = ax^2 + bx + c waits for the block.

Disappear: taking glyphs off screen

A Disappear block takes off the glyphs it names. A glyph that is not on screen when the block starts is left alone. Here the right side of the same formula goes, and y = stays.

Transform: moving glyphs

A Transform block has two kinds, and the Animations panel switches a block between them with Whole formula and Part of the formula.

A keyframe stays between the end of the intro and the start of the outro. A part of the formula follows the formula if the whole formula moves later.

The Animations section of a clip’s Timing tab has a second button, Add keyframe at playhead. It adds a whole-formula Transform that starts at the playhead and goes to the state the clip has there; you then edit what it goes to. The panel calls each of these a tween, and heads its editor Tween 1, Tween 2 and so on.

You can set where a Transform ends in the Preview, by hand. Select its block: two round icons appear on its top corners. The left one moves the playhead to where the block starts and shows the state it starts from. The right one moves the playhead to where the block ends and lets you move, scale and turn the formula there, or only the glyphs of a part, with the state it starts from drawn faintly beneath. Esc, pressing the icon again, moving the playhead or selecting something else ends the edit.

A keyframe selected on the timeline, with the icon at the end of its block marked 1, and the Preview marked 2 showing the formula at the end state: smaller and gold, at the lower right, with its start state faint.
The icon at the end of the block (1) takes the Preview (2) to the end state of the Transform, where the formula is edited.

Morph: one formula becomes the next line

A Morph block turns glyphs of the formula into other glyphs of the same formula, the way a derivation grows line by line. You choose the pairs; the glyphs that arrive through the block skip the intro.

Morph blocks have their own page, with the pair editor: Morph blocks.

Emphasis: drawing the eye

An Emphasis block acts on the glyphs that are on screen when it starts, and leaves them as they were. Indicate and Wiggle animate the glyphs themselves. Circumscribe, Flash and FocusOn draw something of their own where the glyphs are when the block starts.

Two of these cards have their settings turned up, to make the effect visible in a small card: the Wiggle swells to 1.2 and rocks by 10°, where a new one starts with 1.1 and 3.6°, and the FocusOn disc is gold at 0.35 opacity, where a new one is grey at 0.2.

The defaults of every block, the ones a new block starts with, are in the table of what a new block starts with.

Choosing the glyphs

Appear, Disappear, Emphasis and a part Transform name the glyphs they act on. The Glyphs section of the Animations panel draws the formula: click a glyph, Shift+click for a range, Ctrl+click to add or remove one, or drag a box over several. A block that names All becomes an explicit list the first time you pick by hand.

Glyphs that are not on screen when the block starts are drawn faint, so you see what the block will find. Four buttons above the formula choose in one press:

Picking glyphs with the pointer in the Preview works for this too: see Picking glyphs.

Timing a block

The fields

Select a block on the timeline: the Animations panel shows it. The Timing section has:

The settings of the animation itself are in the Animation section above. An Appear or Disappear has just its Animation menu, so you can change from Write to Create without adding a new block. A part Transform has Shift X, Shift Y, Scale, Rotation, Set opacity and Set colour. An Emphasis has its Effect and the settings of that effect.

The Animations panel with a Wiggle block selected: its Animation section (1), its Timing section (2) and its Glyphs section (3).
The panel for a block: what it animates (1), when (2) and on which glyphs (3).

What a new block starts with

BlockDurationEasingSettings
Write1 slinearLag ratio
Create1 ssmoothLag ratio
FadeIn1 ssmoothLag ratio, shift, scale
GrowFromCenter1 ssmoothLag ratio
DrawBorderThenFill2 sdouble_smoothLag ratio
FadeOut1 ssmoothLag ratio, shift, scale
Unwrite1 slinearLag ratio
Uncreate1 ssmoothLag ratio
ShrinkToCenter1 ssmoothLag ratio
Transform, whole formula or part1 ssmoothPosition, scale, rotation, flips, opacity, colour
Morph1 ssmoothDefault style, path arc, pairs
Indicate1 sthere_and_backColour (yellow), scale 1.2
Wiggle2 ssmoothScale 1.1, angle 3.6°, 6 wiggles
Circumscribe1 ssmoothColour (yellow), gap 0.1, stroke 4, time width 0.3
Flash1 snone: each library’s own tempoColour (yellow)
FocusOn2 ssmoothColour (grey), opacity 0.2

Easing

An easing is a rate function: it reshapes the speed of a block without changing its length. The curve plots progress against time, so a steep stretch is fast and a flat one is slow. The eight the editor offers are the ones ManimCE and ManimGL share, named as Manim names them.

Click a curve to stop on a moment and see how far along each easing is. ManimCE and ManimGL mean other curves by smooth, and by the functions made of it, so the switch above the cards shows either library’s.

Indicate offers only the two that come back to where they started, marked comes back: there_and_back and there_and_back_with_pause, since it is a pulse. Flash has no easing field at all.

Moving and resizing on the timeline

Drag a block by its body to move it, and by an edge to change its length. It snaps to the ruler’s small ticks, the playhead, the clip’s edges, the end of the intro, the start of the outro, the edges of the clip’s other blocks and the windows of its relations. Hold Shift to move without snapping.

A readout under the block gives its start, its end and its length while you drag, and names the blocks it runs alongside. Where the pointer asks for more than the clip or the other animations allow, the block stops and the readout says why.

The Wiggle dragged to the left runs in parallel with the Write and the Indicate, and the readout says so. Dragged to the right, it stops at 5 s, where a Transform of the same two glyphs starts. Esc puts it back.

With a block selected, Alt+← and Alt+→ move it by one frame, and with Shift by five. A block that is in a group takes the whole group with it.

Blocks at the same time

Blocks on different glyphs can run at the same time. Where they overlap, the timeline gives each its own lane, and the track grows taller to hold them. The block you drag lies on top of the others.

A clip on the timeline with three blocks in three lanes: a Write, an Indicate and a Wiggle.
The Write (1) and the Indicate (2) start together; the Wiggle (3) starts in the middle of both.

What blocks cannot do is animate the same glyph twice at once. A glyph is busy during the intro, the outro, a relation’s window and any block that animates it; another block cannot take it at the same time. When you drag one into such a clash, it stops short of it.

There is one exception. A Circumscribe, a Flash or a FocusOn only looks at its glyphs when it starts, so it may run while another block moves them. It cannot start while something is still drawing them.

Three commands help to make blocks that run together. Split into runs turns one block into one block for each run of consecutive glyphs, all at the same time. Split… lets you choose the glyphs of each new block. Duplicate for the other glyphs puts a copy beside the block for the glyphs it does not animate. Blocks made this way start together and last the same, so the timeline draws them as a single block: that is a group of animation blocks.

The block dialog

Double-click a block to open its dialog: the fields of the Animations panel with more room, and beside them the formula in large to choose the glyphs. It starts wide, and you can maximise it or drag its corner to resize it; the size is kept for the session. The panel keeps showing the same block, and every edit made in either place is one undo step.

A keyframe and a Morph name no glyphs, so their dialog is narrower, with the fields alone and the same Preview button. A button in the dialog that starts something in the Preview, such as Edit path… of a Morph pair, closes the dialog first, because the dialog would cover what you are about to click.

The dialog of a whole-formula Transform: its start, duration and easing, the position, scale, rotation and colour it moves to, and the Preview button in the title bar.
The dialog of a keyframe.

Right-click a block for its own menu. An Appear or a Disappear lists the other animations of both families under Change animation; an Emphasis lists its five effects under Change effect. Both keep the block’s time and glyphs.

The menu of a Wiggle block: Change effect with its five effects, then Duplicate, Duplicate for the other glyphs, Split into runs, Split… and Delete….
The menu of a block that names glyphs.

Ctrl+D duplicates the selected block, and Delete deletes it after a confirmation.

What the export does with blocks

The Python the app writes follows the timeline. Each block becomes a self.play(…) of the Manim animation it names, and every stretch where nothing happens becomes a self.wait(…). Glyphs that wait for an Appear are not added to the scene until it plays. This is the first clip of the Appear example:

self.add(eq_g[0], eq_g[1])
# 0 s – 0.5 s
self.wait(0.5)
# 0.5 s – 1.5 s: eq write
self.play(Write(VGroup(*eq_g[2:])), run_time=1)
# 1.5 s – 4 s
self.wait(2.5)

eq_g holds the glyphs of the formula in the editor’s order, so eq_g[2:] is the right side of the equation.

Most blocks use Manim’s own classes, with the names you see in the menus. ManimGL calls Create ShowCreation. Wiggle and Circumscribe are written as small helper classes at the top of the file, so that both libraries do the same thing. A whole-formula Transform is a .animate call on the formula, and a part Transform one on the group of its glyphs.

Manim plays one self.play at a time. Where blocks overlap without starting and ending together, the export cuts the time into slices, one self.play each, and a small helper called _Part plays the right stretch of every block that runs in a slice. The three blocks that start the clip at the top of this page come out like this:

eq_indicate = Indicate(VGroup(eq_g[0], eq_g[1]))
eq_appear = Write(VGroup(eq_g[7], eq_g[8]))
# 1.6 s – 2.2 s: eq indicate, eq write
self.play(_Part(eq_indicate, 0, 0.6), _Part(eq_appear, 0, 0.6), run_time=0.6)
eq_wiggle = _Wiggle(VGroup(eq_g[3], eq_g[4]))
# 2.2 s – 2.6 s: eq indicate, eq write, eq wiggle
self.play(
    _Part(eq_indicate, 0.6, 1),
    _Part(eq_appear, 0.6, 1),
    _Part(eq_wiggle, 0, 0.2),
    run_time=0.4,
)

The preview and the exported scene agree on what plays and when. The generated Python says how to run it and how close it is to the editor’s preview.

Where to go next