From 306723c6bf7f9ed2bbab3a4e96428b92b592efdf Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Tue, 12 Sep 2023 18:24:29 +0200 Subject: [PATCH] Liboverride/Outliner: Fix assert in Hierarchy view. Not sure why/when that was changed, but drawing code should not assume all items in the hierarchy view tree of the Outliner are liboverrides - it adds e.g. regular local IDs items for the root item of each library hierarchy of linked liboverrides. Reported by @dfelinto & @LukasTonne, thanks. --- source/blender/editors/space_outliner/outliner_draw.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/source/blender/editors/space_outliner/outliner_draw.cc b/source/blender/editors/space_outliner/outliner_draw.cc index 7c807dd339a..d528a21074e 100644 --- a/source/blender/editors/space_outliner/outliner_draw.cc +++ b/source/blender/editors/space_outliner/outliner_draw.cc @@ -1988,11 +1988,14 @@ static void outliner_draw_overrides_restrictbuts(Main *bmain, } ID &id = te_id->get_ID(); - BLI_assert(ID_IS_OVERRIDE_LIBRARY(&id)); - if (ID_IS_LINKED(&id)) { continue; } + if (!ID_IS_OVERRIDE_LIBRARY(&id)) { + /* Some items may not be liboverrides, e.g. the root item for all linked libraries (see + * #TreeDisplayOverrideLibraryHierarchies::build_tree). */ + continue; + } const bool is_system_override = BKE_lib_override_library_is_system_defined(bmain, &id); const BIFIconID icon = is_system_override ? ICON_LIBRARY_DATA_OVERRIDE_NONEDITABLE :