From 116169ca663dd600e6bfa2c969c0661d4811a7d0 Mon Sep 17 00:00:00 2001 From: ousttrue Date: Tue, 15 Sep 2020 14:14:03 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=A8=E3=83=A9=E3=83=BC=E3=82=92=E8=AD=A6?= =?UTF-8?q?=E5=91=8A=E3=81=AB=E8=90=BD=E3=81=A8=E3=81=97=E3=81=9F=E3=80=82?= =?UTF-8?q?=E3=82=A8=E3=82=AF=E3=82=B9=E3=83=9D=E3=83=BC=E3=83=88=E6=99=82?= =?UTF-8?q?=E3=81=AB=20null=20check=20=E3=82=92=E8=BF=BD=E5=8A=A0=E3=81=97?= =?UTF-8?q?=E3=81=9F=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Editor/BlendShape/VRMBlendShapeProxyValidator.cs | 6 +++--- Assets/VRM/UniVRM/Scripts/Format/glTF_VRMExtensions.cs | 9 +++++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Assets/VRM/UniVRM/Editor/BlendShape/VRMBlendShapeProxyValidator.cs b/Assets/VRM/UniVRM/Editor/BlendShape/VRMBlendShapeProxyValidator.cs index 37eace657..be97ab003 100644 --- a/Assets/VRM/UniVRM/Editor/BlendShape/VRMBlendShapeProxyValidator.cs +++ b/Assets/VRM/UniVRM/Editor/BlendShape/VRMBlendShapeProxyValidator.cs @@ -26,7 +26,7 @@ namespace VRM var key = c.Key; if (used.Contains(key)) { - yield return Validation.Error($"duplicated BlendShapeKey: {c}"); + yield return Validation.Error($"duplicated BlendShapeKey: {key}"); } else { @@ -55,7 +55,7 @@ namespace VRM var target = p.transform.Find(v.RelativePath); if (target == null) { - yield return Validation.Error($"{c}.Values[{i}].RelativePath({v.RelativePath} is not found"); + yield return Validation.Warning($"{c}.Values[{i}].RelativePath({v.RelativePath} is not found"); } } @@ -64,7 +64,7 @@ namespace VRM var v = c.MaterialValues[i]; if (!materialNames.Contains(v.MaterialName)) { - yield return Validation.Error($"{c}.MaterialValues[{i}].MaterialName({v.MaterialName} is not found"); + yield return Validation.Warning($"{c}.MaterialValues[{i}].MaterialName({v.MaterialName} is not found"); } } } diff --git a/Assets/VRM/UniVRM/Scripts/Format/glTF_VRMExtensions.cs b/Assets/VRM/UniVRM/Scripts/Format/glTF_VRMExtensions.cs index d4dc817e8..9e0955f6b 100644 --- a/Assets/VRM/UniVRM/Scripts/Format/glTF_VRMExtensions.cs +++ b/Assets/VRM/UniVRM/Scripts/Format/glTF_VRMExtensions.cs @@ -19,7 +19,12 @@ namespace VRM public static glTF_VRM_BlendShapeBind Create(Transform root, BlendShapeBinding binding, gltfExporter exporter) { - var transform = UniGLTF.UnityExtensions.GetFromPath(root.transform, binding.RelativePath); + var transform = root.transform.Find(binding.RelativePath); + if (transform == null) + { + Debug.LogWarning($"{binding.RelativePath} not found"); + return null; + } var renderer = transform.GetComponent(); if (renderer == null) { @@ -38,7 +43,7 @@ namespace VRM return null; } - if(!exporter.MeshBlendShapeIndexMap.TryGetValue(mesh, out Dictionary blendShapeIndexMap)) + if (!exporter.MeshBlendShapeIndexMap.TryGetValue(mesh, out Dictionary blendShapeIndexMap)) { // この Mesh は エクスポートされていない return null;