diff --git a/source/blender/editors/space_outliner/outliner_utils.cc b/source/blender/editors/space_outliner/outliner_utils.cc index 4a1ce077ee3..8833d66f4de 100644 --- a/source/blender/editors/space_outliner/outliner_utils.cc +++ b/source/blender/editors/space_outliner/outliner_utils.cc @@ -31,6 +31,7 @@ #include "outliner_intern.hh" #include "tree/tree_display.hh" +#include "tree/tree_element_rna.hh" namespace blender::ed::outliner { @@ -195,6 +196,19 @@ TreeElement *outliner_find_id(SpaceOutliner *space_outliner, ListBase *lb, const return te; } } + else if (tselem->type == TSE_RNA_STRUCT) { + /* No ID, so check if entry is RNA-struct, and if that RNA-struct is an ID datablock we are + * good. */ + const TreeElementRNAStruct *te_rna_struct = tree_element_cast(te); + if (te_rna_struct) { + const PointerRNA &ptr = te_rna_struct->get_pointer_rna(); + if (RNA_struct_is_ID(ptr.type)) { + if (static_cast(ptr.data) == id) { + return te; + } + } + } + } TreeElement *tes = outliner_find_id(space_outliner, &te->subtree, id); if (tes) {