[Bf-blender-cvs] [bfa6cb3a7d9] master: Fix T64312: Selection inconsistencies when switching collections

Dalai Felinto noreply at git.blender.org
Thu Jul 18 00:42:02 CEST 2019


Commit: bfa6cb3a7d9a867d4f664e169ab8b65e2bd2142b
Author: Dalai Felinto
Date:   Fri Jul 12 12:51:54 2019 -0300
Branches: master
https://developer.blender.org/rBbfa6cb3a7d9a867d4f664e169ab8b65e2bd2142b

Fix T64312: Selection inconsistencies when switching collections

Basically layer_collection_sync was calling BKE_base_eval_flags right away while
iterating over the bases.

However when a parent/sibling collection is to influence the collection flag of
an object that exists in more than one collection, it is too late since we
deselect the object in BKE_base_eval_flags right away.

Related to T64312.

Reviewers: sergey, brecht

Differential Revision: https://developer.blender.org/D5243

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

M	source/blender/blenkernel/intern/layer.c

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

diff --git a/source/blender/blenkernel/intern/layer.c b/source/blender/blenkernel/intern/layer.c
index 2b064c6b2a7..7dc04214ba5 100644
--- a/source/blender/blenkernel/intern/layer.c
+++ b/source/blender/blenkernel/intern/layer.c
@@ -745,9 +745,6 @@ static short layer_collection_sync(ViewLayer *view_layer,
       }
 
       lc->runtime_flag |= LAYER_COLLECTION_HAS_OBJECTS;
-
-      /* Make sure flags on base are usable right away. */
-      BKE_base_eval_flags(base);
     }
 
     runtime_flag |= lc->runtime_flag;
@@ -814,6 +811,10 @@ void BKE_layer_collection_sync(const Scene *scene, ViewLayer *view_layer)
   BLI_freelistN(&view_layer->object_bases);
   view_layer->object_bases = new_object_bases;
 
+  for (Base *base = view_layer->object_bases.first; base; base = base->next) {
+    BKE_base_eval_flags(base);
+  }
+
   /* Always set a valid active collection. */
   LayerCollection *active = view_layer->active_collection;



More information about the Bf-blender-cvs mailing list