Add isMaterialMapImageAsset helper function for asset type checking
This commit is contained in:
@@ -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";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user