diff options
author | Alexander Gavrilov <angavrilov@gmail.com> | 2018-11-23 18:28:36 +0300 |
---|---|---|
committer | Alexander Gavrilov <angavrilov@gmail.com> | 2018-11-23 18:37:28 +0300 |
commit | 1cc7bcd8d8495e68160501d099defbb3986ba314 (patch) | |
tree | 9397a398d9cbaa383f703fbe00f8de2649527c4f /source/blender/editors/mesh/editface.c | |
parent | d891c8f1f802f91629ca63c149f126fd19f9a5d9 (diff) |
Add missing COW updates when selection changes in paint modes.
Diffstat (limited to 'source/blender/editors/mesh/editface.c')
-rw-r--r-- | source/blender/editors/mesh/editface.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/source/blender/editors/mesh/editface.c b/source/blender/editors/mesh/editface.c index df623a7633c..2beb9303a2e 100644 --- a/source/blender/editors/mesh/editface.c +++ b/source/blender/editors/mesh/editface.c @@ -105,6 +105,12 @@ void paintface_flush_flags(Object *ob, short flag) BKE_mesh_batch_cache_dirty_tag(me, BKE_MESH_BATCH_DIRTY_ALL); } +void paintface_tag_select_update(struct bContext *C, struct Object *ob) +{ + DEG_id_tag_update(ob->data, DEG_TAG_COPY_ON_WRITE | DEG_TAG_SELECT_UPDATE); + WM_event_add_notifier(C, NC_GEOM | ND_SELECT, ob->data); +} + void paintface_hide(Object *ob, const bool unselected) { Mesh *me; @@ -252,6 +258,7 @@ void paintface_select_linked(bContext *C, Object *ob, const int mval[2], const b select_linked_tfaces_with_seams(me, index, select); paintface_flush_flags(ob, SELECT); + paintface_tag_select_update(C, ob); } void paintface_deselect_all_visible(Object *ob, int action, bool flush_flags) @@ -386,8 +393,7 @@ bool paintface_mouse_select(struct bContext *C, Object *ob, const int mval[2], b /* image window redraw */ paintface_flush_flags(ob, SELECT); - DEG_id_tag_update(ob->data, DEG_TAG_SELECT_UPDATE); - WM_event_add_notifier(C, NC_GEOM | ND_SELECT, ob->data); + paintface_tag_select_update(C, ob); ED_region_tag_redraw(CTX_wm_region(C)); // XXX - should redraw all 3D views return true; } @@ -458,6 +464,7 @@ int do_paintface_box_select(ViewContext *vc, rcti *rect, int sel_op) #endif paintface_flush_flags(vc->obact, SELECT); + paintface_tag_select_update(vc->C, vc->obact); return OPERATOR_FINISHED; } @@ -509,6 +516,13 @@ void paintvert_flush_flags(Object *ob) BKE_mesh_batch_cache_dirty_tag(me, BKE_MESH_BATCH_DIRTY_ALL); } + +void paintvert_tag_select_update(struct bContext *C, struct Object *ob) +{ + DEG_id_tag_update(ob->data, DEG_TAG_COPY_ON_WRITE | DEG_TAG_SELECT_UPDATE); + WM_event_add_notifier(C, NC_GEOM | ND_SELECT, ob->data); +} + /* note: if the caller passes false to flush_flags, then they will need to run paintvert_flush_flags(ob) themselves */ void paintvert_deselect_all_visible(Object *ob, int action, bool flush_flags) { |