dont try and recreate singletons

This commit is contained in:
AzaezelX 2026-01-19 11:15:42 -06:00
parent a80502d50d
commit 0f827ac89e

View file

@ -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();