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
This commit is contained in:
Philipp Oeser 2019-09-13 15:17:03 +02:00
parent 89cc5c2bd3
commit 57e0e520e8
Notes: blender-bot 2023-02-14 08:25:14 +01:00
Referenced by issue #70038, Vertex Paint ➔ Paint menu ➔ Smooth Vertex Colors could be improved
1 changed files with 9 additions and 5 deletions

View File

@ -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 */