Fix T82881: Paint mask 'deselect on nothing' missed viewport update

Was failing for weightpaint and vertexpaint.

Selection flags were actually changed, but the update in the viewport
wasnt immediate, leading to confusion when the update happened later
(e.g. when using the weight gradient tool as done in the report).

We need to tag ID_RECALC_SELECT and send ND_SELECT notifier here. This
could be done explicitly, but there is also existing functionality
available that does this.
Note: the way updates happen for paintfaces vs. paintverts looks a bit
inconsistent (so this could be part of a later cleanup commit)

Maniphest Tasks: T82881

Differential Revision: https://developer.blender.org/D9631
This commit is contained in:
Philipp Oeser 2020-11-23 12:44:44 +01:00
parent 7c8e01341f
commit 727d5013a7
Notes: blender-bot 2023-02-14 08:08:54 +01:00
Referenced by issue #82881, Weight paint gradient tool paint mask deselect after viewport left click
1 changed files with 4 additions and 1 deletions

View File

@ -2457,13 +2457,16 @@ static int view3d_select_exec(bContext *C, wmOperator *op)
else if (obact && BKE_paint_select_face_test(obact)) {
retval = paintface_mouse_select(C, obact, location, extend, deselect, toggle);
if (!retval && deselect_all) {
retval = paintface_deselect_all_visible(C, CTX_data_active_object(C), SEL_DESELECT, false);
retval = paintface_deselect_all_visible(C, CTX_data_active_object(C), SEL_DESELECT, true);
}
}
else if (BKE_paint_select_vert_test(obact)) {
retval = ed_wpaint_vertex_select_pick(C, location, extend, deselect, toggle, obact);
if (!retval && deselect_all) {
retval = paintvert_deselect_all_visible(obact, SEL_DESELECT, false);
if (retval) {
paintvert_tag_select_update(C, obact);
}
}
}
else {