From e3f7f0c3ebd3c1aa546fa212c3d67d050fab2e41 Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Thu, 29 Nov 2018 19:43:52 -0200 Subject: Outliner: eyes for collection affect collection visibility As oppose to affect the collection objects' visibility. --- .../blender/editors/space_outliner/outliner_draw.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'source') diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c index 781d2381846..7a2ac82cf54 100644 --- a/source/blender/editors/space_outliner/outliner_draw.c +++ b/source/blender/editors/space_outliner/outliner_draw.c @@ -295,10 +295,11 @@ static void hidebutton_layer_collection_flag_cb(bContext *C, void *poin, void *p bool extend = (CTX_wm_window(C)->eventstate->ctrl == 0); /* Undo button toggle, let function do it. */ - lc->runtime_flag ^= LAYER_COLLECTION_HAS_VISIBLE_OBJECTS; + lc->flag ^= LAYER_COLLECTION_RESTRICT_VIEW; BKE_layer_collection_set_visible(scene, view_layer, lc, extend); + DEG_relations_tag_update(CTX_data_main(C)); DEG_id_tag_update(&scene->id, ID_RECALC_BASE_FLAGS); WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene); } @@ -640,16 +641,14 @@ static void outliner_draw_restrictbuts( if ((!lc || !(lc->flag & LAYER_COLLECTION_EXCLUDE)) && !(collection->flag & COLLECTION_IS_MASTER)) { - if (lc && (lc->runtime_flag & LAYER_COLLECTION_HAS_ENABLED_OBJECTS)) { - bt = uiDefIconButBitS( - block, UI_BTYPE_ICON_TOGGLE_N, LAYER_COLLECTION_HAS_VISIBLE_OBJECTS, 0, ICON_HIDE_OFF, - (int)(ar->v2d.cur.xmax - OL_TOG_HIDEX), te->ys, UI_UNIT_X, - UI_UNIT_Y, &lc->runtime_flag, 0, 0, 0, 0, - TIP_("Hide collection in viewport (Ctrl to isolate)")); - UI_but_func_set(bt, hidebutton_layer_collection_flag_cb, view_layer, lc); - UI_but_flag_enable(bt, UI_BUT_DRAG_LOCK); - UI_but_drawflag_enable(bt, UI_BUT_ICON_REVERSE); - } + bt = uiDefIconButBitS( + block, UI_BTYPE_ICON_TOGGLE, LAYER_COLLECTION_RESTRICT_VIEW, 0, ICON_HIDE_OFF, + (int)(ar->v2d.cur.xmax - OL_TOG_HIDEX), te->ys, UI_UNIT_X, + UI_UNIT_Y, &lc->flag, 0, 0, 0, 0, + TIP_("Hide collection in viewport (Ctrl to isolate)")); + UI_but_func_set(bt, hidebutton_layer_collection_flag_cb, view_layer, lc); + UI_but_flag_enable(bt, UI_BUT_DRAG_LOCK); + UI_but_drawflag_enable(bt, UI_BUT_ICON_REVERSE); PointerRNA collection_ptr; RNA_id_pointer_create(&collection->id, &collection_ptr); -- cgit v1.2.3