diff options
author | Bastien Montagne <bastien@blender.org> | 2022-08-12 16:06:18 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2022-08-12 16:11:59 +0300 |
commit | c73cc15e07ea6b0e2e4d1f7fa419e428291f45ad (patch) | |
tree | 4f1e53c0a9ac345d9a20aa8ca48856826f9ad057 /release | |
parent | 4dc9a8a21e82d1c56419713c517b38728993ed8a (diff) |
LibOverride: Rework Outliner contextual menu.
Follow-up to design discussions here at the studio, add liboverride
operations into their own sub-menu, with three main entries:
- Create: Create, or enable for user editing, override hierarchies.
- Reset: Keep overrides data, but reset all local changes to the
reference linked data values.
- Clear: like reset, but also turn editable overrides back to system
overrides (aka non user editable).
Those three options can all operate either on the selected items, their
content only, or both.
Advanced operations are moved into a "Troubleshoot Hierarchy" sub-menu,
where one can resync, resync enforced, and fully delete library
overrides. Those operations always affect a whole override hierarchy,
regardless of which items are selected or not.
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/startup/bl_ui/space_outliner.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/release/scripts/startup/bl_ui/space_outliner.py b/release/scripts/startup/bl_ui/space_outliner.py index 011a430a1ec..66e6a174003 100644 --- a/release/scripts/startup/bl_ui/space_outliner.py +++ b/release/scripts/startup/bl_ui/space_outliner.py @@ -97,6 +97,10 @@ class OUTLINER_MT_context_menu(Menu): layout.separator() + layout.menu("OUTLINER_MT_liboverride") + + layout.separator() + layout.menu("OUTLINER_MT_context_menu_view") layout.separator() @@ -320,6 +324,19 @@ class OUTLINER_MT_asset(Menu): layout.operator("asset.clear", text="Clear Asset (Set Fake User)").set_fake_user = True +class OUTLINER_MT_liboverride(Menu): + bl_label = "Library Override" + + def draw(self, _context): + layout = self.layout + + layout.operator_menu_enum("outliner.liboverride_operation", "selection_set", text="Create").type = 'OVERRIDE_LIBRARY_CREATE_HIERARCHY' + layout.operator_menu_enum("outliner.liboverride_operation", "selection_set", text="Reset").type = 'OVERRIDE_LIBRARY_RESET' + layout.operator_menu_enum("outliner.liboverride_operation", "selection_set", text="Clear").type = 'OVERRIDE_LIBRARY_CLEAR_SINGLE' + + layout.operator_menu_enum("outliner.liboverride_troubleshoot_operation", "type", text="Troubleshoot Hierarchy").selection_set = 'SELECTED' + + class OUTLINER_PT_filter(Panel): bl_space_type = 'OUTLINER' bl_region_type = 'HEADER' @@ -457,6 +474,7 @@ classes = ( OUTLINER_MT_collection_view_layer, OUTLINER_MT_object, OUTLINER_MT_asset, + OUTLINER_MT_liboverride, OUTLINER_MT_context_menu, OUTLINER_MT_context_menu_view, OUTLINER_MT_view_pie, |