Skip to content

Commit 863ae03

Browse files
Fixed issue with morph targets and animation groups. (#1105)
1 parent 53e75fb commit 863ae03

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

SharedProjects/Babylon2GLTF/GLTFExporter.Animation.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ private void ExportAnimationGroups(GLTF gltf, BabylonScene babylonScene)
109109
else
110110
{
111111
// if the node isn't found in the scene id map, check if it is the id for a morph target
112-
BabylonMorphTargetManager morphTargetManager = babylonScene.morphTargetManagers.FirstOrDefault(mtm => mtm.targets.Any(target => target.animations != null && target.animations.Length > 0 && target.animations[0] != null));
112+
BabylonMorphTargetManager morphTargetManager = babylonScene.morphTargetManagers.FirstOrDefault(mtm => mtm.targets.Any(target => target.animations != null && target.animations.Length > 0 && target.animations[0] != null && target.id == id));
113+
113114
if (morphTargetManager != null)
114115
{
115116
BabylonMesh mesh = morphTargetManager.sourceMesh;

0 commit comments

Comments
 (0)