[Bf-blender-cvs] [02581a7ef81] master: Fix T61287: Object restrict viewport ignored in instanced collection

Dalai Felinto noreply at git.blender.org
Fri Feb 8 16:57:21 CET 2019


Commit: 02581a7ef819bfd388420114280ab4a83f155eaf
Author: Dalai Felinto
Date:   Fri Feb 8 13:51:13 2019 -0200
Branches: master
https://developer.blender.org/rB02581a7ef819bfd388420114280ab4a83f155eaf

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.

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

M	source/blender/editors/space_outliner/outliner_draw.c
M	source/blender/makesrna/intern/rna_object.c

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

diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c
index 40722eb7d45..84385afdb9f 100644
--- a/source/blender/editors/space_outliner/outliner_draw.c
+++ b/source/blender/editors/space_outliner/outliner_draw.c
@@ -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);
diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c
index 37eb749ca72..0526269bded 100644
--- a/source/blender/makesrna/intern/rna_object.c
+++ b/source/blender/makesrna/intern/rna_object.c
@@ -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);



More information about the Bf-blender-cvs mailing list