diff options
author | cosmic-linden <111533034+cosmic-linden@users.noreply.github.com> | 2023-08-21 09:23:19 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-21 09:23:19 -0700 |
commit | 311f62f4fa9d4094bb33f99194ed04b8217fe603 (patch) | |
tree | 78c7f8818d4e630ffbc0a9be9fbe0edc04b96771 /indra | |
parent | 00e7311960e6ae9f951355db243c6787bc7132d9 (diff) | |
parent | a388c5494e2e5b6669820995a2f4d62a308b870f (diff) |
Merge pull request #338 from secondlife/SL-20024
SL-20024: Fix unable to modify a no-copy material from the build floater
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llmaterialeditor.cpp | 11 |
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); |