Commit: c40ec17fd358e16c360fb259da3668a09a2ab023
Author: Nathan Craddock
Date:   Mon Jul 8 22:45:02 2019 -0600
Branches: soc-2019-outliner
https://developer.blender.org/rBc40ec17fd358e16c360fb259da3668a09a2ab023

Outliner: Support selecting other objects when in edit/pose modes

When selecting in the outliner, rather than activating other
elements when in edit or pose mode, just select. This is useful
for selecting other objects while in edit/pose modes for adding
parents, hooks, etc.

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

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 6b6774f19a9..cbf17ad1e58 100644
--- a/source/blender/editors/space_outliner/outliner_select.c
+++ b/source/blender/editors/space_outliner/outliner_select.c
@@ -1123,9 +1123,8 @@ static void 
do_outliner_item_activate_tree_element(bContext *C,
                                                    const bool extend,
                                                    const bool recursive)
 {
-  /* Set TreeStore flags for active element */
-  outliner_flag_set(&soops->tree, TSE_ACTIVE, false);
-  tselem->flag |= TSE_ACTIVE;
+  TreeElement *te_active = outliner_find_active_element(&soops->tree);
+  Object *obact = OBACT(view_layer);
 
   /* Always makes active object, except for some specific types. */
   if (ELEM(tselem->type,
@@ -1143,6 +1142,10 @@ static void 
do_outliner_item_activate_tree_element(bContext *C,
   else if (tselem->type == TSE_POSE_BASE) {
     /* Support pose mode toggle, keeping the active object as is. */
   }
+  else if (ELEM(obact->mode, OB_MODE_EDIT, OB_MODE_POSE) && (te != te_active)) 
{
+    /* Select rather than activate other elements when in edit or pose mode */
+    return;
+  }
   else if (soops->flag & SO_SYNC_SELECTION) {
     tree_element_set_active_object(C,
                                    scene,
@@ -1154,6 +1157,9 @@ static void 
do_outliner_item_activate_tree_element(bContext *C,
                                    recursive && tselem->type == 0);
   }
 
+  outliner_flag_set(&soops->tree, TSE_ACTIVE, false);
+  tselem->flag |= TSE_ACTIVE;
+
   if (tselem->type == 0) {  // the lib blocks
     /* editmode? */
     if (te->idcode == ID_SCE) {

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to