From f2c49654d84113ab1be426cf5b9f6d03ffebaff3 Mon Sep 17 00:00:00 2001 From: Cosmic Linden Date: Tue, 7 Mar 2023 14:49:44 -0800 Subject: Revert "SL-19128: Cleanup" This reverts commit baed7a64049901c6756180450da7692891bceb6f. --- indra/newview/llselectmgr.cpp | 48 ++++++++++++++++++++++++++++++++----------- 1 file changed, 36 insertions(+), 12 deletions(-) (limited to 'indra') diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index a5f857395a..30a7f34ea8 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -1847,11 +1847,21 @@ void LLSelectMgr::selectionSetImage(const LLUUID& imageid) } if (mItem) { - LLToolDragAndDrop::dropTextureOneFace(objectp, - te, - mItem, - LLToolDragAndDrop::SOURCE_AGENT, - LLUUID::null); + if (te == -1) // all faces + { + LLToolDragAndDrop::dropTextureAllFaces(objectp, + mItem, + LLToolDragAndDrop::SOURCE_AGENT, + LLUUID::null); + } + else // one face + { + LLToolDragAndDrop::dropTextureOneFace(objectp, + te, + mItem, + LLToolDragAndDrop::SOURCE_AGENT, + LLUUID::null); + } } else // not an inventory item { @@ -1921,14 +1931,21 @@ void LLSelectMgr::selectionSetGLTFMaterial(const LLUUID& mat_id) f(LLViewerInventoryItem* item, const LLUUID& id) : mItem(item), mMatId(id) {} bool apply(LLViewerObject* objectp, S32 te) { - LLUUID asset_id = mMatId; - // 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 (objectp && !objectp->permModify()) { return false; } - asset_id = mItem->getAssetUUID(); + 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) + { + return false; + } + asset_id = mItem->getAssetUUID(); + } // Blank out most override data on the object and send to server objectp->setRenderMaterialID(te, asset_id); @@ -1937,8 +1954,15 @@ void LLSelectMgr::selectionSetGLTFMaterial(const LLUUID& mat_id) } }; - f setfunc(item, mat_id); - getSelection()->applyToTEs(&setfunc); + if (item && !item->getPermissions().allowOperationBy(PERM_COPY, gAgent.getID())) + { + getSelection()->applyNoCopyPbrMaterialToTEs(item); + } + else + { + f setfunc(item, mat_id); + getSelection()->applyToTEs(&setfunc); + } struct g : public LLSelectedObjectFunctor { -- cgit v1.2.3