From a4030031f895f8497e106f0547eb29780d6ec4e9 Mon Sep 17 00:00:00 2001 From: Cosmic Linden Date: Fri, 21 Jul 2023 17:28:09 -0700 Subject: SL-20024: Do not show material preview for no-modify materials --- indra/newview/app_settings/settings.xml | 2 +- indra/newview/llpanelface.cpp | 16 +++++++++------- indra/newview/skins/default/xui/en/notifications.xml | 12 ++++++++++++ 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 0cd63d9d5f..b92a829f36 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -250,7 +250,7 @@ TextureLivePreview Comment - Preview selections in texture picker immediately + Preview selections in texture picker or material picker immediately Persist 1 Type 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"); } } } diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index ca07aacb21..bbc3798034 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -9209,6 +9209,18 @@ We cannot display a preview of this texture because it is no-copy and/or no-tran yestext="OK"/> + + +We cannot display a preview of this material because it is no-copy, no-transfer, and/or no-modify. + + +