diff --git a/source/blender/editors/space_outliner/outliner_intern.h b/source/blender/editors/space_outliner/outliner_intern.h index 85bbbd4fffb..1a6448588aa 100644 --- a/source/blender/editors/space_outliner/outliner_intern.h +++ b/source/blender/editors/space_outliner/outliner_intern.h @@ -143,9 +143,6 @@ void outliner_build_tree(struct Main *mainvar, struct Scene *scene, struct Space void draw_outliner(const struct bContext *C); /* outliner_select.c -------------------------------------------- */ - -void outliner_select(struct SpaceOops *soops, ListBase *lb, int *index, short *selecting); - int tree_element_type_active(struct bContext *C, struct Scene *scene, struct SpaceOops *soops, TreeElement *te, TreeStoreElem *tselem, int set); int tree_element_active(struct bContext *C, struct Scene *scene, SpaceOops *soops, TreeElement *te, int set); diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c index 620a936a944..46a9bde8267 100644 --- a/source/blender/editors/space_outliner/outliner_select.c +++ b/source/blender/editors/space_outliner/outliner_select.c @@ -106,10 +106,11 @@ /* ****************************************************** */ /* Outliner Selection (grey-blue highlight for rows) */ -void outliner_select(SpaceOops *soops, ListBase *lb, int *index, short *selecting) +static int outliner_select(SpaceOops *soops, ListBase *lb, int *index, short *selecting) { TreeElement *te; TreeStoreElem *tselem; + int change= 0; for (te= lb->first; te && *index >= 0; te=te->next, (*index)--) { tselem= TREESTORE(te); @@ -131,6 +132,8 @@ void outliner_select(SpaceOops *soops, ListBase *lb, int *index, short *selectin tselem->flag |= TSE_SELECTED; else tselem->flag &= ~TSE_SELECTED; + + change |= 1; } } else if ((tselem->flag & TSE_CLOSED)==0) { @@ -142,10 +145,12 @@ void outliner_select(SpaceOops *soops, ListBase *lb, int *index, short *selectin * function correctly */ (*index)--; - outliner_select(soops, &te->subtree, index, selecting); + change |= outliner_select(soops, &te->subtree, index, selecting); (*index)++; } } + + return change; } /* ****************************************************** */ @@ -839,11 +844,14 @@ static int outliner_item_activate(bContext *C, wmOperator *op, wmEvent *event) fmval[0], fmval[1], NULL, &row); /* select relevant row */ - outliner_select(soops, &soops->tree, &row, &selecting); + if(outliner_select(soops, &soops->tree, &row, &selecting)) { - soops->storeflag |= SO_TREESTORE_REDRAW; + soops->storeflag |= SO_TREESTORE_REDRAW; - ED_undo_push(C, "Outliner selection event"); + /* no need for undo push here, only changing outliner data which is + * scene level - campbell */ + /* ED_undo_push(C, "Outliner selection event"); */ + } } ED_region_tag_redraw(ar);