mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-13 15:44:36 +00:00
Updates ImageAsset usage to utilize AssetRef, and standardizes the setter/getter functions and naming conventions, as well as the ability to use and bind named targets.
This commit is contained in:
parent
a858d8624e
commit
34e3f78a22
82 changed files with 1451 additions and 951 deletions
|
|
@ -129,7 +129,15 @@ function MaterialAsset::generatePreviewImage(%this, %previewButton, %forceRegene
|
|||
{
|
||||
if(isObject(%this.materialDefinitionName))
|
||||
{
|
||||
if(compareFileTimes(%this.materialDefinitionName.getDiffuseMap(0), %previewFilePath) == 1 ||
|
||||
%diffuseMapFile = "";
|
||||
%diffuseMapAssetId = %this.materialDefinitionName.getDiffuseMapAsset(0);
|
||||
if(AssetDatabase.isDeclaredAsset(%diffuseMapAssetId))
|
||||
{
|
||||
%diffuseMapFile = AssetDatabase.acquireAsset(%diffuseMapAssetId).getImagePath();
|
||||
AssetDatabase.releaseAsset(%diffuseMapAssetId);
|
||||
}
|
||||
|
||||
if(compareFileTimes(%diffuseMapFile, %previewFilePath) == 1 ||
|
||||
compareFileTimes(%this.materialDefinitionName.getFilename(), %previewFilePath) == 1)
|
||||
%generatePreview = true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -120,7 +120,15 @@ function TerrainAssetMaterial::generatePreviewImage(%this, %previewButton, %forc
|
|||
{
|
||||
if(isObject(%this.materialDefinitionName))
|
||||
{
|
||||
if(compareFileTimes(%this.materialDefinitionName.getDiffuseMap(), %previewFilePath) == 1 ||
|
||||
%diffuseMapFile = "";
|
||||
%diffuseMapAssetId = %this.materialDefinitionName.getDiffuseMapAsset();
|
||||
if(AssetDatabase.isDeclaredAsset(%diffuseMapAssetId))
|
||||
{
|
||||
%diffuseMapFile = AssetDatabase.acquireAsset(%diffuseMapAssetId).getImagePath();
|
||||
AssetDatabase.releaseAsset(%diffuseMapAssetId);
|
||||
}
|
||||
|
||||
if(compareFileTimes(%diffuseMapFile, %previewFilePath) == 1 ||
|
||||
compareFileTimes(%this.materialDefinitionName.getFilename(), %previewFilePath) == 1)
|
||||
%generatePreview = true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue