From 8b154ad95e786bf4d5378c707618a99bbbe35b84 Mon Sep 17 00:00:00 2001 From: Beq Date: Mon, 3 Feb 2025 21:21:29 +0000 Subject: [PATCH] FIRE-34749 - editing PBR objects turns them all white Technically what appears to be happening is that the renderer is identifying the object as wnating to show the BP textures because the BP tab was selected. This fix tries to correctly select the BP tab by default only when no PBR faces are present. It also triggers a rebuild of the selected objects to force them updated draw because the selection even occurs before the tab change and they would otherwise by displayed using whatever the previous mode was. --- indra/newview/fspanelface.cpp | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/indra/newview/fspanelface.cpp b/indra/newview/fspanelface.cpp index 6146511ec4..55f54f47ba 100644 --- a/indra/newview/fspanelface.cpp +++ b/indra/newview/fspanelface.cpp @@ -605,8 +605,24 @@ void FSPanelFace::onMatTabChange() { last_mat = curr_mat; gSavedSettings.setBOOL("FSShowSelectedInBlinnPhong", (curr_mat == MATMEDIA_MATERIAL)); - objectp->markForUpdate(); - objectp->faceMappingChanged(); + // Iterate through the linkset and mark each object for update + for (LLObjectSelection::iterator iter = LLSelectMgr::getInstance()->getSelection()->begin(); + iter != LLSelectMgr::getInstance()->getSelection()->end(); ++iter) + { + LLSelectNode* select_node = *iter; + LLViewerObject* linked_objectp = select_node->getObject(); + if (linked_objectp) + { + linked_objectp->markForUpdate(); + linked_objectp->faceMappingChanged(); + + // Ensure full rebuild of geometry + if (linked_objectp->mDrawable.notNull()) + { + linked_objectp->mDrawable->setState(LLDrawable::REBUILD_ALL); + } + } + } } } } @@ -1501,7 +1517,14 @@ void FSPanelFace::updateUI(bool force_set_values /*false*/) mTabsPBRMatMedia->enableTabButton( mTabsPBRMatMedia->getIndexForPanel( mTabsPBRMatMedia->getPanelByName("panel_material_type_blinn_phong")), editable ); - + if(!has_pbr_material) + { + mTabsPBRMatMedia->selectTabByName("panel_material_type_blinn_phong"); + } + else + { + mTabsPBRMatMedia->selectTabByName("panel_material_type_pbr"); + } // only turn on auto-adjust button if there is a media renderer and the media is loaded mBtnAlignMedia->setEnabled(editable);