From 83770c357eff84aa859cbfd70f04f94b7b145ac1 Mon Sep 17 00:00:00 2001 From: ousttrue Date: Tue, 29 Oct 2024 17:03:16 +0900 Subject: [PATCH] fix `binds` KeyNotFoundException in migration. --- Assets/VRM10/Runtime/Migration/MigrationVrmExpression.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Assets/VRM10/Runtime/Migration/MigrationVrmExpression.cs b/Assets/VRM10/Runtime/Migration/MigrationVrmExpression.cs index e694a8af81..8013b1ecf9 100644 --- a/Assets/VRM10/Runtime/Migration/MigrationVrmExpression.cs +++ b/Assets/VRM10/Runtime/Migration/MigrationVrmExpression.cs @@ -239,8 +239,10 @@ static void ToMaterialColorBinds(UniGLTF.glTF gltf, JsonNode json, UniGLTF.Exten MaterialColorBinds = new List(), TextureTransformBinds = new List(), }; - expression.MorphTargetBinds = ToMorphTargetBinds(blendShapeClip["binds"], meshToNode).ToList(); - + if (blendShapeClip.TryGet("binds", out JsonNode binds)) + { + expression.MorphTargetBinds = ToMorphTargetBinds(binds, meshToNode).ToList(); + } if (blendShapeClip.TryGet("materialValues", out JsonNode materialValues)) { ToMaterialColorBinds(gltf, materialValues, expression);