diff options
author | Pablo Dobarro <pablodp606@gmail.com> | 2019-09-30 16:56:12 +0300 |
---|---|---|
committer | Pablo Dobarro <pablodp606@gmail.com> | 2019-09-30 16:58:03 +0300 |
commit | e8f6f70846e57be81d5d4e28556f7a12d291f5db (patch) | |
tree | d86a3780a58439f185e580b16372faa5a3b427c4 /source/blender/editors/sculpt_paint/paint_mask.c | |
parent | 3dc027add3976557e120a1afdb58e80628ae32b0 (diff) |
PBVH: PBVH_FullyMasked and PBVH_FullyUnmasked flags
This commit introduces flags to tag the PBVH nodes as fully masked or unmasked. This is used in do_brush_actions to filter fully masked nodes during a stroke. Other tools can also be updated to use this flags.
Sculpt updates now require a flag to update the mask or the vertex coordinates.
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D5935
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_mask.c')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_mask.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_mask.c b/source/blender/editors/sculpt_paint/paint_mask.c index 7133936ff79..a93e55685d2 100644 --- a/source/blender/editors/sculpt_paint/paint_mask.c +++ b/source/blender/editors/sculpt_paint/paint_mask.c @@ -126,7 +126,7 @@ static void mask_flood_fill_task_cb(void *__restrict userdata, BKE_pbvh_vertex_iter_end; if (redraw) { - BKE_pbvh_node_mark_redraw(node); + BKE_pbvh_node_mark_update_mask(node); if (data->multires) { BKE_pbvh_node_mark_normals_update(node); } @@ -174,6 +174,8 @@ static int mask_flood_fill_exec(bContext *C, wmOperator *op) multires_mark_as_modified(depsgraph, ob, MULTIRES_COORDS_MODIFIED); } + BKE_pbvh_update_vertex_data(pbvh, PBVH_UpdateMask); + sculpt_undo_push_end(); if (nodes) { @@ -283,7 +285,7 @@ static void mask_box_select_task_cb(void *__restrict userdata, BKE_pbvh_vertex_iter_end; if (redraw) { - BKE_pbvh_node_mark_redraw(node); + BKE_pbvh_node_mark_update_mask(node); } } @@ -355,6 +357,8 @@ bool ED_sculpt_mask_box_select(struct bContext *C, ViewContext *vc, const rcti * multires_mark_as_modified(depsgraph, ob, MULTIRES_COORDS_MODIFIED); } + BKE_pbvh_update_vertex_data(pbvh, PBVH_UpdateMask); + sculpt_undo_push_end(); ED_region_tag_redraw(ar); @@ -542,6 +546,8 @@ static int paint_mask_gesture_lasso_exec(bContext *C, wmOperator *op) multires_mark_as_modified(depsgraph, ob, MULTIRES_COORDS_MODIFIED); } + BKE_pbvh_update_vertex_data(pbvh, PBVH_UpdateMask); + sculpt_undo_push_end(); ED_region_tag_redraw(vc.ar); |