[Bf-blender-cvs] [53ea46d36c3] blender2.8: Outliner: Fix selection drawing

Dalai Felinto noreply at git.blender.org
Wed Dec 13 19:27:34 CET 2017


Commit: 53ea46d36c30cc43f5241384d2ac614c7ed14b1f
Author: Dalai Felinto
Date:   Wed Dec 13 16:23:56 2017 -0200
Branches: blender2.8
https://developer.blender.org/rB53ea46d36c30cc43f5241384d2ac614c7ed14b1f

Outliner: Fix selection drawing

Outliner was using the old selection flag to show selected objects.
So if you selected an object in the outliner it would keep "selected"
(drawn in yellow) even after you selected another object.

===================================================================

M	source/blender/editors/space_outliner/outliner_draw.c
M	source/blender/editors/space_outliner/outliner_select.c

===================================================================

diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c
index 670fc4e6627..cecfc0cb71d 100644
--- a/source/blender/editors/space_outliner/outliner_draw.c
+++ b/source/blender/editors/space_outliner/outliner_draw.c
@@ -1378,22 +1378,24 @@ static void outliner_draw_tree_element(
 			}
 			else if (te->idcode == ID_OB) {
 				Object *ob = (Object *)tselem->id;
-				
-				if (ob == OBACT(view_layer) || (ob->flag & SELECT)) {
+				Base *base = (Base *)te->directdata;
+				const bool is_selected = (base != NULL) && ((base->flag & BASE_SELECTED) != 0);
+
+				if (ob == OBACT(view_layer) || is_selected) {
 					char col[4] = {0, 0, 0, 0};
 					
 					/* outliner active ob: always white text, circle color now similar to view3d */
 					
 					active = OL_DRAWSEL_ACTIVE;
 					if (ob == OBACT(view_layer)) {
-						if (ob->flag & SELECT) {
+						if (is_selected) {
 							UI_GetThemeColorType4ubv(TH_ACTIVE, SPACE_VIEW3D, col);
 							col[3] = alpha;
 						}
 						
 						active = OL_DRAWSEL_NORMAL;
 					}
-					else if (ob->flag & SELECT) {
+					else if (is_selected) {
 						UI_GetThemeColorType4ubv(TH_SELECT, SPACE_VIEW3D, col);
 						col[3] = alpha;
 					}
diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c
index 1806d52f1b3..fcbb0986e09 100644
--- a/source/blender/editors/space_outliner/outliner_select.c
+++ b/source/blender/editors/space_outliner/outliner_select.c
@@ -185,7 +185,7 @@ static eOLDrawState tree_element_set_active_object(
 
 		if (recursive) {
 			/* Recursive select/deselect for Object hierarchies */
-			do_outliner_object_select_recursive(view_layer, ob, (ob->flag & SELECT) != 0);
+			do_outliner_object_select_recursive(view_layer, ob, (base->flag & BASE_SELECTED) != 0);
 		}
 
 		if (set != OL_SETSEL_NONE) {



More information about the Bf-blender-cvs mailing list