Skip to content
Raisul Sohan

After Effects CEP Panel & Typing Engine

LazyTyper

Natural Typing Animation for After Effects, in One Click

Solo Developer & Creative Tools Engineer Documentation Adobe After Effects CEP • ExtendScript & ES3 Expression Engine • v1.1

  • GitHub stars: 1
LazyTyper

A free After Effects panel that types text on screen the way a person does. Select a text layer, click Create Typing Rig, and it types on with a real rhythm: quick through common words, a moment longer on capitals and symbols, a breath after a comma and a longer one after a full stop, with a blinking cursor right behind the last letter. Every character takes its time from its neighbours, so the rhythm stays natural when the text changes. Presets from Very Fast to Hunt & Peck, pauses, erasing and retyping, and baking to keyframes; a rig is plain expressions, so a project plays on a machine without the panel. Free and open source under MIT.

The challenge

Text typing on screen turns up in almost every explainer, ad and social video: a search bar, a chat message, a line of code. In After Effects it is usually a text animator or a few keyframes revealing one character every few frames, so every key takes the same time and the eye reads it as a machine at once. Real typing has a rhythm: common words come quickly, a capital or a symbol takes a moment, a comma brings a short breath and a full stop a longer one. Keyframing that by hand takes an afternoon per line, and starts over when a word changes.

Technical challenges:
1. A rhythm, not a speed: each character's time has to come from the characters around it, read from the text itself, and be the same on every render.
2. Plain expressions only: the engine has to run in both expression engines, including the legacy ExtendScript one, which knows only ES3 and stops on reading a property that does not exist, so a project plays without the panel.
3. A cursor that knows where the text ends: an expression cannot ask where one character is, yet the cursor has to sit right after the last typed letter, on paragraph text that wraps and on centred lines that grow.
4. Keystrokes you can edit: pauses, erasing and retyping, and the rhythm turned into ordinary keyframes that move one by one, all from the same engine.

The solution

1. One engine, everywhere: the typing engine is one ES3 function, lazyTyperRun. Its source is copied into the rig's expressions, the Node tests run the same function, and Bake runs it once in record mode to list every keystroke, so the preview, the playback and the bake can never drift apart.

2. Every key timed by its neighbours: a base speed, in Frames Per Character or as a Total Duration, is slowed by capitals, numbers, symbols, punctuation, sentence ends, new lines, word starts, long words and hard-to-reach letters, sped up by repeated letters, common letter pairs, common words and momentum inside a word, and pushed either way by spaces, same-hand letters and fatigue. Variance makes a key come late by 25–150 % now and then, the keys picked by a random seed, so a take looks natural and renders the same every time. Every control can be keyframed.

3. Three typists and your own: Very Fast, Average and Hunt & Peck type about 14, 7 and 2.5 characters a second at 30 fps, speeds a person could really type at; any rig's settings save as a preset of your own, and the panel draws the rhythm a preset gives the selected text.

4. Pauses, erasing and retyping: a Pause layer marker holds the typing for as long as its end is dragged; Stop typing, Erase (everything, or the last few characters, backspace by backspace), a new Source Text keyframe and Start typing replace one phrase with another.

5. Two rigs: a Dynamic rig shows the typed part in Source Text itself, so paragraph text wraps word by word and centred lines stay centred. A hidden guide copy with a Scale-0 text animator leaves only the last typed character with a size, and since sourceRectAtTime follows scaled characters, its box is where the cursor goes. A Stable rig keeps the layout fixed and hides untyped characters with an animator, so mixed fonts, sizes and colours survive; its cursor follows points measured with Create Shapes from Text. When the font, size, tracking, alignment or box changes after that, version 1.1 says so in amber at the top of the panel: one click refreshes.

6. A real cursor layer: a shape layer parented to the text, with colour, blink rate and softness, solid while keys come in, a width that grows to the right, top and bottom set separately, all four corners rounded together or one by one, and offsets; Vertical, Underscore and Box presets and your own.

7. Keyframes you can touch: Bake turns Characters Shown into hold keyframes labelled by what was typed (letters, numbers, punctuation, spaces, deleting), so any keystroke can be nudged by hand and a long rig plays instantly; Shift+click unbakes. Baked or not, a rig is ordinary expression controls, a text animator and expressions, in the JavaScript and the legacy ExtendScript engine alike, so a project sent to someone without LazyTyper still plays.

8. Built with care, tested twice: the host script is ES3 and ASCII, every action is one undo step with the layer selection put back, and the panel asks After Effects about the selection only on pointer-over, on focus or after an action, never in the background. npm test checks the host, the engine and all 14 expressions as ES3 and runs 224 engine checks in Node; npm run test:ae builds and bakes rigs inside After Effects 26.5 in both expression engines, 92 checks in each, the typing matching Node frame for frame; npm run test:ui presses the real panel's buttons through DevTools, 26 checks. The signed panel installs with a double-click on Windows or macOS, and the demo on this page is drawn in code and typed by the same engine.

Highlights

  • Select a text layer, click Create Typing Rig, press play: it types like a person
  • Every key timed by its neighbours: capitals, symbols, punctuation, sentence ends, common words and letter pairs, same-hand letters, fatigue
  • Variance with a random seed: natural, and the same take on every render
  • Very Fast, Average and Hunt & Peck presets (about 14, 7 and 2.5 characters a second at 30 fps), and your own
  • Pause markers; Erase everything or the last few characters, then retype
  • Dynamic rigs re-wrap and re-centre as they type; Stable rigs keep mixed fonts and colours
  • Bake to keyframes coloured by character type, nudge any keystroke, Shift+click to unbake
  • A real cursor layer: blink, width, roundness corner by corner; Vertical, Underscore and Box presets
  • Both expression engines; plain expressions, so a rig keeps working without the panel
  • One ES3 engine for the expressions, the tests and Bake; tested in Node and inside After Effects
  • A signed package that installs with a double-click; free and open source under MIT

Built with

  • After Effects
  • Adobe CEP
  • ExtendScript
  • Expressions
  • Typing Animation
  • Text Animation
  • Open Source