diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2022-08-09 00:21:45 +0300 |
---|---|---|
committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2022-08-09 00:22:09 +0300 |
commit | e73fd2a2f28a01c1ab1e0dee63ba4d2ca73c9634 (patch) | |
tree | 74c69448be4d97958cb5970a0c4e776bd0c00eae /indra/newview/llmaterialeditor.cpp | |
parent | c0d20995c32cb9cabc3e8e74aef96726bcc19ddf (diff) |
SL-17653 Perially done restoration functionality
Diffstat (limited to 'indra/newview/llmaterialeditor.cpp')
-rw-r--r-- | indra/newview/llmaterialeditor.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/indra/newview/llmaterialeditor.cpp b/indra/newview/llmaterialeditor.cpp index 0e252518cb..13e250ec3b 100644 --- a/indra/newview/llmaterialeditor.cpp +++ b/indra/newview/llmaterialeditor.cpp @@ -165,6 +165,15 @@ void LLMaterialEditor::onClickCloseBtn(bool app_quitting) } } +void LLMaterialEditor::onClose(bool app_quitting) +{ + // todo: will only revert whatever was recently selected, + // Later should work based of tools floater + LLSelectMgr::getInstance()->selectionRevertGLTFMaterials(); + + LLPreview::onClose(app_quitting); +} + LLUUID LLMaterialEditor::getAlbedoId() { return mAlbedoTextureCtrl->getValue().asUUID(); @@ -1362,17 +1371,17 @@ public: return true; } private: - LLGLTFMaterial *mMat; + LLPointer<LLGLTFMaterial> mMat; LLUUID mMatId; }; void LLMaterialEditor::applyToSelection() { - LLGLTFMaterial* mat = new LLGLTFMaterial(); + LLPointer<LLGLTFMaterial> mat = new LLGLTFMaterial(); getGLTFMaterial(mat); const LLUUID placeholder("984e183e-7811-4b05-a502-d79c6f978a98"); LLUUID asset_id = mAssetID.notNull() ? mAssetID : placeholder; - LLRemderMaterialFunctor mat_func(mat, mAssetID); + LLRemderMaterialFunctor mat_func(mat, asset_id); LLObjectSelectionHandle selected_objects = LLSelectMgr::getInstance()->getSelection(); selected_objects->applyToTEs(&mat_func); } |