[Bf-blender-cvs] [fcbae6c3b3] blender2.8: Outliner: Highlight active layer collection in "All Collections" mode

Julian Eisel noreply at git.blender.org
Tue Feb 28 21:58:49 CET 2017


Commit: fcbae6c3b389c81777d74d6db7676de4254dbc0e
Author: Julian Eisel
Date:   Tue Feb 28 21:58:07 2017 +0100
Branches: blender2.8
https://developer.blender.org/rBfcbae6c3b389c81777d74d6db7676de4254dbc0e

Outliner: Highlight active layer collection in "All Collections" mode

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

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

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

diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c
index cb4d5e9255..dd89a36fe9 100644
--- a/source/blender/editors/space_outliner/outliner_select.c
+++ b/source/blender/editors/space_outliner/outliner_select.c
@@ -755,14 +755,20 @@ static eOLDrawState tree_element_active_keymap_item(
 }
 
 static eOLDrawState tree_element_active_collection(
-        bContext *C, TreeElement *te, TreeStoreElem *UNUSED(tselem), const eOLSetState set)
+        bContext *C, TreeElement *te, TreeStoreElem *tselem, const eOLSetState set)
 {
 	if (set == OL_SETSEL_NONE) {
-		if (CTX_data_layer_collection(C) == te->directdata) {
+		LayerCollection *active = CTX_data_layer_collection(C);
+
+		if ((tselem->type == TSE_SCENE_COLLECTION && active->scene_collection == te->directdata) ||
+		    (tselem->type == TSE_LAYER_COLLECTION && active == te->directdata))
+		{
 			return OL_DRAWSEL_NORMAL;
 		}
 	}
-	else {
+	/* don't allow selecting a scene collection, it can have multiple layer collection
+	 * instances (which one would the user want to be selected then?) */
+	else if (tselem->type == TSE_LAYER_COLLECTION) {
 		SceneLayer *sl = CTX_data_scene_layer(C);
 		LayerCollection *lc = te->directdata;
 		const int collection_index = BKE_layer_collection_findindex(sl, lc);
@@ -850,6 +856,7 @@ eOLDrawState tree_element_type_active(
 		case TSE_GP_LAYER:
 			//return tree_element_active_gplayer(C, scene, s, te, tselem, set);
 			break;
+		case TSE_SCENE_COLLECTION:
 		case TSE_LAYER_COLLECTION:
 			return tree_element_active_collection(C, te, tselem, set);
 	}




More information about the Bf-blender-cvs mailing list