From 05c8ef3f3c002e71805bb04e9eddc3280630fca1 Mon Sep 17 00:00:00 2001 From: Cosmic Linden Date: Fri, 1 Sep 2023 17:36:00 -0700 Subject: SL-20167: Grey out the clipboard when copying the material to clipboard is not allowed --- indra/newview/llmaterialeditor.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'indra/newview/llmaterialeditor.cpp') diff --git a/indra/newview/llmaterialeditor.cpp b/indra/newview/llmaterialeditor.cpp index 54d85c87ac..8f4e0658f6 100644 --- a/indra/newview/llmaterialeditor.cpp +++ b/indra/newview/llmaterialeditor.cpp @@ -1947,6 +1947,14 @@ bool LLMaterialEditor::canSaveObjectsMaterial() return can_use_objects_material(func, std::vector({PERM_COPY, PERM_MODIFY}), permissions, item_out); } +bool LLMaterialEditor::canClipboardObjectsMaterial() +{ + LLSelectedTEGetMatData func(true); + LLPermissions permissions; + LLViewerInventoryItem* item_out; + return can_use_objects_material(func, std::vector({PERM_COPY, PERM_MODIFY, PERM_TRANSFER}), permissions, item_out); +} + void LLMaterialEditor::saveObjectsMaterialAs() { LLSelectedTEGetMatData func(true); -- cgit v1.2.3 From c0bcc3740ea4c6662f9707d49ab5c7132bb2a0a8 Mon Sep 17 00:00:00 2001 From: Cosmic Linden Date: Wed, 6 Sep 2023 11:47:34 -0700 Subject: SL-20167: Don't block clipboard if GLTF material is null --- indra/newview/llmaterialeditor.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'indra/newview/llmaterialeditor.cpp') diff --git a/indra/newview/llmaterialeditor.cpp b/indra/newview/llmaterialeditor.cpp index 8f4e0658f6..d4ea725af7 100644 --- a/indra/newview/llmaterialeditor.cpp +++ b/indra/newview/llmaterialeditor.cpp @@ -1949,6 +1949,24 @@ bool LLMaterialEditor::canSaveObjectsMaterial() bool LLMaterialEditor::canClipboardObjectsMaterial() { + if (LLSelectMgr::getInstance()->getSelection()->getObjectCount() != 1) + { + return false; + } + + struct LLSelectedTEGetNullMat : public LLSelectedTEFunctor + { + bool apply(LLViewerObject* objectp, S32 te_index) + { + return objectp->getRenderMaterialID(te_index).isNull(); + } + } null_func; + + if (LLSelectMgr::getInstance()->getSelection()->applyToTEs(&null_func)) + { + return true; + } + LLSelectedTEGetMatData func(true); LLPermissions permissions; LLViewerInventoryItem* item_out; -- cgit v1.2.3