Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/sculpt_paint/sculpt_filter_mask.c
| Show First 20 Lines • Show All 206 Lines • ▼ Show 20 Lines | static int sculpt_mask_filter_exec(bContext *C, wmOperator *op) | ||||
| if (!ob->sculpt->pmap) { | if (!ob->sculpt->pmap) { | ||||
| return OPERATOR_CANCELLED; | return OPERATOR_CANCELLED; | ||||
| } | } | ||||
| int num_verts = SCULPT_vertex_count_get(ss); | int num_verts = SCULPT_vertex_count_get(ss); | ||||
| BKE_pbvh_search_gather(pbvh, NULL, NULL, &nodes, &totnode); | BKE_pbvh_search_gather(pbvh, NULL, NULL, &nodes, &totnode); | ||||
| SCULPT_undo_push_begin("Mask filter"); | SCULPT_undo_push_begin(ob, "Mask filter"); | ||||
| for (int i = 0; i < totnode; i++) { | for (int i = 0; i < totnode; i++) { | ||||
| SCULPT_undo_push_node(ob, nodes[i], SCULPT_UNDO_MASK); | SCULPT_undo_push_node(ob, nodes[i], SCULPT_UNDO_MASK); | ||||
| } | } | ||||
| float *prev_mask = NULL; | float *prev_mask = NULL; | ||||
| int iterations = RNA_int_get(op->ptr, "iterations"); | int iterations = RNA_int_get(op->ptr, "iterations"); | ||||
| ▲ Show 20 Lines • Show All 211 Lines • ▼ Show 20 Lines | static int sculpt_dirty_mask_exec(bContext *C, wmOperator *op) | ||||
| SCULPT_vertex_random_access_ensure(ss); | SCULPT_vertex_random_access_ensure(ss); | ||||
| if (!ob->sculpt->pmap) { | if (!ob->sculpt->pmap) { | ||||
| return OPERATOR_CANCELLED; | return OPERATOR_CANCELLED; | ||||
| } | } | ||||
| BKE_pbvh_search_gather(pbvh, NULL, NULL, &nodes, &totnode); | BKE_pbvh_search_gather(pbvh, NULL, NULL, &nodes, &totnode); | ||||
| SCULPT_undo_push_begin("Dirty Mask"); | SCULPT_undo_push_begin(ob, "Dirty Mask"); | ||||
| for (int i = 0; i < totnode; i++) { | for (int i = 0; i < totnode; i++) { | ||||
| SCULPT_undo_push_node(ob, nodes[i], SCULPT_UNDO_MASK); | SCULPT_undo_push_node(ob, nodes[i], SCULPT_UNDO_MASK); | ||||
| } | } | ||||
| SculptThreadedTaskData data = { | SculptThreadedTaskData data = { | ||||
| .sd = sd, | .sd = sd, | ||||
| .ob = ob, | .ob = ob, | ||||
| ▲ Show 20 Lines • Show All 50 Lines • Show Last 20 Lines | |||||