mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-06-14 20:10:36 -05:00
Check Editor NormalMap.
This commit is contained in:
parent
751e1697ce
commit
c142e670bd
|
|
@ -33,6 +33,29 @@ namespace VRMShaders
|
|||
// Equals color space ?
|
||||
if (!IsFileColorSpaceSameWithExportColorSpace(texture2D, textureImporter, exportColorSpace)) return false;
|
||||
|
||||
// Each Texture Importer Type Validation
|
||||
switch (textureImporter.textureType)
|
||||
{
|
||||
case TextureImporterType.Default:
|
||||
break;
|
||||
case TextureImporterType.NormalMap:
|
||||
if (!IsCorrectNormalMap(texture2D, textureImporter)) return false;
|
||||
break;
|
||||
case TextureImporterType.GUI:
|
||||
case TextureImporterType.Sprite:
|
||||
case TextureImporterType.Cursor:
|
||||
case TextureImporterType.Cubemap:
|
||||
case TextureImporterType.Cookie:
|
||||
case TextureImporterType.Lightmap:
|
||||
case TextureImporterType.HDRI:
|
||||
case TextureImporterType.Advanced:
|
||||
case TextureImporterType.SingleChannel:
|
||||
// Not Supported TextureImporterType
|
||||
return false;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -139,5 +162,15 @@ namespace VRMShaders
|
|||
throw new ArgumentOutOfRangeException(nameof(colorSpace), colorSpace, null);
|
||||
}
|
||||
}
|
||||
|
||||
private bool IsCorrectNormalMap(Texture2D texture, TextureImporter textureImporter)
|
||||
{
|
||||
if (textureImporter.textureType != TextureImporterType.NormalMap) return false;
|
||||
|
||||
// Is Not generated from HeightMap ?
|
||||
if (textureImporter.convertToNormalmap) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user