diff options
author | Pablo Dobarro <pablodp606@gmail.com> | 2019-10-03 02:32:32 +0300 |
---|---|---|
committer | Pablo Dobarro <pablodp606@gmail.com> | 2019-10-03 16:25:19 +0300 |
commit | 8a1f4fc8a78ef39654df5e8ea46b2d227ada4834 (patch) | |
tree | a9e8a162b20c7a8a133ffdaddbd881a7c240b1bd /source/blender/editors/mesh/editmesh_mask_extract.c | |
parent | 11768d1c9f4374ffa512a0d90cfde776d3e9babe (diff) |
Fix T70102: Mask Extract bad solution
Reviewed By: brecht
Maniphest Tasks: T70102
Differential Revision: https://developer.blender.org/D5978
Diffstat (limited to 'source/blender/editors/mesh/editmesh_mask_extract.c')
-rw-r--r-- | source/blender/editors/mesh/editmesh_mask_extract.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/source/blender/editors/mesh/editmesh_mask_extract.c b/source/blender/editors/mesh/editmesh_mask_extract.c index d066e9ecddc..ab38592dfa3 100644 --- a/source/blender/editors/mesh/editmesh_mask_extract.c +++ b/source/blender/editors/mesh/editmesh_mask_extract.c @@ -105,12 +105,14 @@ static int paint_mask_extract_exec(bContext *C, wmOperator *op) float mask_threshold = RNA_float_get(op->ptr, "mask_threshold"); BM_ITER_MESH (f, &iter, bm, BM_FACES_OF_MESH) { - bool delete_face = false; + bool keep_face = true; BM_ITER_ELEM (v, &face_iter, f, BM_VERTS_OF_FACE) { float mask = BM_elem_float_data_get(&bm->vdata, v, CD_PAINT_MASK); - delete_face = mask < mask_threshold; + if (mask < mask_threshold) { + keep_face = false; + } } - BM_elem_flag_set(f, BM_ELEM_TAG, delete_face); + BM_elem_flag_set(f, BM_ELEM_TAG, !keep_face); } BM_mesh_delete_hflag_context(bm, BM_ELEM_TAG, DEL_FACES); |