diff options
Diffstat (limited to 'source/blender/editors/space_outliner/outliner_utils.c')
-rw-r--r-- | source/blender/editors/space_outliner/outliner_utils.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/source/blender/editors/space_outliner/outliner_utils.c b/source/blender/editors/space_outliner/outliner_utils.c index a058c30cef2..5f19d8b8757 100644 --- a/source/blender/editors/space_outliner/outliner_utils.c +++ b/source/blender/editors/space_outliner/outliner_utils.c @@ -256,7 +256,7 @@ TreeElement *outliner_find_editbone(ListBase *lb, const EditBone *ebone) return NULL; } -ID *outliner_search_back(TreeElement *te, short idcode) +TreeElement *outliner_search_back_te(TreeElement *te, short idcode) { TreeStoreElem *tselem; te = te->parent; @@ -264,13 +264,26 @@ ID *outliner_search_back(TreeElement *te, short idcode) while (te) { tselem = TREESTORE(te); if (tselem->type == 0 && te->idcode == idcode) { - return tselem->id; + return te; } te = te->parent; } return NULL; } +ID *outliner_search_back(TreeElement *te, short idcode) +{ + TreeElement *search_te; + TreeStoreElem *tselem; + + search_te = outliner_search_back_te(te, idcode); + if (search_te) { + tselem = TREESTORE(search_te); + return tselem->id; + } + return NULL; +} + /** * Iterate over all tree elements (pre-order traversal), executing \a func callback for * each tree element matching the optional filters. |