[Bf-blender-cvs] [aa6c8f609ce] soc-2019-outliner: Outliner: Disable synced selection in certain modes

Nathan Craddock noreply at git.blender.org
Fri Jul 12 01:14:36 CEST 2019


Commit: aa6c8f609ce4d9312818910f079c4cfea280c635
Author: Nathan Craddock
Date:   Thu Jul 11 17:13:05 2019 -0600
Branches: soc-2019-outliner
https://developer.blender.org/rBaa6c8f609ce4d9312818910f079c4cfea280c635

Outliner: Disable synced selection in certain modes

Certain display modes don't make sense, or don't work well for
selection syncing. This disables syncing in Blender Libraries,
Data API, and Orphans view.

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

M	release/scripts/startup/bl_ui/space_outliner.py
M	source/blender/editors/space_outliner/outliner_draw.c
M	source/blender/editors/space_outliner/outliner_sync.c

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

diff --git a/release/scripts/startup/bl_ui/space_outliner.py b/release/scripts/startup/bl_ui/space_outliner.py
index b5afe72aef9..dadba32d952 100644
--- a/release/scripts/startup/bl_ui/space_outliner.py
+++ b/release/scripts/startup/bl_ui/space_outliner.py
@@ -46,8 +46,9 @@ class OUTLINER_HT_header(Header):
 
         layout.separator_spacer()
 
-        row = layout.row(align=True)
-        row.prop(space, "use_sync_selection", text="")
+        if display_mode not in {'LIBRARIES', 'DATA_API', 'ORPHAN_DATA'}:
+            row = layout.row(align=True)
+            row.prop(space, "use_sync_selection", text="")
 
         row = layout.row(align=True)
         if display_mode in {'SCENES', 'VIEW_LAYER'}:
diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c
index 142925b5b5c..bab62f68228 100644
--- a/source/blender/editors/space_outliner/outliner_draw.c
+++ b/source/blender/editors/space_outliner/outliner_draw.c
@@ -3595,7 +3595,8 @@ void draw_outliner(const bContext *C)
   outliner_build_tree(mainvar, scene, view_layer, soops, ar);  // always
 
   /* Sync selection state from view layer or clean outliner if needed */
-  if (soops->flag & SO_SYNC_SELECTION) {
+  if (!ELEM(soops->outlinevis, SO_LIBRARIES, SO_DATA_API, SO_ID_ORPHANS) &&
+      soops->flag & SO_SYNC_SELECTION) {
     outliner_sync_selection(C, soops);
   }
   else {
diff --git a/source/blender/editors/space_outliner/outliner_sync.c b/source/blender/editors/space_outliner/outliner_sync.c
index c6789337165..10fa564f94b 100644
--- a/source/blender/editors/space_outliner/outliner_sync.c
+++ b/source/blender/editors/space_outliner/outliner_sync.c
@@ -223,6 +223,11 @@ static void outliner_sync_selection_to_outliner(const bContext *C,
 /* Set clean outliner and mark other outliners for syncing */
 void outliner_select_sync(bContext *C, SpaceOutliner *soops)
 {
+  /* Don't sync in certain outliner display modes */
+  if (ELEM(soops->outlinevis, SO_LIBRARIES, SO_DATA_API, SO_ID_ORPHANS)) {
+    return;
+  }
+
   Scene *scene = CTX_data_scene(C);
 
   puts("Outliner select... Mark other outliners as dirty for syncing");



More information about the Bf-blender-cvs mailing list