From 4d146107531d8b5a8a87482e1746d6096393d6cf Mon Sep 17 00:00:00 2001 From: marauder2k7 Date: Thu, 27 Mar 2025 09:22:22 +0000 Subject: [PATCH] Update materialEditor.ed.tscript cleanup materialEditor script --- .../materialEditor/scripts/materialEditor.ed.tscript | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Templates/BaseGame/game/tools/materialEditor/scripts/materialEditor.ed.tscript b/Templates/BaseGame/game/tools/materialEditor/scripts/materialEditor.ed.tscript index a9b958d47..ba638b509 100644 --- a/Templates/BaseGame/game/tools/materialEditor/scripts/materialEditor.ed.tscript +++ b/Templates/BaseGame/game/tools/materialEditor/scripts/materialEditor.ed.tscript @@ -864,7 +864,7 @@ function MaterialEditorGui::convertMaterialTextureField(%this, %material, %mapNa for(%index = 0; %index < 4; %index++) { %mapFile = %material.call("get" @ %mapName, %index); - if(%mapFile !$= "" && !isFile(%mapFile)) + if(%mapFile !$= "") { if(isFile(%mapFile)) { @@ -874,9 +874,10 @@ function MaterialEditorGui::convertMaterialTextureField(%this, %material, %mapNa } else { - %assetPtr = %material.call("get" @ %mapName @ "Asset", %index); - if(%assetPtr.isNamedTarget()) + %firstChar = getSubStr( %mapFile, 0, 1 ); + if(%firstChar $= "#" || %firstChar $= "$" ) // we are a named target { + %assetPtr = %material.call("get" @ %mapName @ "Asset", %index); MaterialEditorGui.currentMaterial.call("set" @ %mapName, %assetPtr, %index); } } @@ -1099,7 +1100,6 @@ function MaterialEditorGui::guiSync( %this, %material ) //Diffuse %diffuseMap = (%material).getDiffuseMap(%layer); %diffuseMapText = %diffuseMap !$= "" && %diffuseMap !$=$MaterialEditor::emptyMaterialImage ? (%material).getDiffuseMapAsset(%layer) : "None"; - MaterialEditorPropertiesWindow-->diffuseMapNameText.setText( %diffuseMapText ); MaterialEditorPropertiesWindow-->diffuseMapDisplayBitmap.setBitmap( getAssetPreviewImage(%diffuseMapText) );