summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorCosmic Linden <cosmic@lindenlab.com>2023-08-18 16:08:03 -0700
committerCosmic Linden <cosmic@lindenlab.com>2023-08-18 16:33:26 -0700
commita388c5494e2e5b6669820995a2f4d62a308b870f (patch)
tree78c7f8818d4e630ffbc0a9be9fbe0edc04b96771 /indra/newview
parent00e7311960e6ae9f951355db243c6787bc7132d9 (diff)
SL-20024: Fix unable to modify a no-copy material from the build floater
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llmaterialeditor.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/indra/newview/llmaterialeditor.cpp b/indra/newview/llmaterialeditor.cpp
index 92042ad49f..54d85c87ac 100644
--- a/indra/newview/llmaterialeditor.cpp
+++ b/indra/newview/llmaterialeditor.cpp
@@ -1827,7 +1827,12 @@ bool can_use_objects_material(LLSelectedTEGetMatData& func, const std::vector<Pe
return false;
}
+ // func.mIsOverride=true is used for the singleton material editor floater
+ // associated with the build floater. This flag also excludes objects from
+ // the selection that do not satisfy PERM_MODIFY.
+ llassert(func.mIsOverride);
LLSelectMgr::getInstance()->getSelection()->applyToTEs(&func, true /*first applicable*/);
+
LLViewerObject* selected_object = func.mObject;
if (!selected_object)
{
@@ -1928,7 +1933,7 @@ bool can_use_objects_material(LLSelectedTEGetMatData& func, const std::vector<Pe
bool LLMaterialEditor::canModifyObjectsMaterial()
{
- LLSelectedTEGetMatData func(false);
+ LLSelectedTEGetMatData func(true);
LLPermissions permissions;
LLViewerInventoryItem* item_out;
return can_use_objects_material(func, std::vector({PERM_MODIFY}), permissions, item_out);
@@ -1936,7 +1941,7 @@ bool LLMaterialEditor::canModifyObjectsMaterial()
bool LLMaterialEditor::canSaveObjectsMaterial()
{
- LLSelectedTEGetMatData func(false);
+ LLSelectedTEGetMatData func(true);
LLPermissions permissions;
LLViewerInventoryItem* item_out;
return can_use_objects_material(func, std::vector({PERM_COPY, PERM_MODIFY}), permissions, item_out);
@@ -1944,7 +1949,7 @@ bool LLMaterialEditor::canSaveObjectsMaterial()
void LLMaterialEditor::saveObjectsMaterialAs()
{
- LLSelectedTEGetMatData func(false);
+ LLSelectedTEGetMatData func(true);
LLPermissions permissions;
LLViewerInventoryItem* item = nullptr;
bool allowed = can_use_objects_material(func, std::vector({PERM_COPY, PERM_MODIFY}), permissions, item);