summaryrefslogtreecommitdiff
path: root/indra/newview/llgltfmateriallist.cpp
diff options
context:
space:
mode:
authorBrad Linden <brad@lindenlab.com>2023-03-21 13:40:00 -0700
committerBrad Linden <brad@lindenlab.com>2023-03-21 13:43:40 -0700
commit6e6bac6b4025e01ee636b8490edbe09db2497722 (patch)
tree5f69bfecc9d79dc8b6b89fe0213ce7c7c991a477 /indra/newview/llgltfmateriallist.cpp
parentb30cde2a05c5217018d8be7608f14bda8b66127a (diff)
Phase 2 of fix for SL-18458 material overrides not being cached properly
Diffstat (limited to 'indra/newview/llgltfmateriallist.cpp')
-rw-r--r--indra/newview/llgltfmateriallist.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/indra/newview/llgltfmateriallist.cpp b/indra/newview/llgltfmateriallist.cpp
index 4051521ad4..d0c1c73f0e 100644
--- a/indra/newview/llgltfmateriallist.cpp
+++ b/indra/newview/llgltfmateriallist.cpp
@@ -157,8 +157,8 @@ public:
// receive override data from simulator via LargeGenericMessage
// message should have:
// object_id - UUID of LLViewerObject
- // side - S32 index of texture entry
- // gltf_json - String of GLTF json for override data
+ // sides - array of S32 indices of texture entries
+ // gltf_json - array of corresponding Strings of GLTF json for override data
LLSD message;
@@ -380,11 +380,22 @@ void LLGLTFMaterialList::applyQueuedOverrides(LLViewerObject* obj)
{ // object doesn't have its base GLTF material yet, don't apply override (yet)
return;
}
- obj->setTEGLTFMaterialOverride(i, overrides[i]);
+
+ S32 status = obj->setTEGLTFMaterialOverride(i, overrides[i]);
+ if (status == TEM_CHANGE_NONE)
+ {
+ // can't apply this yet, since failure to change the material override
+ // probably means the base material is still being fetched. leave in
+ // the queue for later
+ return;
+ }
+
if (obj->getTE(i)->isSelected())
{
handle_gltf_override_message.doSelectionCallbacks(id, i);
}
+ // success!
+ overrides[i] = nullptr;
}
}