A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.
TypeScript 2d-game-engine3d3d-game-engineandroidcppecsgame-editorgame-enginegamedeviostypescriptwebassemblywebglwebgpuwechat-minigame
fix(import): the skin warning says what is actually wrong
esengine139430c2014f
diff --git a/desktop/tests/gltf-import.test.ts b/desktop/tests/gltf-import.test.tsindex 89465f57f..9c57ea40f 100644--- a/desktop/tests/gltf-import.test.ts+++ b/desktop/tests/gltf-import.test.ts@@ -656,7 +656,7 @@ describe('glTF animation import', () => {expect((result.animations[0]!.document as any).tracks[0].childPath).toBe('Arm_2');});- it('says a skinned node moves joints the mesh will not follow', async () => {+ it('says a channel aimed at a skinned mesh node moves nothing', async () => {const result = await importGltfMeshes(animatedGltf({times: [0, 1], components: 4, values: [0, 0, 0, 1, 0, HALF, 0, HALF],skins: [{ joints: [1] }],@@ -664,7 +664,7 @@ describe('glTF animation import', () => {}), 'robot');expect(result.animations).toHaveLength(1);- expect(result.warnings.some(w => /joints move/.test(w))).toBe(true);+ expect(result.warnings.some(w => /moves nothing/.test(w))).toBe(true);});it('reports a morph-weight channel rather than dropping it', async () => {diff --git a/pipeline/src/assets/gltfImport.ts b/pipeline/src/assets/gltfImport.tsindex 0f427e2f2..e3c263ef1 100644--- a/pipeline/src/assets/gltfImport.ts+++ b/pipeline/src/assets/gltfImport.ts@@ -922,9 +922,12 @@ function readAnimations(json: GltfJson, src: GltfBytes, nodes: ImportedNode[],warnings.push(`${name}: no channel targets a node this import produced`);continue;}+ // Not "skinning is missing" — it is here. A skinned mesh is placed by its+ // JOINTS, and glTF requires the mesh node's own transform to be ignored, so+ // a channel aimed at that node moves nothing at all.if (drivesSkin) {- warnings.push(`${name}: drives skinned nodes — the joints move, but the mesh bound to`- + ' them does not deform (skinning is not implemented)');+ warnings.push(`${name}: animates a node that carries a skin, whose own transform is`+ + ' ignored (glTF requires it) — this channel moves nothing. Animate its joints.');}out.push({// A source's animation name is whatever the tool wrote (spaces, dots,