summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llselectmgr.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp
index c5a5175780..dbc3fe0ce5 100644
--- a/indra/newview/llselectmgr.cpp
+++ b/indra/newview/llselectmgr.cpp
@@ -2219,10 +2219,6 @@ void LLSelectMgr::selectionRevertGLTFMaterials()
LLUUID asset_id = nodep->mSavedGLTFMaterialIds[te];
objectp->setRenderMaterialID(te, asset_id, false /*wait for bulk update*/);
- // Restore overrides
- LLSD overrides;
- overrides["object_id"] = objectp->getID();
- overrides["side"] = te;
// todo: make sure this does not cause race condition with setRenderMaterialID
// when we are reverting from null id to non null plus override
@@ -2230,10 +2226,20 @@ void LLSelectMgr::selectionRevertGLTFMaterials()
&& nodep->mSavedGLTFOverrideMaterials[te].notNull()
&& asset_id.notNull())
{
+ // Restore overrides
+ LLSD overrides;
+ overrides["object_id"] = objectp->getID();
+ overrides["side"] = te;
+
overrides["gltf_json"] = nodep->mSavedGLTFOverrideMaterials[te]->asJSON();
- } // else nothing to blank override out
+ LLGLTFMaterialList::queueUpdate(overrides);
+ }
+ else
+ {
+ //blank override out
+ LLGLTFMaterialList::queueApply(objectp->getID(), te, asset_id);
+ }
- LLGLTFMaterialList::queueUpdate(overrides);
}
return true;
}