From 9a8b428e1960829fe0b6043e1547eacc214b5d00 Mon Sep 17 00:00:00 2001 From: ousttrue Date: Thu, 25 Nov 2021 15:21:07 +0900 Subject: [PATCH] =?UTF-8?q?flow=20=E3=82=82=E3=81=A8=E3=81=AB=E6=88=BB?= =?UTF-8?q?=E3=81=97=E3=80=82=20HasProperty=20=E3=81=A7=20GetProperty=20?= =?UTF-8?q?=E3=81=AE=E3=82=A8=E3=83=A9=E3=83=BC=E3=82=92=E5=9B=9E=E9=81=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UniGLTF/ExportDialog/MaterialValidator.cs | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/Assets/UniGLTF/Editor/UniGLTF/ExportDialog/MaterialValidator.cs b/Assets/UniGLTF/Editor/UniGLTF/ExportDialog/MaterialValidator.cs index 93732b958..bf6d15af4 100644 --- a/Assets/UniGLTF/Editor/UniGLTF/ExportDialog/MaterialValidator.cs +++ b/Assets/UniGLTF/Editor/UniGLTF/ExportDialog/MaterialValidator.cs @@ -43,12 +43,26 @@ namespace UniGLTF // main color yield return (MaterialExporter.COLOR_TEXTURE_PROP, m.GetTexture(MaterialExporter.COLOR_TEXTURE_PROP)); - if (GetGltfMaterialTypeFromUnityShaderName(m.shader.name) == "Standard") + if (GetGltfMaterialTypeFromUnityShaderName(m.shader.name) == "unlit") + { + yield break; + } + + // PBR + if (m.HasProperty(MaterialExporter.METALLIC_TEX_PROP)) { - // PBR yield return (MaterialExporter.METALLIC_TEX_PROP, m.GetTexture(MaterialExporter.METALLIC_TEX_PROP)); + } + if (m.HasProperty(MaterialExporter.NORMAL_TEX_PROP)) + { yield return (MaterialExporter.NORMAL_TEX_PROP, m.GetTexture(MaterialExporter.NORMAL_TEX_PROP)); + } + if (m.HasProperty(MaterialExporter.EMISSION_TEX_PROP)) + { yield return (MaterialExporter.EMISSION_TEX_PROP, m.GetTexture(MaterialExporter.EMISSION_TEX_PROP)); + } + if (m.HasProperty(MaterialExporter.OCCLUSION_TEX_PROP)) + { yield return (MaterialExporter.OCCLUSION_TEX_PROP, m.GetTexture(MaterialExporter.OCCLUSION_TEX_PROP)); } }