summaryrefslogtreecommitdiff
path: root/indra/newview/llselectmgr.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2024-03-27 00:45:06 +0200
committerAndrey Lihatskiy <alihatskiy@productengine.com>2024-03-27 00:45:06 +0200
commit71ed19839eb95d918329b2c776c8af3b8724f1da (patch)
tree4639de2c088a688bb5c4a77a2763261397d904fd /indra/newview/llselectmgr.cpp
parent5ac0b9debc100a5a4d14e9eaad1a6542c927a275 (diff)
parent9567393f803dfb0c786b8e917e41c8f4b8b22af7 (diff)
Merge branch 'main' into DRTVWR-600-maint-A
# Conflicts: # indra/newview/llappviewer.cpp # indra/newview/llfloaterchangeitemthumbnail.cpp # indra/newview/llpanelprofile.cpp # indra/newview/llselectmgr.cpp # indra/newview/lltexturectrl.cpp # indra/newview/lltexturectrl.h # indra/newview/lltooldraganddrop.cpp # indra/newview/llviewerdisplay.cpp # indra/newview/llvovolume.cpp
Diffstat (limited to 'indra/newview/llselectmgr.cpp')
-rw-r--r--indra/newview/llselectmgr.cpp41
1 files changed, 24 insertions, 17 deletions
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp
index 99e1e83512..8eaedb764e 100644
--- a/indra/newview/llselectmgr.cpp
+++ b/indra/newview/llselectmgr.cpp
@@ -1879,7 +1879,8 @@ bool LLSelectMgr::selectionSetImage(const LLUUID& imageid)
te,
mItem,
LLToolDragAndDrop::SOURCE_AGENT,
- LLUUID::null);
+ LLUUID::null,
+ false);
}
else // not an inventory item
{
@@ -1959,26 +1960,30 @@ bool LLSelectMgr::selectionSetGLTFMaterial(const LLUUID& mat_id)
{
return false;
}
- if (mItem && objectp->isAttachment())
+ LLUUID asset_id = mMatId;
+ if (mItem)
{
const LLPermissions& perm = mItem->getPermissions();
- bool unrestricted = ((perm.getMaskBase() & PERM_ITEM_UNRESTRICTED) == PERM_ITEM_UNRESTRICTED) ? true : false;
- if (!unrestricted)
+ bool from_library = perm.getOwner() == ALEXANDRIA_LINDEN_ID;
+ if (objectp->isAttachment())
{
- // Attachments are in world and in inventory simultaneously,
- // at the moment server doesn't support such a situation.
- return false;
+ bool unrestricted = (perm.getMaskBase() & PERM_ITEM_UNRESTRICTED) == PERM_ITEM_UNRESTRICTED;
+
+ if (!unrestricted && !from_library)
+ {
+ // Attachments are in world and in inventory simultaneously,
+ // at the moment server doesn't support such a situation.
+ return false;
+ }
}
- }
- LLUUID asset_id = mMatId;
- if (mItem)
- {
- // If success, the material may be copied into the object's inventory
- bool success = LLToolDragAndDrop::handleDropMaterialProtections(objectp, mItem, LLToolDragAndDrop::SOURCE_AGENT, LLUUID::null);
- if (!success)
+
+ if (!from_library
+ // Check if item may be copied into the object's inventory
+ && !LLToolDragAndDrop::handleDropMaterialProtections(objectp, mItem, LLToolDragAndDrop::SOURCE_AGENT, LLUUID::null))
{
return false;
}
+
asset_id = mItem->getAssetUUID();
if (asset_id.isNull())
{
@@ -1994,11 +1999,13 @@ bool LLSelectMgr::selectionSetGLTFMaterial(const LLUUID& mat_id)
};
bool success = true;
- if (item &&
- (!item->getPermissions().allowOperationBy(PERM_COPY, gAgent.getID()) ||
+ if (item
+ && (!item->getPermissions().allowOperationBy(PERM_COPY, gAgent.getID()) ||
!item->getPermissions().allowOperationBy(PERM_TRANSFER, gAgent.getID()) ||
!item->getPermissions().allowOperationBy(PERM_MODIFY, gAgent.getID())
- ))
+ )
+ && item->getPermissions().getOwner() != ALEXANDRIA_LINDEN_ID
+ )
{
success = success && getSelection()->applyRestrictedPbrMaterialToTEs(item);
}