Add isMaterialMapImageAsset helper function for asset type checking

This commit is contained in:
2026-05-18 16:10:35 +02:00
parent 518e40b79e
commit 9c00ae4c7e

View File

@@ -1499,6 +1499,23 @@ function isImageAsset(asset: ProjectAssetRecord): asset is ImageAssetRecord {
return asset.kind === "image"; return asset.kind === "image";
} }
function isMaterialMapImageAsset(
asset: ProjectAssetRecord
): asset is ImageAssetRecord {
if (asset.kind !== "image") {
return false;
}
const sourceName = asset.sourceName.toLowerCase();
return (
asset.mimeType !== "image/x-exr" &&
asset.mimeType !== "image/vnd.radiance" &&
!sourceName.endsWith(".exr") &&
!sourceName.endsWith(".hdr")
);
}
function isAudioAsset(asset: ProjectAssetRecord): asset is AudioAssetRecord { function isAudioAsset(asset: ProjectAssetRecord): asset is AudioAssetRecord {
return asset.kind === "audio"; return asset.kind === "audio";
} }