summaryrefslogtreecommitdiff
path: root/indra/newview/lltooldraganddrop.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2024-12-04 02:29:43 +0200
committerAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2024-12-04 19:03:28 +0200
commit27fb297b6f5ac1e5b5e28c012a63f845eb81ab68 (patch)
treec36d2341e2f69ef45cb68ae53a256b0614b9ac8e /indra/newview/lltooldraganddrop.cpp
parent3f6d55f4fee10c5e1dc8b8f39e0560ce39e4a919 (diff)
#3190 Ensure materials are properly copied instead of reused.
Diffstat (limited to 'indra/newview/lltooldraganddrop.cpp')
-rw-r--r--indra/newview/lltooldraganddrop.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp
index 6d0704a469..6be7ec2262 100644
--- a/indra/newview/lltooldraganddrop.cpp
+++ b/indra/newview/lltooldraganddrop.cpp
@@ -1410,6 +1410,7 @@ void LLToolDragAndDrop::dropTexture(LLViewerObject* hit_obj,
LLTextureEntry* te = hit_obj->getTE(hit_face);
if (te && !remove_pbr)
{
+ // saveGLTFMaterials will make a copy
override_materials.push_back(te->getGLTFMaterialOverride());
}
else
@@ -1448,7 +1449,8 @@ void LLToolDragAndDrop::dropTexture(LLViewerObject* hit_obj,
LLTextureEntry* te = hit_obj->getTE(hit_face);
if (te && !remove_pbr)
{
- nodep->mSavedGLTFOverrideMaterials[hit_face] = te->getGLTFMaterialOverride();
+ LLGLTFMaterial* copy = new LLGLTFMaterial(*te->getGLTFMaterialOverride());
+ nodep->mSavedGLTFOverrideMaterials[hit_face] = copy;
}
else
{