diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2022-09-22 20:15:38 +0300 |
---|---|---|
committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2022-09-22 20:15:38 +0300 |
commit | 524e5f06b7665cf7b26f451998a418d2cfe9ae13 (patch) | |
tree | 29c17147760f5658c880a4ec4d9a0b0a105fde74 /indra/newview/llmaterialeditor.cpp | |
parent | 94b92868587c652d7140aa704db42e497482827d (diff) |
SL-18001 Fix LLMaterialEditor::applyToSelection()
Diffstat (limited to 'indra/newview/llmaterialeditor.cpp')
-rw-r--r-- | indra/newview/llmaterialeditor.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/indra/newview/llmaterialeditor.cpp b/indra/newview/llmaterialeditor.cpp index bdc66a85fc..4efbf19572 100644 --- a/indra/newview/llmaterialeditor.cpp +++ b/indra/newview/llmaterialeditor.cpp @@ -32,6 +32,9 @@ #include "llagentbenefits.h" #include "llappviewer.h" #include "llcombobox.h" +#include "llfloaterreg.h" +#include "llfilesystem.h" +#include "llgltfmateriallist.h" #include "llinventorymodel.h" #include "llnotificationsutil.h" #include "lltexturectrl.h" @@ -47,8 +50,6 @@ #include "llvovolume.h" #include "roles_constants.h" #include "llviewerobjectlist.h" -#include "llfloaterreg.h" -#include "llfilesystem.h" #include "llsdserialize.h" #include "llimagej2c.h" #include "llviewertexturelist.h" @@ -1525,8 +1526,8 @@ void LLMaterialEditor::importMaterial() class LLRemderMaterialFunctor : public LLSelectedTEFunctor { public: - LLRemderMaterialFunctor(LLGLTFMaterial *mat, const LLUUID &id) - : mMat(mat), mMatId(id) + LLRemderMaterialFunctor(const LLUUID &id) + : mMatId(id) { } @@ -1535,24 +1536,23 @@ public: if (objectp && objectp->permModify() && objectp->getVolume()) { LLVOVolume* vobjp = (LLVOVolume*)objectp; - vobjp->setRenderMaterialID(te, mMatId); - vobjp->getTE(te)->setGLTFMaterial(mMat); + vobjp->setRenderMaterialID(te, mMatId, false /*preview only*/); vobjp->updateTEMaterialTextures(te); } return true; } private: - LLPointer<LLGLTFMaterial> mMat; LLUUID mMatId; }; void LLMaterialEditor::applyToSelection() { + // Placehodler. Will be removed once override systems gets finished. 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, asset_id); + gGLTFMaterialList.addMaterial(placeholder, mat); + LLRemderMaterialFunctor mat_func(placeholder); LLObjectSelectionHandle selected_objects = LLSelectMgr::getInstance()->getSelection(); selected_objects->applyToTEs(&mat_func); } |