Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/sculpt_paint/paint_mask.c
| Show First 20 Lines • Show All 163 Lines • ▼ Show 20 Lines | static int mask_flood_fill_exec(bContext *C, wmOperator *op) | ||||
| value = RNA_float_get(op->ptr, "value"); | value = RNA_float_get(op->ptr, "value"); | ||||
| BKE_sculpt_update_object_for_edit(depsgraph, ob, false, true, false); | BKE_sculpt_update_object_for_edit(depsgraph, ob, false, true, false); | ||||
| pbvh = ob->sculpt->pbvh; | pbvh = ob->sculpt->pbvh; | ||||
| multires = (BKE_pbvh_type(pbvh) == PBVH_GRIDS); | multires = (BKE_pbvh_type(pbvh) == PBVH_GRIDS); | ||||
| BKE_pbvh_search_gather(pbvh, NULL, NULL, &nodes, &totnode); | BKE_pbvh_search_gather(pbvh, NULL, NULL, &nodes, &totnode); | ||||
| SCULPT_undo_push_begin("Mask flood fill"); | SCULPT_undo_push_begin(ob, "Mask flood fill"); | ||||
| MaskTaskData data = { | MaskTaskData data = { | ||||
| .ob = ob, | .ob = ob, | ||||
| .pbvh = pbvh, | .pbvh = pbvh, | ||||
| .nodes = nodes, | .nodes = nodes, | ||||
| .multires = multires, | .multires = multires, | ||||
| .mode = mode, | .mode = mode, | ||||
| .value = value, | .value = value, | ||||
| ▲ Show 20 Lines • Show All 521 Lines • ▼ Show 20 Lines | case SCULPT_GESTURE_SHAPE_LINE: | ||||
| return plane_point_side_v3(sgcontext->line.plane, vd->co) > 0.0f; | return plane_point_side_v3(sgcontext->line.plane, vd->co) > 0.0f; | ||||
| } | } | ||||
| return false; | return false; | ||||
| } | } | ||||
| static void sculpt_gesture_apply(bContext *C, SculptGestureContext *sgcontext) | static void sculpt_gesture_apply(bContext *C, SculptGestureContext *sgcontext) | ||||
| { | { | ||||
| SculptGestureOperation *operation = sgcontext->operation; | SculptGestureOperation *operation = sgcontext->operation; | ||||
| SCULPT_undo_push_begin("Sculpt Gesture Apply"); | SCULPT_undo_push_begin(CTX_data_active_object(C), "Sculpt Gesture Apply"); | ||||
| operation->sculpt_gesture_begin(C, sgcontext); | operation->sculpt_gesture_begin(C, sgcontext); | ||||
| for (ePaintSymmetryFlags symmpass = 0; symmpass <= sgcontext->symm; symmpass++) { | for (ePaintSymmetryFlags symmpass = 0; symmpass <= sgcontext->symm; symmpass++) { | ||||
| if (SCULPT_is_symmetry_iteration_valid(symmpass, sgcontext->symm)) { | if (SCULPT_is_symmetry_iteration_valid(symmpass, sgcontext->symm)) { | ||||
| sculpt_gesture_flip_for_symmetry_pass(sgcontext, symmpass); | sculpt_gesture_flip_for_symmetry_pass(sgcontext, symmpass); | ||||
| sculpt_gesture_update_effected_nodes(sgcontext); | sculpt_gesture_update_effected_nodes(sgcontext); | ||||
| ▲ Show 20 Lines • Show All 1,069 Lines • Show Last 20 Lines | |||||