Page MenuHome
Paste P1535

Masterwork From Distant Lands
ActivePublic

Authored by Ankit Meel (ankitm) on Jul 17 2020, 12:07 AM.
diff --git a/source/blender/editors/space_outliner/outliner_dragdrop.c b/source/blender/editors/space_outliner/outliner_dragdrop.c
index 09d7f889bde..0a526113a8b 100644
--- a/source/blender/editors/space_outliner/outliner_dragdrop.c
+++ b/source/blender/editors/space_outliner/outliner_dragdrop.c
@@ -838,6 +838,40 @@ static int collection_drop_invoke(bContext *C, wmOperator *UNUSED(op), const wmE
DEG_relations_tag_update(bmain);
WM_event_add_notifier(C, NC_SCENE | ND_LAYER, scene);
+ ViewLayer *view_layer = CTX_data_view_layer(C);
+
+ LayerCollection *lc_master = view_layer->layer_collections.first;
+ LISTBASE_FOREACH (LayerCollection *, lc_iter, &lc_master->layer_collections) {
+ fprintf(stderr, "%s\n" , lc_iter->collection->id.name);
+ BKE_layer_collection_set_flag(lc_iter, LAYER_COLLECTION_EXCLUDE, true);
+ }
+
+ LISTBASE_FOREACH (Base *, base, &view_layer->object_bases) {
+ base->flag &= ~BASE_HIDDEN;
+ }
+
+ BKE_layer_collection_sync(scene, view_layer);
+ DEG_id_tag_update(&scene->id, ID_RECALC_BASE_FLAGS);
+
+ WM_main_add_notifier(NC_SCENE | ND_LAYER_CONTENT, NULL);
+
+ LISTBASE_FOREACH (LayerCollection *, lc_iter, &lc_master->layer_collections) {
+ fprintf(stderr, "%s\n" , lc_iter->collection->id.name);
+ BKE_layer_collection_set_flag(lc_iter, LAYER_COLLECTION_EXCLUDE, false);
+ }
+
+ LISTBASE_FOREACH (Base *, base, &view_layer->object_bases) {
+ base->flag &= ~BASE_HIDDEN;
+ }
+
+ BKE_layer_collection_sync(scene, view_layer);
+ DEG_id_tag_update(&scene->id, ID_RECALC_BASE_FLAGS);
+
+ WM_main_add_notifier(NC_SCENE | ND_LAYER_CONTENT, NULL);
+
+ fprintf(stderr, __func__);
+ return OPERATOR_FINISHED;
+
return OPERATOR_FINISHED;
}

Event Timeline

Ankit Meel (ankitm) changed the title of this paste from untitled to Masterwork From Distant Lands.