[Bf-blender-cvs] [64c54170170] soc-2019-outliner: Outliner: Enable synced selection by default

Nathan Craddock noreply at git.blender.org
Sat Jun 22 07:08:49 CEST 2019


Commit: 64c541701704b315e0b74a7885053fb9e7d1afa1
Author: Nathan Craddock
Date:   Fri Jun 21 15:44:23 2019 -0600
Branches: soc-2019-outliner
https://developer.blender.org/rB64c541701704b315e0b74a7885053fb9e7d1afa1

Outliner: Enable synced selection by default

Mark outliners as dirty and enable synced selection for new
outliners. Also apply in versioning.

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

M	source/blender/blenloader/intern/versioning_280.c
M	source/blender/editors/space_outliner/space_outliner.c

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

diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c
index 4b55364f0b1..1ee962ca035 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -3510,5 +3510,17 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
     LISTBASE_FOREACH (bArmature *, arm, &bmain->armatures) {
       arm->flag &= ~(ARM_FLAG_UNUSED_6);
     }
+
+    /* Marks each outliner as dirty so a sync will occur as synced selection is enabled. */
+    for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) {
+      for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) {
+        for (SpaceLink *space = sa->spacedata.first; space; space = space->next) {
+          if (space->spacetype == SPACE_OUTLINER) {
+            SpaceOutliner *soutliner = (SpaceOutliner *)space;
+            soutliner->flag |= SO_IS_DIRTY | SO_SYNC_SELECTION;
+          }
+        }
+      }
+    }
   }
 }
diff --git a/source/blender/editors/space_outliner/space_outliner.c b/source/blender/editors/space_outliner/space_outliner.c
index 908b033d688..78df99f5dcc 100644
--- a/source/blender/editors/space_outliner/space_outliner.c
+++ b/source/blender/editors/space_outliner/space_outliner.c
@@ -299,7 +299,7 @@ static SpaceLink *outliner_new(const ScrArea *UNUSED(area), const Scene *UNUSED(
   soutliner->filter_id_type = ID_GR;
   soutliner->show_restrict_flags = SO_RESTRICT_ENABLE | SO_RESTRICT_HIDE;
   soutliner->outlinevis = SO_VIEW_LAYER;
-  soutliner->flag |= SO_IS_DIRTY;
+  soutliner->flag |= SO_IS_DIRTY | SO_SYNC_SELECTION;
 
   /* header */
   ar = MEM_callocN(sizeof(ARegion), "header for outliner");



More information about the Bf-blender-cvs mailing list