diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2022-09-15 00:01:03 +0300 |
---|---|---|
committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2022-09-15 00:29:54 +0300 |
commit | 5d918f98eaacc0eec84edcf23a40d6f6c93807c3 (patch) | |
tree | 2424ae7a189a6b38ee7a55cbf328b66354f5418c | |
parent | 2ce39f3ad98fe855fb126dc29c82145751434421 (diff) |
SL-18161 Add PBR materials to Uploads in preferences
-rw-r--r-- | indra/newview/app_settings/settings_per_account.xml | 11 | ||||
-rw-r--r-- | indra/newview/llfloaterpreference.cpp | 10 | ||||
-rw-r--r-- | indra/newview/llfloaterpreference.h | 1 | ||||
-rw-r--r-- | indra/newview/llinventorymodel.cpp | 5 | ||||
-rw-r--r-- | indra/newview/llinventorypanel.cpp | 4 | ||||
-rw-r--r-- | indra/newview/llmaterialeditor.cpp | 2 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/menu_inventory.xml | 8 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_preferences_uploads.xml | 25 |
8 files changed, 65 insertions, 1 deletions
diff --git a/indra/newview/app_settings/settings_per_account.xml b/indra/newview/app_settings/settings_per_account.xml index 537744b44c..eb3528b9b7 100644 --- a/indra/newview/app_settings/settings_per_account.xml +++ b/indra/newview/app_settings/settings_per_account.xml @@ -370,6 +370,17 @@ <key>Value</key> <string></string> </map> + <key>PBRUploadFolder</key> + <map> + <key>Comment</key> + <string>All pbr uploads will be stored in this directory (UUID)</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>String</string> + <key>Value</key> + <string></string> + </map> <key>TextureUploadFolder</key> <map> <key>Comment</key> diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index dd9a212c1c..68928e9c8f 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -399,6 +399,7 @@ BOOL LLFloaterPreference::postBuild() gSavedSettings.getControl("PreferredMaturity")->getSignal()->connect(boost::bind(&LLFloaterPreference::onChangeMaturity, this)); gSavedPerAccountSettings.getControl("ModelUploadFolder")->getSignal()->connect(boost::bind(&LLFloaterPreference::onChangeModelFolder, this)); + gSavedPerAccountSettings.getControl("PBRUploadFolder")->getSignal()->connect(boost::bind(&LLFloaterPreference::onChangePBRFolder, this)); gSavedPerAccountSettings.getControl("TextureUploadFolder")->getSignal()->connect(boost::bind(&LLFloaterPreference::onChangeTextureFolder, this)); gSavedPerAccountSettings.getControl("SoundUploadFolder")->getSignal()->connect(boost::bind(&LLFloaterPreference::onChangeSoundFolder, this)); gSavedPerAccountSettings.getControl("AnimationUploadFolder")->getSignal()->connect(boost::bind(&LLFloaterPreference::onChangeAnimationFolder, this)); @@ -688,6 +689,7 @@ void LLFloaterPreference::onOpen(const LLSD& key) onChangeMaturity(); onChangeModelFolder(); + onChangePBRFolder(); onChangeTextureFolder(); onChangeSoundFolder(); onChangeAnimationFolder(); @@ -1773,6 +1775,14 @@ void LLFloaterPreference::onChangeModelFolder() } } +void LLFloaterPreference::onChangePBRFolder() +{ + if (gInventory.isInventoryUsable()) + { + getChild<LLTextBox>("upload_pbr")->setText(get_category_path(LLFolderType::FT_MATERIAL)); + } +} + void LLFloaterPreference::onChangeTextureFolder() { if (gInventory.isInventoryUsable()) diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index 542df18ddb..af17c46be0 100644 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -173,6 +173,7 @@ public: void applyResolution(); void onChangeMaturity(); void onChangeModelFolder(); + void onChangePBRFolder(); void onChangeTextureFolder(); void onChangeSoundFolder(); void onChangeAnimationFolder(); diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index c101033a5d..cc1bd846e5 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -628,6 +628,11 @@ const LLUUID LLInventoryModel::findUserDefinedCategoryUUIDForType(LLFolderType:: cat_id = LLUUID(gSavedPerAccountSettings.getString("AnimationUploadFolder")); break; } + case LLFolderType::FT_MATERIAL: + { + cat_id = LLUUID(gSavedPerAccountSettings.getString("PBRUploadFolder")); + break; + } default: break; } diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index cd24b3ea43..03ca7e7431 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -1612,6 +1612,10 @@ void LLInventoryPanel::fileUploadLocation(const LLSD& userdata) { gSavedPerAccountSettings.setString("AnimationUploadFolder", LLFolderBridge::sSelf.get()->getUUID().asString()); } + else if (param == "pbr_material") + { + gSavedPerAccountSettings.setString("PBRUploadFolder", LLFolderBridge::sSelf.get()->getUUID().asString()); + } } void LLInventoryPanel::purgeSelectedItems() diff --git a/indra/newview/llmaterialeditor.cpp b/indra/newview/llmaterialeditor.cpp index 6461aa71a6..477f834a22 100644 --- a/indra/newview/llmaterialeditor.cpp +++ b/indra/newview/llmaterialeditor.cpp @@ -762,7 +762,7 @@ bool LLMaterialEditor::saveIfNeeded() LLAssetID new_asset_id = tid.makeAssetID(gAgent.getSecureSessionID()); std::string res_desc = buildMaterialDescription(); U32 next_owner_perm = LLPermissions::DEFAULT.getMaskNextOwner(); - LLUUID parent = gInventory.findCategoryUUIDForType(LLFolderType::FT_MATERIAL); + LLUUID parent = gInventory.findUserDefinedCategoryUUIDForType(LLFolderType::FT_MATERIAL); const U8 subtype = NO_INV_SUBTYPE; // TODO maybe use AT_SETTINGS and LLSettingsType::ST_MATERIAL ? create_inventory_item(gAgent.getID(), gAgent.getSessionID(), parent, tid, mMaterialName, res_desc, diff --git a/indra/newview/skins/default/xui/en/menu_inventory.xml b/indra/newview/skins/default/xui/en/menu_inventory.xml index c7c1e1d75a..46dd0ada5d 100644 --- a/indra/newview/skins/default/xui/en/menu_inventory.xml +++ b/indra/newview/skins/default/xui/en/menu_inventory.xml @@ -692,6 +692,14 @@ function="Inventory.FileUploadLocation" parameter="model" /> </menu_item_call> + <menu_item_call + label="PBR material uploads" + layout="topleft" + name="PBR uploads"> + <menu_item_call.on_click + function="Inventory.FileUploadLocation" + parameter="pbr_material" /> + </menu_item_call> </menu> <menu_item_separator layout="topleft" /> diff --git a/indra/newview/skins/default/xui/en/panel_preferences_uploads.xml b/indra/newview/skins/default/xui/en/panel_preferences_uploads.xml index 67eff2b762..08ff3d4d53 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_uploads.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_uploads.xml @@ -126,6 +126,31 @@ type="string" length="1" follows="left|top" + height="12" + layout="topleft" + left="37" + name="title_pbr" + top_pad="7" + width="100"> + PBR Materials + </text> + <text + type="string" + use_ellipses="true" + follows="left|top" + height="27" + layout="topleft" + font.style="BOLD" + left="37" + name="upload_pbr" + top_pad="5" + width="370" + word_wrap="true"/> + + <text + type="string" + length="1" + follows="left|top" height="30" layout="topleft" font.style="ITALIC" |