From e8dd027586a59cdef6ca20f1bedac92ba1e31f87 Mon Sep 17 00:00:00 2001 From: ziree Date: Fri, 21 Jun 2019 17:52:00 +0200 Subject: [PATCH 01/46] Added Texture Refresh function to inventory context menu for worn attachments. --- indra/newview/llinventorybridge.cpp | 44 +++++++ indra/newview/llviewermenu.cpp | 117 ++++++++++-------- indra/newview/llviewermenu.h | 2 + .../skins/default/xui/en/menu_inventory.xml | 8 ++ 4 files changed, 116 insertions(+), 55 deletions(-) diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 2b85c62edb..8553f10f4f 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -6793,6 +6793,37 @@ void handle_attachment_touch(const LLUUID& idItem) } // +// Texture Refresh on worn attachments +void handle_attachment_texture_refresh(const LLUUID& idItem) +{ + // get the associated worn attachment's UUID + const LLInventoryItem* pItem = gInventory.getItem(idItem); + if ( (!isAgentAvatarValid()) || (!pItem) ) + { + return; + } + + LLViewerObject* pAttachObj = gAgentAvatarp->getWornAttachment(pItem->getLinkedUUID()); + if (!pAttachObj) + return; + + // iterate through the list of child prims, call texture refresh on each one of them + LLViewerObject::const_child_list_t& children = pAttachObj->getChildren(); + for (LLViewerObject::child_list_t::const_iterator iter = children.begin(); + iter != children.end(); iter++) + { + LLViewerObject* child = *iter; + + // NULL means, we don't have individual texture faces selected, + // so refresh them all + handle_object_tex_refresh(child, NULL); + } + + // texture refresh the root prim, too + handle_object_tex_refresh(pAttachObj, NULL); +} +// + // virtual void LLObjectBridge::performAction(LLInventoryModel* model, std::string action) { @@ -6839,6 +6870,12 @@ void LLObjectBridge::performAction(LLInventoryModel* model, std::string action) handle_attachment_touch(mUUID); } // + // Texture Refresh on worn attachments + else if ("texture_refresh_attachment" == action) + { + handle_attachment_texture_refresh(mUUID); + } + // else if (isRemoveAction(action)) { LLAppearanceMgr::instance().removeItemFromAvatar(mUUID); @@ -7029,6 +7066,13 @@ void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags) if ( ((flags & FIRST_SELECTED_ITEM) == 0) || (!enable_attachment_touch(mUUID)) ) disabled_items.push_back(std::string("Touch Attachment")); + // Texture Refresh on worn attachments + if (item->getType() == LLAssetType::AT_OBJECT) + { + items.push_back(std::string("Texture Refresh Attachment")); + } + // + items.push_back(std::string("Detach From Yourself")); // [RLVa:KB] - Checked: 2010-02-27 (RLVa-1.2.0a) | Modified: RLVa-1.2.0a if ( (rlv_handler_t::isEnabled()) && (!gRlvAttachmentLocks.canDetach(item)) ) diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index bb502ea7e1..db15723267 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -3120,6 +3120,67 @@ void destroy_texture(const LLUUID& id) // will be used by the texture refresh f LLAppViewer::getTextureCache()->removeFromCache(id); } +void handle_object_tex_refresh(LLViewerObject* object, LLSelectNode* node) +{ + U8 te_count = object->getNumTEs(); + // map from texture ID to list of faces using it + typedef std::map< LLUUID, std::vector > map_t; + map_t faces_per_texture; + for (U8 i = 0; i < te_count; ++i) + { + // "node" will be NULL when invoked from inventory menu, + // otherwise it will hold the root node of the selection and we + // need to make sure only to refresh the selected faces + if (node && !node->isTESelected(i)) continue; + + LLViewerTexture* img = object->getTEImage(i); + faces_per_texture[img->getID()].push_back(i); + + if (object->getTE(i)->getMaterialParams().notNull()) + { + LLViewerTexture* norm_img = object->getTENormalMap(i); + faces_per_texture[norm_img->getID()].push_back(i); + + LLViewerTexture* spec_img = object->getTESpecularMap(i); + faces_per_texture[spec_img->getID()].push_back(i); + } + } + + map_t::iterator it; + for (it = faces_per_texture.begin(); it != faces_per_texture.end(); ++it) + { + destroy_texture(it->first); + } + + // Refresh sculpt texture + if (object->isSculpted()) + { + LLSculptParams *sculpt_params = (LLSculptParams *)object->getParameterEntry(LLNetworkData::PARAMS_SCULPT); + if (sculpt_params) + { + LLUUID sculpt_uuid = sculpt_params->getSculptTexture(); + + LLViewerFetchedTexture* tx = LLViewerTextureManager::getFetchedTexture(sculpt_uuid); + if (tx) + { + S32 num_volumes = tx->getNumVolumes(LLRender::SCULPT_TEX); + const LLViewerTexture::ll_volume_list_t* pVolumeList = tx->getVolumeList(LLRender::SCULPT_TEX); + + destroy_texture(sculpt_uuid); + + for (S32 idxVolume = 0; idxVolume < num_volumes; ++idxVolume) + { + LLVOVolume* pVolume = pVolumeList->at(idxVolume); + if (pVolume) + { + pVolume->notifyMeshLoaded(); + } + } + } + } + } +} + class LLObjectTexRefresh : public view_listener_t { bool handleEvent(const LLSD& userdata) @@ -3129,61 +3190,7 @@ class LLObjectTexRefresh : public view_listener_t iter != LLSelectMgr::getInstance()->getSelection()->valid_end(); iter++) { LLSelectNode* node = *iter; - - U8 te_count = node->getObject()->getNumTEs(); - // map from texture ID to list of faces using it - typedef std::map< LLUUID, std::vector > map_t; - map_t faces_per_texture; - for (U8 i = 0; i < te_count; ++i) - { - if (!node->isTESelected(i)) continue; - - LLViewerTexture* img = node->getObject()->getTEImage(i); - faces_per_texture[img->getID()].push_back(i); - - if (node->getObject()->getTE(i)->getMaterialParams().notNull()) - { - LLViewerTexture* norm_img = node->getObject()->getTENormalMap(i); - faces_per_texture[norm_img->getID()].push_back(i); - - LLViewerTexture* spec_img = node->getObject()->getTESpecularMap(i); - faces_per_texture[spec_img->getID()].push_back(i); - } - } - - map_t::iterator it; - for (it = faces_per_texture.begin(); it != faces_per_texture.end(); ++it) - { - destroy_texture(it->first); - } - - // Refresh sculpt texture - if (node->getObject()->isSculpted()) - { - LLSculptParams *sculpt_params = (LLSculptParams *)node->getObject()->getParameterEntry(LLNetworkData::PARAMS_SCULPT); - if (sculpt_params) - { - LLUUID sculpt_uuid = sculpt_params->getSculptTexture(); - - LLViewerFetchedTexture* tx = LLViewerTextureManager::getFetchedTexture(sculpt_uuid); - if (tx) - { - S32 num_volumes = tx->getNumVolumes(LLRender::SCULPT_TEX); - const LLViewerTexture::ll_volume_list_t* pVolumeList = tx->getVolumeList(LLRender::SCULPT_TEX); - - destroy_texture(sculpt_uuid); - - for (S32 idxVolume = 0; idxVolume < num_volumes; ++idxVolume) - { - LLVOVolume* pVolume = pVolumeList->at(idxVolume); - if (pVolume) - { - pVolume->notifyMeshLoaded(); - } - } - } - } - } + handle_object_tex_refresh(node->getObject(),node); } return true; diff --git a/indra/newview/llviewermenu.h b/indra/newview/llviewermenu.h index d40dcdfce4..b84d55ff83 100644 --- a/indra/newview/llviewermenu.h +++ b/indra/newview/llviewermenu.h @@ -38,6 +38,7 @@ class LLView; class LLParcelSelection; class LLObjectSelection; class LLSelectNode; +class LLViewerObject; // [RLVa:KB] - Checked: RLVa-2.0.0 void set_use_wireframe(bool useWireframe); @@ -103,6 +104,7 @@ void handle_object_build(void*); void handle_object_touch(); bool enable_object_open(); void handle_object_open(); +void handle_object_tex_refresh(LLViewerObject* object, LLSelectNode* node); bool visible_take_object(); bool tools_visible_take_object(); diff --git a/indra/newview/skins/default/xui/en/menu_inventory.xml b/indra/newview/skins/default/xui/en/menu_inventory.xml index fd6853a102..fe026e75e3 100644 --- a/indra/newview/skins/default/xui/en/menu_inventory.xml +++ b/indra/newview/skins/default/xui/en/menu_inventory.xml @@ -855,6 +855,14 @@ function="Inventory.DoToSelected" parameter="touch" /> + + + Date: Fri, 21 Jun 2019 18:18:32 +0200 Subject: [PATCH 02/46] Update German translation --- indra/newview/skins/default/xui/de/menu_inventory.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/newview/skins/default/xui/de/menu_inventory.xml b/indra/newview/skins/default/xui/de/menu_inventory.xml index fa9ddbca2d..a3dba2c65d 100644 --- a/indra/newview/skins/default/xui/de/menu_inventory.xml +++ b/indra/newview/skins/default/xui/de/menu_inventory.xml @@ -110,6 +110,7 @@ + From ac287a4a68a78410134139926df83606f6dc6665 Mon Sep 17 00:00:00 2001 From: PanteraPolnocy Date: Fri, 21 Jun 2019 19:40:20 +0200 Subject: [PATCH 03/46] Updated Polish translation --- indra/newview/skins/default/xui/pl/floater_fs_im_session.xml | 3 +++ indra/newview/skins/default/xui/pl/menu_inventory.xml | 1 + indra/newview/skins/default/xui/pl/notifications.xml | 2 ++ 3 files changed, 6 insertions(+) diff --git a/indra/newview/skins/default/xui/pl/floater_fs_im_session.xml b/indra/newview/skins/default/xui/pl/floater_fs_im_session.xml index 4b2fa57d5e..769a192546 100644 --- a/indra/newview/skins/default/xui/pl/floater_fs_im_session.xml +++ b/indra/newview/skins/default/xui/pl/floater_fs_im_session.xml @@ -45,6 +45,9 @@ + + + diff --git a/indra/newview/skins/default/xui/pl/menu_inventory.xml b/indra/newview/skins/default/xui/pl/menu_inventory.xml index d0f199fcae..e0bbb713d1 100644 --- a/indra/newview/skins/default/xui/pl/menu_inventory.xml +++ b/indra/newview/skins/default/xui/pl/menu_inventory.xml @@ -108,6 +108,7 @@ + diff --git a/indra/newview/skins/default/xui/pl/notifications.xml b/indra/newview/skins/default/xui/pl/notifications.xml index 7ee7bf4632..f554fbd9c1 100644 --- a/indra/newview/skins/default/xui/pl/notifications.xml +++ b/indra/newview/skins/default/xui/pl/notifications.xml @@ -3911,6 +3911,8 @@ Powód: [SANITY_COMMENT] Obecne ustawienie: [CURRENT_VALUE]
+