Fix Outliner highlighting multiple base elements in different libraries

In the Blender File display mode of the Outliner, mouse hovering a
"base" element (e.g. "Objects", "Materials", ...) would also highlight
that same base element in other libraries linked into the scene. In fact
operations like (un)collapsing would be applied to both too.
Issue was that we'd always use the listbase containing the data-blocks
from the current main as a way to identify the tree element. So for the
same data-block types we'd use the same listbase pointers. Instead use
the the library pointer + a per library index.
This commit is contained in:
Julian Eisel 2022-03-25 19:00:04 +01:00
parent 2631b44e71
commit ba49345705
Notes: blender-bot 2023-02-14 05:44:22 +01:00
Referenced by commit e772087ed6, Fix T98753: Outliner Unlink material in Blender File mode crashes
Referenced by commit 4a5cd4e6c7, Fix T96844: Crash when switching workspaces and outliner modes
Referenced by issue #103881, Regression: Blender Crash when unlinking a Collection from Blender File
Referenced by issue #98753, Regression: Outliner Unlink material crash Blender 3.2
Referenced by issue #96844, Crash when trying to switch between workspaces and outliner modes
Referenced by issue #92680, UI glitch in Outliner when opening file containing linked file
Referenced by issue #82191, Outliner: Blender File view will collapse/expand libraries of different .blends simulatiously
Referenced by issue #82180, Expanded items in outliner (Blender File) become collapsed when any undo is done.
1 changed files with 1 additions and 1 deletions

View File

@ -150,7 +150,7 @@ TreeElement *TreeDisplayLibraries::add_library_contents(Main &mainvar, ListBase
}
else {
ten = outliner_add_element(
&space_outliner_, &tenlib->subtree, lbarray[a], nullptr, TSE_ID_BASE, 0);
&space_outliner_, &tenlib->subtree, lib, nullptr, TSE_ID_BASE, a);
ten->directdata = lbarray[a];
ten->name = outliner_idcode_to_plural(GS(id->name));
}