summaryrefslogtreecommitdiff
path: root/indra/newview/llmaterialeditor.cpp
diff options
context:
space:
mode:
authorCosmic Linden <cosmic@lindenlab.com>2023-07-24 16:16:52 -0700
committerCosmic Linden <cosmic@lindenlab.com>2023-08-11 16:30:59 -0700
commitca6f465088be904fa5b85297396227f905792a3b (patch)
tree13b470566e2af2529b112e044990b9d8c3cae607 /indra/newview/llmaterialeditor.cpp
parenta4030031f895f8497e106f0547eb29780d6ec4e9 (diff)
SL-20024: Disable material editor on prim when contained material is no mod
Diffstat (limited to 'indra/newview/llmaterialeditor.cpp')
-rw-r--r--indra/newview/llmaterialeditor.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/indra/newview/llmaterialeditor.cpp b/indra/newview/llmaterialeditor.cpp
index 3a0e64985c..b30f94e145 100644
--- a/indra/newview/llmaterialeditor.cpp
+++ b/indra/newview/llmaterialeditor.cpp
@@ -238,6 +238,7 @@ struct LLSelectedTEGetMatData : public LLSelectedTEFunctor
LLUUID mTexNormalId;
LLUUID mObjectId;
S32 mObjectTE;
+ LLUUID mMaterialId;
LLPointer<LLGLTFMaterial> mMaterial;
LLPointer<LLLocalGLTFMaterial> mLocalMaterial;
};
@@ -259,6 +260,7 @@ bool LLSelectedTEGetMatData::apply(LLViewerObject* objectp, S32 te_index)
return false;
}
LLUUID mat_id = objectp->getRenderMaterialID(te_index);
+ mMaterialId = mat_id;
bool can_use = mIsOverride ? objectp->permModify() : objectp->permCopy();
LLTextureEntry *tep = objectp->getTE(te_index);
// We might want to disable this entirely if at least
@@ -2708,7 +2710,10 @@ bool LLMaterialEditor::setFromSelection()
if (func.mMaterial.notNull())
{
setFromGLTFMaterial(func.mMaterial);
- setEnableEditing(true);
+ LLViewerObject* selected_object = selected_objects->getFirstSelectedObject(NULL);
+ const LLViewerInventoryItem* item = selected_object->getInventoryItemByAsset(func.mMaterialId);
+ const bool allow_modify = !item || canModify(selected_object, item);
+ setEnableEditing(allow_modify);
}
else
{