Skip to content

Commit

Permalink
Fixed issue with morph targets and animation groups. (#1105)
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioRZMasson authored Sep 22, 2023
1 parent 53e75fb commit 863ae03
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion SharedProjects/Babylon2GLTF/GLTFExporter.Animation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 863ae03

Please sign in to comment.