mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-29 00:05:40 +00:00
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:
parent
db8c565416
commit
bfe2401ebb
5 changed files with 139 additions and 23 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue