From c29cb378b06f6eaa971824e3e9aadd36e60c5160 Mon Sep 17 00:00:00 2001 From: codereader Date: Fri, 2 Apr 2021 06:47:20 +0200 Subject: [PATCH] #5567: Make sure editor image expression is carried over when cloning templates --- radiant/ui/materials/editor/MaterialEditor.cpp | 1 + radiantcore/shaders/ShaderTemplate.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/radiant/ui/materials/editor/MaterialEditor.cpp b/radiant/ui/materials/editor/MaterialEditor.cpp index fb13fcfbc3..c4d4d57504 100644 --- a/radiant/ui/materials/editor/MaterialEditor.cpp +++ b/radiant/ui/materials/editor/MaterialEditor.cpp @@ -368,6 +368,7 @@ void MaterialEditor::setupBasicMaterialPage() _material->setEditorImageExpressionFromString(editorImageEntry->GetValue().ToStdString()); updateStageBlendControls(); + updateBasicImagePreview(); onMaterialChanged(); }); diff --git a/radiantcore/shaders/ShaderTemplate.cpp b/radiantcore/shaders/ShaderTemplate.cpp index 1d7d123198..e4726bb3e4 100644 --- a/radiantcore/shaders/ShaderTemplate.cpp +++ b/radiantcore/shaders/ShaderTemplate.cpp @@ -56,6 +56,8 @@ ShaderTemplate::ShaderTemplate(const ShaderTemplate& other) : _parseFlags(other._parseFlags), _guiDeclName(other._guiDeclName) { + _editorTex = other._editorTex ? MapExpression::createForString(other._editorTex->getExpressionString()) : MapExpressionPtr(); + _ambientRimColour[0] = other._ambientRimColour[0]; _ambientRimColour[1] = other._ambientRimColour[1]; _ambientRimColour[2] = other._ambientRimColour[2];