diff options
author | Lukas Tönne <lukas.toenne@gmail.com> | 2016-04-28 18:33:19 +0300 |
---|---|---|
committer | Lukas Tönne <lukas.toenne@gmail.com> | 2016-04-28 18:33:19 +0300 |
commit | 1f723603c882e6d79ab69bea6e5c034ae21a6ce7 (patch) | |
tree | 098b0133beea06c460c3e9e92010bc669d151e5d /source/blender/editors/space_outliner/outliner_tree.c | |
parent | 3632c4997f5019d2a519996d9e216d474aa05d3b (diff) | |
parent | a48d7407986d04492107a2ef16d0ff6f0d012c45 (diff) |
Merge branch 'master' into temp_remove_particlestemp_remove_particles
Diffstat (limited to 'source/blender/editors/space_outliner/outliner_tree.c')
-rw-r--r-- | source/blender/editors/space_outliner/outliner_tree.c | 62 |
1 files changed, 50 insertions, 12 deletions
diff --git a/source/blender/editors/space_outliner/outliner_tree.c b/source/blender/editors/space_outliner/outliner_tree.c index 666179dd3c7..83d8519a7cb 100644 --- a/source/blender/editors/space_outliner/outliner_tree.c +++ b/source/blender/editors/space_outliner/outliner_tree.c @@ -198,7 +198,7 @@ void outliner_cleanup_tree(SpaceOops *soops) } /* Find specific item from the treestore */ -TreeElement *outliner_find_tree_element(ListBase *lb, TreeStoreElem *store_elem) +TreeElement *outliner_find_tree_element(ListBase *lb, const TreeStoreElem *store_elem) { TreeElement *te, *tes; for (te = lb->first; te; te = te->next) { @@ -210,7 +210,7 @@ TreeElement *outliner_find_tree_element(ListBase *lb, TreeStoreElem *store_elem) } /* tse is not in the treestore, we use its contents to find a match */ -TreeElement *outliner_find_tse(SpaceOops *soops, TreeStoreElem *tse) +TreeElement *outliner_find_tse(SpaceOops *soops, const TreeStoreElem *tse) { TreeStoreElem *tselem; @@ -225,25 +225,63 @@ TreeElement *outliner_find_tse(SpaceOops *soops, TreeStoreElem *tse) } /* Find treestore that refers to given ID */ -TreeElement *outliner_find_id(SpaceOops *soops, ListBase *lb, ID *id) +TreeElement *outliner_find_id(SpaceOops *soops, ListBase *lb, const ID *id) { - TreeElement *te, *tes; - TreeStoreElem *tselem; - - for (te = lb->first; te; te = te->next) { - tselem = TREESTORE(te); + for (TreeElement *te = lb->first; te; te = te->next) { + TreeStoreElem *tselem = TREESTORE(te); if (tselem->type == 0) { - if (tselem->id == id) return te; + if (tselem->id == id) { + return te; + } /* only deeper on scene or object */ - if (te->idcode == ID_OB || te->idcode == ID_SCE || (soops->outlinevis == SO_GROUPS && te->idcode == ID_GR)) { - tes = outliner_find_id(soops, &te->subtree, id); - if (tes) return tes; + if (ELEM(te->idcode, ID_OB, ID_SCE) || + ((soops->outlinevis == SO_GROUPS) && (te->idcode == ID_GR))) + { + TreeElement *tes = outliner_find_id(soops, &te->subtree, id); + if (tes) { + return tes; + } + } + } + } + return NULL; +} + +TreeElement *outliner_find_posechannel(SpaceOops *soops, ListBase *lb, const bPoseChannel *pchan) +{ + for (TreeElement *te = lb->first; te; te = te->next) { + if (te->directdata == pchan) { + return te; + } + + TreeStoreElem *tselem = TREESTORE(te); + if (ELEM(tselem->type, TSE_POSE_BASE, TSE_POSE_CHANNEL)) { + TreeElement *tes = outliner_find_posechannel(soops, &te->subtree, pchan); + if (tes) { + return tes; } } } return NULL; } +TreeElement *outliner_find_editbone(SpaceOops *soops, ListBase *lb, const EditBone *ebone) +{ + for (TreeElement *te = lb->first; te; te = te->next) { + if (te->directdata == ebone) { + return te; + } + + TreeStoreElem *tselem = TREESTORE(te); + if (ELEM(tselem->type, 0, TSE_EBONE)) { + TreeElement *tes = outliner_find_editbone(soops, &te->subtree, ebone); + if (tes) { + return tes; + } + } + } + return NULL; +} ID *outliner_search_back(SpaceOops *UNUSED(soops), TreeElement *te, short idcode) { |