Commit: c1b8007cea7c6ca3c0475da31d748e234ae94421 Author: Dalai Felinto Date: Tue Dec 11 16:23:40 2018 -0200 Branches: temp-outliner-visibility https://developer.blender.org/rBc1b8007cea7c6ca3c0475da31d748e234ae94421
Merge remote-tracking branch 'origin/blender2.8' into temp-outliner-visibility =================================================================== =================================================================== diff --cc source/blender/editors/object/object_edit.c index 45e45b849ca,efbea1ee30e..392f4fb83d8 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@@ -295,8 -295,7 +295,8 @@@ static int object_hide_collection_exec( BKE_layer_collection_set_visible(scene, view_layer, lc, extend); + DEG_relations_tag_update(CTX_data_main(C)); - DEG_id_tag_update(&scene->id, DEG_TAG_BASE_FLAGS_UPDATE); + DEG_id_tag_update(&scene->id, ID_RECALC_BASE_FLAGS); WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene); return OPERATOR_FINISHED; diff --cc source/blender/editors/space_outliner/outliner_draw.c index 41052215a8b,6cf7e2ce0a1..a5c3d3fade1 --- a/source/blender/editors/space_outliner/outliner_draw.c +++ b/source/blender/editors/space_outliner/outliner_draw.c @@@ -280,34 -279,21 +280,34 @@@ static void hidebutton_base_flag_cb(bCo Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = poin; Base *base = poin2; - bool extend = (CTX_wm_window(C)->eventstate->ctrl == 0); - - /* Undo button toggle, let function do it. */ - base->flag ^= BASE_HIDDEN; - - BKE_base_set_visible(scene, view_layer, base, extend); + Object *ob = base->object; + bool freeze = (CTX_wm_window(C)->eventstate->ctrl != 0); + bool changed_restrict_view = false; - if (!extend && (base->flag & BASE_VISIBLE)) { - /* Auto select solo-ed object. */ - ED_object_base_select(base, BA_SELECT); - view_layer->basact = base; + if (freeze) { + ob->restrictflag |= OB_RESTRICT_VIEW; + changed_restrict_view = true; + } + else if (ob->restrictflag & OB_RESTRICT_VIEW) { + ob->restrictflag &= ~OB_RESTRICT_VIEW; + base->flag &= ~BASE_HIDDEN; + changed_restrict_view = true; + } + else { + base->flag ^= BASE_HIDDEN; } - DEG_id_tag_update(&scene->id, ID_RECALC_BASE_FLAGS); - WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene); + if (changed_restrict_view) { + BKE_main_collection_sync(bmain); - DEG_id_tag_update(&ob->id, DEG_TAG_COPY_ON_WRITE); ++ 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); + } + if (!freeze) { + BKE_layer_collection_sync(scene, view_layer); - DEG_id_tag_update(&scene->id, DEG_TAG_BASE_FLAGS_UPDATE); ++ DEG_id_tag_update(&scene->id, ID_RECALC_BASE_FLAGS); + WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene); + } } static void hidebutton_layer_collection_flag_cb(bContext *C, void *poin, void *poin2) @@@ -315,25 -301,15 +315,25 @@@ Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = poin; LayerCollection *lc = poin2; - bool extend = (CTX_wm_window(C)->eventstate->ctrl == 0); + Collection *collection = lc->collection; + bool freeze = (CTX_wm_window(C)->eventstate->ctrl != 0); - /* Undo button toggle, let function do it. */ - lc->runtime_flag ^= LAYER_COLLECTION_HAS_VISIBLE_OBJECTS; + if (freeze) { + collection->flag |= COLLECTION_RESTRICT_VIEW; + } + else if (collection->flag & COLLECTION_RESTRICT_VIEW) { + collection->flag &= ~COLLECTION_RESTRICT_VIEW; + lc->flag &= ~LAYER_COLLECTION_RESTRICT_VIEW; + } + else { + lc->flag ^= LAYER_COLLECTION_RESTRICT_VIEW; + } - BKE_layer_collection_set_visible(scene, view_layer, lc, extend); + BKE_layer_collection_sync(scene, view_layer); - DEG_id_tag_update(&scene->id, DEG_TAG_BASE_FLAGS_UPDATE); + DEG_id_tag_update(&scene->id, ID_RECALC_BASE_FLAGS); - WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene); + DEG_relations_tag_update(CTX_data_main(C)); + WM_main_add_notifier(NC_SCENE | ND_LAYER_CONTENT, NULL); } static void namebutton_cb(bContext *C, void *tsep, char *oldname) _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs