diff --git a/Assets/UniGLTF/Editor/UniGLTF/ExportDialog/MeshExportValidator.cs b/Assets/UniGLTF/Editor/UniGLTF/ExportDialog/MeshExportValidator.cs index 7ad8ac66d..e83a249e9 100644 --- a/Assets/UniGLTF/Editor/UniGLTF/ExportDialog/MeshExportValidator.cs +++ b/Assets/UniGLTF/Editor/UniGLTF/ExportDialog/MeshExportValidator.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; using System.Linq; using UniGLTF.M17N; +using UnityEditor; using UnityEngine; namespace UniGLTF @@ -118,9 +119,42 @@ namespace UniGLTF { yield return Validation.Warning($"{m}: unknown shader: {m.shader.name} => export as gltf default"); } - } - yield break; + var count = ShaderUtil.GetPropertyCount(m.shader); + for (int i = 0; i < count; ++i) + { + var propType = ShaderUtil.GetPropertyType(m.shader, i); + if (propType == ShaderUtil.ShaderPropertyType.TexEnv) + { + var propName = ShaderUtil.GetPropertyName(m.shader, i); + var tex = m.GetTexture(propName); + if (tex != null) + { + var assetPath = AssetDatabase.GetAssetPath(tex); + if (!string.IsNullOrEmpty(assetPath)) + { + if (AssetImporter.GetAtPath(assetPath) is TextureImporter textureImporter) + { + switch (textureImporter.textureType) + { + case TextureImporterType.Default: + case TextureImporterType.NormalMap: + break; + + default: + // EditorTextureSerializer throw Exception + // エクスポート未実装 + yield return Validation.Error($"{tex}: unknown texture type: {textureImporter.textureType}", ValidationContext.Create(tex)); + break; + } + } + } + } + } + } + + yield break; + } } } } diff --git a/Assets/UniGLTF/Runtime/UniGLTF/Validation/Validation.cs b/Assets/UniGLTF/Runtime/UniGLTF/Validation/Validation.cs index b6fa5ad92..be438bf3a 100644 --- a/Assets/UniGLTF/Runtime/UniGLTF/Validation/Validation.cs +++ b/Assets/UniGLTF/Runtime/UniGLTF/Validation/Validation.cs @@ -32,14 +32,14 @@ namespace UniGLTF /// Messageの発生個所にジャンプするための情報 /// public Type Type; - public UnityEngine.Component Context; + public UnityEngine.Object Context; /// /// DrawGUIから呼び出す。追加のGUIボタンなどを実装する /// public Action Extended; - public static ValidationContext Create(T c) where T : UnityEngine.Component + public static ValidationContext Create(T c) where T : UnityEngine.Object { return new ValidationContext {