diff options
| author | Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> | 2025-11-21 05:31:30 +0200 |
|---|---|---|
| committer | Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> | 2025-11-21 14:14:45 +0200 |
| commit | 7b2c3f7a22b0df319348224072b14448b1d0f54b (patch) | |
| tree | 20ec384e862fe524e3eeae4b39a76a7dca4a5873 | |
| parent | 9d5e7161e5ff94cad9975a7087dc49f2d546b1c8 (diff) | |
#5026 Upload To Folder feature not working
| -rw-r--r-- | indra/newview/llfloaterbulkupload.cpp | 3 | ||||
| -rw-r--r-- | indra/newview/llfloaterbulkupload.h | 1 | ||||
| -rw-r--r-- | indra/newview/llfloaterimagepreview.cpp | 3 | ||||
| -rw-r--r-- | indra/newview/llmaterialeditor.cpp | 7 | ||||
| -rw-r--r-- | indra/newview/llviewerassetupload.cpp | 22 | ||||
| -rw-r--r-- | indra/newview/llviewermenufile.cpp | 14 | ||||
| -rw-r--r-- | indra/newview/llviewermenufile.h | 2 |
7 files changed, 31 insertions, 21 deletions
diff --git a/indra/newview/llfloaterbulkupload.cpp b/indra/newview/llfloaterbulkupload.cpp index b898cb28b6..d11e9949f6 100644 --- a/indra/newview/llfloaterbulkupload.cpp +++ b/indra/newview/llfloaterbulkupload.cpp @@ -41,6 +41,7 @@ LLFloaterBulkUpload::LLFloaterBulkUpload(const LLSD& key) mUploadCost = key["upload_cost"].asInteger(); mUploadCount = key["upload_count"].asInteger(); mHas2kTextures = key["has_2k_textures"].asBoolean(); + mDestinationFolderId = key["dest"]; if (key["files"].isArray()) { const LLSD& files = key["files"]; @@ -125,7 +126,7 @@ void LLFloaterBulkUpload::onUpload2KCheckBox() void LLFloaterBulkUpload::onClickUpload() { - do_bulk_upload(mFiles, mAllow2kTextures); + do_bulk_upload(mFiles, mAllow2kTextures, mDestinationFolderId); closeFloater(); } diff --git a/indra/newview/llfloaterbulkupload.h b/indra/newview/llfloaterbulkupload.h index d07dc8eabe..3d3004d84d 100644 --- a/indra/newview/llfloaterbulkupload.h +++ b/indra/newview/llfloaterbulkupload.h @@ -59,6 +59,7 @@ private: std::vector<std::string> mFiles; bool mAllow2kTextures = true; bool mHas2kTextures = false; + LLUUID mDestinationFolderId; S32 mUploadCost = 0; S32 mUploadCount = 0; }; diff --git a/indra/newview/llfloaterimagepreview.cpp b/indra/newview/llfloaterimagepreview.cpp index c924807273..82b5fd23fc 100644 --- a/indra/newview/llfloaterimagepreview.cpp +++ b/indra/newview/llfloaterimagepreview.cpp @@ -289,7 +289,8 @@ void LLFloaterImagePreview::onBtnOK() LLFloaterPerms::getNextOwnerPerms("Uploads"), LLFloaterPerms::getGroupPerms("Uploads"), LLFloaterPerms::getEveryonePerms("Uploads"), - expected_upload_cost + expected_upload_cost, + mDestinationFolderId )); upload_new_resource(assetUploadInfo); diff --git a/indra/newview/llmaterialeditor.cpp b/indra/newview/llmaterialeditor.cpp index cac72bb085..cbd95f9cc6 100644 --- a/indra/newview/llmaterialeditor.cpp +++ b/indra/newview/llmaterialeditor.cpp @@ -1987,12 +1987,14 @@ void LLMaterialEditor::loadMaterialFromFile(const std::string& filename, S32 ind { // Prespecified material LLMaterialEditor* me = (LLMaterialEditor*)LLFloaterReg::getInstance("material_editor"); + me->mUploadFolder = dest_folder; me->loadMaterial(model_in, filename, index); } else if (model_in.materials.size() == 1) { // Only one material, just load it LLMaterialEditor* me = (LLMaterialEditor*)LLFloaterReg::getInstance("material_editor"); + me->mUploadFolder = dest_folder; me->loadMaterial(model_in, filename, 0); } else @@ -2018,11 +2020,12 @@ void LLMaterialEditor::loadMaterialFromFile(const std::string& filename, S32 ind material_list.push_back(LLTrans::getString("material_batch_import_text")); LLFloaterComboOptions::showUI( - [model_in, filename](const std::string& option, S32 index) + [model_in, filename, dest_folder](const std::string& option, S32 index) { if (index >= 0) // -1 on cancel { LLMaterialEditor* me = (LLMaterialEditor*)LLFloaterReg::getInstance("material_editor"); + me->mUploadFolder = dest_folder; me->loadMaterial(model_in, filename, index); } }, @@ -2448,7 +2451,7 @@ void LLMaterialEditor::loadMaterial(const tinygltf::Model &model_in, const std:: if (index == model_in.materials.size()) { // bulk upload all the things - upload_bulk({ filename }, LLFilePicker::FFLOAD_MATERIAL, true, LLUUID::null); + upload_bulk({ filename }, LLFilePicker::FFLOAD_MATERIAL, true, mUploadFolder); return; } diff --git a/indra/newview/llviewerassetupload.cpp b/indra/newview/llviewerassetupload.cpp index 7d5386110d..5298bd1cfa 100644 --- a/indra/newview/llviewerassetupload.cpp +++ b/indra/newview/llviewerassetupload.cpp @@ -300,17 +300,19 @@ void LLResourceUploadInfo::assignDefaults() { mDescription = "(No Description)"; } - - if (mAssetType == LLAssetType::AT_GLTF || - mAssetType == LLAssetType::AT_GLTF_BIN) + if (mFolderId.isNull()) // don't overwrite if destination is already specified { - mFolderId = LLUUID::null; - } - else - { - mFolderId = gInventory.findUserDefinedCategoryUUIDForType( - (mDestinationFolderType == LLFolderType::FT_NONE) ? - (LLFolderType::EType)mAssetType : mDestinationFolderType); + if (mAssetType == LLAssetType::AT_GLTF || + mAssetType == LLAssetType::AT_GLTF_BIN) + { + mFolderId = LLUUID::null; + } + else + { + mFolderId = gInventory.findUserDefinedCategoryUUIDForType( + (mDestinationFolderType == LLFolderType::FT_NONE) ? + (LLFolderType::EType)mAssetType : mDestinationFolderType); + } } } diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index 801ff3c212..fcffde3caf 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -530,7 +530,7 @@ void upload_single_file( return; } -void do_bulk_upload(std::vector<std::string> filenames, bool allow_2k) +void do_bulk_upload(std::vector<std::string> filenames, bool allow_2k, const LLUUID& dest) { for (std::vector<std::string>::const_iterator in_iter = filenames.begin(); in_iter != filenames.end(); ++in_iter) { @@ -650,7 +650,8 @@ void do_bulk_upload(std::vector<std::string> filenames, bool allow_2k) LLFloaterPerms::getNextOwnerPerms("Uploads"), LLFloaterPerms::getGroupPerms("Uploads"), LLFloaterPerms::getEveryonePerms("Uploads"), - LLAgentBenefitsMgr::current().getTextureUploadCost(raw_image->getWidth(), raw_image->getHeight()) + LLAgentBenefitsMgr::current().getTextureUploadCost(raw_image->getWidth(), raw_image->getHeight()), + dest )); upload_new_resource(assetUploadInfo); @@ -666,7 +667,8 @@ void do_bulk_upload(std::vector<std::string> filenames, bool allow_2k) LLFloaterPerms::getNextOwnerPerms("Uploads"), LLFloaterPerms::getGroupPerms("Uploads"), LLFloaterPerms::getEveryonePerms("Uploads"), - expected_upload_cost); + expected_upload_cost, + dest); LLResourceUploadInfo::ptr_t uploadInfo(info_p); upload_new_resource(uploadInfo); @@ -687,14 +689,14 @@ void do_bulk_upload(std::vector<std::string> filenames, bool allow_2k) // Todo: // 1. Decouple bulk upload from material editor // 2. Take into account possiblity of identical textures - LLMaterialEditor::uploadMaterialFromModel(filename, model, i); + LLMaterialEditor::uploadMaterialFromModel(filename, model, i, dest); } } } } } -void do_bulk_upload(std::vector<std::string> filenames, bool allow_2k, const LLSD& notification, const LLSD& response) +void do_bulk_upload(std::vector<std::string> filenames, bool allow_2k, const LLSD& notification, const LLSD& response, const LLUUID& dest) { S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if (option != 0) @@ -703,7 +705,7 @@ void do_bulk_upload(std::vector<std::string> filenames, bool allow_2k, const LLS return; } - do_bulk_upload(filenames, allow_2k); + do_bulk_upload(filenames, allow_2k, dest); } bool get_bulk_upload_expected_cost( diff --git a/indra/newview/llviewermenufile.h b/indra/newview/llviewermenufile.h index 8f7df48a2e..e40dd84bc9 100644 --- a/indra/newview/llviewermenufile.h +++ b/indra/newview/llviewermenufile.h @@ -72,7 +72,7 @@ bool get_bulk_upload_expected_cost( S32& bvh_count, S32& textures_2k_count); -void do_bulk_upload(std::vector<std::string> filenames, bool allow_2k); +void do_bulk_upload(std::vector<std::string> filenames, bool allow_2k, const LLUUID &dest_folder); void upload_single_file( const std::vector<std::string>& filenames, |
