mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-12 07:04:36 +00:00
Re-added prefix handling for named texture lookups for image asset fields
Changed render-out of shape preview images to use png Added filter against previewCache folder
This commit is contained in:
parent
0fa8b97f91
commit
8ed3bab44c
7 changed files with 10 additions and 20 deletions
|
|
@ -2778,7 +2778,7 @@ function getAssetPreviewImage(%asset)
|
|||
|
||||
if(%previewPath $= "")
|
||||
%previewPath = "ToolsModule:unknownImage_image";
|
||||
|
||||
|
||||
return %previewPath;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@ function ImageAsset::generatePreviewImage(%this, %previewButton, %forceRegenerat
|
|||
}
|
||||
|
||||
%previewFilePath = %previewPath @ %this.assetName @ ".png";
|
||||
|
||||
if(!isFile(%previewFilePath) || (compareFileTimes(%this.getImagePath(), %previewFilePath) == 1))
|
||||
{
|
||||
%generatePreview = true;
|
||||
|
|
|
|||
|
|
@ -67,6 +67,7 @@ function MaterialAsset::buildBrowserElement(%this, %previewData)
|
|||
%previewImage = getAssetPreviewImage(%this.getAssetId());
|
||||
|
||||
%previewData.previewImage = isFile(%previewImage) ? %previewImage : "ToolsModule:genericAssetIcon_image";
|
||||
|
||||
%previewData.previewLoaded = false; //this marks it for loading progressively later
|
||||
|
||||
%previewData.assetName = %this.assetName;
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ function ShapeAsset::onDelete(%this)
|
|||
{
|
||||
//Special handle the cache preview image
|
||||
%module = $CurrentAssetBrowser.dirHandler.getModuleFromAddress(makeRelativePath(filePath(%this.getShapePath())));
|
||||
%previewPath = "tools/resources/previewCache/" @ %module.moduleId @ "/" @ %this.assetName @ ".png";
|
||||
%previewPath = "tools/resources/previewCache/" @ %module.moduleId @ "/" @ %this.assetName @ ".dds";
|
||||
|
||||
if(isFile(%previewPath))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -40,6 +40,9 @@ function directoryHandler::loadFolders(%this, %path, %parentId)
|
|||
if(%parentName $= "Data" && (%folderName $= "shaderCache" || %folderName $= "cache"))
|
||||
continue;
|
||||
|
||||
if(%folderName $= "previewCache")
|
||||
continue;
|
||||
|
||||
if(%folderName $= ".git")
|
||||
continue;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue