diff options
author | Jonathan "Geenz" Goodman <geenz@geenzo.com> | 2024-01-24 14:37:33 -0800 |
---|---|---|
committer | Jonathan "Geenz" Goodman <geenz@geenzo.com> | 2024-01-24 14:37:33 -0800 |
commit | 373b06398c274eee476e4aa9c35b9c6327f9d45f (patch) | |
tree | 4a324b36ab896d9507374e71e15f9ec064b41add /indra/newview/llselectmgr.cpp | |
parent | bd9c0a2e658e183bb8a321cdce546f10b6d76afe (diff) | |
parent | c22aefafb3d05be37965361913c02568fa10adf6 (diff) |
Merge remote-tracking branch 'origin/release/materials_featurette' into DRTVWR-583
Diffstat (limited to 'indra/newview/llselectmgr.cpp')
-rw-r--r-- | indra/newview/llselectmgr.cpp | 48 |
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; |