diff --git a/Assets/VRM/Runtime/IO/VRMMaterialExporter.cs b/Assets/VRM/Runtime/IO/VRMMaterialExporter.cs index c97d56a1b..bf021f20b 100644 --- a/Assets/VRM/Runtime/IO/VRMMaterialExporter.cs +++ b/Assets/VRM/Runtime/IO/VRMMaterialExporter.cs @@ -180,10 +180,17 @@ namespace VRM var texture = m.GetTexture(kv.Key); if (texture != null) { - var value = kv.Key == "_BumpMap" - ? textureExporter.RegisterExportingAsNormal(texture) - : textureExporter.RegisterExportingAsSRgb(texture, needsAlpha: kv.Key == "_MainTex") - ; + var value = -1; + var isNormalMap = kv.Key == "_BumpMap"; + if (isNormalMap) + { + value = textureExporter.RegisterExportingAsNormal(texture); + } + else + { + var needsAlpha = kv.Key == "_MainTex"; + value = textureExporter.RegisterExportingAsSRgb(texture, needsAlpha); + } if (value == -1) { Debug.LogFormat("not found {0}", texture.name);