From e84b42bfcf105be555c6cfef2692d20b223cdad4 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Fri, 25 Feb 2022 15:06:43 +0100 Subject: Fix (unreported) Outliner 'liboverride create hierarchy' applied on several IDs. This operation can only be applied on one ID at a time, so only apply it to the active Outliner item, and not all the selected ones. Also renamed `Make Library Override` menu entry to `Make Library Override Single` to emphasis this is not the 'default expected' option for the user. --- source/blender/editors/space_outliner/outliner_tools.cc | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'source') diff --git a/source/blender/editors/space_outliner/outliner_tools.cc b/source/blender/editors/space_outliner/outliner_tools.cc index 03fc4c20fe5..2a3c0a9392b 100644 --- a/source/blender/editors/space_outliner/outliner_tools.cc +++ b/source/blender/editors/space_outliner/outliner_tools.cc @@ -814,6 +814,13 @@ static void id_override_library_create_fn(bContext *C, void *user_data) { BLI_assert(TSE_IS_REAL_ID(tselem)); + + /* We can only safely apply this operation on one item at a time, so only do it on the active + * one. */ + if ((tselem->flag & TSE_ACTIVE) == 0) { + return; + } + ID *id_root = tselem->id; OutlinerLibOverrideData *data = reinterpret_cast(user_data); const bool do_hierarchy = data->do_hierarchy; @@ -1829,13 +1836,15 @@ static const EnumPropertyItem prop_id_op_types[] = { {OUTLINER_IDOP_OVERRIDE_LIBRARY_CREATE, "OVERRIDE_LIBRARY_CREATE", 0, - "Make Library Override", - "Make a local override of this linked data-block"}, + "Make Library Override Single", + "Make a single, out-of-hierarchy local override of this linked data-block - only applies to " + "active Outliner item"}, {OUTLINER_IDOP_OVERRIDE_LIBRARY_CREATE_HIERARCHY, "OVERRIDE_LIBRARY_CREATE_HIERARCHY", 0, "Make Library Override Hierarchy", - "Make a local override of this linked data-block, and its hierarchy of dependencies"}, + "Make a local override of this linked data-block, and its hierarchy of dependencies - only " + "applies to active Outliner item"}, {OUTLINER_IDOP_OVERRIDE_LIBRARY_PROXY_CONVERT, "OVERRIDE_LIBRARY_PROXY_CONVERT", 0, -- cgit v1.2.3