diff options
author | Cosmic Linden <cosmic@lindenlab.com> | 2023-03-07 14:49:44 -0800 |
---|---|---|
committer | Cosmic Linden <cosmic@lindenlab.com> | 2023-03-07 14:49:44 -0800 |
commit | f2c49654d84113ab1be426cf5b9f6d03ffebaff3 (patch) | |
tree | 8a5de10be3978288267e66c8318f86675f69f42d /indra/newview/llselectmgr.cpp | |
parent | baed7a64049901c6756180450da7692891bceb6f (diff) |
Revert "SL-19128: Cleanup"
This reverts commit baed7a64049901c6756180450da7692891bceb6f.
Diffstat (limited to 'indra/newview/llselectmgr.cpp')
-rw-r--r-- | indra/newview/llselectmgr.cpp | 48 |
1 files changed, 36 insertions, 12 deletions
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 { |