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.
master
Beq 2025-02-03 21:21:29 +00:00
parent 224ee9f7f5
commit 8b154ad95e
1 changed files with 26 additions and 3 deletions

View File

@ -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);