[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [39532] trunk/blender/source/blender/ editors/space_outliner: minor change for operator OUTLINER_OT_item_activate

Campbell Barton ideasman42 at gmail.com
Thu Aug 18 20:42:42 CEST 2011


Revision: 39532
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=39532
Author:   campbellbarton
Date:     2011-08-18 18:42:42 +0000 (Thu, 18 Aug 2011)
Log Message:
-----------
minor change for operator OUTLINER_OT_item_activate

Noticed clicking anywhere in the outliner was doing undo pushes, even in empty areas.

- check if any selection is made before redrawing.
- don't do an undo push when selecting outliner items since only screen data is touched here.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_outliner/outliner_intern.h
    trunk/blender/source/blender/editors/space_outliner/outliner_select.c

Modified: trunk/blender/source/blender/editors/space_outliner/outliner_intern.h
===================================================================
--- trunk/blender/source/blender/editors/space_outliner/outliner_intern.h	2011-08-18 17:47:13 UTC (rev 39531)
+++ trunk/blender/source/blender/editors/space_outliner/outliner_intern.h	2011-08-18 18:42:42 UTC (rev 39532)
@@ -143,9 +143,6 @@
 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);
 

Modified: trunk/blender/source/blender/editors/space_outliner/outliner_select.c
===================================================================
--- trunk/blender/source/blender/editors/space_outliner/outliner_select.c	2011-08-18 17:47:13 UTC (rev 39531)
+++ trunk/blender/source/blender/editors/space_outliner/outliner_select.c	2011-08-18 18:42:42 UTC (rev 39532)
@@ -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 @@
 					tselem->flag |= TSE_SELECTED;
 				else 
 					tselem->flag &= ~TSE_SELECTED;
+
+				change |= 1;
 			}
 		}
 		else if ((tselem->flag & TSE_CLOSED)==0) {
@@ -142,10 +145,12 @@
 			 * 	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 @@
 						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);




More information about the Bf-blender-cvs mailing list