threejs-animation
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseWhen to use this skill
何时使用此技能
ALWAYS use this skill when the user mentions:
- ,
AnimationMixer.updateplay/pause/stop, crossfade, synchronized clipsAnimationAction - from glTF or
AnimationClip, retargeting caveats at API levelAnimationClipCreator - Keyframe tracks: position/rotation/scale/color tracks, boolean/string tracks where applicable
- IK: /
CCDIKSolverfrom addonsCCDIKHelper
IMPORTANT: animation vs objects
- threejs-animation = time evaluation and tracks.
- threejs-objects = /
SkinnedMeshattachment, bind pose—mesh side.Skeleton
Trigger phrases include:
- "AnimationMixer", "AnimationAction", "AnimationClip", "crossFade", "KeyframeTrack"
- "动画混合", "骨骼动画", "剪辑", "淡入淡出"
当用户提及以下内容时,务必使用此技能:
- 、
AnimationMixer.update的播放/暂停/停止、交叉淡入淡出、同步剪辑AnimationAction - 来自glTF的或
AnimationClip、API层面的重定向注意事项AnimationClipCreator - 关键帧轨道:位置/旋转/缩放/颜色轨道,以及适用的布尔/字符串轨道
- IK:附加组件中的/
CCDIKSolverCCDIKHelper
重要提示:动画与对象的区别
- threejs-animation = 时间计算与轨道。
- threejs-objects = /
SkinnedMesh绑定、绑定姿势——网格侧。Skeleton
触发短语包括:
- "AnimationMixer"、"AnimationAction"、"AnimationClip"、"crossFade"、"KeyframeTrack"
- "动画混合"、"骨骼动画"、"剪辑"、"淡入淡出"
How to use this skill
如何使用此技能
- Collect clips from or create with utilities /
gltf.animations.AnimationClipCreator - Create mixer bound to root object (often or rig root).
scene - Create actions per clip via ; configure loop mode (
mixer.clipAction(clip),LoopOnce,LoopRepeat).LoopPingPong - Per frame: compute delta seconds (use from core—documented under Core in docs index), call
Clock.mixer.update(delta) - Blending: adjust ,
weight,crossFadeToflags; watch for additive vs full replacement semantics per docs.enabled - PropertyBinding: understand path strings targeting bones/morphs—errors often from wrong object names.
- IK addon: attach solver after base animation if using CCD IK from examples.
See examples/workflow-mixer-action.md.
- 收集剪辑:从中获取,或使用工具 /
gltf.animations创建。AnimationClipCreator - 创建混合器:绑定到根对象(通常是或绑定根节点)。
scene - 创建动作:通过为每个剪辑创建动作;配置循环模式(
mixer.clipAction(clip)、LoopOnce、LoopRepeat)。LoopPingPong - 逐帧更新:计算增量秒数(使用核心模块中的——文档索引的核心部分有说明),调用
Clock。mixer.update(delta) - 混合:调整、
weight、crossFadeTo标志;注意文档中说明的叠加与完全替换语义的区别。enabled - PropertyBinding:理解用于定位骨骼/形变目标的路径字符串——错误通常源于对象名称不正确。
- IK附加组件:如果使用示例中的CCD IK,需在基础动画之后附加求解器。
参见 examples/workflow-mixer-action.md。
Doc map (official)
文档导航(官方)
| Docs section | Representative links |
|---|---|
| Animation (index) | https://threejs.org/docs/#Animation |
| Action | https://threejs.org/docs/AnimationAction.html |
| Mixer | https://threejs.org/docs/AnimationMixer.html |
| Clip | https://threejs.org/docs/AnimationClip.html |
| Tracks | https://threejs.org/docs/KeyframeTrack.html |
More: references/official-sections.md.
更多内容:references/official-sections.md。
Scope
适用范围
- In scope: Core Animation module, keyframe pipeline, listed addons for clip creation and IK.
- Out of scope: DCC export best practices; physics ragdoll; audio sync (link conceptually only).
- 适用范围: 核心动画模块、关键帧管线、上述用于剪辑创建和IK的附加组件。
- 不适用范围: DCC导出最佳实践;物理布娃娃系统;音频同步(仅作概念性关联)。
Common pitfalls and best practices
常见陷阱与最佳实践
- Forgetting freezes animation; double
mixer.updateper frame speeds up.update - Mixing clips with incompatible hierarchies causes violent pops—validate bind pose.
- Root motion must be handled in game logic if not baked—document explicitly.
- Large track counts cost CPU—strip unused tracks in preprocessing when possible.
- 忘记调用会导致动画冻结;每帧重复调用
mixer.update会导致动画加速。update - 混合层级不兼容的剪辑会导致剧烈跳变——请验证绑定姿势。
- 如果根运动未烘焙,必须在游戏逻辑中处理——需明确说明。
- 轨道数量过多会消耗CPU——尽可能在预处理阶段移除未使用的轨道。
Documentation and version
文档与版本
Behavior of , tracks, and glTF animation import can change between three.js majors. Treat the Animation section of the docs index as authoritative for the user’s installed version; when upgrading, check the three.js repository release notes and migration notes for renamed properties or loader output.
AnimationMixerAgent response checklist
Agent回复检查清单
When answering under this skill, prefer responses that:
- Cite the exact class (,
AnimationMixer, etc.) or addon (AnimationAction) from the official docs.CCDIKSolver - Include at least one link (e.g. AnimationAction).
https://threejs.org/docs/... - Relate clips to / skeleton via threejs-objects when deformation is involved.
SkinnedMesh - Mention and a stable time source (
mixer.update(delta)) explicitly.Clock - Reference official examples by name only (no full file paste).
在此技能下回答问题时,优先遵循以下要求:
- 引用官方文档中的确切类名(、
AnimationMixer等)或附加组件名(AnimationAction)。CCDIKSolver - 至少包含一个链接(例如 AnimationAction)。
https://threejs.org/docs/... - 涉及变形时,通过threejs-objects将剪辑与/ 骨骼关联起来。
SkinnedMesh - 明确提及和稳定的时间源(
mixer.update(delta))。Clock - 仅通过名称引用官方示例(不要粘贴完整文件内容)。
References
参考资料
Keywords
关键词
English: animationmixer, animationaction, animationclip, keyframetrack, crossfade, skinning, propertybinding, three.js
中文: 动画混合、AnimationMixer、AnimationAction、关键帧、骨骼动画、剪辑、淡入淡出、three.js
English: animationmixer, animationaction, animationclip, keyframetrack, crossfade, skinning, propertybinding, three.js
中文: 动画混合、AnimationMixer、AnimationAction、关键帧、骨骼动画、剪辑、淡入淡出、three.js
能力边界
能力边界
✅ 适用场景
✅ 适用场景
- 当你需要使用此技能对应的技术栈时
- 当项目需要遵循最佳实践时
- 当需要快速上手或深入理解核心概念时
- 当你需要使用此技能对应的技术栈时
- 当项目需要遵循最佳实践时
- 当需要快速上手或深入理解核心概念时
⚠️ 需要注意
⚠️ 需要注意
- 复杂业务逻辑需要结合具体场景调整
- 性能优化需要根据实际数据量评估
- 复杂业务逻辑需要结合具体场景调整
- 性能优化需要根据实际数据量评估
❌ 不适用场景
❌ 不适用场景
- 不相关的技术栈或框架
- 需要完全自定义的特殊场景
- 不相关的技术栈或框架
- 需要完全自定义的特殊场景
常见陷阱 (Gotchas)
常见陷阱 (Gotchas)
- 版本兼容性:注意框架版本与依赖库的兼容性,不同版本 API 可能有差异
- 配置文件格式:配置文件格式错误是最常见的问题,建议使用编辑器的语法检查
- 环境变量:确保所有必要的环境变量已正确设置,敏感信息不要硬编码
- 依赖冲突:多版本共存时注意依赖冲突,使用 lock 文件锁定版本
- 性能陷阱:大数据量场景下注意性能优化,避免 N+1 查询等常见问题
- 版本兼容性:注意框架版本与依赖库的兼容性,不同版本 API 可能有差异
- 配置文件格式:配置文件格式错误是最常见的问题,建议使用编辑器的语法检查
- 环境变量:确保所有必要的环境变量已正确设置,敏感信息不要硬编码
- 依赖冲突:多版本共存时注意依赖冲突,使用 lock 文件锁定版本
- 性能陷阱:大数据量场景下注意性能优化,避免 N+1 查询等常见问题
使用流程
使用流程
Step 1: 环境准备
Step 1: 环境准备
确保开发环境已安装必要的依赖和工具。
确保开发环境已安装必要的依赖和工具。
Step 2: 配置初始化
Step 2: 配置初始化
根据项目需求进行基础配置。
根据项目需求进行基础配置。
Step 3: 核心功能使用
Step 3: 核心功能使用
按照示例代码实现核心功能。
按照示例代码实现核心功能。
Step 4: 测试验证
Step 4: 测试验证
运行测试确保功能正常。
运行测试确保功能正常。
Step 5: 部署上线
Step 5: 部署上线
完成开发后进行部署和监控。
完成开发后进行部署和监控。