From c07b88d4e6152d561efe227db6bc2a23ca3e0acd Mon Sep 17 00:00:00 2001 From: Skillbert Date: Sat, 6 Jun 2026 12:51:05 +0200 Subject: [PATCH] prevent crash on missing skeleton --- src/3d/anims/animationskeletal.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/3d/anims/animationskeletal.ts b/src/3d/anims/animationskeletal.ts index 6e55559..6f77118 100644 --- a/src/3d/anims/animationskeletal.ts +++ b/src/3d/anims/animationskeletal.ts @@ -214,10 +214,14 @@ export async function mountSkeletalSkeleton(rootnode: Object3D, cache: ThreejsSc skeleton.calculateInverses(); rootnode.traverse(node => { if (node instanceof SkinnedMesh) { - node.bind(skeleton, childbind); let geo = node.geometry as BufferGeometry; - geo.attributes.skinIndex = geo.attributes.RA_skinIndex_skin; - geo.attributes.skinWeight = geo.attributes.RA_skinWeight_skin; + if (!geo.attributes.RA_skinIndex_skin || !geo.attributes.RA_skinWeight_skin) { + console.log("warning, mesh without skin bones used in skinned animation"); + } else { + node.bind(skeleton, childbind); + geo.attributes.skinIndex = geo.attributes.RA_skinIndex_skin; + geo.attributes.skinWeight = geo.attributes.RA_skinWeight_skin; + } } }); }