summaryrefslogtreecommitdiff
path: root/indra/newview/llmaterialeditor.cpp
diff options
context:
space:
mode:
authorCosmic Linden <cosmic@lindenlab.com>2022-11-08 10:53:24 -0800
committerCosmic Linden <cosmic@lindenlab.com>2022-11-08 11:55:45 -0800
commitcba87c62cc3c31d48c680bf92aa7ae2b9555ba69 (patch)
tree28deae73bd42a8b807f2d32017a9738c719c495d /indra/newview/llmaterialeditor.cpp
parentd72824c2b789b81b2bc0ae2c20012ca45d23a42d (diff)
SL-18523: When editing an object's material override, use the object's material override as a base, rather than its render material
Diffstat (limited to 'indra/newview/llmaterialeditor.cpp')
-rw-r--r--indra/newview/llmaterialeditor.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/indra/newview/llmaterialeditor.cpp b/indra/newview/llmaterialeditor.cpp
index a0cb4e1c8f..70b165460a 100644
--- a/indra/newview/llmaterialeditor.cpp
+++ b/indra/newview/llmaterialeditor.cpp
@@ -2385,19 +2385,26 @@ public:
// Selection can cover multiple objects, and live editor is
// supposed to overwrite changed values only
LLTextureEntry* tep = objectp->getTE(te);
- LLPointer<LLGLTFMaterial> material = tep->getGLTFRenderMaterial();
- if (material.isNull())
+ if (tep->getGLTFMaterial().isNull())
{
// overrides are not supposed to work or apply if
// there is no base material to work from
return false;
}
-
+ LLPointer<LLGLTFMaterial> material = tep->getGLTFMaterialOverride();
// make a copy to not invalidate existing
// material for multiple objects
- material = new LLGLTFMaterial(*material);
+ if (material.isNull())
+ {
+ // Start with a material override which does not make any changes
+ material = new LLGLTFMaterial(LLGLTFMaterial::sOverrideDefault);
+ }
+ else
+ {
+ material = new LLGLTFMaterial(*material);
+ }
U32 changed_flags = mEditor->getUnsavedChangesFlags();
U32 reverted_flags = mEditor->getRevertedChangesFlags();