Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/sculpt_paint/sculpt.c
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
| Show First 20 Lines • Show All 2,891 Lines • ▼ Show 20 Lines | static void do_mask_brush_draw(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode) | ||||
| TaskParallelSettings settings; | TaskParallelSettings settings; | ||||
| BKE_pbvh_parallel_range_settings(&settings, true, totnode); | BKE_pbvh_parallel_range_settings(&settings, true, totnode); | ||||
| BLI_task_parallel_range(0, totnode, &data, do_mask_brush_draw_task_cb_ex, &settings); | BLI_task_parallel_range(0, totnode, &data, do_mask_brush_draw_task_cb_ex, &settings); | ||||
| } | } | ||||
| static void do_mask_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode) | static void do_mask_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode) | ||||
| { | { | ||||
| SculptSession *ss = ob->sculpt; | |||||
| Brush *brush = BKE_paint_brush(&sd->paint); | Brush *brush = BKE_paint_brush(&sd->paint); | ||||
| switch ((BrushMaskTool)brush->mask_tool) { | switch ((BrushMaskTool)brush->mask_tool) { | ||||
| case BRUSH_MASK_DRAW: | case BRUSH_MASK_DRAW: | ||||
| do_mask_brush_draw(sd, ob, nodes, totnode); | do_mask_brush_draw(sd, ob, nodes, totnode); | ||||
| break; | break; | ||||
| case BRUSH_MASK_SMOOTH: | case BRUSH_MASK_SMOOTH: | ||||
| SCULPT_smooth(sd, ob, nodes, totnode, ss->cache->bstrength, true); | SCULPT_do_smooth_mask_brush(sd, ob, nodes, totnode); | ||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| static void do_draw_brush_task_cb_ex(void *__restrict userdata, | static void do_draw_brush_task_cb_ex(void *__restrict userdata, | ||||
| const int n, | const int n, | ||||
| const TaskParallelTLS *__restrict tls) | const TaskParallelTLS *__restrict tls) | ||||
| { | { | ||||
| ▲ Show 20 Lines • Show All 2,785 Lines • ▼ Show 20 Lines | switch (brush->sculpt_tool) { | ||||
| case SCULPT_TOOL_SMEAR: | case SCULPT_TOOL_SMEAR: | ||||
| SCULPT_do_smear_brush(sd, ob, nodes, totnode); | SCULPT_do_smear_brush(sd, ob, nodes, totnode); | ||||
| break; | break; | ||||
| } | } | ||||
| if (!ELEM(brush->sculpt_tool, SCULPT_TOOL_SMOOTH, SCULPT_TOOL_MASK) && | if (!ELEM(brush->sculpt_tool, SCULPT_TOOL_SMOOTH, SCULPT_TOOL_MASK) && | ||||
| brush->autosmooth_factor > 0) { | brush->autosmooth_factor > 0) { | ||||
| if (brush->flag & BRUSH_INVERSE_SMOOTH_PRESSURE) { | if (brush->flag & BRUSH_INVERSE_SMOOTH_PRESSURE) { | ||||
| SCULPT_smooth(sd, | SCULPT_smooth( | ||||
| ob, | sd, ob, nodes, totnode, brush->autosmooth_factor * (1.0f - ss->cache->pressure)); | ||||
| nodes, | |||||
| totnode, | |||||
| brush->autosmooth_factor * (1.0f - ss->cache->pressure), | |||||
| false); | |||||
| } | } | ||||
| else { | else { | ||||
| SCULPT_smooth(sd, ob, nodes, totnode, brush->autosmooth_factor, false); | SCULPT_smooth(sd, ob, nodes, totnode, brush->autosmooth_factor); | ||||
| } | } | ||||
| } | } | ||||
| if (sculpt_brush_use_topology_rake(ss, brush)) { | if (sculpt_brush_use_topology_rake(ss, brush)) { | ||||
| bmesh_topology_rake(sd, ob, nodes, totnode, brush->topology_rake_factor); | bmesh_topology_rake(sd, ob, nodes, totnode, brush->topology_rake_factor); | ||||
| } | } | ||||
| /* The cloth brush adds the gravity as a regular force and it is processed in the solver. */ | /* The cloth brush adds the gravity as a regular force and it is processed in the solver. */ | ||||
| ▲ Show 20 Lines • Show All 3,280 Lines • Show Last 20 Lines | |||||