mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 16:44:36 +00:00
Merge pull request #1659 from Azaezel/alpha41/decalInstPreview
Some checks are pending
Linux Build / ${{matrix.config.name}} (map[build_type:Release cc:gcc cxx:g++ generator:Ninja name:Ubuntu Latest GCC]) (push) Waiting to run
MacOSX Build / ${{matrix.config.name}} (map[build_type:Release cc:clang cxx:clang++ generator:Ninja name:MacOSX Latest Clang]) (push) Waiting to run
Windows Build / ${{matrix.config.name}} (map[build_type:Release cc:cl cxx:cl environment_script:C:/Program Files (x86)/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat generator:Visual Studio 17 2022 name:Windows Latest MSVC]) (push) Waiting to run
Some checks are pending
Linux Build / ${{matrix.config.name}} (map[build_type:Release cc:gcc cxx:g++ generator:Ninja name:Ubuntu Latest GCC]) (push) Waiting to run
MacOSX Build / ${{matrix.config.name}} (map[build_type:Release cc:clang cxx:clang++ generator:Ninja name:MacOSX Latest Clang]) (push) Waiting to run
Windows Build / ${{matrix.config.name}} (map[build_type:Release cc:cl cxx:cl environment_script:C:/Program Files (x86)/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat generator:Visual Studio 17 2022 name:Windows Latest MSVC]) (push) Waiting to run
fix decal instance preview
This commit is contained in:
commit
6e96c0510d
1 changed files with 26 additions and 3 deletions
|
|
@ -350,6 +350,13 @@ function DecalEditorGui::completeGizmoTransform( %this, %decalId, %nodeDetails )
|
||||||
|
|
||||||
function DecalEditorGui::onSleep( %this )
|
function DecalEditorGui::onSleep( %this )
|
||||||
{
|
{
|
||||||
|
DecalEditorTreeView.clearSelection();
|
||||||
|
DecalDataList.setSelected( DecalDataList.getSelectedItems(), false );
|
||||||
|
|
||||||
|
DecalEditorGui.currentDecalData = "";
|
||||||
|
DecalPreviewWindow-->decalPreview.setBitmap("");
|
||||||
|
DecalEditorGui.selDecalInstanceId = "";
|
||||||
|
DecalPreviewWindow-->instancePreview.setBitmap("");
|
||||||
}
|
}
|
||||||
|
|
||||||
function DecalEditorGui::syncNodeDetails( %this )
|
function DecalEditorGui::syncNodeDetails( %this )
|
||||||
|
|
@ -629,14 +636,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