Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSybren A. Stüvel <sybren@blender.org>2021-09-28 16:04:55 +0300
committerSybren A. Stüvel <sybren@blender.org>2021-09-28 16:04:55 +0300
commit3674347849311b3722c27c67a61b1fac5528bd6b (patch)
tree1aa54d5f4b2e36952e15120ea89ce60aa823b082 /release/scripts/startup/bl_ui/space_outliner.py
parent73b2ecb2975eb0438473e65c4c8f691e36524399 (diff)
Assets: Clear Asset operator variants for clearing/setting Fake User
The Clear Asset operator (`ASSET_OT_clear`) now clears the Fake User. This makes it symmetrical with the Mark Asset (`ASSET_OT_mark`) operator, which sets Fake User to ensure assets are always saved to disk. Clear Asset now also has a `set_fake_user` boolean option, which allows users to Clear Asset and set Fake User in one go. The asset browser now shows these options in the context menu: - Clear Asset: also clears Fake User. This makes it possible to actually remove assets from the blend file without leaving the Asset Browser. - Clear Asset (Set Fake User): keeps the Fake User bit set. This makes it possible to "hide" the asset from the asset browser, without loosing the actual data. Internally, the `ED_asset_clear_id(id)` function now always clears the Fake User bit. If it was intended that this bit was kept set, it's up to the caller to explicitly call `id_fake_user_set(id)` afterwards. Manifest Task: T90844 Reviewed By: Severin Differential Revision: https://developer.blender.org/D12663
Diffstat (limited to 'release/scripts/startup/bl_ui/space_outliner.py')
-rw-r--r--release/scripts/startup/bl_ui/space_outliner.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/release/scripts/startup/bl_ui/space_outliner.py b/release/scripts/startup/bl_ui/space_outliner.py
index febd064147f..3d18160d90f 100644
--- a/release/scripts/startup/bl_ui/space_outliner.py
+++ b/release/scripts/startup/bl_ui/space_outliner.py
@@ -323,7 +323,8 @@ class OUTLINER_MT_asset(Menu):
space = context.space_data
layout.operator("asset.mark")
- layout.operator("asset.clear")
+ layout.operator("asset.clear", text="Clear Asset").set_fake_user = False
+ layout.operator("asset.clear", text="Clear Asset (Set Fake User)").set_fake_user = True
class OUTLINER_PT_filter(Panel):