diff options
| author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2022-10-29 03:16:16 +0300 |
|---|---|---|
| committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2022-10-29 03:16:16 +0300 |
| commit | 35d4124b5eb3d412643124993b4fa8c09f3f747c (patch) | |
| tree | e8e35b52d51e4baef9c39cda52174d965a7ff1bb /indra/newview/llmaterialeditor.cpp | |
| parent | b6a35e36d71b421e8f74e5b5e3f0909c8fcda930 (diff) | |
SL-18446 Material override arrival for selected objects should update material editor
Diffstat (limited to 'indra/newview/llmaterialeditor.cpp')
| -rw-r--r-- | indra/newview/llmaterialeditor.cpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/indra/newview/llmaterialeditor.cpp b/indra/newview/llmaterialeditor.cpp index 533f882d39..c10625a45a 100644 --- a/indra/newview/llmaterialeditor.cpp +++ b/indra/newview/llmaterialeditor.cpp @@ -1513,13 +1513,14 @@ void LLMaterialEditor::loadMaterialFromFile(const std::string& filename, S32 ind ); } } + void LLMaterialEditor::onSelectionChanged() { // This won't get deletion or deselectAll() // Might need to handle that separately - mUnsavedChanges = 0; clearTextures(); setFromSelection(); + // At the moment all cahges are 'live' so don't reset dirty flags // saveLiveValues(); todo } @@ -1554,6 +1555,21 @@ void LLMaterialEditor::saveLiveValues() LLSelectMgr::getInstance()->getSelection()->applyToObjects(&savefunc); } +void LLMaterialEditor::updateLive() +{ + const LLSD floater_key(LIVE_MATERIAL_EDITOR_KEY); + LLFloater* instance = LLFloaterReg::findInstance("material_editor", floater_key); + if (instance && LLFloater::isVisible(instance)) + { + LLMaterialEditor* me = (LLMaterialEditor*)instance; + if (me) + { + me->clearTextures(); + me->setFromSelection(); + } + } +} + void LLMaterialEditor::loadLive() { // Allow only one 'live' instance @@ -2164,6 +2180,9 @@ void LLMaterialEditor::applyToSelection() // TODO figure out how to get the right asset id in cases where we don't have a good one LLRenderMaterialOverrideFunctor override_func(this, url); selected_objects->applyToTEs(&override_func); + + // we posted all changes + mUnsavedChanges = 0; } else { |
