From 0f827ac89ea72bd12df2765178213c0e52673678 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Mon, 19 Jan 2026 11:15:42 -0600 Subject: [PATCH] dont try and recreate singletons --- .../scripts/materialEditor.ed.tscript | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/Templates/BaseGame/game/tools/materialEditor/scripts/materialEditor.ed.tscript b/Templates/BaseGame/game/tools/materialEditor/scripts/materialEditor.ed.tscript index 0ff1c9bf7..3640a276c 100644 --- a/Templates/BaseGame/game/tools/materialEditor/scripts/materialEditor.ed.tscript +++ b/Templates/BaseGame/game/tools/materialEditor/scripts/materialEditor.ed.tscript @@ -641,16 +641,14 @@ function MaterialEditorGui::setActiveMaterial( %this, %material ) MaterialEditorGui.currentMaterial = %material; MaterialEditorGui.lastMaterial = %material; - // we create or recreate a material to hold in a pristine state - // or, this crashes the ap. fix properly - BJR - //if(isObject(notDirtyMaterial)) - // notDirtyMaterial.delete(); - - singleton Material(notDirtyMaterial) + if(!isObject(notDirtyMaterial)) { - mapTo = "matEd_mappedMat"; - diffuseMapAsset[0] = "ToolsModule:matEd_mappedMat_image"; - }; + singleton Material(notDirtyMaterial) + { + mapTo = "matEd_mappedMat"; + diffuseMapAsset[0] = "ToolsModule:matEd_mappedMat_image"; + }; + } // Converts the texture files into absolute paths. MaterialEditorGui.convertTextureFields();