Update gltf-model-import to use SkeletonUtils.clone for better skinned mesh handling

This commit is contained in:
2026-04-05 06:38:07 +02:00
parent f68d2b7aa4
commit 892e142caa
2 changed files with 10 additions and 2 deletions

View File

@@ -328,7 +328,11 @@ function rewriteGltfResourceUris(gltfJson, files) {
};
}
function cloneTemplateScene(scene) {
return scene.clone(true);
// Use SkeletonUtils.clone so that SkinnedMesh.skeleton.bones are remapped
// to the cloned hierarchy. A plain scene.clone(true) leaves the bones array
// pointing at the original loader's nodes, which are gone after parsing,
// making every skinned mesh invisible at runtime.
return cloneSkeleton(scene);
}
function cloneMaterial(material) {
return material.clone();

View File

@@ -453,7 +453,11 @@ function rewriteGltfResourceUris(
}
function cloneTemplateScene(scene: Group): Group {
return scene.clone(true);
// Use SkeletonUtils.clone so that SkinnedMesh.skeleton.bones are remapped
// to the cloned hierarchy. A plain scene.clone(true) leaves the bones array
// pointing at the original loader's nodes, which are gone after parsing,
// making every skinned mesh invisible at runtime.
return cloneSkeleton(scene) as Group;
}
function cloneMaterial(material: Material): Material {