Merge pull request #338 from secondlife/SL-20024

SL-20024: Fix unable to modify a no-copy material from the build floater
master
cosmic-linden 2023-08-21 09:23:19 -07:00 committed by GitHub
commit 311f62f4fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 3 deletions

View File

@ -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);