Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/sculpt_paint/sculpt_ops.c
| Show First 20 Lines • Show All 881 Lines • ▼ Show 20 Lines | static void do_mask_by_color_contiguous_update_nodes_cb( | ||||
| BKE_pbvh_vertex_iter_begin (ss->pbvh, data->nodes[n], vd, PBVH_ITER_UNIQUE) { | BKE_pbvh_vertex_iter_begin (ss->pbvh, data->nodes[n], vd, PBVH_ITER_UNIQUE) { | ||||
| const float current_mask = *vd.mask; | const float current_mask = *vd.mask; | ||||
| const float new_mask = data->mask_by_color_floodfill[vd.index]; | const float new_mask = data->mask_by_color_floodfill[vd.index]; | ||||
| *vd.mask = sculpt_mask_by_color_final_mask_get(current_mask, new_mask, invert, preserve_mask); | *vd.mask = sculpt_mask_by_color_final_mask_get(current_mask, new_mask, invert, preserve_mask); | ||||
| if (current_mask == *vd.mask) { | if (current_mask == *vd.mask) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| update_node = true; | update_node = true; | ||||
| if (vd.mvert) { | |||||
| BKE_pbvh_vert_mark_update(ss->pbvh, vd.vertex); | |||||
| } | |||||
| } | } | ||||
| BKE_pbvh_vertex_iter_end; | BKE_pbvh_vertex_iter_end; | ||||
| if (update_node) { | if (update_node) { | ||||
| BKE_pbvh_node_mark_update_mask(data->nodes[n]); | BKE_pbvh_node_mark_update_mask(data->nodes[n]); | ||||
| } | } | ||||
| } | } | ||||
| static bool sculpt_mask_by_color_contiguous_floodfill_cb( | static bool sculpt_mask_by_color_contiguous_floodfill_cb( | ||||
| ▲ Show 20 Lines • Show All 103 Lines • ▼ Show 20 Lines | BKE_pbvh_vertex_iter_begin (ss->pbvh, data->nodes[n], vd, PBVH_ITER_UNIQUE) { | ||||
| const float current_mask = *vd.mask; | const float current_mask = *vd.mask; | ||||
| const float new_mask = sculpt_mask_by_color_delta_get(active_color, col, threshold, invert); | const float new_mask = sculpt_mask_by_color_delta_get(active_color, col, threshold, invert); | ||||
| *vd.mask = sculpt_mask_by_color_final_mask_get(current_mask, new_mask, invert, preserve_mask); | *vd.mask = sculpt_mask_by_color_final_mask_get(current_mask, new_mask, invert, preserve_mask); | ||||
| if (current_mask == *vd.mask) { | if (current_mask == *vd.mask) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| update_node = true; | update_node = true; | ||||
| if (vd.mvert) { | |||||
| BKE_pbvh_vert_mark_update(ss->pbvh, vd.vertex); | |||||
| } | |||||
| } | } | ||||
| BKE_pbvh_vertex_iter_end; | BKE_pbvh_vertex_iter_end; | ||||
| if (update_node) { | if (update_node) { | ||||
| BKE_pbvh_node_mark_redraw(data->nodes[n]); | BKE_pbvh_node_mark_update_mask(data->nodes[n]); | ||||
| } | } | ||||
| } | } | ||||
| static void sculpt_mask_by_color_full_mesh(Object *object, | static void sculpt_mask_by_color_full_mesh(Object *object, | ||||
| const PBVHVertRef vertex, | const PBVHVertRef vertex, | ||||
| const float threshold, | const float threshold, | ||||
| const bool invert, | const bool invert, | ||||
| const bool preserve_mask) | const bool preserve_mask) | ||||
| ▲ Show 20 Lines • Show All 149 Lines • Show Last 20 Lines | |||||