diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2017-04-21 15:31:38 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2017-04-21 15:42:45 +0300 |
commit | cc8f1040982b6747815f94999136971af6c5a0f2 (patch) | |
tree | f870d807c9a84d33de487820b621f668649d27ea /source/blender/editors/space_outliner/outliner_draw.c | |
parent | 81011679ddb1fc57e37fe1ba2eb494a1dedaa0fd (diff) |
Tag depsgraph update when hide and hide_select are changed
We were not updating depsgraph when collection just "became" selectable,
but although this doesn't change object selection, it change its
selectability.
Diffstat (limited to 'source/blender/editors/space_outliner/outliner_draw.c')
-rw-r--r-- | source/blender/editors/space_outliner/outliner_draw.c | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c index 82fdee675b9..1755370a5d6 100644 --- a/source/blender/editors/space_outliner/outliner_draw.c +++ b/source/blender/editors/space_outliner/outliner_draw.c @@ -245,10 +245,9 @@ static void restrictbutton_gp_layer_flag_cb(bContext *C, void *UNUSED(poin), voi WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_EDITED, NULL); } -static void restrictbutton_collection_hide_cb(bContext *C, void *poin, void *UNUSED(poin2)) +static void restrictbutton_collection_flag_cb(bContext *C, void *poin, void *UNUSED(poin2)) { Scene *scene = poin; - /* hide and deselect bases that are directly influenced by this LayerCollection */ /* TODO(sergey): Use proper flag for tagging here. */ DAG_id_tag_update(&scene->id, 0); @@ -256,20 +255,6 @@ static void restrictbutton_collection_hide_cb(bContext *C, void *poin, void *UNU WM_event_add_notifier(C, NC_SCENE | ND_LAYER_CONTENT, NULL); } -static void restrictbutton_collection_hide_select_cb(bContext *C, void *poin, void *poin2) -{ - Scene *scene = poin; - LayerCollection *collection = poin2; - - if ((collection->flag & COLLECTION_SELECTABLE) == 0) { - /* deselect bases that are directly influenced by this LayerCollection */ - /* TODO(sergey): Use proper flag for tagging here. */ - DAG_id_tag_update(&scene->id, 0); - WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, CTX_data_scene(C)); - } - WM_event_add_notifier(C, NC_SCENE | ND_LAYER_CONTENT, NULL); -} - static void restrictbutton_id_user_toggle(bContext *UNUSED(C), void *poin, void *UNUSED(poin2)) { ID *id = (ID *)poin; @@ -579,14 +564,14 @@ static void outliner_draw_restrictbuts(uiBlock *block, Scene *scene, ARegion *ar (int)(ar->v2d.cur.xmax - OL_TOG_RESTRICT_VIEWX), te->ys, UI_UNIT_X, UI_UNIT_Y, &collection->flag, 0, 0, 0, 0, TIP_("Restrict/Allow 3D View visibility of objects in the collection")); - UI_but_func_set(bt, restrictbutton_collection_hide_cb, scene, collection); + UI_but_func_set(bt, restrictbutton_collection_flag_cb, scene, collection); UI_but_flag_enable(bt, UI_BUT_DRAG_LOCK); bt = uiDefIconButBitS(block, UI_BTYPE_ICON_TOGGLE_N, COLLECTION_SELECTABLE, 0, ICON_RESTRICT_SELECT_OFF, (int)(ar->v2d.cur.xmax - OL_TOG_RESTRICT_SELECTX), te->ys, UI_UNIT_X, UI_UNIT_Y, &collection->flag, 0, 0, 0, 0, TIP_("Restrict/Allow 3D View selection of objects in the collection")); - UI_but_func_set(bt, restrictbutton_collection_hide_select_cb, scene, collection); + UI_but_func_set(bt, restrictbutton_collection_flag_cb, scene, collection); UI_but_flag_enable(bt, UI_BUT_DRAG_LOCK); UI_block_emboss_set(block, UI_EMBOSS); |