From 5fd98cc54c8e6df4ee52f38f140d8f050bfa3017 Mon Sep 17 00:00:00 2001 From: ousttrue Date: Thu, 25 Mar 2021 20:33:03 +0900 Subject: [PATCH] fix `Remapped Textures` --- .../ScriptedImporter/EditorMaterial.cs | 28 +++++++++++++------ 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/Assets/UniGLTF/Editor/UniGLTF/ScriptedImporter/EditorMaterial.cs b/Assets/UniGLTF/Editor/UniGLTF/ScriptedImporter/EditorMaterial.cs index c9d2e3ef0..6f0d0114b 100644 --- a/Assets/UniGLTF/Editor/UniGLTF/ScriptedImporter/EditorMaterial.cs +++ b/Assets/UniGLTF/Editor/UniGLTF/ScriptedImporter/EditorMaterial.cs @@ -57,17 +57,27 @@ namespace UniGLTF s_foldTextures = EditorGUILayout.Foldout(s_foldTextures, "Remapped Textures"); if (s_foldTextures) { - DrawRemapGUI(importer, GltfTextureEnumerator.Enumerate(parser).Select(x => - { - switch (x.TextureType) + var names = GltfTextureEnumerator.Enumerate(parser) + .Select(x => { - case TextureImportTypes.NormalMap: - return x.GltfName; + if (x.TextureType != TextureImportTypes.StandardMap && !string.IsNullOrEmpty(x.Uri)) + { + // GLTF の 無変換テクスチャーをスキップする + return null; + } - default: - return x.ConvertedName; - } - })); + switch (x.TextureType) + { + case TextureImportTypes.NormalMap: + return x.GltfName; + + default: + return x.ConvertedName; + } + }) + .Where(x => !string.IsNullOrEmpty(x)) + ; + DrawRemapGUI(importer, names); } if (GUILayout.Button("Clear"))