Token导航 LogoToken导航TokenDH.com
研究检索只读github未标认证来源可访问许可证需确认审计通过

threejs-impl-animationThree.js impl animation 搜索

Agent Skill

用于辅助视频生成、动画合成、脚本化剪辑或 Remotion 等视频项目开发。它适合让 Agent 组织镜头、生成素材说明、维护合成代码或排查渲染问题。使用时需要确认分辨率、时长、素材路径和导出格式;涉及外部素材、人物肖像或商业发布时,应先核对版权授权和内容审核要求。

总安装

212

周安装

9

GitHub Stars

1

下载量

74
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:threejs-impl-animation(Three.js impl animation 搜索)
来源仓库:https://github.com/openaec-foundation/three.js-claude-skill-package
仓库路径:skills/threejs-impl-animation
安装命令:
npx skills add https://github.com/openaec-foundation/three.js-claude-skill-package --skill threejs-impl-animation
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/openaec-foundation/three.js-claude-skill-package --skill threejs-impl-animation

简介

用于辅助视频生成、动画合成、脚本化剪辑或 Remotion 等视频项目开发。

  • 可组织镜头、生成素材说明、维护合成代码或排查渲染问题。
  • 使用时需确认分辨率、时长、素材路径和导出格式等参数。
  • 涉及外部素材、人物肖像或商业发布时,应先核对版权授权和内容审核要求。
  • 建议在安装前确认权限范围和维护状态,避免不必要的文件写入或网络请求。

SKILL.md

threejs-impl-animation

Quick Reference

Architecture

AnimationClip        (data: array of KeyframeTrack objects)
  └── AnimationAction  (playback controller: play, pause, fade, crossfade)
        └── AnimationMixer (master scheduler: one per animated root object)
              └── Clock    (provides delta time for mixer.update)

ALWAYS create exactly ONE AnimationMixer per animated root object. ALWAYS call mixer.update(delta) every frame inside the render loop. NEVER instantiate AnimationAction directly -- ALWAYS use mixer.clipAction(clip).

Essential Imports

import * as THREE from 'three';
import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';

Minimal Animation Setup

import * as THREE from 'three';
import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';

const clock = new THREE.Clock();
let mixer;

const loader = new GLTFLoader();
loader.load('character.glb', (gltf) => {
  scene.add(gltf.scene);
  mixer = new THREE.AnimationMixer(gltf.scene);

  // Play all animations from the GLTF file
  gltf.animations.forEach((clip) => {
    mixer.clipAction(clip).play();
  });
});

function animate() {
  const delta = clock.getDelta();
  if (mixer) mixer.update(delta);
  renderer.render(scene, camera);
}
renderer.setAnimationLoop(animate);

Critical Warnings

NEVER forget to call mixer.update(delta) in the render loop -- animations will NOT play without it.

NEVER use new Date() or performance.now() to compute delta manually -- ALWAYS use THREE.Clock or renderer.setAnimationLoop which provides stable frame timing.

NEVER call mixer.clipAction(clip) repeatedly in the render loop -- it caches internally, but the lookup is unnecessary overhead. ALWAYS store the returned action in a variable.

NEVER call .play() every frame -- call it ONCE to start playback. Calling .play() again on an already-playing action has no effect, but it signals misunderstanding.

ALWAYS call .reset() before .play() when restarting a stopped or finished action, or the action may resume from its last position.

ALWAYS set action.clampWhenFinished = true when using LoopOnce -- otherwise the action resets to the first frame when finished.


AnimationMixer

The master scheduler that drives all animation actions for a single object hierarchy.

Constructor

const mixer = new THREE.AnimationMixer(rootObject);

rootObject is the root Object3D of the animated model (typically gltf.scene).

Properties

PropertyTypeDefaultDescription
.timenumber0Global mixer time in seconds
.timeScalenumber1Global speed multiplier; 0 pauses ALL actions

Methods

MethodReturnsDescription
.clipAction(clip, root?, blendMode?)AnimationActionReturns or creates an action for the clip
.existingAction(clip, root?)`AnimationAction \null`Returns previously created action or null
.update(delta)thisAdvances mixer by delta seconds -- MUST call every frame
.setTime(seconds)thisSets global time, updates all actions
.stopAllAction()thisDeactivates all scheduled actions
.getRoot()Object3DReturns the mixer's root object
.uncacheAction(clip, root?)voidDeallocates cached action
.uncacheClip(clip)voidDeallocates clip data
.uncacheRoot(root)voidDeallocates root object data

Events

Listen via mixer.addEventListener(type, callback):

EventFires When
'finished'Action completes (ONLY with LoopOnce + clampWhenFinished = true)
'loop'Action completes a loop iteration

Event object properties: {action, loopDelta, type}.

Blend Modes

Pass as the third argument to mixer.clipAction(clip, root, blendMode):

ConstantBehavior
THREE.NormalAnimationBlendModeStandard blending (default)
THREE.AdditiveAnimationBlendModeLayered on top of base animation

AnimationAction

Controls playback of a single animation clip. NEVER instantiate directly.

Properties

