diff options
author | Cosmic Linden <cosmic@lindenlab.com> | 2023-07-21 17:28:09 -0700 |
---|---|---|
committer | Cosmic Linden <cosmic@lindenlab.com> | 2023-08-11 16:30:59 -0700 |
commit | a4030031f895f8497e106f0547eb29780d6ec4e9 (patch) | |
tree | b94d9eb98e0a8073ea87feaa40f4f9a0928a5574 /indra/newview/llpanelface.cpp | |
parent | e7e565dc6e7e0c666132ffffa4798b2cfc00d6a4 (diff) |
SL-20024: Do not show material preview for no-modify materials
Diffstat (limited to 'indra/newview/llpanelface.cpp')
-rw-r--r-- | indra/newview/llpanelface.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index b633ccc5d5..e91b14a453 100644 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -3094,6 +3094,7 @@ void LLPanelFace::onSelectPbr(const LLSD& data) id = pbr_ctrl->getImageAssetID(); } if (!LLSelectMgr::getInstance()->selectionSetGLTFMaterial(id)) + { refresh(); } } @@ -4989,23 +4990,24 @@ void LLPanelFace::onPbrSelectionChanged(LLInventoryItem* itemp) LLSaleInfo sale_info; LLSelectMgr::instance().selectGetSaleInfo(sale_info); - bool can_copy = itemp->getPermissions().allowCopyBy(gAgentID); // do we have perm to copy this texture? - bool can_transfer = itemp->getPermissions().allowOperationBy(PERM_TRANSFER, gAgentID); // do we have perm to transfer this texture? - bool is_object_owner = gAgentID == obj_owner_id; // does object for which we are going to apply texture belong to the agent? - bool not_for_sale = !sale_info.isForSale(); // is object for which we are going to apply texture not for sale? + bool can_copy = itemp->getPermissions().allowCopyBy(gAgentID); // do we have perm to copy this material? + bool can_transfer = itemp->getPermissions().allowOperationBy(PERM_TRANSFER, gAgentID); // do we have perm to transfer this material? + bool can_modify = itemp->getPermissions().allowOperationBy(PERM_MODIFY, gAgentID); // do we have perm to transfer this material? + bool is_object_owner = gAgentID == obj_owner_id; // does object for which we are going to apply material belong to the agent? + bool not_for_sale = !sale_info.isForSale(); // is object for which we are going to apply material not for sale? - if (can_copy && can_transfer) + if (can_copy && can_transfer && can_modify) { pbr_ctrl->setCanApply(true, true); return; } - // if texture has (no-transfer) attribute it can be applied only for object which we own and is not for sale + // if material has (no-transfer) attribute it can be applied only for object which we own and is not for sale pbr_ctrl->setCanApply(false, can_transfer ? true : is_object_owner && not_for_sale); if (gSavedSettings.getBOOL("TextureLivePreview")) { - LLNotificationsUtil::add("LivePreviewUnavailable"); + LLNotificationsUtil::add("LivePreviewUnavailablePBR"); } } } |