From cf3a0c77f1855aa1a33ff39f86e846e7fb9031d1 Mon Sep 17 00:00:00 2001 From: Brad Linden Date: Thu, 23 Mar 2023 16:51:30 -0700 Subject: Fix for SL-18458 overrides not applying when cache load happened before LLViewerObject::updateTEMaterialTextures call --- indra/newview/llviewerobject.cpp | 39 +++++++++++++++++++++++++++++++-------- 1 file changed, 31 insertions(+), 8 deletions(-) (limited to 'indra/newview/llviewerobject.cpp') diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index cc7e716bb5..1c53bddb62 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -4963,12 +4963,16 @@ void LLViewerObject::updateTEMaterialTextures(U8 te) mat = (LLFetchedGLTFMaterial*) gGLTFMaterialList.getMaterial(mat_id); if (mat->isFetching()) { // material is not loaded yet, rebuild draw info when the object finishes loading - LLUUID id = getID(); - mat->onMaterialComplete([=] + mat->onMaterialComplete([id=getID()] { LLViewerObject* obj = gObjectList.findObject(id); if (obj) { + LLViewerRegion* region = obj->getRegion(); + if(region) + { + region->loadCacheMiscExtras(obj->getLocalID()); + } obj->markForUpdate(FALSE); } }); @@ -5698,6 +5702,23 @@ void LLViewerObject::setDebugText(const std::string &utf8text) updateText(); } +void LLViewerObject::appendDebugText(const std::string &utf8text) +{ + if (utf8text.empty() && !mText) + { + return; + } + + if (!mText) + { + initHudText(); + } + mText->addLine(utf8text, LLColor4::white); + mText->setZCompare(FALSE); + mText->setDoFade(FALSE); + updateText(); +} + void LLViewerObject::initHudText() { mText = (LLHUDText *)LLHUDObject::addHUDObject(LLHUDObject::LL_HUD_TEXT); @@ -7260,12 +7281,14 @@ void LLViewerObject::setRenderMaterialID(S32 te_in, const LLUUID& id, bool updat } else { - LLPointer this_ptr = this; - new_material->onMaterialComplete([this_ptr]() mutable { - if (this_ptr->isDead()) { return; } - - this_ptr->rebuildMaterial(); - }); + new_material->onMaterialComplete([obj_id = getID()]() + { + LLViewerObject* obj = gObjectList.findObject(obj_id); + if (obj) + { + obj->rebuildMaterial(); + } + }); } // predictively update LLRenderMaterialParams (don't wait for server) -- cgit v1.2.3