From 8c2ff7973f4d98e4b6dc5dfff2a7e32ec4fb1894 Mon Sep 17 00:00:00 2001 From: ousttrue Date: Fri, 8 Jul 2022 16:17:50 +0900 Subject: [PATCH 1/3] add MULTIFRAME_BLENDSHAPE validation --- .../UniGLTF/ExportDialog/MeshExportValidator.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Assets/UniGLTF/Editor/UniGLTF/ExportDialog/MeshExportValidator.cs b/Assets/UniGLTF/Editor/UniGLTF/ExportDialog/MeshExportValidator.cs index 5ab9e55a8..5c760aead 100644 --- a/Assets/UniGLTF/Editor/UniGLTF/ExportDialog/MeshExportValidator.cs +++ b/Assets/UniGLTF/Editor/UniGLTF/ExportDialog/MeshExportValidator.cs @@ -52,6 +52,7 @@ namespace UniGLTF MATERIALS_GREATER_THAN_SUBMESH_COUNT, MATERIALS_CONTAINS_NULL, UNKNOWN_SHADER, + MULTIFRAME_BLENDSHAPE, } public IEnumerable Validate(GameObject ExportRoot) @@ -78,6 +79,22 @@ namespace UniGLTF yield return Validation.Error($"{info.Renderers}: {Messages.MATERIALS_CONTAINS_NULL.Msg()}"); } } + + // blendShapeFraem + var shapeCount = info.Mesh.blendShapeCount; + var multiFrameShapes = new List(); + for (int i = 0; i < shapeCount; ++i) + { + if (info.Mesh.GetBlendShapeFrameCount(i) > 1) + { + multiFrameShapes.Add($"[{i}]{info.Mesh.GetBlendShapeName(i)}"); + } + } + if (multiFrameShapes.Count > 0) + { + var names = String.Join(", ", multiFrameShapes); + yield return Validation.Error($"{names}: {Messages.MULTIFRAME_BLENDSHAPE.Msg()}"); + } } foreach (var m in Meshes.GetUniqueMaterials()) From c47f6059e5b4c4267c86c053449bd65ad7b35dd2 Mon Sep 17 00:00:00 2001 From: ousttrue Date: Fri, 8 Jul 2022 17:24:43 +0900 Subject: [PATCH 2/3] update messages --- .../Editor/UniGLTF/ExportDialog/MeshExportValidator.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Assets/UniGLTF/Editor/UniGLTF/ExportDialog/MeshExportValidator.cs b/Assets/UniGLTF/Editor/UniGLTF/ExportDialog/MeshExportValidator.cs index 5c760aead..c642d6734 100644 --- a/Assets/UniGLTF/Editor/UniGLTF/ExportDialog/MeshExportValidator.cs +++ b/Assets/UniGLTF/Editor/UniGLTF/ExportDialog/MeshExportValidator.cs @@ -52,6 +52,9 @@ namespace UniGLTF MATERIALS_GREATER_THAN_SUBMESH_COUNT, MATERIALS_CONTAINS_NULL, UNKNOWN_SHADER, + + [LangMsg(Languages.en, "Meshes containing BlendShapes with multiple Frames cannot be exported")] + [LangMsg(Languages.ja, "複数Frameを持つBlendShapeを含むMeshはエクスポートできません")] MULTIFRAME_BLENDSHAPE, } @@ -80,14 +83,14 @@ namespace UniGLTF } } - // blendShapeFraem + // blendShapeFrame var shapeCount = info.Mesh.blendShapeCount; var multiFrameShapes = new List(); for (int i = 0; i < shapeCount; ++i) { if (info.Mesh.GetBlendShapeFrameCount(i) > 1) { - multiFrameShapes.Add($"[{i}]{info.Mesh.GetBlendShapeName(i)}"); + multiFrameShapes.Add($"{info.Mesh.name}[{i}]({info.Mesh.GetBlendShapeName(i)})"); } } if (multiFrameShapes.Count > 0) From c7fa4e3a8181f8f62d10d34a9d844531d5c6aacb Mon Sep 17 00:00:00 2001 From: ousttrue Date: Fri, 8 Jul 2022 17:29:11 +0900 Subject: [PATCH 3/3] =?UTF-8?q?=E5=AF=BE=E8=B1=A1=E3=81=AE=20Renderer=20?= =?UTF-8?q?=E3=81=B8=E3=81=AE=E5=8F=82=E7=85=A7=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Editor/UniGLTF/ExportDialog/MeshExportValidator.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Assets/UniGLTF/Editor/UniGLTF/ExportDialog/MeshExportValidator.cs b/Assets/UniGLTF/Editor/UniGLTF/ExportDialog/MeshExportValidator.cs index c642d6734..ee0c53b02 100644 --- a/Assets/UniGLTF/Editor/UniGLTF/ExportDialog/MeshExportValidator.cs +++ b/Assets/UniGLTF/Editor/UniGLTF/ExportDialog/MeshExportValidator.cs @@ -90,13 +90,13 @@ namespace UniGLTF { if (info.Mesh.GetBlendShapeFrameCount(i) > 1) { - multiFrameShapes.Add($"{info.Mesh.name}[{i}]({info.Mesh.GetBlendShapeName(i)})"); + multiFrameShapes.Add($"[{i}]({info.Mesh.GetBlendShapeName(i)})"); } } if (multiFrameShapes.Count > 0) { var names = String.Join(", ", multiFrameShapes); - yield return Validation.Error($"{names}: {Messages.MULTIFRAME_BLENDSHAPE.Msg()}"); + yield return Validation.Error($"{names}: {Messages.MULTIFRAME_BLENDSHAPE.Msg()}", ValidationContext.Create(info.Renderers[0].Item1)); } }