diff options
Diffstat (limited to 'indra/newview/llselectmgr.cpp')
-rw-r--r-- | indra/newview/llselectmgr.cpp | 48 |
1 files changed, 29 insertions, 19 deletions
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 4745bda641..b50c0f60bd 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); } @@ -4308,9 +4315,12 @@ BOOL LLSelectMgr::selectGetAggregateTexturePermissions(LLAggregatePermissions& r BOOL LLSelectMgr::isMovableAvatarSelected() { - if (mAllowSelectAvatar) + if (mAllowSelectAvatar && getSelection()->getObjectCount() == 1) { - return (getSelection()->getObjectCount() == 1) && (getSelection()->getFirstRootObject()->isAvatar()) && getSelection()->getFirstMoveableNode(TRUE); + // nothing but avatar should be selected, so check that + // there is only one selected object and it is a root + LLViewerObject* obj = getSelection()->getFirstRootObject(); + return obj && obj->isAvatar() && getSelection()->getFirstMoveableNode(TRUE); } return FALSE; } |