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:
Dalai Felinto 2019-07-12 12:51:54 -03:00
parent 158eb98c22
commit bfa6cb3a7d
Notes: blender-bot 2023-02-14 06:17:17 +01:00
Referenced by issue #64312, Selection inconsistencies when switching collections
1 changed files with 4 additions and 3 deletions

View File

@ -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;