summaryrefslogtreecommitdiff
path: root/indra/llprimitive/llgltfmaterial.cpp
diff options
context:
space:
mode:
authorCosmic Linden <cosmic@lindenlab.com>2022-12-13 10:41:21 -0800
committerCosmic Linden <cosmic@lindenlab.com>2023-01-10 17:09:30 -0800
commit693925ef23ef41e3927a9654a7f423d0e24ce19a (patch)
treef04b58860de9c0af845185123a1271edd9bc0482 /indra/llprimitive/llgltfmaterial.cpp
parent4fa77b6f728b6be3d2e7fc74dda97b835476f797 (diff)
SL-18820: Fix applying material clearing transform overrides. Loosen some asserts to allow non-default transform overrides.
Diffstat (limited to 'indra/llprimitive/llgltfmaterial.cpp')
-rw-r--r--indra/llprimitive/llgltfmaterial.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/indra/llprimitive/llgltfmaterial.cpp b/indra/llprimitive/llgltfmaterial.cpp
index 5442af33d0..a8dad89292 100644
--- a/indra/llprimitive/llgltfmaterial.cpp
+++ b/indra/llprimitive/llgltfmaterial.cpp
@@ -392,11 +392,23 @@ bool LLGLTFMaterial::setBaseMaterial()
{
const LLGLTFMaterial old_override = *this;
*this = sDefault;
- // Preserve the texture transforms
- mTextureTransform = old_override.mTextureTransform;
+ setBaseMaterial(old_override);
return *this != old_override;
}
+bool LLGLTFMaterial::isClearedForBaseMaterial()
+{
+ LLGLTFMaterial cleared_override = sDefault;
+ cleared_override.setBaseMaterial(*this);
+ return *this == cleared_override;
+}
+
+// For material overrides only. Copies transforms from the old override.
+void LLGLTFMaterial::setBaseMaterial(const LLGLTFMaterial& old_override_mat)
+{
+ mTextureTransform = old_override_mat.mTextureTransform;
+}
+
// static
void LLGLTFMaterial::hackOverrideUUID(LLUUID& id)