diff options
author | Philipp Oeser <info@graphics-engineer.com> | 2019-09-13 16:17:03 +0300 |
---|---|---|
committer | Philipp Oeser <info@graphics-engineer.com> | 2019-09-13 23:29:14 +0300 |
commit | 57e0e520e89b1de8fec424a2be4f90a59d7557dc (patch) | |
tree | a777b531fe6cac84f02341e47a2f418389fefdda /source/blender | |
parent | 89cc5c2bd3ba2424881cc02de2e820ac5353fc14 (diff) |
Fix (unreported) 'smooth vertex colors' operator not respecting vertex
paint mask selection
followup to rBr27bbe7cbd9b, might as well make this consistent across
all the color operations [with the exception of 'Dirty Vertex Colors'
which is python]
Reviewers: brecht
Differential Revision: https://developer.blender.org/D5786
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_vertex_color_ops.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_vertex_color_ops.c b/source/blender/editors/sculpt_paint/paint_vertex_color_ops.c index 9a6251e2f98..266c130d12a 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex_color_ops.c +++ b/source/blender/editors/sculpt_paint/paint_vertex_color_ops.c @@ -272,7 +272,6 @@ static bool vertex_color_smooth(Object *ob) { Mesh *me; const MPoly *mp; - int i, j; bool *mlooptag; @@ -282,6 +281,7 @@ static bool vertex_color_smooth(Object *ob) } const bool use_face_sel = (me->editflag & ME_EDIT_PAINT_FACE_SEL) != 0; + const bool use_vert_sel = (me->editflag & ME_EDIT_PAINT_VERT_SEL) != 0; mlooptag = MEM_callocN(sizeof(bool) * me->totloop, "VPaintData mlooptag"); @@ -289,15 +289,19 @@ static bool vertex_color_smooth(Object *ob) mp = me->mpoly; for (i = 0; i < me->totpoly; i++, mp++) { const MLoop *ml = me->mloop + mp->loopstart; - int ml_index = mp->loopstart; if (use_face_sel && !(mp->flag & ME_FACE_SEL)) { continue; } - for (j = 0; j < mp->totloop; j++, ml_index++, ml++) { - mlooptag[ml_index] = true; - } + j = 0; + do { + if (!(use_vert_sel && !(me->mvert[ml->v].flag & SELECT))) { + mlooptag[mp->loopstart + j] = true; + } + ml++; + j++; + } while (j < mp->totloop); } /* remove stale me->mcol, will be added later */ |