PropertyTypeDefaultDescription
.blendModenumberNormalAnimationBlendModeBlending strategy
.clampWhenFinishedbooleanfalsePause at last frame when done
.enabledbooleantrueDisable without resetting
.loopnumberLoopRepeatLoop mode
.pausedbooleanfalseFreeze playback
.repetitionsnumberInfinityLoop count
.timenumber0Local time in seconds
.timeScalenumber1Speed: 0 pauses, negative reverses
.weightnumber1Blend influence [0, 1]
.zeroSlopeAtEndbooleantrueSmooth interpolation at loop end
.zeroSlopeAtStartbooleantrueSmooth interpolation at loop start

Loop Modes

ConstantBehavior
THREE.LoopOncePlays once, stops
THREE.LoopRepeatRestarts from beginning each loop
THREE.LoopPingPongAlternates forward/backward

Playback Methods

MethodDescription
.play()Start playback
.stop()Stop and reset to start
.reset()Reset time, weight, speed to initial state
.startAt(mixerTime)Delay start until specified mixer time

Fading and Crossfade Methods

MethodDescription
.fadeIn(duration)Fade weight from 0 to 1
.fadeOut(duration)Fade weight from 1 to 0
.crossFadeFrom(fadeOutAction, duration, warp)Crossfade from another action into this one
.crossFadeTo(fadeInAction, duration, warp)Crossfade from this action to another
.stopFading()Cancel any active fade

Speed and Timing Methods

MethodDescription
.halt(duration)Decelerate timeScale to 0 over duration
.warp(startScale, endScale, duration)Smoothly transition playback speed
.stopWarping()Cancel any active warp
.setDuration(seconds)Adjust timeScale so one loop takes exactly seconds
.setEffectiveTimeScale(scale)Set effective time scale
.setEffectiveWeight(weight)Set effective weight
.setLoop(mode, repetitions)Set loop mode and count
.syncWith(otherAction)Synchronize time with another action

Query Methods

MethodReturnsDescription
.isRunning()booleantrue only if actively playing
.isScheduled()booleantrue if .play() was called
.getClip()AnimationClipThe associated clip
.getMixer()AnimationMixerThe owning mixer
.getRoot()Object3DThe root object
.getEffectiveTimeScale()numberComputed time scale
.getEffectiveWeight()numberComputed weight

AnimationClip

A reusable set of keyframe tracks. Typically loaded from GLTF files.

Constructor

const clip = new THREE.AnimationClip(name, duration, tracks, blendMode);
  • name -- string identifier (GLTF clips use names from the file)
  • duration -- seconds; -1 to auto-calculate from tracks
  • tracks -- array of KeyframeTrack objects
  • blendMode -- optional blend mode constant

Key Static Methods

MethodDescription
AnimationClip.findByName(arrayOrObject, name)Look up clip by name
AnimationClip.CreateFromMorphTargetSequence(name, targets, fps, noLoop)Create clip from morph targets
AnimationClip.parse(json)Deserialize from JSON

KeyframeTrack Types

Track TypeValue TypeUse Case
VectorKeyframeTrackVector3Position, scale
QuaternionKeyframeTrackQuaternionRotation (uses slerp)
NumberKeyframeTracknumberOpacity, intensity
BooleanKeyframeTrackbooleanVisibility toggles
ColorKeyframeTrackColorColor animation
StringKeyframeTrackstringDiscrete string values

Interpolation Modes

ConstantBehavior
THREE.InterpolateDiscreteStep function, no smoothing
THREE.InterpolateLinearLinear interpolation (default)
THREE.InterpolateSmoothCubic spline interpolation

PropertyBinding Path Format

"meshName.position"                    // animate position
"meshName.material.opacity"            // animate material property
"meshName.morphTargetInfluences[0]"    // animate morph target
"boneName.quaternion"                  // animate bone rotation

Clock

Constructor

const clock = new THREE.Clock(autoStart); // autoStart defaults to true

Methods

MethodReturnsDescription
.getDelta()numberSeconds since last getDelta() call
.getElapsedTime()numberTotal elapsed time in seconds
.start()voidStart the clock
.stop()voidStop without resetting

Crossfade Pattern (Character State Machine)

const actions = {};
gltf.animations.forEach((clip) => {
  actions[clip.name] = mixer.clipAction(clip);
});

let currentAction = actions['Idle'];
currentAction.play();

function switchAction(toName, duration = 0.5) {
  const toAction = actions[toName];
  toAction.reset();
  toAction.setEffectiveTimeScale(1);
  toAction.setEffectiveWeight(1);
  toAction.crossFadeFrom(currentAction, duration, true);
  toAction.play();
  currentAction = toAction;
}

ALWAYS call .reset() on the incoming action before crossfading. ALWAYS store the current action reference for the next transition.


Additive Animation Blending

const baseAction = mixer.clipAction(baseClip);
const additiveAction = mixer.clipAction(
  additiveClip, undefined, THREE.AdditiveAnimationBlendMode
);

baseAction.play();
additiveAction.play();
additiveAction.setEffectiveWeight(0.5);

Use additive blending for layered effects: breathing, damage reactions, aim offsets.


Morph Target Animation

// Manual control
mesh.morphTargetInfluences[0] = Math.sin(elapsed) * 0.5 + 0.5;

// Via GLTF animation clip (preferred)
const morphAction = mixer.clipAction(morphClip);
morphAction.play();

Reference Links

Official Sources

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

38.21%
按下载量换算28

Claude

28.84%
按下载量换算21

Cursor

19.72%
按下载量换算15

Gemini CLI

8.28%
按下载量换算6

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills