Use when implementing Disney's 12 animation principles with Lottie animations exported from After Effects
复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-lottie-bodymovin-a5ca6a2a413f ,按照其中的说明把「lottie-bodymovin」安装到你(当前 AI 工具)中。执行前先告诉我将运行的命令和写入的位置,等我确认。
查看 AI 将读取的安装说明正在读取 GitHub 原文…
内容来自 GitHub 原始文件,由原作者维护。在 GitHub 查看
Implement all 12 Disney animation principles using Lottie (Bodymovin) for vector animations.
In After Effects before export:
s = transform.scale[1]; [100 + (100-s), s]// Control at runtime
lottie.setSpeed(1.5); // affect squash timing
Structure your AE composition:
// Play anticipation segment
anim.playSegments([0, 10], true);
setTimeout(() => anim.playSegments([10, 50], true), 200);
// Layer multiple Lotties
<div className="scene">
<Lottie animationData={background} style={{ opacity: 0.6 }} />
<Lottie animationData={hero} style={{ zIndex: 10 }} />
</div>
Pose to pose in AE:
// Jump to specific poses
anim.goToAndStop(25, true); // frame 25
In After Effects:
thisComp.layer("Parent").transform.position.valueAtTime(time - 0.05)AE Keyframe settings:
// Adjust playback speed dynamically
anim.setSpeed(0.5); // slower
anim.setSpeed(2); // faster
In After Effects:
// Trigger secondary animation
mainAnim.addEventListener('complete', () => {
secondaryAnim.play();
});
// Or sync with frame
mainAnim.addEventListener('enterFrame', (e) => {
if (e.currentTime > 15) particleAnim.play();
});
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
In After Effects:
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; }In After Effects:
Design principles in AE:
// React Lottie with hover
<Lottie
animationData={data}
onMouseEnter={() => anim.setDirection(1)}
onMouseLeave={() => anim.setDirection(-1)}
/>
import Lottie from 'lottie-react';
import animationData from './animation.json';
<Lottie
animationData={animationData}
loop={true}
autoplay={true}
style={{ width: 200, height: 200 }}
/>
playSegments([start, end]) - Play frame rangesetSpeed(n) - Control timingsetDirection(1/-1) - Forward/reversegoToAndStop(frame) - Pose controladdEventListener - Frame eventslottie-interactivity