home / skills / dylantarre / animation-principles / lottie-bodymovin

This skill helps you implement Disney's 12 animation principles with Lottie exports, guiding timing, spacing, and expressive motion in vector animations.

npx playbooks add skill dylantarre/animation-principles --skill lottie-bodymovin

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
3.6 KB
---
name: lottie-bodymovin
description: Use when implementing Disney's 12 animation principles with Lottie animations exported from After Effects
---

# Lottie Animation Principles

Implement all 12 Disney animation principles using Lottie (Bodymovin) for vector animations.

## 1. Squash and Stretch

In After Effects before export:
- Animate Scale X and Y inversely
- Use expression: `s = transform.scale[1]; [100 + (100-s), s]`

```javascript
// Control at runtime
lottie.setSpeed(1.5); // affect squash timing
```

## 2. Anticipation

Structure your AE composition:
1. **Frames 0-10**: Wind-up pose
2. **Frames 10-40**: Main action
3. **Frames 40-50**: Settle

```javascript
// Play anticipation segment
anim.playSegments([0, 10], true);
setTimeout(() => anim.playSegments([10, 50], true), 200);
```

## 3. Staging

```javascript
// Layer multiple Lotties
<div className="scene">
  <Lottie animationData={background} style={{ opacity: 0.6 }} />
  <Lottie animationData={hero} style={{ zIndex: 10 }} />
</div>
```

## 4. Straight Ahead / Pose to Pose

Pose to pose in AE:
- Set keyframes at key poses
- Let AE interpolate between
- Use Easy Ease for smoothing

```javascript
// Jump to specific poses
anim.goToAndStop(25, true); // frame 25
```

## 5. Follow Through and Overlapping Action

In After Effects:
- Offset child layer keyframes by 2-4 frames
- Use parenting with delayed expressions
- `thisComp.layer("Parent").transform.position.valueAtTime(time - 0.05)`

## 6. Slow In and Slow Out

AE Keyframe settings:
- Select keyframes > Easy Ease (F9)
- Use Graph Editor to adjust curves
- Bezier handles control acceleration

```javascript
// Adjust playback speed dynamically
anim.setSpeed(0.5); // slower
anim.setSpeed(2); // faster
```

## 7. Arc

In After Effects:
- Use motion paths (position property)
- Convert keyframes to Bezier
- Pull handles to create arcs
- Or use "Auto-Orient to Path"

## 8. Secondary Action

```javascript
// Trigger secondary animation
mainAnim.addEventListener('complete', () => {
  secondaryAnim.play();
});

// Or sync with frame
mainAnim.addEventListener('enterFrame', (e) => {
  if (e.currentTime > 15) particleAnim.play();
});
```

## 9. Timing

```javascript
anim.setSpeed(0.5);  // half speed - dramatic
anim.setSpeed(1);    // normal
anim.setSpeed(2);    // double speed - snappy

// Or control frame rate in AE export
// 24fps = cinematic, 30fps = smooth, 60fps = fluid
```

## 10. Exaggeration

In After Effects:
- Push scale beyond 100% (120-150%)
- Overshoot rotation
- Use Overshoot expression
- `amp = 15; freq = 3; decay = 5; n = 0; time_start = key(1).time; if (time > time_start) { n = (time - time_start) / thisComp.frameDuration; amp * Math.sin(freq*n) / Math.exp(decay*n/100); } else { 0; }`

## 11. Solid Drawing

In After Effects:
- Use 3D layers
- Apply perspective camera
- Animate Z position and rotation
- Use depth of field

## 12. Appeal

Design principles in AE:
- Smooth curves over sharp angles
- Consistent timing patterns
- Pleasing color palette
- Clean vector shapes

```javascript
// React Lottie with hover
<Lottie
  animationData={data}
  onMouseEnter={() => anim.setDirection(1)}
  onMouseLeave={() => anim.setDirection(-1)}
/>
```

## Lottie Implementation

```javascript
import Lottie from 'lottie-react';
import animationData from './animation.json';

<Lottie
  animationData={animationData}
  loop={true}
  autoplay={true}
  style={{ width: 200, height: 200 }}
/>
```

## Key Lottie Features

- `playSegments([start, end])` - Play frame range
- `setSpeed(n)` - Control timing
- `setDirection(1/-1)` - Forward/reverse
- `goToAndStop(frame)` - Pose control
- `addEventListener` - Frame events
- Interactivity via `lottie-interactivity`

Overview

This skill teaches how to apply Disney's 12 principles of animation to Lottie (Bodymovin) vector exports from After Effects. It focuses on practical patterns and runtime controls so animations keep character, timing, and appeal when delivered as Lottie JSON. You get concrete workflows for authoring in After Effects and for controlling behavior in the browser or React apps.

How this skill works

Author key poses, offsets, and motion paths in After Effects using standard animation tools (keyframes, expressions, parenting, graph editor), then export with Bodymovin to produce Lottie JSON. At runtime use Lottie APIs (playSegments, setSpeed, setDirection, goToAndStop, addEventListener) and small scripts to reproduce squash-and-stretch, anticipation, follow-through, arcs, secondary actions, and other principles. The skill maps each of the twelve principles to specific AE techniques and Lottie controls for reliable playback and interactivity.

When to use it

  • When converting character animations from After Effects to Lottie while preserving classical animation principles.
  • When you need interactive web or app animations that respond to hover, scroll, or timeline events.
  • When optimizing vector motion for small file sizes without losing timing and appeal.
  • When building reusable Lottie components (hero, UI feedback, micro-interactions) with clear pose control.
  • When coordinating multiple layered Lottie animations in a staged scene.

Best practices

  • Author key poses in AE (pose-to-pose) and let AE interpolate; use Easy Ease and the Graph Editor for slow-in/slow-out.
  • Offset child layers by a few frames or use delayed expressions for follow-through and overlapping action.
  • Create motion paths with Bezier handles to maintain natural arcs and convert keyframes to smooth curves.
  • Use segmented playback (playSegments) and goToAndStop for anticipation, timing, and pose control in UI flows.
  • Expose setSpeed, setDirection, and frame events to let the host app tune exaggeration and timing dynamically.

Example use cases

  • A mascot animation that squashes and stretches on click, with secondary particle effects triggered after the main action.
  • A hero banner built from layered Lotties: background parallax, staged hero pose, and timed entrance using playSegments.
  • Micro-interactions where hover reverses direction and frame-based events trigger a secondary animation.
  • Character jump implemented pose-to-pose: wind-up segment, main action segment, and settle segment controlled via segments playback.
  • Animated UI feedback that slows down for emphasis (setSpeed(0.5)) or snaps faster for quick responses (setSpeed(2)).

FAQ

Can Lottie reproduce squash-and-stretch made in After Effects?

Yes—author inverse scale keyframes or expressions in AE, export with Bodymovin, and use playback speed controls to fine-tune timing in the player.

How do I coordinate multiple Lottie files in a scene?

Layer them in the DOM or React component tree, use z-index and opacity for staging, and synchronize with events or timed playSegments calls.