From 6e32993c8787e7ba569d5a9ebcdb994c2ba03671 Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Tue, 26 Sep 2023 13:59:31 +0300 Subject: SL-20338 FIXED Texture tab Material drop-down does not change if same numbered face is selected --- indra/newview/llpanelface.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'indra/newview/llpanelface.cpp') diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index e1f08915fa..1428f7fe23 100644 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -1056,6 +1056,7 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) LLSelectedTEMaterial::getSpecularID(specmap_id, identical_spec); static S32 selected_te = -1; + static LLUUID prev_obj_id; if ((LLToolFace::getInstance() == LLToolMgr::getInstance()->getCurrentTool()) && !LLSelectMgr::getInstance()->getSelection()->isMultipleTESelected()) { @@ -1070,7 +1071,8 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) } } - if (new_selection != selected_te) + if ((new_selection != selected_te) + || (prev_obj_id != objectp->getID())) { bool te_has_media = objectp->getTE(new_selection) && objectp->getTE(new_selection)->hasMedia(); bool te_has_pbr = objectp->getRenderMaterialID(new_selection).notNull(); @@ -1088,6 +1090,7 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) mComboMatMedia->selectNthItem(MATMEDIA_MATERIAL); } selected_te = new_selection; + prev_obj_id = objectp->getID(); } } -- cgit v1.3 From 1b493d56905a2d3875648196ac1bc39fc71e895a Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 27 Sep 2023 21:11:01 +0300 Subject: SL-20343 Material floater was disconnected from object's face --- indra/newview/llmaterialeditor.cpp | 27 +-------------------------- indra/newview/llmaterialeditor.h | 1 - indra/newview/llpanelface.cpp | 1 + 3 files changed, 2 insertions(+), 27 deletions(-) (limited to 'indra/newview/llpanelface.cpp') diff --git a/indra/newview/llmaterialeditor.cpp b/indra/newview/llmaterialeditor.cpp index a0c3fd9a28..0897ed14c6 100644 --- a/indra/newview/llmaterialeditor.cpp +++ b/indra/newview/llmaterialeditor.cpp @@ -412,9 +412,6 @@ BOOL LLMaterialEditor::postBuild() if (mIsOverride) { - // Material override change success callback - LLGLTFMaterialList::addSelectionUpdateCallback(&LLMaterialEditor::updateLive); - // Live editing needs a recovery mechanism on cancel mBaseColorTextureCtrl->setOnCancelCallback(boost::bind(&LLMaterialEditor::onCancelCtrl, this, _1, _2, MATERIAL_BASE_COLOR_TEX_DIRTY)); mMetallicTextureCtrl->setOnCancelCallback(boost::bind(&LLMaterialEditor::onCancelCtrl, this, _1, _2, MATERIAL_METALLIC_ROUGHTNESS_TEX_DIRTY)); @@ -542,12 +539,6 @@ void LLMaterialEditor::draw() { if (mIsOverride) { - bool selection_empty = LLSelectMgr::getInstance()->getSelection()->isEmpty(); - if (selection_empty && mHasSelection) - { - mSelectionNeedsUpdate = true; - } - if (mSelectionNeedsUpdate) { mSelectionNeedsUpdate = false; @@ -1790,22 +1781,6 @@ void LLMaterialEditor::updateLive() mOverrideInProgress = false; } -void LLMaterialEditor::updateLive(const LLUUID &object_id, S32 te) -{ - if (mOverrideObjectId != object_id - || mOverrideObjectTE != te) - { - // Ignore if waiting for override, - // if not waiting, mark selection dirty - mSelectionNeedsUpdate |= !mOverrideInProgress; - return; - } - - // update for currently displayed object and face - mSelectionNeedsUpdate = true; - mOverrideInProgress = false; -} - void LLMaterialEditor::loadLive() { LLMaterialEditor* me = (LLMaterialEditor*)LLFloaterReg::getInstance("live_material_editor"); @@ -2816,7 +2791,7 @@ public: // something went wrong update selection LLMaterialEditor::updateLive(); } - // else we will get updateLive(obj, id) from applied overrides + // else we will get updateLive() from panel face } bool getResult() { return mSuccess; } diff --git a/indra/newview/llmaterialeditor.h b/indra/newview/llmaterialeditor.h index b29db706f8..1c40fcc348 100644 --- a/indra/newview/llmaterialeditor.h +++ b/indra/newview/llmaterialeditor.h @@ -110,7 +110,6 @@ class LLMaterialEditor : public LLPreview, public LLVOInventoryListener void onSelectionChanged(); // live overrides selection changes static void updateLive(); - static void updateLive(const LLUUID &object_id, S32 te); static void loadLive(); static bool canModifyObjectsMaterial(); diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index 1428f7fe23..cb28fb4770 100644 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -515,6 +515,7 @@ void LLPanelFace::draw() if (sMaterialOverrideSelection.update()) { setMaterialOverridesFromSelection(); + LLMaterialEditor::updateLive(); } } -- cgit v1.3