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
This commit is contained in:
		@@ -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;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user