[Bf-blender-cvs] [ed54ee3bac9] soc-2020-outliner: Outliner: Remove camera and collection activation on selection

Nathan Craddock noreply at git.blender.org
Sat Jun 13 23:30:42 CEST 2020


Commit: ed54ee3bac93ee391adccc6254144106a2e7f047
Author: Nathan Craddock
Date:   Sat Jun 13 15:29:54 2020 -0600
Branches: soc-2020-outliner
https://developer.blender.org/rBed54ee3bac93ee391adccc6254144106a2e7f047

Outliner: Remove camera and collection activation on selection

Now that the left column works well for data activation, remove the
albility to activate by clicking the collection or camera data itself.

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

M	source/blender/editors/space_outliner/outliner_draw.c
M	source/blender/editors/space_outliner/outliner_intern.h
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 de7cac82295..8f7afe64dcf 100644
--- a/source/blender/editors/space_outliner/outliner_draw.c
+++ b/source/blender/editors/space_outliner/outliner_draw.c
@@ -1914,7 +1914,7 @@ static void outliner_data_activate_fn(bContext *C, void *tselem_poin, void *UNUS
     return;
   }
 
-  outliner_set_active_data(C, &tvc, soops, te, tselem);
+  outliner_set_active_data(C, &tvc, te, tselem);
 }
 
 static void outliner_mode_toggle_fn(bContext *C, void *tselem_poin, void *UNUSED(arg2))
diff --git a/source/blender/editors/space_outliner/outliner_intern.h b/source/blender/editors/space_outliner/outliner_intern.h
index 590609e1a8a..7ee08d8c448 100644
--- a/source/blender/editors/space_outliner/outliner_intern.h
+++ b/source/blender/editors/space_outliner/outliner_intern.h
@@ -297,7 +297,6 @@ void outliner_item_mode_toggle(struct bContext *C,
 
 void outliner_set_active_data(struct bContext *C,
                               TreeViewContext *tvc,
-                              SpaceOutliner *soops,
                               TreeElement *te,
                               struct TreeStoreElem *tselem);
 
diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c
index 5df46b9edc0..1dd47878298 100644
--- a/source/blender/editors/space_outliner/outliner_select.c
+++ b/source/blender/editors/space_outliner/outliner_select.c
@@ -519,7 +519,7 @@ static eOLDrawState tree_element_active_material(bContext *C,
   return OL_DRAWSEL_NONE;
 }
 
-static eOLDrawState tree_element_active_camera(bContext *C,
+static eOLDrawState tree_element_active_camera(bContext *UNUSED(C),
                                                Scene *scene,
                                                ViewLayer *UNUSED(view_layer),
                                                TreeElement *te,
@@ -528,16 +528,6 @@ static eOLDrawState tree_element_active_camera(bContext *C,
   Object *ob = (Object *)outliner_search_back(te, ID_OB);
 
   if (set != OL_SETSEL_NONE) {
-    scene->camera = ob;
-
-    Main *bmain = CTX_data_main(C);
-    wmWindowManager *wm = bmain->wm.first;
-
-    WM_windows_scene_data_sync(&wm->windows, scene);
-    DEG_id_tag_update(&scene->id, ID_RECALC_COPY_ON_WRITE);
-    DEG_relations_tag_update(bmain);
-    WM_event_add_notifier(C, NC_SCENE | NA_EDITED, NULL);
-
     return OL_DRAWSEL_NONE;
   }
   else {
@@ -1039,12 +1029,6 @@ static eOLDrawState tree_element_active_master_collection(bContext *C,
       return OL_DRAWSEL_NORMAL;
     }
   }
-  else {
-    ViewLayer *view_layer = CTX_data_view_layer(C);
-    LayerCollection *layer_collection = view_layer->layer_collections.first;
-    BKE_layer_collection_activate(view_layer, layer_collection);
-    WM_main_add_notifier(NC_SCENE | ND_LAYER, NULL);
-  }
 
   return OL_DRAWSEL_NONE;
 }
@@ -1060,13 +1044,6 @@ static eOLDrawState tree_element_active_layer_collection(bContext *C,
       return OL_DRAWSEL_NORMAL;
     }
   }
-  else {
-    Scene *scene = CTX_data_scene(C);
-    LayerCollection *layer_collection = te->directdata;
-    ViewLayer *view_layer = BKE_view_layer_find_from_collection(scene, layer_collection);
-    BKE_layer_collection_activate(view_layer, layer_collection);
-    WM_main_add_notifier(NC_SCENE | ND_LAYER, NULL);
-  }
 
   return OL_DRAWSEL_NONE;
 }
@@ -1178,7 +1155,6 @@ static void outliner_set_active_camera(bContext *C, Scene *scene, TreeStoreElem
 
 void outliner_set_active_data(bContext *C,
                               TreeViewContext *tvc,
-                              SpaceOutliner *soops,
                               TreeElement *te,
                               TreeStoreElem *tselem)
 {
@@ -1194,8 +1170,18 @@ void outliner_set_active_data(bContext *C,
       WM_window_set_active_scene(CTX_data_main(C), C, CTX_wm_window(C), scene);
     }
   }
-  else if (outliner_is_collection_tree_element(te)) {
-    tree_element_type_active(C, tvc, soops, te, tselem, OL_SETSEL_NORMAL, false);
+  else if (tselem->type == TSE_VIEW_COLLECTION_BASE) {
+    ViewLayer *view_layer = CTX_data_view_layer(C);
+    LayerCollection *layer_collection = view_layer->layer_collections.first;
+    BKE_layer_collection_activate(view_layer, layer_collection);
+    WM_main_add_notifier(NC_SCENE | ND_LAYER, NULL);
+  }
+  else if (tselem->type == TSE_LAYER_COLLECTION) {
+    Scene *scene = CTX_data_scene(C);
+    LayerCollection *layer_collection = te->directdata;
+    ViewLayer *view_layer = BKE_view_layer_find_from_collection(scene, layer_collection);
+    BKE_layer_collection_activate(view_layer, layer_collection);
+    WM_main_add_notifier(NC_SCENE | ND_LAYER, NULL);
   }
 }



More information about the Bf-blender-cvs mailing list