Index of every page on this site: llms.txt
All skills
oahc09 avatar

/cocosair-animation-tween

@ed38648
by oahc09oahc09/cocosairjs3 stars
2
Run it yourself

Animate tweens and AnimationClip tracks with one step clock. Use to loop a sequence on a target, reverseTime, clean up playback or diagnose unavailable pose graphs.

  • 9 files
  • 52.5 KB
  • MIT
  • Updated last month
  • GitHub
Use this Skill: https://skilld.dev/gh/oahc09/cocosairjs/cocosair-animation-tween

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencescontext.md

≈1.6k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Working context

Use package imports and shipped docs for an application; use source paths and repository commands only in a confirmed AIR checkout. A copied host skill is not a runtime installation.

Read the shared environment rules when locating these roots. If sibling resources are unavailable, use the installed canonical chapter and disclose the limitation. Tool declarations identify workflow capabilities; they do not authorize installation, writes, publication or any action outside the user and host scope.

Related skills

  • cocosair - routing and shared Code First constraints; reuse it if already loaded.
  • cocosair-scene-graph - Node activation, active, deferred destroy() and NODE_DESTROYED, which is what tween node-state binding hooks into.
  • cocosair-application - createAirApp, app.run(scene), game.pause()/game.resume() and the director pacer that createStepClock freezes.
  • cocosair-math - Vec3, Quat, Color and the value types tween props and track channels interpolate.
  • cocosair-gltf - GLTFInstance.setAnimationLoop reconfigures the native AnimationState.wrapMode this skill documents; glTF clips default to WrapMode.Normal.
  • cocosair-skinning-morph - SkeletalAnimation, joint paths and bind pose; skeletal clips play through the same Animation component.
  • cocosair-performance - cost of mass tween/animation, the ActionManager update, and render-on-demand versus a resident loop.
  • cocosair-verification - the gates and collectors behind every browser claim quoted below, including the step-clock probe and examples-verified.json.

Original entry guidance

The original entry wording below is an on-demand archive, not a second routing source.

Use the environment rules to locate the checkout or installed package; sibling skills are optional direct dependencies, not a recursive load list.

Move things over time two ways: the code-first tween(target) chain (zero assets, the shortest path) and the native Animation component driving an AnimationClip you can build entirely in code. Both are stepped by the director, never by your own requestAnimationFrame. For deterministic evidence there is a third, test-only driver, createStepClock, that pauses the real clock and advances one frame at a time.

Read references/quick-start.md when constructing the minimal example. It preserves the complete setup and teardown sequence; select the source-checkout or npm-consumer environment first.

Read references/context.md to select the owner of this step and only its directly needed dependencies. Reuse already loaded skills; this is not a recursive load list.

Original mistake navigation

Before implementing the relevant path, read its wrong/right examples in references/common-mistakes.md:

  • [HIGH] Importing track classes by name
  • [HIGH] Running the real pacer and the step clock at once
  • [HIGH] Assuming reverseTime(embedTween) returns to the start
  • [MEDIUM] Setting wrapMode every frame to keep a clip looping
  • [MEDIUM] Citing marionette or pose-graph animation as available

Original metadata

Description and description_en

The two original fields contained exactly the same value, retained once here.

Drives the Cocos AIR animation and tween surface - the code-first tween(target) chain (to/by/set/delay/call/sequence/parallel/repeat/repeatForever/reverseTime/union/clone/timeScale plus start/stop/pause/resume and the target-bound statics), TweenSystem and its ActionManager, the native Animation component (play/stop/pause/resume/getState/createState/addClip/crossFade, executionOrder 99, playOnLoad), AnimationState wrapMode whose setter resets time and repeatCount, code-first AnimationClip construction, the AnimationClip.WrapMode static enum, the animation namespace that is the only route to VectorTrack and TrackPath, createStepClock single-clock stepping with its dual-clock guard, and the unpublished marionette and pose-graph state. Use when a tween will not reverse, when a clip plays once instead of looping, when track classes fail to import by name, when deterministic frame stepping is needed for evidence, or when pose-graph animation is assumed available.

Keywords

Cocos AIR, cocosair.js, animation, tween

References

  • animation-clip.md - the Animation component surface and lifecycle, AnimationState and the wrapMode setter reset, AnimationClip construction and members, the WrapMode bitmask enum, the animation namespace and TrackPath builders, and the marionette/pose-graph exclusion with its build-time switches.
  • tween-ops.md - the full Tween chain (to/by/set/delay/call/update/sequence/parallel/repeat/repeatForever/reverseTime/union/clone/timeScale), lifecycle (start/stop/pause/resume/running), the target-bound statics, node-state binding, TweenSystem and the ActionManager, and the GAP-T1 reverseTime defect.
  • step-clock.md - the createStepClock contract (begin/step/end, defaults, the dual-clock guard and timeout), how it freezes the real pacer, the probe and verifier tooling, and the exact evidence gap (zero apiProof bindings, no committed w08 record).

Canonical docs

  • docs/manual/animation-system.md - open for the two-route overview, the tween API table, the code-first clip skeleton, the glTF loop rules and the three verified clip sources.
  • docs/manual/how-to-update-things.md - open for update/lateUpdate/schedule discipline, dt units and the startup spike, and the single-clock rule.
  • docs/notes/pose-graph-notes.md - open for the pose-graph/marionette non-delivery, the build-time feature switches, the enablement cost and the owner ruling.
  • docs/reference/api-scenario-gap-matrix.md - open for GAP-T1, the reverseTime embedded-sequence end-point defect and its reproduction note.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No third-party reports yet.

Signed by skilld at ed38648. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated last month
layer
subsystem
All 1 allowed tools
Read Edit Write Bash
Other metadata
compatibility
Cocos AIR source checkout or installed cocosair.js package. Browser rendering requires WebGL 2; source tooling requires Node.js >=18. Use the host-provided tools and user-authorized workspace.
when_to_use
[
  "move or rotate a node over time",
  "a clip plays once instead of looping",
  "a tween will not reverse",
  "track classes fail to import by name",
  "step deterministic frames without a second live clock"
]
owns
[
  "tween",
  "animation-clip",
  "track-path",
  "wrap-mode",
  "step-clock",
  "pose-graph-limits"
]
not_for
[
  "glTF loading and instance setup -> cocosair-gltf",
  "skeletal binding and morph weights -> cocosair-skinning-morph",
  "scalar easing calculations -> cocosair-math"
]
metadata
{
  "author": "oahc09@gmail.com",
  "version": "1.0.0",
  "last-updated": "2026-10-13",
  "description_zh": "使用 AnimationClip、Animation 和 tween,管理播放模式、组合及单一时钟。用于动画播放、补间回收或确定性步进问题。"
}

README badge

README badge for oahc09/cocosairjs/cocosair-animation-tween