From ca3f9cb8351006f0c13efe89cb8bd2c427db4440 Mon Sep 17 00:00:00 2001 From: ousttrue Date: Mon, 3 Aug 2020 15:11:42 +0900 Subject: [PATCH] fix UseUnlit --- .../VRM/UniGLTF/Scripts/IO/MaterialExporter.cs | 15 --------------- .../UniVRM/Editor/Format/VRMExportSettings.cs | 4 ++-- .../Scripts/Format/VRMMaterialExporter.cs | 17 +++++++++++++++++ 3 files changed, 19 insertions(+), 17 deletions(-) diff --git a/Assets/VRM/UniGLTF/Scripts/IO/MaterialExporter.cs b/Assets/VRM/UniGLTF/Scripts/IO/MaterialExporter.cs index 9ef70c542..1e8b14757 100644 --- a/Assets/VRM/UniGLTF/Scripts/IO/MaterialExporter.cs +++ b/Assets/VRM/UniGLTF/Scripts/IO/MaterialExporter.cs @@ -199,21 +199,6 @@ namespace UniGLTF } } - public static bool UseUnlit(string shaderName) - { - switch (shaderName) - { - case "Unlit/Color": - case "Unlit/Texture": - case "Unlit/Transparent": - case "Unlit/Transparent Cutout": - case "UniGLTF/UniUnlit": - return true; - } - return false; - - } - protected virtual glTFMaterial CreateMaterial(Material m) { switch (m.shader.name) diff --git a/Assets/VRM/UniVRM/Editor/Format/VRMExportSettings.cs b/Assets/VRM/UniVRM/Editor/Format/VRMExportSettings.cs index 317021aae..893824370 100644 --- a/Assets/VRM/UniVRM/Editor/Format/VRMExportSettings.cs +++ b/Assets/VRM/UniVRM/Editor/Format/VRMExportSettings.cs @@ -228,7 +228,7 @@ namespace VRM continue; } - if (MaterialExporter.UseUnlit(material.shader.name)) + if (VRMMaterialExporter.UseUnlit(material.shader.name)) { // unlit continue; @@ -240,7 +240,7 @@ namespace VRM continue; } - yield return Validation.Warning(string.Format("{0}: unknown material '{0}' is used. this will export as `Standard` fallback", + yield return Validation.Warning(string.Format("{0}: unknown shader '{1}' is used. this will export as `Standard` fallback", material.name, material.shader.name)); } diff --git a/Assets/VRM/UniVRM/Scripts/Format/VRMMaterialExporter.cs b/Assets/VRM/UniVRM/Scripts/Format/VRMMaterialExporter.cs index fb759d1c8..9878528f8 100644 --- a/Assets/VRM/UniVRM/Scripts/Format/VRMMaterialExporter.cs +++ b/Assets/VRM/UniVRM/Scripts/Format/VRMMaterialExporter.cs @@ -10,6 +10,23 @@ namespace VRM { public class VRMMaterialExporter : MaterialExporter { + public static bool UseUnlit(string shaderName) + { + switch (shaderName) + { + case "Unlit/Color": + case "Unlit/Texture": + case "Unlit/Transparent": + case "Unlit/Transparent Cutout": + case "UniGLTF/UniUnlit": + case "VRM/UnlitTexture": + case "VRM/UnlitTransparent": + case "VRM/UnlitCutout": + return true; + } + return false; + } + protected override glTFMaterial CreateMaterial(Material m) { switch (m.shader.name)