Fix T57177: redo select random operator selects hidden objects.

This commit is contained in:
Brecht Van Lommel 2019-01-03 15:17:01 +01:00
parent ba1cae5a04
commit 481a75a08a
3 changed files with 6 additions and 3 deletions

View File

@ -776,8 +776,9 @@ bool BKE_collection_is_in_scene(Collection *collection)
void BKE_collections_after_lib_link(Main *bmain)
{
/* Update view layer collections to match any changes in linked
* collections after file load. */
/* Need to update layer collections because objects might have changed
* in linked files, and because undo push does not include updated base
* flags since those are refreshed after the operator completes. */
BKE_main_collection_sync(bmain);
}

View File

@ -727,6 +727,7 @@ static short layer_collection_sync(
}
if (base->flag & BASE_HIDDEN) {
base->flag &= ~BASE_VISIBLE;
view_layer->runtime_flag |= VIEW_LAYER_HAS_HIDE;
lc->runtime_flag |= LAYER_COLLECTION_HAS_HIDDEN_OBJECTS;
}

View File

@ -9067,9 +9067,10 @@ BlendFileData *blo_read_file_internal(FileData *fd, const char *filepath)
/* Do not apply in undo case! */
lib_verify_nodetree(bfd->main, true); /* Needed to ensure we have typeinfo in nodes... */
BKE_main_override_static_update(bfd->main);
BKE_collections_after_lib_link(bfd->main);
}
BKE_collections_after_lib_link(bfd->main);
lib_verify_nodetree(bfd->main, true);
fix_relpaths_library(fd->relabase, bfd->main); /* make all relative paths, relative to the open blend file */