Skip to content

Commit

Permalink
Merge pull request #2477 from ousttrue/fix/migration_no_binds_key
Browse files Browse the repository at this point in the history
[migration] BlendShape の binds key が無いときに KeyNotFoundException
  • Loading branch information
ousttrue authored Nov 6, 2024
2 parents 129af09 + 576eb6f commit b52231f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Assets/VRM10/Runtime/Migration/MigrationVrmExpression.cs
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,10 @@ static void ToMaterialColorBinds(UniGLTF.glTF gltf, JsonNode json, UniGLTF.Exten
MaterialColorBinds = new List<UniGLTF.Extensions.VRMC_vrm.MaterialColorBind>(),
TextureTransformBinds = new List<UniGLTF.Extensions.VRMC_vrm.TextureTransformBind>(),
};
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);
Expand Down

0 comments on commit b52231f

Please sign in to comment.