Derived from the cocosair-skinning-morph skill and its canonical docs/source pointers; reorganized on 2026-10-11. Source annotations below identify repository inputs, not files guaranteed to ship to npm consumers.
Contracts
SkinnedMeshRenderer extends MeshRenderer(src/cocos/3d/skinned-mesh-renderer/skinned-mesh-renderer.ts:49) is the only skinning component;_updateModelParamsleaves the model undrawable untilmesh,skeletonandskinningRootall exist (:154-163), which is why the documented order assigns whileenabled = falseand enables last (docs/manual/skinning-code-first.md:13-21). TheskeletonandskinningRootsetters both run_refreshBinding, validating before the old binding is replaced and then rebuilding submodels becausebindSkeletonswapped the buffers or textures underneath them (:67-71,:82-87,:165-178,src/cocos/3d/models/skinning-model.ts:140-170).- Joint paths, never short names:
Skeletondocumentsjointsas paths relative toskinningRoot(src/cocos/3d/assets/skeleton.ts:31-32,:55-61) and every consumer resolves them throughroot.getChildByPath(path)(src/cocos/3d/models/skinning-validation.ts:13,src/cocos/3d/models/skinning-model.ts:161), whilejoints[i]stays index-paired withbindposes[i](src/cocos/3d/assets/skeleton.ts:52-53,:63-73).AIR_E_SKINNING_JOINT_PATHthrows only for a weighted joint whose path does not resolve (src/cocos/3d/models/skinning-validation.ts:11-18), the error carriescode,resource,node,joint,path(:18), and an unweighted joint yields anullbone-space bound and is skipped (src/cocos/3d/assets/mesh.ts:754-756,docs/manual/skinning-code-first.md:9). buildSkeletonTree(root, jointPaths)recordsbindposes[i] = root.getChildByPath(path).worldMatrix.clone().invert()and throws on a missing path (src/air/utils/skeleton-tree.ts:30-37,:31-34); realtime mode then multiplies the live joint world matrix by that inverse each frame (src/cocos/3d/models/skinning-model.ts:208-216), so the captured matrix is what makes the rest pose restorable.Node.worldMatrixupdates itself first, so a detached rig still captures correctly (src/cocos/scene-graph/node.ts:1910-1913).restoreBindPose(root, skeleton)inverts each bindpose back to world, converts to local against the parent's current world matrix and applies SRT, walking depth-first over a sorted copy of the index map (src/air/utils/restore-bind-pose.ts:33-36,:43-55); nothing is written back to the asset, so ordering is preserved (docs/guides/skinned-model.md:30,test/smoke/smoke-06-skeleton-utils.test.ts:81-84).- Two pose transports, one switch: the constructor defaults to
BakedSkinningModel(src/cocos/3d/skinned-mesh-renderer/skinned-mesh-renderer.ts:101),setUseBakedAnimation(val, force)rebuilds the live model when it changes (:129-145), and_tryBindAnimationre-decides the mode from the root association (:197-202), so the call is a rebuild entry, not a persistent lock (docs/manual/skinning-code-first.md:44). Baked mode reads the pose from the clip's uploaded joint texture and never from the live joint transforms (src/cocos/3d/models/baked-skinning-model.ts:166-180,:114-125); realtime mode is the one that samples nodes (src/cocos/3d/models/skinning-model.ts:208-216), which is the difference the mode switch actually buys you. - Capacity is about the slots written, not the skeleton size:
bindSkeletoncomparesUBOSkinning.JOINT_UNIFORM_CAPACITY(src/cocos/rendering/define.ts:653, fallback 30 at:600) againstjoints.lengthand takes the 256-wide realtime texture above it (src/cocos/3d/models/skinning-model.ts:143-145,:153,:84), andvalidateSkinningCapacitychecks eachjointMapsslot against that capacity, throwingAIR_E_SKINNING_CAPACITY(src/cocos/3d/models/skinning-validation.ts:25-41,docs/manual/skinning-code-first.md:54). Mesh.morphRenderingis a lifecycle field:nullby default (src/cocos/3d/assets/mesh.ts:368), created insideinitialize()only whenstruct.morphexists (:412,:571-573), whichrenderingSubMeshestriggers lazily (:359-362) and themeshsetter triggers first (src/cocos/3d/framework/mesh-renderer.ts:487-492,:1233-1249). Morph weights are a silent contract:setWeights(weights, subMeshIndex)returns without effect on an out-of-range index or a target-count mismatch (:695-706),setWeightlikewise (:720-731), values only reach the GPU through the morph instance (:1309-1310), initial values come from the asset (:1260-1287), and reassigningmeshre-inits them (:491, reset note:475-479).enableMorphis a bare flag (:526-532, defaulttrueat:564); the instance is only built from themeshsetter andonLoad(:492,:577-583), so toggling it after binding does nothing until the mesh is reassigned.- Skinning and morph compose rather than compete:
SkinningModelandBakedSkinningModelboth extendMorphModel(src/cocos/3d/models/skinning-model.ts:97,src/cocos/3d/models/baked-skinning-model.ts:60), and_createModelsubstitutesMorphModelonly when the type is still the baseModel(src/cocos/3d/framework/mesh-renderer.ts:971-987), so a skinned sub-mesh keeps its morph macro patches (src/cocos/3d/assets/morph-rendering.ts:157-171). - The deprecated alias is real and shipped:
SkinningModelComponentisSkinnedMeshRendererre-exported with acclegacyregistration and acc.SkinningModelComponentclass alias (src/cocos/3d/skinned-mesh-renderer/deprecated.ts:32-34), alongsideSkinningModelUnit(:39-41) andBatchedSkinningModelComponent(:46-48); the bundle's single export block carries all of them plusSkinnedMeshRenderer,Skeleton,Mesh,buildSkeletonTreeandrestoreBindPose(build/cocosair.module.js, currently :161574), whileMorphRendering,createMorphRendering,MorphandAttributeNamedo not appear there, so morph data must be authored as a plain literal. - Evidence, stated plainly: under candidate fingerprint
2f089f6ce25eaccd(docs/evidence/examples-verified.json, file-levelmeasuredAt2026-10-04T05:52:32.537Z) the idsskinned-animation,gltf-skin,gltf-morphandmesh-morph-boundsareresult: PASS, andexamples/skinned-animation/main.js:195,:210-213,:273are the browser-exercised build, bind and restore sequence;docs/manual/skinning-code-first.md:46records 96 access-order combinations drawn in three browsers, and:31limits that coverage to the tested single joint and the built-in effects.