From 63c4b196133ffbce6bb5994b62ddadaa9f2c9e44 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Fri, 9 May 2025 23:33:11 +0200 Subject: [PATCH 01/15] Fix attachment counter in Appearance window not counting temp attachments which count towards the attachment limit --- indra/newview/llpaneloutfitsinventory.cpp | 19 ++++++++++++++++++- indra/newview/llpaneloutfitsinventory.h | 6 ++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp index 084d2cc2de..3d286984b6 100644 --- a/indra/newview/llpaneloutfitsinventory.cpp +++ b/indra/newview/llpaneloutfitsinventory.cpp @@ -107,6 +107,9 @@ bool LLPanelOutfitsInventory::postBuild() getChild(SAVE_BTN)->setCommitCallback(boost::bind(&LLPanelOutfitsInventory::saveOutfit, this, false)); getChild(SAVE_AS_BTN)->setCommitCallback(boost::bind(&LLPanelOutfitsInventory::saveOutfit, this, true)); + // FIRE-17626: Attachment count in appearance floater + mTempAttachmentUpdateTimer.start(); + return true; } @@ -252,6 +255,20 @@ void LLPanelOutfitsInventory::onSave() } // FIRE-17626: Attachment count in appearance floater +void LLPanelOutfitsInventory::draw() +{ + if (mTempAttachmentUpdateTimer.checkExpirationAndReset(1.f)) + { + if (U32 tempAttachmentCount = (U32)LLAgentWearables::getTempAttachments().size(); tempAttachmentCount != mCurrentTempAttachmentCount) + { + mCurrentTempAttachmentCount = tempAttachmentCount; + onCOFChanged(); + } + } + + LLPanel::draw(); +} + void LLPanelOutfitsInventory::onCOFChanged() { if (!isAgentAvatarValid()) @@ -264,7 +281,7 @@ void LLPanelOutfitsInventory::onCOFChanged() LLInventoryModel::cat_array_t cats; LLIsType is_of_type(LLAssetType::AT_OBJECT); gInventory.collectDescendentsIf(cof, cats, obj_items, LLInventoryModel::EXCLUDE_TRASH, is_of_type); - U32 attachments = static_cast(obj_items.size()); + U32 attachments = static_cast(obj_items.size()) + mCurrentTempAttachmentCount; LLStringUtil::format_map_t args; args["COUNT"] = llformat("%d", attachments); diff --git a/indra/newview/llpaneloutfitsinventory.h b/indra/newview/llpaneloutfitsinventory.h index f834a8d45c..e8b2221874 100644 --- a/indra/newview/llpaneloutfitsinventory.h +++ b/indra/newview/llpaneloutfitsinventory.h @@ -50,6 +50,8 @@ public: /*virtual*/ bool postBuild(); /*virtual*/ void onOpen(const LLSD& key); + void draw(); // FIRE-17626: Attachment count in appearance floater + void onSearchEdit(const std::string& string); void onSave(); void saveOutfit(bool as_new = false); @@ -82,6 +84,10 @@ private: // FIRE-17626: Attachment count in appearance floater LLInventoryCategoriesObserver* mCategoriesObserver; void onCOFChanged(); + + U32 mCurrentTempAttachmentCount{ 0 }; + + LLFrameTimer mTempAttachmentUpdateTimer; // ////////////////////////////////////////////////////////////////////////////////// From 9535ac76b9e17470288d8d07f7a381185203bb05 Mon Sep 17 00:00:00 2001 From: PanteraPolnocy Date: Sun, 11 May 2025 19:23:33 +0200 Subject: [PATCH 02/15] FIRE-35491 Japanese installer translation update, by Logue Takacs --- indra/newview/installers/windows/lang_ja.nsi | Bin 13222 -> 13178 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/indra/newview/installers/windows/lang_ja.nsi b/indra/newview/installers/windows/lang_ja.nsi index e1417c2260968756e5b13b3fc44d0a8c465e4c71..9033ee6c1b98aa24d33a386aa2a28ab901895fe2 100755 GIT binary patch delta 206 zcmZ3M{wr<6E~d#}SS2P$G09E-#N;qph(~U+0Gq(%FU(4tTbL)XfF<=frcHifBr*9O z#}uFfoy`k4zpzdYVpp2HgMSM9B!lj$rz68Bi%QB*t`gWc*-G%jN3hjH^K^)1{0L;*;g delta 225 zcmeyBwk&t;gTmxOG2zV*)Ms%601voE@&Et; From a2b59ce6f77725c99df2f4d36d2b0463bc28fd9e Mon Sep 17 00:00:00 2001 From: chanayane Date: Mon, 12 May 2025 00:49:25 +0200 Subject: [PATCH 03/15] fix potential crashes in AO panel when double-clicking (should fix FIRE-35293) --- indra/newview/ao.cpp | 56 ++++++++++++++++++++++++++++++++------ indra/newview/aoengine.cpp | 27 +++++++++++++----- 2 files changed, 68 insertions(+), 15 deletions(-) diff --git a/indra/newview/ao.cpp b/indra/newview/ao.cpp index f0fb99875f..f3b3e390f7 100644 --- a/indra/newview/ao.cpp +++ b/indra/newview/ao.cpp @@ -871,8 +871,23 @@ void FloaterAO::onAnimationChanged(const LLUUID& animation) if (mCurrentBoldItem) { - ((LLScrollListIcon*)mCurrentBoldItem->getColumn(0))->setValue("FSAO_Animation_Stopped"); - ((LLScrollListText*)mCurrentBoldItem->getColumn(1))->setFontStyle(LLFontGL::NORMAL); +// Safer casts + if (LLScrollListCell* icon_cell = mCurrentBoldItem->getColumn(0)) + { + if (LLScrollListIcon* icon = dynamic_cast(icon_cell)) + { + icon->setValue("FSAO_Animation_Stopped"); + } + } + + if (LLScrollListCell* text_cell = mCurrentBoldItem->getColumn(1)) + { + if (LLScrollListText* text = dynamic_cast(text_cell)) + { + text->setFontStyle(LLFontGL::NORMAL); + } + } +// mCurrentBoldItem = nullptr; } @@ -882,21 +897,46 @@ void FloaterAO::onAnimationChanged(const LLUUID& animation) return; } - // why do we have no LLScrollListCtrl::getItemByUserdata() ? -Zi - for (auto item : mAnimationList->getAllData()) +// Fix potential nullptr + if (!mAnimationList) { - LLUUID* id = (LLUUID*)item->getUserdata(); + LL_WARNS("AO") << "Animation list control is null." << LL_ENDL; + return; + } +// - if (id == &animation) +// Safer casts + // why do we have no LLScrollListCtrl::getItemByUserdata() ? -Zi + for (LLScrollListItem* item : mAnimationList->getAllData()) + { + LLUUID* id = static_cast(item->getUserdata()); + // compares the LLUUID values instead of pointer values + //if (id == &animation) + if (id && *id == animation) + // { mCurrentBoldItem = item; - ((LLScrollListIcon*)mCurrentBoldItem->getColumn(0))->setValue("FSAO_Animation_Playing"); - ((LLScrollListText*)mCurrentBoldItem->getColumn(1))->setFontStyle(LLFontGL::BOLD); + if (LLScrollListCell* icon_cell = mCurrentBoldItem->getColumn(0)) + { + if (LLScrollListIcon* icon = dynamic_cast(icon_cell)) + { + icon->setValue("FSAO_Animation_Playing"); + } + } + + if (LLScrollListCell* text_cell = mCurrentBoldItem->getColumn(1)) + { + if (LLScrollListText* text = dynamic_cast(text_cell)) + { + text->setFontStyle(LLFontGL::BOLD); + } + } return; } } +// } // virtual diff --git a/indra/newview/aoengine.cpp b/indra/newview/aoengine.cpp index 677097427d..19b53d3ba1 100644 --- a/indra/newview/aoengine.cpp +++ b/indra/newview/aoengine.cpp @@ -1014,12 +1014,21 @@ void AOEngine::playAnimation(const LLUUID& animation) // if we can find the original animation already right here, save its asset ID, otherwise this will // be tried again in AOSet::getAnimationForState() and/or AOEngine::cycle() + LLUUID newAnimation; if (item->getLinkedItem()) { - anim.mAssetUUID = item->getAssetUUID(); + newAnimation = item->getAssetUUID(); + //anim.mAssetUUID = item->getAssetUUID(); } - LLUUID newAnimation = anim.mAssetUUID; + if (newAnimation.isNull()) + { + LL_WARNS("AOEngine") << "New animation UUID is null for animation " << animation << LL_ENDL; + return; + } + anim.mAssetUUID = newAnimation; + + //LLUUID newAnimation = anim.mAssetUUID; LLUUID oldAnimation = state->mCurrentAnimationID; // don't do anything if the animation didn't change @@ -1031,7 +1040,7 @@ void AOEngine::playAnimation(const LLUUID& animation) mAnimationChangedSignal(LLUUID::null); // Searches for the index of the animation - U32 idx = -1; + S32 idx = -1; for (U32 i = 0; i < state->mAnimations.size(); i++) { if (state->mAnimations[i].mAssetUUID == newAnimation) @@ -1040,18 +1049,22 @@ void AOEngine::playAnimation(const LLUUID& animation) break; } } - if (idx < 0) + if (idx == -1) { - idx = 0; + LL_WARNS("AOEngine") << "Animation index not found for animation " << animation << LL_ENDL; + return; } - state->mCurrentAnimation = idx; + state->mCurrentAnimation = static_cast(idx); state->mCurrentAnimationID = newAnimation; if (newAnimation.notNull()) { LL_DEBUGS("AOEngine") << "requesting animation start for motion " << gAnimLibrary.animationName(mLastMotion) << ": " << newAnimation << LL_ENDL; gAgent.sendAnimationRequest(newAnimation, ANIM_REQUEST_START); - mAnimationChangedSignal(state->mAnimations[state->mCurrentAnimation].mInventoryUUID); + if (state->mCurrentAnimation < state->mAnimations.size()) + { + mAnimationChangedSignal(state->mAnimations[state->mCurrentAnimation].mInventoryUUID); + } } else { From 0f019128746d201b051b3b94287caad278d7d422 Mon Sep 17 00:00:00 2001 From: Beq Date: Mon, 12 May 2025 17:20:09 +0100 Subject: [PATCH 04/15] Make the pose overwrite confirmation a notification normalise the UI behaviour to use a notification. --- indra/newview/fsfloaterposer.cpp | 90 ++++++++++--------- indra/newview/fsfloaterposer.h | 2 + .../skins/default/xui/en/notifications.xml | 14 +++ 3 files changed, 66 insertions(+), 40 deletions(-) diff --git a/indra/newview/fsfloaterposer.cpp b/indra/newview/fsfloaterposer.cpp index f3d01fd6a9..22ac6d0a94 100644 --- a/indra/newview/fsfloaterposer.cpp +++ b/indra/newview/fsfloaterposer.cpp @@ -33,6 +33,7 @@ #include "llcheckboxctrl.h" #include "llcommonutils.h" #include "llcontrolavatar.h" +#include "llnotificationsutil.h" #include "lldiriterator.h" #include "llsdserialize.h" #include "llscrolllistctrl.h" @@ -61,7 +62,10 @@ constexpr std::string_view POSER_TRACKPAD_SENSITIVITY_SAVE_KEY = "FSPoserTrackpa constexpr std::string_view POSER_STOPPOSINGWHENCLOSED_SAVE_KEY = "FSPoserStopPosingWhenClosed"; constexpr std::string_view POSER_RESETBASEROTONEDIT_SAVE_KEY = "FSPoserResetBaseRotationOnEdit"; constexpr std::string_view POSER_SAVEEXTERNALFORMAT_SAVE_KEY = "FSPoserSaveExternalFileAlso"; -constexpr std::string_view POSER_SAVECONFIRMREQUIRED_SAVE_KEY = "FSPoserOnSaveConfirmOverwrite"; +constexpr std::string_view POSER_SAVECONFIRMREQUIRED_SAVE_KEY = "FSPoserOnSaveConfirmOverwrite"; +constexpr char ICON_SAVE_OK[] = "icon_rotation_is_own_work"; +constexpr char ICON_SAVE_FAILED[] = "icon_save_failed_button"; + } // namespace /// @@ -368,19 +372,8 @@ void FSFloaterPoser::onPoseFileSelect() mLoadPosesBtn->setLabel(getString("LoadPoseLabel")); } -void FSFloaterPoser::onClickPoseSave() +void FSFloaterPoser::doPoseSave(LLVOAvatar* avatar, const std::string& filename) { - std::string filename = mPoseSaveNameEditor->getValue().asString(); - if (filename.empty() && hasString("icon_save_failed_button")) - { - mSavePosesBtn->setImageOverlay(getString("icon_save_failed_button"), mSavePosesBtn->getImageOverlayHAlign()); - return; - } - - if (confirmFileOverwrite(filename)) - return; - - LLVOAvatar* avatar = getUiSelectedAvatar(); if (!avatar) return; @@ -393,43 +386,60 @@ void FSFloaterPoser::onClickPoseSave() if (getSavingToBvh()) savePoseToBvh(avatar, filename); - if (hasString("icon_rotation_is_own_work")) - mSavePosesBtn->setImageOverlay(getString("icon_rotation_is_own_work"), mSavePosesBtn->getImageOverlayHAlign()); + if (hasString(ICON_SAVE_OK)) + mSavePosesBtn->setImageOverlay(getString(ICON_SAVE_OK), mSavePosesBtn->getImageOverlayHAlign()); setSavePosesButtonText(!mPoserAnimator.allBaseRotationsAreZero(avatar)); } else { - if (hasString("icon_save_failed_button")) - mSavePosesBtn->setImageOverlay(getString("icon_save_failed_button"), mSavePosesBtn->getImageOverlayHAlign()); - } + if (hasString(ICON_SAVE_FAILED)) + mSavePosesBtn->setImageOverlay(getString(ICON_SAVE_FAILED), mSavePosesBtn->getImageOverlayHAlign()); + } } -bool FSFloaterPoser::confirmFileOverwrite(std::string fileName) +void FSFloaterPoser::onClickPoseSave() { - if (fileName.empty()) - return false; + std::string filename = mPoseSaveNameEditor->getValue().asString(); + if (filename.empty() && hasString(ICON_SAVE_FAILED)) + { + mSavePosesBtn->setImageOverlay(getString(ICON_SAVE_FAILED), mSavePosesBtn->getImageOverlayHAlign()); + return; + } + + LLVOAvatar* avatar = getUiSelectedAvatar(); + if (!avatar) + return; + + // if prompts are disabled or file doesn't exist, do the save immediately: + const bool prompt = gSavedSettings.getBOOL(POSER_SAVECONFIRMREQUIRED_SAVE_KEY); - if (!gSavedSettings.getBOOL(POSER_SAVECONFIRMREQUIRED_SAVE_KEY)) - return false; + std::string fullPath = gDirUtilp->getExpandedFilename( + LL_PATH_USER_SETTINGS, POSE_SAVE_SUBDIRECTORY, filename + POSE_INTERNAL_FORMAT_FILE_EXT); + const bool exists = gDirUtilp->fileExists(fullPath); - if (!hasString("icon_save_query")) - return false; - - if (mSavePosesBtn->getImageOverlay().notNull() && mSavePosesBtn->getImageOverlay()->getName() == getString("icon_save_query")) - return false; - - std::string fullSavePath = - gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, POSE_SAVE_SUBDIRECTORY, fileName + POSE_INTERNAL_FORMAT_FILE_EXT); - - if (!gDirUtilp->fileExists(fullSavePath)) - return false; - - mSavePosesBtn->setImageOverlay(getString("icon_save_query"), mSavePosesBtn->getImageOverlayHAlign()); - if (hasString("OverWriteLabel")) - mSavePosesBtn->setLabel(getString("OverWriteLabel")); - - return true; + if (!prompt || !exists) + { + // new file or no overwrite guard + doPoseSave(avatar, filename); + } + else + { + // show a modal dialog, passing the pose name along + LLSD args; + args["POSE_NAME"] = filename; + + LLNotificationsUtil::add("ConfirmPoserOverwrite", args, LLSD(), // no payload + [this, avatar, filename](const LLSD& notification, const LLSD& response) + { + if (LLNotificationsUtil::getSelectedOption(notification, response) == 0) + { + // user clicked “Yes” + doPoseSave(avatar, filename); + } + // else do nothing (cancel) + }); + } } void FSFloaterPoser::onMouseLeaveSavePoseBtn() diff --git a/indra/newview/fsfloaterposer.h b/indra/newview/fsfloaterposer.h index 14c7d90615..7e0e6c42e4 100644 --- a/indra/newview/fsfloaterposer.h +++ b/indra/newview/fsfloaterposer.h @@ -86,6 +86,8 @@ public: void redo() override { onRedoLastChange(); }; bool canRedo() const override { return true; } private: + // Helper function to encapsualte save logic + void doPoseSave(LLVOAvatar* avatar, const std::string& filename); bool postBuild() override; void onOpen(const LLSD& key) override; void onClose(bool app_quitting) override; diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index cdda3e7c74..3f098c782f 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -14662,4 +14662,18 @@ For detailed instructions on how to whitelist [APP_NAME] - including a list of f https://wiki.firestormviewer.org/antivirus_whitelisting + + + Overwrite existing pose “[POSE_NAME]”? + confirm + + + From 63dd86f57bfdb302cbaa60647f83d5a05e33c3cd Mon Sep 17 00:00:00 2001 From: Beq Date: Mon, 12 May 2025 19:30:53 +0100 Subject: [PATCH 05/15] Add "Streaming" to the version types reported in support groups --- indra/newview/fsfloaterim.cpp | 8 ++++++++ indra/newview/llversioninfo.cpp | 5 +++++ indra/newview/llversioninfo.h | 1 + 3 files changed, 14 insertions(+) diff --git a/indra/newview/fsfloaterim.cpp b/indra/newview/fsfloaterim.cpp index 136a626252..d0875ee3da 100644 --- a/indra/newview/fsfloaterim.cpp +++ b/indra/newview/fsfloaterim.cpp @@ -479,6 +479,10 @@ void FSFloaterIM::sendMsgFromInputEditor(EChatType type) { str_version_tag = "Release"; } + else if( viewer_maturity == LLVersionInfo::FSViewerMaturity::STREAMING_VIEWER ) + { + str_version_tag = "Streaming"; + } else if( viewer_maturity == LLVersionInfo::FSViewerMaturity::UNOFFICIAL_VIEWER ) { str_version_tag = "Unofficial"; @@ -502,6 +506,10 @@ void FSFloaterIM::sendMsgFromInputEditor(EChatType type) { str_version_tag = "Unofficial"; } + if( viewer_maturity == LLVersionInfo::FSViewerMaturity::STREAMING_VIEWER ) + { + str_version_tag = "Streaming"; + } else if( viewer_maturity != LLVersionInfo::FSViewerMaturity::RELEASE_VIEWER ) { str_version_tag = "pre-Release"; diff --git a/indra/newview/llversioninfo.cpp b/indra/newview/llversioninfo.cpp index e50758ba2a..3614a6b754 100644 --- a/indra/newview/llversioninfo.cpp +++ b/indra/newview/llversioninfo.cpp @@ -224,6 +224,7 @@ LLVersionInfo::FSViewerMaturity LLVersionInfo::getFSViewerMaturity() const static const boost::regex is_alpha_channel("\\bAlpha(x64)?\\b"); static const boost::regex is_release_channel("\\bRelease(x64)?\\b"); static const boost::regex is_nightly_channel("\\bNightly(x64)?\\b"); + static const boost::regex is_streaming_channel("\\bStreaming\\b"); if (ll_regex_search(channel, is_release_channel)) { @@ -245,6 +246,10 @@ LLVersionInfo::FSViewerMaturity LLVersionInfo::getFSViewerMaturity() const { maturity = FSViewerMaturity::NIGHTLY_VIEWER; } + else if (ll_regex_search(channel, is_streaming_channel)) + { + maturity = FSViewerMaturity::STREAMING_VIEWER; + } else { maturity = FSViewerMaturity::UNOFFICIAL_VIEWER; diff --git a/indra/newview/llversioninfo.h b/indra/newview/llversioninfo.h index d399dde814..5d1e90a654 100644 --- a/indra/newview/llversioninfo.h +++ b/indra/newview/llversioninfo.h @@ -119,6 +119,7 @@ public: BETA_VIEWER, NIGHTLY_VIEWER, RELEASE_VIEWER, + STREAMING_VIEWER, }; FSViewerMaturity getFSViewerMaturity() const; // From 94464cdeb6f90dc1130aec8456389d4667e0efbc Mon Sep 17 00:00:00 2001 From: Ansariel Date: Mon, 12 May 2025 20:32:14 +0200 Subject: [PATCH 06/15] Update German translation --- indra/newview/skins/default/xui/de/notifications.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/indra/newview/skins/default/xui/de/notifications.xml b/indra/newview/skins/default/xui/de/notifications.xml index 9291a40d2c..3eabe6de3f 100644 --- a/indra/newview/skins/default/xui/de/notifications.xml +++ b/indra/newview/skins/default/xui/de/notifications.xml @@ -5863,4 +5863,8 @@ Detaillierte Instruktionen zum whitelisten von [APP_NAME] - inklusive einer List https://wiki.firestormviewer.org/antivirus_whitelisting + + Bestehende Pose „[POSE_NAME]“ überschreiben? + + From 7e87933db30ac28f630bd6fcb04190b6f9152592 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Mon, 12 May 2025 22:00:32 +0200 Subject: [PATCH 07/15] Add additional performance tweaks already integrated in LL's develop branch --- indra/llappearance/llavatarappearance.h | 2 +- indra/llcharacter/llbvhloader.cpp | 2 +- indra/llcharacter/llbvhloader.h | 2 +- indra/llprimitive/lldaeloader.cpp | 2 +- indra/llprimitive/lldaeloader.h | 30 ++++++++++++------------- indra/llprimitive/llgltfloader.cpp | 26 ++++++++++----------- indra/llprimitive/llgltfloader.h | 24 ++++++++++---------- indra/llprimitive/llmodelloader.h | 2 +- indra/newview/llfloaterbvhpreview.cpp | 4 ++-- indra/newview/llfloaterbvhpreview.h | 2 +- indra/newview/llfloatermodelpreview.cpp | 2 +- indra/newview/llmodelpreview.cpp | 2 +- indra/newview/vjlocalmeshimportdae.cpp | 6 ++--- indra/newview/vjlocalmeshimportdae.h | 2 +- 14 files changed, 54 insertions(+), 54 deletions(-) diff --git a/indra/llappearance/llavatarappearance.h b/indra/llappearance/llavatarappearance.h index 25a51da03d..140116fc46 100644 --- a/indra/llappearance/llavatarappearance.h +++ b/indra/llappearance/llavatarappearance.h @@ -156,7 +156,7 @@ public: public: typedef std::vector avatar_joint_list_t; const avatar_joint_list_t& getSkeleton() { return mSkeleton; } - typedef std::map joint_alias_map_t; + typedef std::map> joint_alias_map_t; const joint_alias_map_t& getJointAliases(); diff --git a/indra/llcharacter/llbvhloader.cpp b/indra/llcharacter/llbvhloader.cpp index 20613ea771..e8cb1c9dfd 100644 --- a/indra/llcharacter/llbvhloader.cpp +++ b/indra/llcharacter/llbvhloader.cpp @@ -131,7 +131,7 @@ LLQuaternion::Order bvhStringToOrder( char *str ) // LLBVHLoader() //----------------------------------------------------------------------------- -LLBVHLoader::LLBVHLoader(const char* buffer, ELoadStatus &loadStatus, S32 &errorLine, std::map& joint_alias_map ) +LLBVHLoader::LLBVHLoader(const char* buffer, ELoadStatus &loadStatus, S32 &errorLine, std::map>& joint_alias_map ) { reset(); errorLine = 0; diff --git a/indra/llcharacter/llbvhloader.h b/indra/llcharacter/llbvhloader.h index 3fc49a3482..347e8ff416 100644 --- a/indra/llcharacter/llbvhloader.h +++ b/indra/llcharacter/llbvhloader.h @@ -227,7 +227,7 @@ class LLBVHLoader friend class LLKeyframeMotion; public: // Constructor - LLBVHLoader(const char* buffer, ELoadStatus &loadStatus, S32 &errorLine, std::map& joint_alias_map ); + LLBVHLoader(const char* buffer, ELoadStatus &loadStatus, S32 &errorLine, std::map>& joint_alias_map ); ~LLBVHLoader(); /* diff --git a/indra/llprimitive/lldaeloader.cpp b/indra/llprimitive/lldaeloader.cpp index 8d5d02aff0..d0ff1945ea 100644 --- a/indra/llprimitive/lldaeloader.cpp +++ b/indra/llprimitive/lldaeloader.cpp @@ -917,7 +917,7 @@ LLDAELoader::LLDAELoader( void* opaque_userdata, JointTransformMap& jointTransformMap, JointNameSet& jointsFromNodes, - std::map& jointAliasMap, + std::map>& jointAliasMap, U32 maxJointsPerMesh, U32 modelLimit, // mesh loader suffix configuration diff --git a/indra/llprimitive/lldaeloader.h b/indra/llprimitive/lldaeloader.h index d20422d5cb..a94605a652 100644 --- a/indra/llprimitive/lldaeloader.h +++ b/indra/llprimitive/lldaeloader.h @@ -49,22 +49,22 @@ public: dae_model_map mModelsMap; LLDAELoader( - std::string filename, - S32 lod, - LLModelLoader::load_callback_t load_cb, - LLModelLoader::joint_lookup_func_t joint_lookup_func, - LLModelLoader::texture_load_func_t texture_load_func, - LLModelLoader::state_callback_t state_cb, - void* opaque_userdata, - JointTransformMap& jointTransformMap, - JointNameSet& jointsFromNodes, - std::map& jointAliasMap, - U32 maxJointsPerMesh, - U32 modelLimit, + std::string filename, + S32 lod, + LLModelLoader::load_callback_t load_cb, + LLModelLoader::joint_lookup_func_t joint_lookup_func, + LLModelLoader::texture_load_func_t texture_load_func, + LLModelLoader::state_callback_t state_cb, + void* opaque_userdata, + JointTransformMap& jointTransformMap, + JointNameSet& jointsFromNodes, + std::map>& jointAliasMap, + U32 maxJointsPerMesh, + U32 modelLimit, // configrable lod suffix support - // bool preprocess); - bool preprocess, - const LODSuffixArray& lod_suffix); + // bool preprocess); + bool preprocess, + const LODSuffixArray& lod_suffix); // virtual ~LLDAELoader() ; diff --git a/indra/llprimitive/llgltfloader.cpp b/indra/llprimitive/llgltfloader.cpp index 480012699a..724b1a88b2 100644 --- a/indra/llprimitive/llgltfloader.cpp +++ b/indra/llprimitive/llgltfloader.cpp @@ -66,19 +66,19 @@ static const std::string lod_suffix[LLModel::NUM_LODS] = }; -LLGLTFLoader::LLGLTFLoader(std::string filename, - S32 lod, - LLModelLoader::load_callback_t load_cb, - LLModelLoader::joint_lookup_func_t joint_lookup_func, - LLModelLoader::texture_load_func_t texture_load_func, - LLModelLoader::state_callback_t state_cb, - void * opaque_userdata, - JointTransformMap & jointTransformMap, - JointNameSet & jointsFromNodes, - std::map &jointAliasMap, - U32 maxJointsPerMesh, - U32 modelLimit) //, - //bool preprocess) +LLGLTFLoader::LLGLTFLoader(std::string filename, + S32 lod, + LLModelLoader::load_callback_t load_cb, + LLModelLoader::joint_lookup_func_t joint_lookup_func, + LLModelLoader::texture_load_func_t texture_load_func, + LLModelLoader::state_callback_t state_cb, + void * opaque_userdata, + JointTransformMap & jointTransformMap, + JointNameSet & jointsFromNodes, + std::map> & jointAliasMap, + U32 maxJointsPerMesh, + U32 modelLimit) //, + //bool preprocess) : LLModelLoader( filename, lod, load_cb, diff --git a/indra/llprimitive/llgltfloader.h b/indra/llprimitive/llgltfloader.h index 66671d1c5a..848a07c1e4 100644 --- a/indra/llprimitive/llgltfloader.h +++ b/indra/llprimitive/llgltfloader.h @@ -121,18 +121,18 @@ class LLGLTFLoader : public LLModelLoader typedef std::map material_map; LLGLTFLoader(std::string filename, - S32 lod, - LLModelLoader::load_callback_t load_cb, - LLModelLoader::joint_lookup_func_t joint_lookup_func, - LLModelLoader::texture_load_func_t texture_load_func, - LLModelLoader::state_callback_t state_cb, - void * opaque_userdata, - JointTransformMap & jointTransformMap, - JointNameSet & jointsFromNodes, - std::map &jointAliasMap, - U32 maxJointsPerMesh, - U32 modelLimit); //, - //bool preprocess ); + S32 lod, + LLModelLoader::load_callback_t load_cb, + LLModelLoader::joint_lookup_func_t joint_lookup_func, + LLModelLoader::texture_load_func_t texture_load_func, + LLModelLoader::state_callback_t state_cb, + void * opaque_userdata, + JointTransformMap & jointTransformMap, + JointNameSet & jointsFromNodes, + std::map> &jointAliasMap, + U32 maxJointsPerMesh, + U32 modelLimit); //, + //bool preprocess ); virtual ~LLGLTFLoader(); virtual bool OpenFile(const std::string &filename); diff --git a/indra/llprimitive/llmodelloader.h b/indra/llprimitive/llmodelloader.h index f5783515fa..357672aa4e 100644 --- a/indra/llprimitive/llmodelloader.h +++ b/indra/llprimitive/llmodelloader.h @@ -36,7 +36,7 @@ class LLJoint; typedef std::map JointTransformMap; typedef std::map::iterator JointTransformMapIt; -typedef std::map JointMap; +typedef std::map> JointMap; typedef std::deque JointNameSet; const S32 SLM_SUPPORTED_VERSION = 3; diff --git a/indra/newview/llfloaterbvhpreview.cpp b/indra/newview/llfloaterbvhpreview.cpp index ce3627a136..e4aacedc62 100644 --- a/indra/newview/llfloaterbvhpreview.cpp +++ b/indra/newview/llfloaterbvhpreview.cpp @@ -217,7 +217,7 @@ void LLFloaterBvhPreview::setAnimCallbacks() getChild("ease_out_time")->setValidateBeforeCommit( boost::bind(&LLFloaterBvhPreview::validateEaseOut, this, _1)); } -std::map LLFloaterBvhPreview::getJointAliases() +std::map > LLFloaterBvhPreview::getJointAliases() { LLPointer av = (LLVOAvatar*)mAnimPreview->getDummyAvatar(); return av->getJointAliases(); @@ -337,7 +337,7 @@ bool LLFloaterBvhPreview::loadBVH() ELoadStatus load_status = E_ST_OK; S32 line_number = 0; - std::map joint_alias_map = getJointAliases(); + auto joint_alias_map = getJointAliases(); loaderp = new LLBVHLoader(file_buffer, load_status, line_number, joint_alias_map); std::string status = getString(STATUS[load_status]); diff --git a/indra/newview/llfloaterbvhpreview.h b/indra/newview/llfloaterbvhpreview.h index b677e4c1be..493b5b1db8 100644 --- a/indra/newview/llfloaterbvhpreview.h +++ b/indra/newview/llfloaterbvhpreview.h @@ -123,7 +123,7 @@ public: // private: void setAnimCallbacks() ; - std::map getJointAliases(); + std::map > getJointAliases(); // Reload animation from disk bool loadBVH(); diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 0fcd96dd8b..1edc6a52b2 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -1671,7 +1671,7 @@ void LLFloaterModelPreview::updateAvatarTab(bool highlight_overrides) { // Populate table - std::map joint_alias_map; + std::map> joint_alias_map; mModelPreview->getJointAliases(joint_alias_map); S32 conflicts = 0; diff --git a/indra/newview/llmodelpreview.cpp b/indra/newview/llmodelpreview.cpp index de1f34eadb..effb969636 100644 --- a/indra/newview/llmodelpreview.cpp +++ b/indra/newview/llmodelpreview.cpp @@ -1020,7 +1020,7 @@ void LLModelPreview::loadModel(std::string filename, S32 lod, bool force_disable clearGLODGroup(); } // - std::map joint_alias_map; + std::map> joint_alias_map; getJointAliases(joint_alias_map); LLHandle preview_handle = getHandle(); diff --git a/indra/newview/vjlocalmeshimportdae.cpp b/indra/newview/vjlocalmeshimportdae.cpp index 9d73b0c80c..fe80746ba0 100644 --- a/indra/newview/vjlocalmeshimportdae.cpp +++ b/indra/newview/vjlocalmeshimportdae.cpp @@ -471,7 +471,7 @@ bool LLLocalMeshImportDAE::processObject(domMesh* current_mesh, LLLocalMeshObjec } // Function to load the JointMap -JointMap loadJointMap() +static JointMap loadJointMap() { JointMap joint_map = gAgentAvatarp->getJointAliases(); @@ -483,7 +483,7 @@ JointMap loadJointMap() extra_names.insert(extra_names.end(), more_extra_names.begin(), more_extra_names.end()); // add the extras to jointmap - for (auto extra_name : extra_names) + for (const auto& extra_name : extra_names) { joint_map[extra_name] = extra_name; } @@ -1067,7 +1067,7 @@ bool LLLocalMeshImportDAE::processSkin(daeDatabase* collada_db, daeElement* coll return true; } -bool LLLocalMeshImportDAE::processSkeletonJoint(domNode* current_node, std::map& joint_map, std::map& joint_transforms, bool recurse_children) +bool LLLocalMeshImportDAE::processSkeletonJoint(domNode* current_node, std::map>& joint_map, std::map& joint_transforms, bool recurse_children) { // safety checks & name check const auto node_name = current_node->getName(); diff --git a/indra/newview/vjlocalmeshimportdae.h b/indra/newview/vjlocalmeshimportdae.h index 87582f4201..fb6b021e43 100644 --- a/indra/newview/vjlocalmeshimportdae.h +++ b/indra/newview/vjlocalmeshimportdae.h @@ -71,7 +71,7 @@ public: loadFile_return loadFile(LLLocalMeshFile* data, LLLocalMeshFileLOD lod); bool processObject(domMesh* current_mesh, LLLocalMeshObject* current_object); bool processSkin(daeDatabase* collada_db, daeElement* collada_document_root, domMesh* current_mesh, domSkin* current_skin, std::unique_ptr& current_object); - bool processSkeletonJoint(domNode* current_node, std::map& joint_map, std::map& joint_transforms, bool recurse_children=false); + bool processSkeletonJoint(domNode* current_node, std::map>& joint_map, std::map& joint_transforms, bool recurse_children=false); bool readMesh_CommonElements(const domInputLocalOffset_Array& inputs, int& offset_position, int& offset_normals, int& offset_uvmap, int& index_stride, From fccc010038e424b59ca5e3e18857fd432423e319 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Mon, 12 May 2025 22:13:29 +0200 Subject: [PATCH 08/15] Replace possibly missing std::less comparator with dynamic binding --- indra/llcharacter/llbvhloader.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/llcharacter/llbvhloader.cpp b/indra/llcharacter/llbvhloader.cpp index e8cb1c9dfd..68a369b8c2 100644 --- a/indra/llcharacter/llbvhloader.cpp +++ b/indra/llcharacter/llbvhloader.cpp @@ -156,9 +156,9 @@ LLBVHLoader::LLBVHLoader(const char* buffer, ELoadStatus &loadStatus, S32 &error } // Recognize all names we've been told are legal. - for (std::map::value_type& alias_pair : joint_alias_map) + for (const auto& [alias, joint] : joint_alias_map) { - makeTranslation( alias_pair.first , alias_pair.second ); + makeTranslation(alias, joint); } char error_text[128]; /* Flawfinder: ignore */ From 06871f92b153daa573534c582b05c8dc8f5cfc01 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Mon, 12 May 2025 23:06:10 +0200 Subject: [PATCH 09/15] Refactor some local mesh code --- indra/newview/vjfloaterlocalmesh.cpp | 104 ++++----- indra/newview/vjfloaterlocalmesh.h | 90 ++++---- indra/newview/vjlocalmesh.cpp | 70 +++--- indra/newview/vjlocalmesh.h | 304 ++++++++++++------------- indra/newview/vjlocalmeshimportdae.cpp | 15 -- indra/newview/vjlocalmeshimportdae.h | 22 +- 6 files changed, 272 insertions(+), 333 deletions(-) diff --git a/indra/newview/vjfloaterlocalmesh.cpp b/indra/newview/vjfloaterlocalmesh.cpp index f5bc191aab..1a2ee2c4d7 100644 --- a/indra/newview/vjfloaterlocalmesh.cpp +++ b/indra/newview/vjfloaterlocalmesh.cpp @@ -46,7 +46,7 @@ #include "vjfloaterlocalmesh.h" #include "vjlocalmesh.h" -static const S32 LOCAL_TRACKING_ID_COLUMN = 4; +static constexpr S32 LOCAL_TRACKING_ID_COLUMN = 4; /*================================*/ @@ -85,14 +85,16 @@ void LLFloaterLocalMeshFilePicker::notify(const std::vector& filena LLFloaterLocalMesh::LLFloaterLocalMesh(const LLSD & key) : LLFloater(key) { - mLastSelectedObject.setNull(); } -LLFloaterLocalMesh::~LLFloaterLocalMesh(void) = default; +LLFloaterLocalMesh::~LLFloaterLocalMesh() +{ + mObjectCreatedCallback.disconnect(); +} //static -void LLFloaterLocalMesh::onOpen(const LLSD & key) +void LLFloaterLocalMesh::onOpen(const LLSD& key) { reloadFileList(false); @@ -120,12 +122,12 @@ void LLFloaterLocalMesh::onSelectionChangedCallback() bool LLFloaterLocalMesh::postBuild() { - childSetAction("btn_add", LLFloaterLocalMesh::onBtnAdd, this); - childSetAction("btn_reload", LLFloaterLocalMesh::onBtnReload, this); - childSetAction("btn_remove", LLFloaterLocalMesh::onBtnRemove, this); - childSetAction("btn_apply", LLFloaterLocalMesh::onBtnApply, this); - childSetAction("btn_clear", LLFloaterLocalMesh::onBtnClear, this); - childSetAction("btn_rez", LLFloaterLocalMesh::onBtnRez, this); + getChild("btn_add")->setCommitCallback([this](LLUICtrl*, const LLSD&) { onBtnAdd(); }); + getChild("btn_reload")->setCommitCallback([this](LLUICtrl*, const LLSD&) { onBtnReload(); }); + getChild("btn_remove")->setCommitCallback([this](LLUICtrl*, const LLSD&) { onBtnRemove(); }); + getChild("btn_apply")->setCommitCallback([this](LLUICtrl*, const LLSD&) { onBtnApply(); }); + getChild("btn_clear")->setCommitCallback([this](LLUICtrl*, const LLSD&) { onBtnClear(); }); + getChild("btn_rez")->setCommitCallback([this](LLUICtrl*, const LLSD&) { onBtnRez(); }); mTabContainer = findChild("local_mesh_tabs"); if(mTabContainer) @@ -133,16 +135,15 @@ bool LLFloaterLocalMesh::postBuild() mLogPanel = mTabContainer->getChild("local_mesh_log"); mScrollCtrl = mTabContainer->getChild("l_name_list"); mScrollCtrl->setCommitCallback(boost::bind(&LLFloaterLocalMesh::onFileListCommitCallback, this)); - // mTabContainer->setCommitCallback(boost::bind(&LLFloaterLocalMesh::onTabChange, this)); } - getChild("lod_suffix_combo")->setCommitCallback(boost::bind(&LLFloaterLocalMesh::onSuffixStandardSelected, this, (LLUICtrl*)this)); + getChild("lod_suffix_combo")->setCommitCallback(boost::bind(&LLFloaterLocalMesh::onSuffixStandardSelected, this, _1)); reloadLowerUI(); return true; } -void LLFloaterLocalMesh::update_selected_target(LLUUID selected_id) +void LLFloaterLocalMesh::update_selected_target(const LLUUID& selected_id) { if ( selected_id != mLastSelectedObject ) { @@ -166,30 +167,23 @@ void LLFloaterLocalMesh::draw() LLFloater::draw(); } -void LLFloaterLocalMesh::onBtnAdd(void* userdata) +void LLFloaterLocalMesh::onBtnAdd() { - auto* self = (LLFloaterLocalMesh*)userdata; - (new LLFloaterLocalMeshFilePicker(self))->getFile(); + (new LLFloaterLocalMeshFilePicker(this))->getFile(); } -void LLFloaterLocalMesh::onBtnAddCallback(std::string filename) +void LLFloaterLocalMesh::onBtnAddCallback(const std::string& filename) { - static const bool try_lods {true}; + constexpr bool try_lods{ true }; LLLocalMeshSystem::getInstance()->addFile(filename, try_lods); showLog(); } -void LLFloaterLocalMesh::onBtnReload(void* userdata) +void LLFloaterLocalMesh::onBtnReload() { - auto* self = static_cast(userdata); - if (!self) - { - return; - } - - auto selected_item = self->mScrollCtrl->getFirstSelected(); + auto selected_item = mScrollCtrl->getFirstSelected(); if (!selected_item) { return; @@ -205,16 +199,10 @@ void LLFloaterLocalMesh::onBtnReload(void* userdata) LLLocalMeshSystem::getInstance()->reloadFile(selected_id); } -void LLFloaterLocalMesh::onBtnRemove(void* userdata) +void LLFloaterLocalMesh::onBtnRemove() { - auto* self = static_cast(userdata); - if (!self) - { - return; - } - // more checks necessary, apparently. - auto selected_item = self->mScrollCtrl->getFirstSelected(); + auto selected_item = mScrollCtrl->getFirstSelected(); if (!selected_item) { return; @@ -228,18 +216,12 @@ void LLFloaterLocalMesh::onBtnRemove(void* userdata) LLUUID selected_id = selected_column->getValue().asUUID(); LLLocalMeshSystem::getInstance()->deleteFile(selected_id); - self->reloadLowerUI(); + reloadLowerUI(); } -void LLFloaterLocalMesh::onBtnApply(void* userdata) +void LLFloaterLocalMesh::onBtnApply() { - auto* self = static_cast(userdata); - if (!self) - { - return; - } - - auto scroll_ctrl_selected_item = self->mScrollCtrl->getFirstSelected(); + auto scroll_ctrl_selected_item = mScrollCtrl->getFirstSelected(); if (!scroll_ctrl_selected_item) { return; @@ -252,14 +234,14 @@ void LLFloaterLocalMesh::onBtnApply(void* userdata) } // check combobox pointer - auto objectlist_combo_box = self->getChild("object_apply_list"); + auto objectlist_combo_box = getChild("object_apply_list"); if (!objectlist_combo_box) { return; } // make sure the selection is still valid, and if so - get id. - LLUUID selected_object_id = self->getCurrentSelectionIfValid(); + LLUUID selected_object_id = getCurrentSelectionIfValid(); if (selected_object_id.isNull()) { return; @@ -267,14 +249,13 @@ void LLFloaterLocalMesh::onBtnApply(void* userdata) // get selected local file id, object idx and use_scale boolean LLUUID file_id = scroll_ctrl_selected_column->getValue().asUUID(); - int object_idx = objectlist_combo_box->getFirstSelectedIndex(); + S32 object_idx = objectlist_combo_box->getFirstSelectedIndex(); // finally tell local mesh system to apply LLLocalMeshSystem::getInstance()->applyVObject(selected_object_id, file_id, object_idx, false); } -//static -void LLFloaterLocalMesh::onSuffixStandardSelected(LLUICtrl* ctrl, void* userdata) +void LLFloaterLocalMesh::onSuffixStandardSelected(LLUICtrl* ctrl) { S32 which{0}; // SL standard LODs are the reverse of every other game engine (LOD0 least detail) @@ -303,11 +284,10 @@ void LLFloaterLocalMesh::onSuffixStandardSelected(LLUICtrl* ctrl, void* userdata "HIGH", "PHYS" }; - auto * self = (LLFloaterLocalMesh *)ctrl; - if (LLCtrlSelectionInterface* iface = self->childGetSelectionInterface("lod_suffix_combo")) + if (auto cbx = dynamic_cast(ctrl)) { - which = iface->getFirstSelectedIndex(); + which = cbx->getFirstSelectedIndex(); } else { @@ -318,19 +298,19 @@ void LLFloaterLocalMesh::onSuffixStandardSelected(LLUICtrl* ctrl, void* userdata switch (which) { case 1: // SL - for (int i = 0; i < LLModel::NUM_LODS; i++) + for (S32 i = 0; i < LLModel::NUM_LODS; i++) { gSavedSettings.setString(LLModelPreview::sSuffixVarNames[i], sl_suffixes[i]); } break; case 2: // standard - for (int i = 0; i < LLModel::NUM_LODS; i++) + for (S32 i = 0; i < LLModel::NUM_LODS; i++) { gSavedSettings.setString(LLModelPreview::sSuffixVarNames[i], std_suffixes[i]); } break; case 3: // descriptive english - for (int i = 0; i < LLModel::NUM_LODS; i++) + for (S32 i = 0; i < LLModel::NUM_LODS; i++) { gSavedSettings.setString(LLModelPreview::sSuffixVarNames[i], desc_suffixes[i]); } @@ -341,15 +321,9 @@ void LLFloaterLocalMesh::onSuffixStandardSelected(LLUICtrl* ctrl, void* userdata }; } -void LLFloaterLocalMesh::onBtnClear(void* userdata) +void LLFloaterLocalMesh::onBtnClear() { - auto* self = static_cast(userdata); - if (!self) - { - return; - } - - LLUUID selected_object_id = self->getCurrentSelectionIfValid(); + LLUUID selected_object_id = getCurrentSelectionIfValid(); if (selected_object_id.isNull()) { return; @@ -443,11 +417,9 @@ bool LLFloaterLocalMesh::processPrimCreated(LLViewerObject* object) return true; } -void LLFloaterLocalMesh::onBtnRez(void* userdata) +void LLFloaterLocalMesh::onBtnRez() { - auto* self = (LLFloaterLocalMesh*)userdata; - - self->mObjectCreatedCallback = gObjectList.setNewObjectCallback(boost::bind(&LLFloaterLocalMesh::processPrimCreated, self, _1)); + mObjectCreatedCallback = gObjectList.setNewObjectCallback(boost::bind(&LLFloaterLocalMesh::processPrimCreated, this, _1)); LLToolMgr::getInstance()->getCurrentToolset()->selectTool( (LLTool *) LLToolCompCreate::getInstance()); } diff --git a/indra/newview/vjfloaterlocalmesh.h b/indra/newview/vjfloaterlocalmesh.h index 30c568c121..8e3f619452 100644 --- a/indra/newview/vjfloaterlocalmesh.h +++ b/indra/newview/vjfloaterlocalmesh.h @@ -28,61 +28,63 @@ #include "llfloater.h" #include "lltabcontainer.h" -class LLObjectSelection; +class LLObjectSelection; class LLFloaterLocalMeshFilePicker; class LLFloaterLocalMesh : public LLFloater { - public: - explicit LLFloaterLocalMesh(const LLSD& key); - ~LLFloaterLocalMesh(void) final; +public: + explicit LLFloaterLocalMesh(const LLSD& key); + ~LLFloaterLocalMesh() final; - void onOpen(const LLSD& key) final; - void onClose(bool app_quitting) final; - void onSelectionChangedCallback(); - bool postBuild() final; - void draw() final; + void onOpen(const LLSD& key) final; + void onClose(bool app_quitting) final; + void onSelectionChangedCallback(); + bool postBuild() final; + void draw() final; - /* add - loads a new file, adds it to the list and reads it. - reload - re-loads a selected file, reapplies it to viewer objects. - remove - clears all affected viewer objects and unloads selected file - apply - applies selected file onto a selected viewer object - clear - reverts a selected viewer object to it's normal state - show log/show list - toggles between loaded file list, and log. - */ - static void onBtnAdd(void* userdata); - void onBtnAddCallback(std::string filename); + /* add - loads a new file, adds it to the list and reads it. + reload - re-loads a selected file, reapplies it to viewer objects. + remove - clears all affected viewer objects and unloads selected file + apply - applies selected file onto a selected viewer object + clear - reverts a selected viewer object to it's normal state + show log/show list - toggles between loaded file list, and log. + */ + void onBtnAdd(); + void onBtnAddCallback(const std::string& filename); - static void onBtnReload(void* userdata); - static void onBtnRemove(void* userdata); - static void onBtnApply(void* userdata); - static void onBtnClear(void* userdata); - static void onBtnRez(void* userdata); - static void onSuffixStandardSelected(LLUICtrl* ctrl, void *userdata); + void onBtnReload(); + void onBtnRemove(); + void onBtnApply(); + void onBtnClear(); + void onBtnRez(); + void onSuffixStandardSelected(LLUICtrl* ctrl); - bool processPrimCreated(LLViewerObject* object); + bool processPrimCreated(LLViewerObject* object); - void reloadFileList(bool keep_selection); - void onFileListCommitCallback(); - void reloadLowerUI(); - void toggleSelectTool(bool toggle); - LLUUID getCurrentSelectionIfValid() const; + void reloadFileList(bool keep_selection); + void onFileListCommitCallback(); + void reloadLowerUI(); + void toggleSelectTool(bool toggle); + LLUUID getCurrentSelectionIfValid() const; - private: - void update_selected_target(LLUUID selected_id); - boost::signals2::connection mObjectCreatedCallback; - void showLog(); - LLTabContainer * mTabContainer; - LLTextEditor * mLogPanel; - LLScrollListCtrl * mScrollCtrl; - // llsafehandle is deprecated. - LLPointer mObjectSelection; +private: + void update_selected_target(const LLUUID& selected_id); + void showLog(); - // since we use this to check if selection changed, - // and since uuid seems like a safer way to check rather than - // comparing llvovolumes, we might as well refer to this - // when querying what is actually selected. - LLUUID mLastSelectedObject; + boost::signals2::connection mObjectCreatedCallback; + LLTabContainer* mTabContainer{ nullptr }; + LLTextEditor* mLogPanel{ nullptr }; + LLScrollListCtrl* mScrollCtrl{ nullptr }; + + // llsafehandle is deprecated. + LLPointer mObjectSelection{ nullptr }; + + // since we use this to check if selection changed, + // and since uuid seems like a safer way to check rather than + // comparing llvovolumes, we might as well refer to this + // when querying what is actually selected. + LLUUID mLastSelectedObject{ LLUUID::null }; }; diff --git a/indra/newview/vjlocalmesh.cpp b/indra/newview/vjlocalmesh.cpp index 2d4bd0842c..679269f134 100644 --- a/indra/newview/vjlocalmesh.cpp +++ b/indra/newview/vjlocalmesh.cpp @@ -26,6 +26,7 @@ // linden headers #include "llviewerprecompiledheaders.h" + #include "llcallbacklist.h" #include "llsdutil.h" #include "llviewerobjectlist.h" @@ -56,7 +57,7 @@ /* values for indices, bounding box and */ /* vtx pos, normals, uv coords, weights. */ /*==========================================*/ -void LLLocalMeshFace::setFaceBoundingBox(LLVector4 data_in, bool initial_values) +void LLLocalMeshFace::setFaceBoundingBox(const LLVector4& data_in, bool initial_values) { if (initial_values) { @@ -113,7 +114,7 @@ void LLLocalMeshFace::logFaceInfo() const } ss_norm << "]"; LL_DEBUGS("LocalMesh") << " mFaceNormals: " << ss_norm.str() << LL_ENDL; - int i = 0; + S32 i = 0; for (const auto& skinUnit : mSkin) { // log the mJointIncdices and mJointWeights as "num: idx = weight" for each entry in th skinUnit vector @@ -166,8 +167,6 @@ void LLLocalMeshObject::logObjectInfo() const // } } - - void LLLocalMeshObject::computeObjectBoundingBox() { // for the purposes of a bounding box, we only care for LOD3 @@ -195,14 +194,12 @@ void LLLocalMeshObject::computeObjectBoundingBox() { const auto& [current_bbox_min, current_bbox_max] = lod3_faces[face_iter]->getFaceBoundingBox(); - for (size_t array_iter = 0; array_iter < 4; ++array_iter) { mObjectBoundingBox.first.mV[array_iter] = std::min(mObjectBoundingBox.first.mV[array_iter], current_bbox_min.mV[array_iter]); mObjectBoundingBox.second.mV[array_iter] = std::max(mObjectBoundingBox.second.mV[array_iter], current_bbox_max.mV[array_iter]); } } - } void LLLocalMeshObject::computeObjectTransform(const LLMatrix4& scene_transform) @@ -219,7 +216,7 @@ void LLLocalMeshObject::computeObjectTransform(const LLMatrix4& scene_transform) mObjectSize = mObjectBoundingBox.second - mObjectBoundingBox.first; // make sure all axes of mObjectSize are non zero (don't adjust the 4th dim) - for ( int i=0; i <3; i++ ) + for (S32 i = 0; i < 3; i++) { auto& axis_size = mObjectSize[i]; // set size of 1.0 if < F_APPROXIMATELY_ZERO @@ -228,9 +225,10 @@ void LLLocalMeshObject::computeObjectTransform(const LLMatrix4& scene_transform) axis_size = 1.0f; } } + // object scale is the inverse of the object size mObjectScale.set(1.f, 1.f, 1.f,1.f); - for (int vec_iter = 0; vec_iter < 4; ++vec_iter) + for (S32 vec_iter = 0; vec_iter < 4; ++vec_iter) { mObjectScale[vec_iter] /= mObjectSize[vec_iter]; } @@ -258,7 +256,7 @@ void LLLocalMeshObject::normalizeFaceValues(LLLocalMeshFileLOD lod_iter) current_submesh_bbox.second += mObjectTranslation; LL_INFOS("LocalMesh") << "before squish:" << current_submesh_bbox.first << " " << current_submesh_bbox.second << LL_ENDL; - for (int vec_iter = 0; vec_iter < 4; ++vec_iter) + for (S32 vec_iter = 0; vec_iter < 4; ++vec_iter) { current_submesh_bbox.first.mV[vec_iter] *= mObjectScale.mV[vec_iter]; current_submesh_bbox.second.mV[vec_iter] *= mObjectScale.mV[vec_iter]; @@ -270,7 +268,7 @@ void LLLocalMeshObject::normalizeFaceValues(LLLocalMeshFileLOD lod_iter) for (auto& current_position : current_face_positions) { current_position += mObjectTranslation; - for (int vec_iter = 0; vec_iter < 4; ++vec_iter) + for (S32 vec_iter = 0; vec_iter < 4; ++vec_iter) { current_position.mV[vec_iter] *= mObjectScale.mV[vec_iter]; } @@ -455,7 +453,8 @@ LLLocalMeshFile::LLLocalMeshFile(const std::string& filename, bool try_lods) pushLog("LLLocalMeshFile", "Initializing with base filename: " + base_lod_filename); // check if main filename exists, just in case - if (!boost::filesystem::exists(filename)) + boost::system::error_code ec; + if (!boost::filesystem::exists(filename, ec) || ec.failed()) { // filename provided doesn't exist, just stop. mLocalMeshFileStatus = LLLocalMeshFileStatus::STATUS_ERROR; @@ -468,8 +467,7 @@ LLLocalMeshFile::LLLocalMeshFile(const std::string& filename, bool try_lods) // check if we have a valid extension, can't switch with string can we? auto path = boost::filesystem::path(filename); - if (std::string exten_str = path.extension().string(); - boost::iequals(exten_str, ".dae") ) + if (std::string exten_str = path.extension().string(); boost::iequals(exten_str, ".dae")) { mExtension = LLLocalMeshFileExtension::EXTEN_DAE; pushLog("LLLocalMeshFile", "Extension found: COLLADA"); @@ -522,9 +520,11 @@ void LLLocalMeshFile::reloadLocalMeshObjects(bool initial_load) mLocalMeshFileStatus = LLLocalMeshFileStatus::STATUS_LOADING; mLocalMeshFileNeedsUIUpdate = true; + boost::system::error_code ec; + // another recheck that mFilenames[3] main file is present, // in case the file got deleted and the user hits reload - it'll error out here. - if (!boost::filesystem::exists(mFilenames[LOCAL_LOD_HIGH])) + if (!boost::filesystem::exists(mFilenames[LOCAL_LOD_HIGH]) || ec.failed()) { // filename provided doesn't exist, just stop. mLocalMeshFileStatus = LLLocalMeshFileStatus::STATUS_ERROR; @@ -547,8 +547,8 @@ void LLLocalMeshFile::reloadLocalMeshObjects(bool initial_load) auto lod_suffix { getLodSuffix(lodfile_iter) }; auto extension { boost::filesystem::path(mFilenames[LOCAL_LOD_HIGH]).extension() }; - boost::filesystem::path current_lod_filename = filepath / (mShortName + lod_suffix + extension.string()); - if ( boost::filesystem::exists( current_lod_filename ) ) + boost::filesystem::path current_lod_filename = filepath / (mShortName + lod_suffix + extension.string()); + if (boost::filesystem::exists(current_lod_filename, ec) && !ec.failed()) { pushLog("LLLocalMeshFile", "LOD filename " + current_lod_filename.string() + " found, adding."); mFilenames[lodfile_iter] = current_lod_filename.string(); @@ -729,14 +729,14 @@ bool LLLocalMeshFile::updateLastModified(LLLocalMeshFileLOD lod) LLSD current_last_modified = mLastModified[lod]; std::string current_filename = mFilenames[lod]; + boost::system::error_code ec; #ifndef LL_WINDOWS - const std::time_t temp_time = boost::filesystem::last_write_time(boost::filesystem::path(current_filename)); + const std::time_t temp_time = boost::filesystem::last_write_time(boost::filesystem::path(current_filename), ec); #else - const std::time_t temp_time = boost::filesystem::last_write_time(boost::filesystem::path(utf8str_to_utf16str(current_filename))); + const std::time_t temp_time = boost::filesystem::last_write_time(boost::filesystem::path(utf8str_to_utf16str(current_filename)), ec); #endif - - if (LLSD new_last_modified = asctime(localtime(&temp_time)); new_last_modified.asString() != current_last_modified.asString()) + if (LLSD new_last_modified = asctime(localtime(&temp_time)); new_last_modified.asString() != current_last_modified.asString() && !ec.failed()) { file_updated = true; mLastModified[lod] = new_last_modified; @@ -771,11 +771,10 @@ LLLocalMeshFile::LLLocalMeshFileInfo LLLocalMeshFile::getFileInfo() if (mLocalMeshFileStatus == LLLocalMeshFileStatus::STATUS_ACTIVE) { // fill object list - auto& vector_objects = getObjectVector(); - for (auto& current_object : vector_objects) + const auto& vector_objects = getObjectVector(); + for (const auto& current_object : vector_objects) { - std::string object_name = current_object->getObjectName(); - result.mObjectList.push_back(object_name); + result.mObjectList.emplace_back(current_object->getObjectName()); } } @@ -925,7 +924,7 @@ void LLLocalMeshSystem::addFile(const std::string& filename, bool try_lods) triggerCheckFileAsyncStatus(); } -void LLLocalMeshSystem::deleteFile(LLUUID local_file_id) +void LLLocalMeshSystem::deleteFile(const LLUUID& local_file_id) { bool delete_done = false; for(auto iterator = mLoadedFileList.begin(); iterator != mLoadedFileList.end();) @@ -959,7 +958,7 @@ void LLLocalMeshSystem::deleteFile(LLUUID local_file_id) } } -void LLLocalMeshSystem::reloadFile(LLUUID local_file_id) +void LLLocalMeshSystem::reloadFile(const LLUUID& local_file_id) { bool reload_started = false; for (auto iterator = mLoadedFileList.begin(); iterator != mLoadedFileList.end(); ++iterator) @@ -988,7 +987,7 @@ void LLLocalMeshSystem::reloadFile(LLUUID local_file_id) } } -void LLLocalMeshSystem::applyVObject(LLUUID viewer_object_id, LLUUID local_file_id, int object_index, bool use_scale) +void LLLocalMeshSystem::applyVObject(const LLUUID& viewer_object_id, const LLUUID& local_file_id, int object_index, bool use_scale) { for (auto& loaded_file : mLoadedFileList) { @@ -1000,7 +999,7 @@ void LLLocalMeshSystem::applyVObject(LLUUID viewer_object_id, LLUUID local_file_ } } -void LLLocalMeshSystem::clearVObject(LLUUID viewer_object_id) +void LLLocalMeshSystem::clearVObject(const LLUUID& viewer_object_id) { auto target_object = (LLVOVolume*)gObjectList.findObject(viewer_object_id); if (!target_object) @@ -1099,27 +1098,24 @@ std::vector LLLocalMeshSystem::getFileInfo { std::vector result; - for (auto& current_file : mLoadedFileList) + for (const auto& current_file : mLoadedFileList) { - result.push_back(current_file->getFileInfo()); + result.emplace_back(current_file->getFileInfo()); } return result; } -std::vector LLLocalMeshSystem::getFileLog(LLUUID local_file_id) const +std::vector LLLocalMeshSystem::getFileLog(const LLUUID& local_file_id) const { - std::vector result; - - for (auto& current_file : mLoadedFileList) + for (const auto& current_file : mLoadedFileList) { if (current_file->getFileID() == local_file_id) { - result = current_file->getFileLog(); - break; + return current_file->getFileLog(); } } - return result; + return {}; } diff --git a/indra/newview/vjlocalmesh.h b/indra/newview/vjlocalmesh.h index df0c6b999a..5c8646209f 100644 --- a/indra/newview/vjlocalmesh.h +++ b/indra/newview/vjlocalmesh.h @@ -32,7 +32,6 @@ // STL headers #include - class LLFloaterLocalMesh; enum LLLocalMeshFileLOD @@ -44,7 +43,6 @@ enum LLLocalMeshFileLOD LOCAL_NUM_LODS }; - /*==========================================*/ /* LLLocalMeshFace: aka submesh denoted by */ /* material assignment. holds per-face */ @@ -53,36 +51,35 @@ enum LLLocalMeshFileLOD /*==========================================*/ class LLLocalMeshFace { - public: - struct LLLocalMeshSkinUnit - { - std::array mJointIndices; - std::array mJointWeights; - }; +public: + struct LLLocalMeshSkinUnit + { + std::array mJointIndices; + std::array mJointWeights; + }; - void setFaceBoundingBox(LLVector4 data_in, bool initial_values = false); + void setFaceBoundingBox(const LLVector4& data_in, bool initial_values = false); - int getNumVerts() const { return static_cast(mPositions.size()); } - int getNumIndices() const { return static_cast(mIndices.size()); } + S32 getNumVerts() const { return static_cast(mPositions.size()); } + S32 getNumIndices() const { return static_cast(mIndices.size()); } - std::vector& getIndices() { return mIndices; }; - std::vector& getPositions() { return mPositions; }; - std::vector& getNormals() { return mNormals; }; - std::vector& getUVs() { return mUVs; }; - std::vector& getSkin() { return mSkin; } - std::pair& getFaceBoundingBox() { return mFaceBoundingBox; } - void logFaceInfo() const; + std::vector& getIndices() { return mIndices; }; + std::vector& getPositions() { return mPositions; }; + std::vector& getNormals() { return mNormals; }; + std::vector& getUVs() { return mUVs; }; + std::vector& getSkin() { return mSkin; } + std::pair& getFaceBoundingBox() { return mFaceBoundingBox; } + void logFaceInfo() const; - private: - std::vector mIndices; - std::vector mPositions; - std::vector mNormals; - std::vector mUVs; - std::vector mSkin; - std::pair mFaceBoundingBox; +private: + std::vector mIndices; + std::vector mPositions; + std::vector mNormals; + std::vector mUVs; + std::vector mSkin; + std::pair mFaceBoundingBox; }; - /*==========================================*/ /* LLLocalMeshObject: collection of faces */ /* has object name, transform & skininfo, */ @@ -91,49 +88,48 @@ class LLLocalMeshFace /*==========================================*/ class LLLocalMeshObject { - public: - // life cycle management - explicit LLLocalMeshObject(std::string_view name); - ~LLLocalMeshObject(); +public: + // life cycle management + explicit LLLocalMeshObject(std::string_view name); + ~LLLocalMeshObject(); - // translation and scale - void computeObjectBoundingBox(); - void computeObjectTransform(const LLMatrix4& scene_transform); - void normalizeFaceValues(LLLocalMeshFileLOD lod_iter); + // translation and scale + void computeObjectBoundingBox(); + void computeObjectTransform(const LLMatrix4& scene_transform); + void normalizeFaceValues(LLLocalMeshFileLOD lod_iter); - // applying local object to viewer object - void fillVolume(LLLocalMeshFileLOD lod); - void attachSkinInfo(); + // applying local object to viewer object + void fillVolume(LLLocalMeshFileLOD lod); + void attachSkinInfo(); - // getters - std::vector>& getFaces(LLLocalMeshFileLOD lod) { return mFaces[lod]; }; - std::pair& getObjectBoundingBox() { return mObjectBoundingBox; }; - LLVector4 getObjectTranslation() const { return mObjectTranslation; }; - std::string getObjectName() const { return mObjectName; }; - LLVector4 getObjectSize() const { return mObjectSize; }; - LLVector4 getObjectScale() const { return mObjectScale; }; - LLPointer getObjectMeshSkinInfo() { return mMeshSkinInfoPtr; }; - void setObjectMeshSkinInfo(LLPointer skininfop ) { mMeshSkinInfoPtr = skininfop; }; - LLVolumeParams getVolumeParams() const { return mVolumeParams; }; - bool getIsRiggedObject() const; - void logObjectInfo() const; + // getters + std::vector>& getFaces(LLLocalMeshFileLOD lod) { return mFaces[lod]; }; + std::pair& getObjectBoundingBox() { return mObjectBoundingBox; }; + LLVector4 getObjectTranslation() const { return mObjectTranslation; }; + std::string getObjectName() const { return mObjectName; }; + LLVector4 getObjectSize() const { return mObjectSize; }; + LLVector4 getObjectScale() const { return mObjectScale; }; + LLPointer getObjectMeshSkinInfo() { return mMeshSkinInfoPtr; }; + void setObjectMeshSkinInfo(LLPointer skininfop) { mMeshSkinInfoPtr = skininfop; }; + LLVolumeParams getVolumeParams() const { return mVolumeParams; }; + bool getIsRiggedObject() const; + void logObjectInfo() const; - private: - // internal data keeping - std::array>, 4> mFaces; - std::pair mObjectBoundingBox; - std::string mObjectName; - LLVector4 mObjectTranslation; - LLVector4 mObjectSize; - LLVector4 mObjectScale; +private: + // internal data keeping + std::array>, 4> mFaces; + std::pair mObjectBoundingBox; + std::string mObjectName; + LLVector4 mObjectTranslation; + LLVector4 mObjectSize; + LLVector4 mObjectScale; - // vovolume - LLPointer mMeshSkinInfoPtr{nullptr}; - LLUUID mSculptID; - LLVolumeParams mVolumeParams; + // vovolume + LLPointer mMeshSkinInfoPtr{ nullptr }; + LLUUID mSculptID; + LLVolumeParams mVolumeParams; }; - /*==========================================*/ /* LLLocalMeshFile: Single Unit */ /* owns filenames [main and lods] */ @@ -142,120 +138,120 @@ class LLLocalMeshObject class LLLocalMeshFile { // class specific types - public: - enum LLLocalMeshFileStatus - { - STATUS_NONE, - STATUS_LOADING, - STATUS_ACTIVE, - STATUS_ERROR - }; +public: + enum LLLocalMeshFileStatus + { + STATUS_NONE, + STATUS_LOADING, + STATUS_ACTIVE, + STATUS_ERROR + }; - // for future gltf support, possibly more. - enum class LLLocalMeshFileExtension - { - EXTEN_DAE, - EXTEN_NONE - }; + // for future gltf support, possibly more. + enum class LLLocalMeshFileExtension + { + EXTEN_DAE, + EXTEN_NONE + }; - struct LLLocalMeshFileInfo - { - std::string mName; - LLLocalMeshFileStatus mStatus; - LLUUID mLocalID; - std::array mLODAvailability; - std::vector mObjectList; - }; + struct LLLocalMeshFileInfo + { + std::string mName; + LLLocalMeshFileStatus mStatus; + LLUUID mLocalID; + std::array mLODAvailability; + std::vector mObjectList; + }; - struct LLLocalMeshLoaderReply - { - bool mChanged; - std::vector mLog; - std::array mStatus; - }; + struct LLLocalMeshLoaderReply + { + bool mChanged; + std::vector mLog; + std::array mStatus; + }; - // life cycle management - LLLocalMeshFile(const std::string& filename, bool try_lods); - ~LLLocalMeshFile(); + // life cycle management + LLLocalMeshFile(const std::string& filename, bool try_lods); + ~LLLocalMeshFile(); - // disallowing copy - LLLocalMeshFile(const LLLocalMeshFile& local_mesh_file) = delete; - LLLocalMeshFile& operator=(const LLLocalMeshFile& local_mesh_file) = delete; + // disallowing copy + LLLocalMeshFile(const LLLocalMeshFile& local_mesh_file) = delete; + LLLocalMeshFile& operator=(const LLLocalMeshFile& local_mesh_file) = delete; - // file loading - void reloadLocalMeshObjects(bool initial_load = false); - LLLocalMeshFileStatus reloadLocalMeshObjectsCheck(); - void reloadLocalMeshObjectsCallback(); - bool updateLastModified(LLLocalMeshFileLOD lod); - std::vector>& getObjectVector() { return mLoadedObjectList; }; + // file loading + void reloadLocalMeshObjects(bool initial_load = false); + LLLocalMeshFileStatus reloadLocalMeshObjectsCheck(); + void reloadLocalMeshObjectsCallback(); + bool updateLastModified(LLLocalMeshFileLOD lod); + std::vector>& getObjectVector() { return mLoadedObjectList; }; - // info getters - bool notifyNeedsUIUpdate(); - LLLocalMeshFileInfo getFileInfo(); - std::string getFilename(LLLocalMeshFileLOD lod) const { return mFilenames[lod]; }; - LLUUID getFileID() const { return mLocalMeshFileID; }; - std::vector getFileLog() const { return mLoadingLog; }; + // info getters + bool notifyNeedsUIUpdate(); + LLLocalMeshFileInfo getFileInfo(); + std::string getFilename(LLLocalMeshFileLOD lod) const { return mFilenames[lod]; }; + LLUUID getFileID() const { return mLocalMeshFileID; }; + std::vector getFileLog() const { return mLoadingLog; }; - // viewer object - void updateVObjects(); - void applyToVObject(LLUUID viewer_object_id, int object_index, bool use_scale); + // viewer object + void updateVObjects(); + void applyToVObject(LLUUID viewer_object_id, int object_index, bool use_scale); - void pushLog(const std::string& who, const std::string& what, bool is_error = false); + void pushLog(const std::string& who, const std::string& what, bool is_error = false); - private: - std::array mFilenames; - std::array mLastModified; - std::array mLoadedSuccessfully; - bool mTryLODFiles; - std::string mShortName; - std::vector mLoadingLog; - LLLocalMeshFileExtension mExtension; - LLLocalMeshFileStatus mLocalMeshFileStatus; - LLUUID mLocalMeshFileID; - bool mLocalMeshFileNeedsUIUpdate; +private: + std::array mFilenames; + std::array mLastModified; + std::array mLoadedSuccessfully; + bool mTryLODFiles; + std::string mShortName; + std::vector mLoadingLog; + LLLocalMeshFileExtension mExtension; + LLLocalMeshFileStatus mLocalMeshFileStatus; + LLUUID mLocalMeshFileID; + bool mLocalMeshFileNeedsUIUpdate; - std::future mAsyncFuture; - std::vector> mLoadedObjectList; - std::vector mSavedObjectSculptIDs; + std::future mAsyncFuture; + std::vector> mLoadedObjectList; + std::vector mSavedObjectSculptIDs; }; - /*=============================*/ /* LLLocalMeshSystem: */ /* user facing manager class. */ /*=============================*/ class LLLocalMeshSystem : public LLSingleton { - // life cycle management - LLSINGLETON(LLLocalMeshSystem); - public: - ~LLLocalMeshSystem(); + // life cycle management + LLSINGLETON(LLLocalMeshSystem); - // file management - void addFile(const std::string& filename, bool try_lods); - void deleteFile(LLUUID local_file_id); - void reloadFile(LLUUID local_file_id); +public: + ~LLLocalMeshSystem(); - // viewer object management - void applyVObject(LLUUID viewer_object_id, LLUUID local_file_id, int object_index, bool use_scale); - void clearVObject(LLUUID viewer_object_id); + // file management + void addFile(const std::string& filename, bool try_lods); + void deleteFile(const LLUUID& local_file_id); + void reloadFile(const LLUUID& local_file_id); - // high level async support - void triggerCheckFileAsyncStatus(); - void checkFileAsyncStatus(); + // viewer object management + void applyVObject(const LLUUID& viewer_object_id, const LLUUID& local_file_id, int object_index, bool use_scale); + void clearVObject(const LLUUID& viewer_object_id); - // floater two-way communication - void registerFloaterPointer(LLFloaterLocalMesh* floater_ptr); - LLFloaterLocalMesh* getFloaterPointer(){return mFloaterPtr;}; - void triggerFloaterRefresh( bool keep_selection=true ); - std::vector getFileInfoVector() const; - std::vector getFileLog(LLUUID local_file_id) const; - // misc - void pushLog(const std::string& who, const std::string& what, bool is_error = false); + // high level async support + void triggerCheckFileAsyncStatus(); + void checkFileAsyncStatus(); - private: - std::vector mSystemLog; - std::vector> mLoadedFileList; - bool mFileAsyncsOngoing; - LLFloaterLocalMesh* mFloaterPtr; + // floater two-way communication + void registerFloaterPointer(LLFloaterLocalMesh* floater_ptr); + LLFloaterLocalMesh* getFloaterPointer() { return mFloaterPtr; }; + void triggerFloaterRefresh(bool keep_selection = true); + std::vector getFileInfoVector() const; + std::vector getFileLog(const LLUUID& local_file_id) const; + // misc + void pushLog(const std::string& who, const std::string& what, bool is_error = false); + +private: + std::vector mSystemLog; + std::vector> mLoadedFileList; + bool mFileAsyncsOngoing; + LLFloaterLocalMesh* mFloaterPtr; }; diff --git a/indra/newview/vjlocalmeshimportdae.cpp b/indra/newview/vjlocalmeshimportdae.cpp index fe80746ba0..c76ccf39da 100644 --- a/indra/newview/vjlocalmeshimportdae.cpp +++ b/indra/newview/vjlocalmeshimportdae.cpp @@ -28,7 +28,6 @@ #include "llviewerprecompiledheaders.h" /* own header */ -#include "vjlocalmesh.h" #include "vjlocalmeshimportdae.h" /* linden headers */ @@ -41,7 +40,6 @@ /* dae headers*/ #include #include -#include #include #include #include @@ -1822,16 +1820,3 @@ void LLLocalMeshImportDAE::pushLog(const std::string& who, const std::string& wh mLoadingLog.push_back(log_msg); LL_INFOS("LocalMesh") << log_msg << LL_ENDL; } - -//bool LLLocalMeshImportDAE::readMesh_Polygons(LLLocalMeshFace* data_out, const domPolygonsRef& data_in) -//{ - /* - i couldn't find any collada files of this type to test on - this type may have been deprecated? - */ - - // ok so.. in here vcount should be a number of polys, EACH poly should have it's own P (array of vtx indices) - - // return false // gotta return a thing - -//} diff --git a/indra/newview/vjlocalmeshimportdae.h b/indra/newview/vjlocalmeshimportdae.h index fb6b021e43..f94815836d 100644 --- a/indra/newview/vjlocalmeshimportdae.h +++ b/indra/newview/vjlocalmeshimportdae.h @@ -26,26 +26,16 @@ #pragma once - // linden headers -#include "llviewerprecompiledheaders.h" +#include "vjlocalmesh.h" + + // collada dom magic +#include // formal declarations class LLLocalMeshObject; class LLLocalMeshFace; class LLLocalMeshFileData; -// collada dom magic -#if LL_MSVC -#pragma warning (disable : 4263) -#pragma warning (disable : 4264) -#endif -#include "dom/domMesh.h" -#if LL_MSVC -#pragma warning (default : 4263) -#pragma warning (default : 4264) -#endif - - /* NOTE: basically everything here is just a refactor of lldaeloader in what is hopefully more modernized and easier to understand c++ @@ -71,7 +61,7 @@ public: loadFile_return loadFile(LLLocalMeshFile* data, LLLocalMeshFileLOD lod); bool processObject(domMesh* current_mesh, LLLocalMeshObject* current_object); bool processSkin(daeDatabase* collada_db, daeElement* collada_document_root, domMesh* current_mesh, domSkin* current_skin, std::unique_ptr& current_object); - bool processSkeletonJoint(domNode* current_node, std::map>& joint_map, std::map& joint_transforms, bool recurse_children=false); + bool processSkeletonJoint(domNode* current_node, std::map>& joint_map, std::map& joint_transforms, bool recurse_children = false); bool readMesh_CommonElements(const domInputLocalOffset_Array& inputs, int& offset_position, int& offset_normals, int& offset_uvmap, int& index_stride, @@ -84,8 +74,6 @@ public: bool readMesh_Triangle(LLLocalMeshFace* data_out, const domTrianglesRef& data_in); bool readMesh_Polylist(LLLocalMeshFace* data_out, const domPolylistRef& data_in); - // NOTE: polygon schema - //bool readMesh_Polygons(LLLocalMeshFace* data_out, const domPolygonsRef& data_in); void pushLog(const std::string& who, const std::string& what, bool is_error=false); private: From be19ca0402b74e62aa34c2e3ea7b74234b740bd1 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Tue, 13 May 2025 19:49:51 +0200 Subject: [PATCH 10/15] Presumed build fix for linux --- indra/newview/vjfloaterlocalmesh.cpp | 1 - indra/newview/vjfloaterlocalmesh.h | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/indra/newview/vjfloaterlocalmesh.cpp b/indra/newview/vjfloaterlocalmesh.cpp index 1a2ee2c4d7..fa7c03ce08 100644 --- a/indra/newview/vjfloaterlocalmesh.cpp +++ b/indra/newview/vjfloaterlocalmesh.cpp @@ -35,7 +35,6 @@ #include "llcheckboxctrl.h" #include "llviewertexteditor.h" #include "llcombobox.h" -#include "llselectmgr.h" #include "lltoolmgr.h" #include "lltoolcomp.h" #include "llmodelpreview.h" diff --git a/indra/newview/vjfloaterlocalmesh.h b/indra/newview/vjfloaterlocalmesh.h index 8e3f619452..2f8205b2d1 100644 --- a/indra/newview/vjfloaterlocalmesh.h +++ b/indra/newview/vjfloaterlocalmesh.h @@ -27,10 +27,12 @@ #pragma once #include "llfloater.h" +#include "llselectmgr.h" #include "lltabcontainer.h" -class LLObjectSelection; class LLFloaterLocalMeshFilePicker; +class LLScrollListCtrl; +class LLTextEditor; class LLFloaterLocalMesh : public LLFloater { From 89523d4b714df61151ef13bd49d2d7d731108da2 Mon Sep 17 00:00:00 2001 From: Beq Date: Tue, 13 May 2025 23:14:19 +0100 Subject: [PATCH 11/15] uhm let's not have that as an INFO shall we? --- indra/newview/llviewerregion.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 36c525b59a..4b9cf1f63e 100755 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -3988,7 +3988,7 @@ bool LLViewerRegion::meshRezEnabled() const // FIRE-35602 and many similar reports - Mesh not appearing after TP/login if(!mSimulatorFeaturesReceived) { - LL_INFOS("MeshRez") << "MeshRezEnabled: SimulatorFeatures not received yet. Defaulting to true" << LL_ENDL; + LL_DEBUGS("MeshRez") << "MeshRezEnabled: SimulatorFeatures not received yet. Defaulting to true" << LL_ENDL; return true; } // From 200bc042513f200eded5fb2a492342a79d9c4e01 Mon Sep 17 00:00:00 2001 From: PanteraPolnocy Date: Wed, 14 May 2025 00:26:52 +0200 Subject: [PATCH 12/15] =?UTF-8?q?Updated=20Chinese=20(by=20=E5=B0=8F?= =?UTF-8?q?=E6=BB=A2=20Zi=20Ying),=20Japanese=20(by=20Logue=20Takacs)=20an?= =?UTF-8?q?d=20Polish=20translations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../skins/default/xui/ja/notifications.xml | 4 ++++ indra/newview/skins/default/xui/ja/strings.xml | 16 ++++++++++------ .../skins/default/xui/pl/notifications.xml | 4 ++++ .../skins/default/xui/zh/notifications.xml | 4 ++++ 4 files changed, 22 insertions(+), 6 deletions(-) diff --git a/indra/newview/skins/default/xui/ja/notifications.xml b/indra/newview/skins/default/xui/ja/notifications.xml index 9ee75f3951..9c4cc79abc 100644 --- a/indra/newview/skins/default/xui/ja/notifications.xml +++ b/indra/newview/skins/default/xui/ja/notifications.xml @@ -5641,4 +5641,8 @@ https://wiki.firestormviewer.org/antivirus_whitelisting 水面を非表示にするボックスをチェックすると、テクスチャ、凹凸、光沢の選択が上書きされます。 + + 「[POSE_NAME]」を上書きしてもよろしいですか? + + diff --git a/indra/newview/skins/default/xui/ja/strings.xml b/indra/newview/skins/default/xui/ja/strings.xml index 5c910128b4..ad9ff7acb5 100644 --- a/indra/newview/skins/default/xui/ja/strings.xml +++ b/indra/newview/skins/default/xui/ja/strings.xml @@ -2198,9 +2198,13 @@ https://support.secondlife.com よりSecond Lifeのサポートまでお問い エラー:オブジェクトは現在のアウトフィットにありますが、装着されていません。 - - 本日参加 - + [AGEYEARS] [AGEMONTHS] + [AGEYEARS]前 + [AGEMONTHS]前 + [AGEWEEKS]前 + [AGEDAYS]前 + 本日参加 + ;[AGEDAYSTOTAL] あなたは、全員から見えるようになりました。 @@ -2272,13 +2276,13 @@ https://support.secondlife.com よりSecond Lifeのサポートまでお問い [COUNT]週間 - [COUNT]日間 + [COUNT]日 - [COUNT]日間 + [COUNT]日 - [COUNT]日間 + [COUNT]日 diff --git a/indra/newview/skins/default/xui/pl/notifications.xml b/indra/newview/skins/default/xui/pl/notifications.xml index 748c7adbc3..67ff7344e6 100644 --- a/indra/newview/skins/default/xui/pl/notifications.xml +++ b/indra/newview/skins/default/xui/pl/notifications.xml @@ -5485,4 +5485,8 @@ Aby uzyskać szczegółowe instrukcje dotyczące umieszczania [APP_NAME]a na bia https://wiki.firestormviewer.org/antivirus_whitelisting + + Nadpisać istniejącą pozę “[POSE_NAME]”? + + diff --git a/indra/newview/skins/default/xui/zh/notifications.xml b/indra/newview/skins/default/xui/zh/notifications.xml index d81a6073fa..42afa43745 100644 --- a/indra/newview/skins/default/xui/zh/notifications.xml +++ b/indra/newview/skins/default/xui/zh/notifications.xml @@ -5749,4 +5749,8 @@ gzip級別6壓縮的測試結果,對[FILE]檔案大小[SIZE] KB: https://wiki.firestormviewer.org/antivirus_whitelisting + + 是否覆蓋現有的姿勢「[POSE_NAME]」? + + From 223f7d84f2018abde5da102cb01a5726353651dc Mon Sep 17 00:00:00 2001 From: Beq Date: Wed, 14 May 2025 00:02:04 +0100 Subject: [PATCH 13/15] Update bugsplat attributes to new format. --- indra/newview/bugsplatattributes.cpp | 5 ++--- indra/newview/llappviewerwin32.cpp | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/indra/newview/bugsplatattributes.cpp b/indra/newview/bugsplatattributes.cpp index 1852f9de3f..fdc8871a26 100644 --- a/indra/newview/bugsplatattributes.cpp +++ b/indra/newview/bugsplatattributes.cpp @@ -91,6 +91,7 @@ bool BugSplatAttributes::writeToFile(const std::string& file_path) } // Write out all other categories + // BugSplat chaanged the XML format and there is no strict category support now. For now we'll prefix the category to each attribute for (const auto& cat_pair : mAttributes) { const std::string& category = cat_pair.first; @@ -101,14 +102,12 @@ bool BugSplatAttributes::writeToFile(const std::string& file_path) continue; } - ofs << " <" << category << ">\n"; for (const auto& kv : cat_pair.second) { const std::string& key = kv.first; const std::string& val = kv.second; - ofs << " <" << key << ">" << val << "\n"; + ofs << " <" << category << "-" << key << ">" << val << "\n"; } - ofs << " \n"; } ofs << "\n"; diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp index 604729f872..fb20d6c7c0 100644 --- a/indra/newview/llappviewerwin32.cpp +++ b/indra/newview/llappviewerwin32.cpp @@ -689,7 +689,7 @@ void LLAppViewerWin32::bugsplatAddStaticAttributes(const LLSD& info) #if LL_DARWIN bugSplatMap.setAttribute("HiDPI", info["HIDPI"].asBoolean() ? "Enabled" : "Disabled"); #endif - bugSplatMap.setAttribute("Max Texture Size", gSavedSettings.getString("RenderMaxTextureResolution")); + bugSplatMap.setAttribute("Max Texture Size", gSavedSettings.getU32("RenderMaxTextureResolution")); } // These attributes are potentially dynamic From ed69ead612e6e385057ae04023cce7c3ce65280e Mon Sep 17 00:00:00 2001 From: Beq Date: Wed, 14 May 2025 10:57:46 +0100 Subject: [PATCH 14/15] FIRE-35002 - revisit flickr preview not working Previous fix only worked if at least one instance of floatersnapshot had previously been opened. flickr snapshot is now independent and can be opened directly from the tool icon --- indra/newview/llappviewer.cpp | 2 ++ indra/newview/llfloaterflickr.cpp | 12 +++++++++++- indra/newview/llfloaterflickr.h | 1 + 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 2279181bba..2727797286 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -234,6 +234,7 @@ #include "llfloaterreg.h" #include "llfloatersimplesnapshot.h" #include "llfloatersnapshot.h" +#include "llfloaterflickr.h" #include "llsidepanelinventory.h" #include "llatmosphere.h" @@ -1749,6 +1750,7 @@ bool LLAppViewer::doFrame() gPipeline.mReflectionMapManager.update(); LLFloaterSnapshot::update(); // take snapshots LLFloaterSimpleSnapshot::update(); + LLFloaterFlickr::update(); // FIRE-35002 - Flickr preview not updating whne opened directly from tool tray icon gGLActive = false; } diff --git a/indra/newview/llfloaterflickr.cpp b/indra/newview/llfloaterflickr.cpp index 64d0c9c935..196defda1f 100644 --- a/indra/newview/llfloaterflickr.cpp +++ b/indra/newview/llfloaterflickr.cpp @@ -27,6 +27,7 @@ #include "llviewerprecompiledheaders.h" +#include "llfloatersnapshot.h" // Fix share to flickr preview again #include "llfloaterflickr.h" #include "llagent.h" @@ -243,7 +244,16 @@ void LLFlickrPhotoPanel::draw() // Draw the rest of the panel on top of it LLPanel::draw(); } - +// FIRE-35002 - Flickr preview not updating whne opened directly from tool tray icon +//static +void LLFloaterFlickr::update() +{ + if (LLFloaterReg::instanceVisible("flickr")) + { + LLFloaterSnapshotBase::ImplBase::updatePreviewList( true, true ); + } +} +// LLSnapshotLivePreview* LLFlickrPhotoPanel::getPreviewView() { LLSnapshotLivePreview* previewp = (LLSnapshotLivePreview*)mPreviewHandle.get(); diff --git a/indra/newview/llfloaterflickr.h b/indra/newview/llfloaterflickr.h index e0579ba870..d24f6ec97f 100644 --- a/indra/newview/llfloaterflickr.h +++ b/indra/newview/llfloaterflickr.h @@ -136,6 +136,7 @@ public: void onOpen(const LLSD& key); LLSnapshotLivePreview* getPreviewView(); // Required for snapshot frame rendering + static void update(); // FIRE-35002 - Flickr preview not updating whne opened directly from tool tray icon private: LLFlickrPhotoPanel* mFlickrPhotoPanel; LLTextBox* mStatusErrorText; From 8d7faa3b6e4c7a77c55d7b454f0dc620f89eea23 Mon Sep 17 00:00:00 2001 From: Beq Date: Wed, 14 May 2025 11:24:30 +0100 Subject: [PATCH 15/15] Prevent permanent FPS drop due to failed shadowres reset --- indra/newview/pipeline.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 0e0b0891d6..16d0982555 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -789,15 +789,9 @@ void LLPipeline::requestResizeShadowTexture() void LLPipeline::resizeShadowTexture() { - // [FIRE-33200] changing shadowres requires reload - original fix by William Weaver (paperwork) - if(mRT->width == 0 || mRT->height == 0) - { - return; - } - // releaseSunShadowTargets(); releaseSpotShadowTargets(); - allocateShadowBuffer(mRT->width, mRT->height); + allocateShadowBuffer(mRT->screen.getWidth(), mRT->screen.getHeight()); // revert and correct previous shadowres fix that leads to FPS drop (FIRE-3200) gResizeShadowTexture = false; }