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

/cocosair-skinning-morph

@ed38648
by oahc09oahc09/cocosairjs3 stars
2
Run it yourself

Bind skeletons, restore bind poses and drive morph weights. Use for realtime/baked deformation, AIR_E_SKINNING_JOINT_PATH or AIR_E_SKINNING_CAPACITY.

  • 9 files
  • 54.4 KB
  • MIT
  • Updated last month
  • GitHub
Use this Skill: https://skilld.dev/gh/oahc09/cocosairjs/cocosair-skinning-morph

Nothing lands on disk. Nothing to clean up.

Fork this Skill

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

referencescontext.md

≈1.2k 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 - getChildByPath resolution, parenting order and deferred destroy(), which a joint path and a release both depend on.
  • cocosair-primitives-mesh - Mesh struct, vertex bundles and minPosition/maxPosition; the geometry half of a skinned mesh.
  • cocosair-materials-effects - the effect and MaterialInstance side of setSharedMaterial, which realtime mode forces.
  • cocosair-animation-tween - SkeletalAnimation clips and useBakedAnimation, the only way to move a pose in baked mode.
  • cocosair-gltf - where loaded joints, bindposes and morph weights come from.
  • cocosair-verification - the smoke test and browser probes behind the claims below.

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.

Bind a code-built bone hierarchy to a skinned mesh, keep the bind pose restorable, choose realtime versus baked pose honestly, and drive morph weights through the native renderer - no Prefab, no Editor, no parallel skeleton abstraction.

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] Writing joint short names instead of full paths
  • [HIGH] Editing skeleton nodes after opting into baked animation
  • [MEDIUM] Expecting restoreBindPose to reorder the joints array
  • [MEDIUM] Treating a morph weight call as proof it applied

Original metadata

Description and description_en

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

Drives Cocos AIR skeletal skinning and morph targets from code - SkinnedMeshRenderer skeleton and skinningRoot binding, Skeleton.joints as full paths relative to the skinning root with AIR_E_SKINNING_JOINT_PATH, buildSkeletonTree bindposes as inverse world matrices, restoreBindPose ancestor-first ordering, realtime versus baked pose through setUseBakedAnimation, joint palette capacity and AIR_E_SKINNING_CAPACITY, Mesh.morphRendering plus getBoneSpaceBounds, and MeshRenderer setWeight, setWeights and enableMorph. Use when a skinned mesh stays in rest pose or draws nothing, when a joint path throws AIR_E_SKINNING_JOINT_PATH, when moving bone nodes after setUseBakedAnimation(true) has no effect, when a morph weight setter appears to be ignored, or when binding a hand-built Mesh to a Skeleton without the Cocos Creator asset pipeline.

Keywords

Cocos AIR, cocosair.js, skinning, morph

References

  • joint-paths.md - path resolution and its consumers, the weighted-joint scope of the path error, palette and capacity rules, glTF-loaded paths, and the deprecated component aliases.
  • bind-pose.md - the inverse-world bindpose convention, capture timing, restoreBindPose ordering and math, stale caches, and rebinding after an asset edit.
  • morph.md - morph data shapes, morphRendering lifecycle, GPU versus CPU blending, the renderer weight API, macro patches, and morph combined with skinning.

Canonical docs

  • docs/manual/skinning-code-first.md - open for the binding order, the AIR_E_SKINNING_* taxonomy, root space versus node scale, manual joints and the first frame, capacity and the read-only inspector.
  • docs/guides/skinned-model.md - open for the buildSkeletonTree, restoreBindPose and frameObject helper contracts, the joint path rule history, and the covering test and example.

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
[
  "build or bind a skeleton from joint paths",
  "a skinned mesh stays in its rest pose",
  "bone edits stop working in baked mode",
  "restore the captured bind pose",
  "morph weight changes appear to be ignored"
]
owns
[
  "skeletal-skinning",
  "joint-paths",
  "bind-pose",
  "baked-pose",
  "joint-capacity",
  "morph-weights"
]
not_for
[
  "glTF loading and decoder deployment -> cocosair-gltf",
  "clip playback and tweens -> cocosair-animation-tween",
  "generic mesh buffer authoring -> cocosair-primitives-mesh"
]
metadata
{
  "author": "oahc09@gmail.com",
  "version": "1.0.0",
  "last-updated": "2026-10-13",
  "description_zh": "配置骨骼路径、蒙皮、绑定姿态、Morph 权重和烘焙动画。用于骨骼变形、绑定姿态恢复或 Morph 问题。"
}

README badge

README badge for oahc09/cocosairjs/cocosair-skinning-morph