mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-13 15:44:36 +00:00
fix decal instance preview
update previews for instance selection just like we do db selection
This commit is contained in:
parent
a80502d50d
commit
d8f585c552
1 changed files with 19 additions and 3 deletions
|
|
@ -629,14 +629,30 @@ function DecalEditorGui::updateInstancePreview( %this, %material )
|
||||||
|
|
||||||
if( isObject( %material ) )
|
if( isObject( %material ) )
|
||||||
{
|
{
|
||||||
%previewImage = %material.getDiffuseMap(0);
|
%previewImage = %material.getDiffuseMapAsset(0);
|
||||||
}
|
}
|
||||||
else
|
else if(AssetDatabase.isDeclaredAsset(%material))
|
||||||
{
|
{
|
||||||
if(AssetDatabase.isDeclaredAsset(%material))
|
if(AssetDatabase.getAssetType(%material) $= "MaterialAsset")
|
||||||
|
{
|
||||||
|
%matAsset = AssetDatabase.acquireAsset(%material);
|
||||||
|
|
||||||
|
%previewImage = %matAsset.materialDefinitionName.getDiffuseMap(0);
|
||||||
|
}
|
||||||
|
else if(AssetDatabase.getAssetType(%material) $= "ImageAsset")
|
||||||
{
|
{
|
||||||
%previewImage = %material;
|
%previewImage = %material;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
error("DecalEditorGui::updateDecalPreview() - Tried to set an invalid asset type for the editor preview!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
error("DecalEditorGui::updateDecalPreview() - Tried to set a non material, non asset value for the editor preview!");
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
DecalPreviewWindow-->instancePreview.setBitmap( getAssetPreviewImage(%previewImage) );
|
DecalPreviewWindow-->instancePreview.setBitmap( getAssetPreviewImage(%previewImage) );
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue