From 44782e475c8f30af38986d5c97f8dafaee0575b2 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 10 Nov 2022 23:50:46 +0200 Subject: SL-18602 Crashfix --- indra/newview/llselectmgr.cpp | 18 ++++++++++++------ 1 file 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; } -- cgit v1.2.3