Fix T61287: Object restrict viewport ignored in instanced collection

make_duplis_collection() depends on the collection object cache,
which was not freed upon object viewport disable change.

The best way to reproduce the bug was to instance the default
collection, disable the cube, save and re-open the file.
Now even if you set the original cube to be enabled, you wouldn't see
the instanced one until you forced collection cache to be freed (e.g.,
changing a collection disable state.
This commit is contained in:
Dalai Felinto 2019-02-08 13:51:13 -02:00
parent 5228a10f6d
commit 02581a7ef8
Notes: blender-bot 2023-02-14 03:49:14 +01:00
Referenced by issue #61386, Mirror Paste for pose bones also copies custom properties
Referenced by issue #61339, Freezes/lags drop FPS when select a Camera object
Referenced by issue #61287, Object's viewport visibility setting gets ignored when its collection is instanced
2 changed files with 2 additions and 2 deletions

View File

@ -288,7 +288,7 @@ static void hidebutton_base_flag_cb(bContext *C, void *poin, void *poin2)
}
if (changed_restrict_view) {
BKE_main_collection_sync(bmain);
BKE_main_collection_sync_remap(bmain);
DEG_id_tag_update(&ob->id, LIB_TAG_COPIED_ON_WRITE);
DEG_relations_tag_update(bmain);
WM_main_add_notifier(NC_OBJECT | ND_DRAW, &ob->id);

View File

@ -266,7 +266,7 @@ static void rna_Object_matrix_world_update(Main *bmain, Scene *scene, PointerRNA
static void rna_Object_hide_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
{
Object *ob = ptr->id.data;
BKE_main_collection_sync(bmain);
BKE_main_collection_sync_remap(bmain);
DEG_id_tag_update(&ob->id, ID_RECALC_COPY_ON_WRITE);
DEG_relations_tag_update(bmain);
WM_main_add_notifier(NC_OBJECT | ND_DRAW, &ob->id);