summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSabrina Shanman <cosmic@lindenlab.com>2022-11-09 00:17:22 +0000
committerSabrina Shanman <cosmic@lindenlab.com>2022-11-09 00:17:22 +0000
commit4d961ccbaafd4e8c17359c49f1acc15967e0e29c (patch)
treeffad843bc655d1d978bee03651bdd29d321a9702
parentded67322deb36dc842deb0e4c47022691d5ffb2b (diff)
parent4aaa48419594c993c6c1b0bd2f5585c6492b6a31 (diff)
Merged in revert-pr-1190 (pull request #1191)
Revert "SL-18523: When editing an object's material override, use the object's material override as a base, rather than its render material (pull request #1190)"
-rw-r--r--indra/llprimitive/llgltfmaterial.cpp26
-rw-r--r--indra/llprimitive/llgltfmaterial.h3
-rw-r--r--indra/newview/llmaterialeditor.cpp15
3 files changed, 4 insertions, 40 deletions
diff --git a/indra/llprimitive/llgltfmaterial.cpp b/indra/llprimitive/llgltfmaterial.cpp
index ee1931a27b..6d23cb8039 100644
--- a/indra/llprimitive/llgltfmaterial.cpp
+++ b/indra/llprimitive/llgltfmaterial.cpp
@@ -61,29 +61,6 @@ LLMatrix3 LLGLTFMaterial::TextureTransform::asMatrix()
return offset * rotation * scale;
}
-LLGLTFMaterial::LLGLTFMaterial(bool for_override)
-: LLGLTFMaterial()
-{
- if (for_override)
- {
- setBaseColorId(mBaseColorId, for_override);
- setNormalId(mNormalId, for_override);
- setMetallicRoughnessId(mMetallicRoughnessId, for_override);
- setEmissiveId(mEmissiveId, for_override);
-
- setBaseColorFactor(mBaseColor, for_override);
- setAlphaCutoff(mAlphaCutoff, for_override);
- setEmissiveColorFactor(mEmissiveColor, for_override);
- setMetallicFactor(mMetallicFactor, for_override);
- setRoughnessFactor(mRoughnessFactor, for_override);
- setAlphaMode(mAlphaMode, for_override);
- setDoubleSided(mDoubleSided, for_override);
-
- // *NOTE: Texture offsets only exist in overrides, so there is no need
- // to hack in the override value here.
- }
-}
-
LLGLTFMaterial::LLGLTFMaterial(const LLGLTFMaterial& rhs)
{
*this = rhs;
@@ -611,9 +588,6 @@ void LLGLTFMaterial::applyOverrideUUID(LLUUID& dst_id, const LLUUID& override_id
}
}
-// Make a static default material override for editing materials
-const LLGLTFMaterial LLGLTFMaterial::sOverrideDefault{true};
-
void LLGLTFMaterial::applyOverride(const LLGLTFMaterial& override_mat)
{
LL_PROFILE_ZONE_SCOPED;
diff --git a/indra/llprimitive/llgltfmaterial.h b/indra/llprimitive/llgltfmaterial.h
index 2476818b27..60116fd423 100644
--- a/indra/llprimitive/llgltfmaterial.h
+++ b/indra/llprimitive/llgltfmaterial.h
@@ -48,8 +48,6 @@ public:
// default material for reference
static const LLGLTFMaterial sDefault;
- // default material override for reference
- static const LLGLTFMaterial sOverrideDefault;
struct TextureTransform
{
@@ -68,7 +66,6 @@ public:
};
LLGLTFMaterial() {}
- LLGLTFMaterial(bool for_override);
LLGLTFMaterial(const LLGLTFMaterial& rhs);
LLGLTFMaterial& operator=(const LLGLTFMaterial& rhs);
diff --git a/indra/newview/llmaterialeditor.cpp b/indra/newview/llmaterialeditor.cpp
index 70b165460a..a0cb4e1c8f 100644
--- a/indra/newview/llmaterialeditor.cpp
+++ b/indra/newview/llmaterialeditor.cpp
@@ -2385,26 +2385,19 @@ 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 (tep->getGLTFMaterial().isNull())
+ if (material.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
- if (material.isNull())
- {
- // Start with a material override which does not make any changes
- material = new LLGLTFMaterial(LLGLTFMaterial::sOverrideDefault);
- }
- else
- {
- material = new LLGLTFMaterial(*material);
- }
+ material = new LLGLTFMaterial(*material);
U32 changed_flags = mEditor->getUnsavedChangesFlags();
U32 reverted_flags = mEditor->getRevertedChangesFlags();