diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2022-10-13 21:01:35 +0300 |
---|---|---|
committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2022-10-13 21:02:02 +0300 |
commit | 3d170fae5d528dfbecacc913fb68c870abbf9ce2 (patch) | |
tree | 2dfb72bd61c0b0226ddc6e7f3027871972814cf7 /indra | |
parent | 0e3f8db632e2f616b0ab9bd3363c20d2f1acb549 (diff) |
SL-18125 Separate GLTF permissions from normal uploads
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/app_settings/settings.xml | 55 | ||||
-rw-r--r-- | indra/newview/llfloaterperms.cpp | 1 | ||||
-rw-r--r-- | indra/newview/llmaterialeditor.cpp | 10 | ||||
-rw-r--r-- | indra/newview/llviewerinventory.cpp | 22 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_perms_default.xml | 68 |
5 files changed, 149 insertions, 7 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 2eee9f2f25..4171b52938 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -16136,6 +16136,61 @@ <key>Value</key> <integer>1</integer> </map> + <key>MaterialsNextOwnerCopy</key> + <map> + <key>Comment</key> + <string>Newly created GLTF material can be copied by next owner</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> + <key>MaterialsNextOwnerModify</key> + <map> + <key>Comment</key> + <string>Newly created GLTF material can be modified by next owner</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> + <key>MaterialsNextOwnerTransfer</key> + <map> + <key>Comment</key> + <string>Newly created GLTF material can be resold or given away by next owner</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> + <key>MaterialsEveryoneCopy</key> + <map> + <key>Comment</key> + <string>Everyone can copy the newly created GLTF material</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> + <key>MaterialsShareWithGroup</key> + <map> + <key>Comment</key> + <string>Newly created GLTF materials are shared with the currently active group</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> <key>DefaultUploadPermissionsConverted</key> <map> <key>Comment</key> diff --git a/indra/newview/llfloaterperms.cpp b/indra/newview/llfloaterperms.cpp index 649a107d74..fb55c6c6c4 100644 --- a/indra/newview/llfloaterperms.cpp +++ b/indra/newview/llfloaterperms.cpp @@ -123,6 +123,7 @@ const std::string LLFloaterPermsDefault::sCategoryNames[CAT_LAST] = "Gestures", "Wearables", "Settings" + "Materials" }; BOOL LLFloaterPermsDefault::postBuild() diff --git a/indra/newview/llmaterialeditor.cpp b/indra/newview/llmaterialeditor.cpp index dfb43dfe0d..4a75426265 100644 --- a/indra/newview/llmaterialeditor.cpp +++ b/indra/newview/llmaterialeditor.cpp @@ -935,7 +935,7 @@ bool LLMaterialEditor::saveIfNeeded() tid.generate(); // timestamp-based randomization + uniquification LLAssetID new_asset_id = tid.makeAssetID(gAgent.getSecureSessionID()); std::string res_desc = buildMaterialDescription(); - U32 next_owner_perm = LLFloaterPerms::getNextOwnerPerms("Uploads"); + U32 next_owner_perm = LLFloaterPerms::getNextOwnerPerms("Materials"); LLUUID parent = gInventory.findUserDefinedCategoryUUIDForType(LLFolderType::FT_MATERIAL); const U8 subtype = NO_INV_SUBTYPE; // TODO maybe use AT_SETTINGS and LLSettingsType::ST_MATERIAL ? @@ -948,11 +948,11 @@ bool LLMaterialEditor::saveIfNeeded() { // create_inventory_item doesn't allow presetting some permissions, fix it now LLPermissions perm = item->getPermissions(); - if (perm.getMaskEveryone() != LLFloaterPerms::getEveryonePerms("Uploads") - || perm.getMaskGroup() != LLFloaterPerms::getGroupPerms("Uploads")) + if (perm.getMaskEveryone() != LLFloaterPerms::getEveryonePerms("Materials") + || perm.getMaskGroup() != LLFloaterPerms::getGroupPerms("Materials")) { - perm.setMaskEveryone(LLFloaterPerms::getEveryonePerms("Uploads")); - perm.setMaskGroup(LLFloaterPerms::getGroupPerms("Uploads")); + perm.setMaskEveryone(LLFloaterPerms::getEveryonePerms("Materials")); + perm.setMaskGroup(LLFloaterPerms::getGroupPerms("Materials")); item->setPermissions(perm); diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 2265379ce4..b4feafb7ff 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -999,6 +999,21 @@ void create_notecard_cb(const LLUUID& inv_item) } } +void create_gltf_material_cb(const LLUUID& inv_item) +{ + if (!inv_item.isNull()) + { + LLViewerInventoryItem* item = gInventory.getItem(inv_item); + if (item) + { + set_default_permissions(item, "Materials"); + + gInventory.updateItem(item); + gInventory.notifyObservers(); + } + } +} + LLInventoryCallbackManager gInventoryCallbacks; void create_inventory_item(const LLUUID& agent_id, const LLUUID& session_id, @@ -1623,6 +1638,13 @@ void create_new_item(const std::string& name, next_owner_perm = LLFloaterPerms::getNextOwnerPerms("Notecards"); break; } + + case LLInventoryType::IT_MATERIAL: + { + cb = new LLBoostFuncInventoryCallback(create_gltf_material_cb); + next_owner_perm = LLFloaterPerms::getNextOwnerPerms("Materials"); + break; + } default: break; } diff --git a/indra/newview/skins/default/xui/en/floater_perms_default.xml b/indra/newview/skins/default/xui/en/floater_perms_default.xml index 49dc719a24..9ca61671e1 100644 --- a/indra/newview/skins/default/xui/en/floater_perms_default.xml +++ b/indra/newview/skins/default/xui/en/floater_perms_default.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater legacy_header_height="18" - height="250" + height="266" layout="topleft" name="perms default" help_topic="perms_default" @@ -10,7 +10,7 @@ width="700"> <panel follows="left|top|right|bottom" - height="200" + height="216" label="Default Permissions" layout="topleft" left="10" @@ -549,6 +549,70 @@ left_pad="0" top_delta="0" width="100" /> + <text + name="label_14" + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="0" + tool_tip="Set default permissions for when GLTF Materials are created" + width="100"> + Materials + </text> + <icon + follows="left|top" + height="16" + image_name="Inv_Material" + layout="topleft" + left_pad="2" + width="18"/> + <check_box + control_name="MaterialsNextOwnerCopy" + height="16" + layout="topleft" + name="env_material_c" + left_pad="45" + top_delta="0" + width="100"> + <check_box.commit_callback + function="PermsDefault.Copy" + parameter="Materials" /> + </check_box> + <check_box + control_name="MaterialsNextOwnerModify" + height="16" + layout="topleft" + name="env_materials_m" + left_pad="0" + top_delta="0" + width="100" /> + <check_box + enabled_control="MaterialsNextOwnerCopy" + control_name="MaterialsNextOwnerTransfer" + height="16" + layout="topleft" + name="env_materials_t" + left_pad="0" + top_delta="0" + width="100" /> + <check_box + control_name="MaterialsShareWithGroup" + height="16" + layout="topleft" + name="env_materials_s" + left_pad="0" + top_delta="0" + width="120" /> + <check_box + control_name="MaterialsEveryoneCopy" + height="16" + layout="topleft" + name="env_materials_e" + left_pad="0" + top_delta="0" + width="100" /> </panel> <button height="20" |