summaryrefslogtreecommitdiff
path: root/indra/newview/llselectmgr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llselectmgr.cpp')
-rw-r--r--indra/newview/llselectmgr.cpp48
1 files changed, 30 insertions, 18 deletions
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp
index c86e43333c..c2e3857af0 100644
--- a/indra/newview/llselectmgr.cpp
+++ b/indra/newview/llselectmgr.cpp
@@ -1959,26 +1959,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 +1998,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);
}
@@ -5830,13 +5836,19 @@ void LLSelectMgr::processObjectProperties(LLMessageSystem* msg, void** user_data
}
else
{
+ // save texture data as soon as we get texture perms first time
+ bool save_textures = !node->mValid;
if (node->mInventorySerial != inv_serial && node->getObject())
{
node->getObject()->dirtyInventory();
+
+ // Even if this isn't object's first udpate, inventory changed
+ // and some of the applied textures might have been in inventory
+ // so update texture list.
+ save_textures = true;
}
- // save texture data as soon as we get texture perms first time
- if (!node->mValid)
+ if (save_textures)
{
BOOL can_copy = FALSE;
BOOL can_transfer = FALSE;