diff --git a/SharedProjects/Babylon2GLTF/GLTFExporter.Animation.cs b/SharedProjects/Babylon2GLTF/GLTFExporter.Animation.cs index b1f09abb..49a544ca 100644 --- a/SharedProjects/Babylon2GLTF/GLTFExporter.Animation.cs +++ b/SharedProjects/Babylon2GLTF/GLTFExporter.Animation.cs @@ -109,7 +109,8 @@ private void ExportAnimationGroups(GLTF gltf, BabylonScene babylonScene) else { // if the node isn't found in the scene id map, check if it is the id for a morph target - BabylonMorphTargetManager morphTargetManager = babylonScene.morphTargetManagers.FirstOrDefault(mtm => mtm.targets.Any(target => target.animations != null && target.animations.Length > 0 && target.animations[0] != null)); + BabylonMorphTargetManager morphTargetManager = babylonScene.morphTargetManagers.FirstOrDefault(mtm => mtm.targets.Any(target => target.animations != null && target.animations.Length > 0 && target.animations[0] != null && target.id == id)); + if (morphTargetManager != null) { BabylonMesh mesh = morphTargetManager.sourceMesh;