get image metadata

adds ability to get image metadata without loading the texture
since we are using the getOwned parameter correctly now new assets must have the full path to the image file when being created
when the asset becomes owned again the image file path will be updated.
This commit is contained in:
marauder2k7 2025-03-28 11:14:21 +00:00
parent db8c565416
commit bfe2401ebb
5 changed files with 139 additions and 23 deletions

View file

@ -147,7 +147,7 @@ function AssetBrowser::importImageAsset(%this, %assetItem)
{
assetName = %assetName;
versionId = 1;
imageFile = fileName(%filePath);
imageFile = makeFullPath(%filePath);
imageType = %assetItem.imageType;
};
@ -238,13 +238,13 @@ function AssetBrowser::generateImageAssetPreviewImage(%this, %previewButton, %fo
{
assetName = %previewAssetName;
versionId = 1;
imageFile = fileName(%previewFilePath);
imageFile = makeFullPath(%previewFilePath);
};
%previewAssetName = "ToolsModule:" @ %previewAssetName;
%previewImgAssetPath = %previewPath @ %previewAsset.assetName @ ".asset.taml";
%assetImportSuccessful = TAMLWrite(%previewAsset, %previewImgAssetPath);
%toolsModuleDef = ModuleDatabase.findModule("ToolsModule",1);
%success = AssetDatabase.addDeclaredAsset(%toolsModuleDef, %previewImgAssetPath);
@ -252,8 +252,8 @@ function AssetBrowser::generateImageAssetPreviewImage(%this, %previewButton, %fo
if(!%success)
{
return false; //failed to register the preview image for some reason?
}
}
}
%previewButton.bitmapAsset = %previewAssetName;
return true;