Fix #122189: Unused IDs with 'extra' usages not shown in Unused Outliner view.
The only ID usages that make it a 'used' ID are its own 'fake user' flag, and normal refcounting usages from other IDs. This was already the behavior of the Purge operation, but the Outliner view would still hide IDs who were only used by shallow 'extra' usages (typically the UI, e.g. the Image Editor).
This commit is contained in:
@@ -64,7 +64,7 @@ ListBase TreeDisplayIDOrphans::build_tree(const TreeSourceData &source_data)
|
||||
|
||||
/* Add the orphaned data-blocks - these will not be added with any subtrees attached. */
|
||||
for (ID *id : List<ID>(lbarray[a])) {
|
||||
if (ID_REAL_USERS(id) <= 0) {
|
||||
if (ID_REFCOUNTING_USERS(id) <= 0) {
|
||||
add_element((te) ? &te->subtree : &tree, id, nullptr, te, TSE_SOME_ID, 0);
|
||||
}
|
||||
}
|
||||
@@ -76,7 +76,7 @@ ListBase TreeDisplayIDOrphans::build_tree(const TreeSourceData &source_data)
|
||||
bool TreeDisplayIDOrphans::datablock_has_orphans(ListBase &lb) const
|
||||
{
|
||||
for (ID *id : List<ID>(lb)) {
|
||||
if (ID_REAL_USERS(id) <= 0) {
|
||||
if (ID_REFCOUNTING_USERS(id) <= 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user