From c73cc15e07ea6b0e2e4d1f7fa419e428291f45ad Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Fri, 12 Aug 2022 15:06:18 +0200 Subject: 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. --- release/scripts/startup/bl_ui/space_outliner.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'release/scripts/startup') 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, -- cgit v1.2.3