Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/sculpt_paint/sculpt_smooth.c
| Show First 20 Lines • Show All 231 Lines • ▼ Show 20 Lines | const float fade = bstrength * SCULPT_brush_strength_factor(ss, | ||||
| vd.vertex, | vd.vertex, | ||||
| thread_id); | thread_id); | ||||
| float disp[3]; | float disp[3]; | ||||
| madd_v3_v3v3fl(disp, vd.co, ss->cache->detail_directions[vd.index], fade); | madd_v3_v3v3fl(disp, vd.co, ss->cache->detail_directions[vd.index], fade); | ||||
| SCULPT_clip(sd, ss, vd.co, disp); | SCULPT_clip(sd, ss, vd.co, disp); | ||||
| if (vd.mvert) { | if (vd.mvert) { | ||||
| BKE_pbvh_vert_mark_update(ss->pbvh, vd.vertex); | BKE_pbvh_vert_tag_update_normal(ss->pbvh, vd.vertex); | ||||
| } | } | ||||
| } | } | ||||
| BKE_pbvh_vertex_iter_end; | BKE_pbvh_vertex_iter_end; | ||||
| } | } | ||||
| static void SCULPT_enhance_details_brush(Sculpt *sd, | static void SCULPT_enhance_details_brush(Sculpt *sd, | ||||
| Object *ob, | Object *ob, | ||||
| PBVHNode **nodes, | PBVHNode **nodes, | ||||
| ▲ Show 20 Lines • Show All 73 Lines • ▼ Show 20 Lines | if (smooth_mask) { | ||||
| CLAMP(*vd.mask, 0.0f, 1.0f); | CLAMP(*vd.mask, 0.0f, 1.0f); | ||||
| } | } | ||||
| else { | else { | ||||
| float avg[3], val[3]; | float avg[3], val[3]; | ||||
| SCULPT_neighbor_coords_average_interior(ss, avg, vd.vertex); | SCULPT_neighbor_coords_average_interior(ss, avg, vd.vertex); | ||||
| sub_v3_v3v3(val, avg, vd.co); | sub_v3_v3v3(val, avg, vd.co); | ||||
| madd_v3_v3v3fl(val, vd.co, val, fade); | madd_v3_v3v3fl(val, vd.co, val, fade); | ||||
| SCULPT_clip(sd, ss, vd.co, val); | SCULPT_clip(sd, ss, vd.co, val); | ||||
| } | |||||
| if (vd.mvert) { | if (vd.mvert) { | ||||
| BKE_pbvh_vert_mark_update(ss->pbvh, vd.vertex); | BKE_pbvh_vert_tag_update_normal(ss->pbvh, vd.vertex); | ||||
| } | |||||
| } | } | ||||
| } | } | ||||
| BKE_pbvh_vertex_iter_end; | BKE_pbvh_vertex_iter_end; | ||||
| } | } | ||||
| void SCULPT_smooth(Sculpt *sd, | void SCULPT_smooth(Sculpt *sd, | ||||
| Object *ob, | Object *ob, | ||||
| PBVHNode **nodes, | PBVHNode **nodes, | ||||
| ▲ Show 20 Lines • Show All 145 Lines • ▼ Show 20 Lines | const float fade = bstrength * SCULPT_brush_strength_factor(ss, | ||||
| vd.vertex, | vd.vertex, | ||||
| thread_id); | thread_id); | ||||
| float disp[3]; | float disp[3]; | ||||
| SCULPT_surface_smooth_laplacian_step( | SCULPT_surface_smooth_laplacian_step( | ||||
| ss, disp, vd.co, ss->cache->surface_smooth_laplacian_disp, vd.vertex, orig_data.co, alpha); | ss, disp, vd.co, ss->cache->surface_smooth_laplacian_disp, vd.vertex, orig_data.co, alpha); | ||||
| madd_v3_v3fl(vd.co, disp, clamp_f(fade, 0.0f, 1.0f)); | madd_v3_v3fl(vd.co, disp, clamp_f(fade, 0.0f, 1.0f)); | ||||
| if (vd.mvert) { | if (vd.mvert) { | ||||
| BKE_pbvh_vert_mark_update(ss->pbvh, vd.vertex); | BKE_pbvh_vert_tag_update_normal(ss->pbvh, vd.vertex); | ||||
| } | } | ||||
| } | } | ||||
| BKE_pbvh_vertex_iter_end; | BKE_pbvh_vertex_iter_end; | ||||
| } | } | ||||
| static void SCULPT_do_surface_smooth_brush_displace_task_cb_ex( | static void SCULPT_do_surface_smooth_brush_displace_task_cb_ex( | ||||
| void *__restrict userdata, const int n, const TaskParallelTLS *__restrict tls) | void *__restrict userdata, const int n, const TaskParallelTLS *__restrict tls) | ||||
| { | { | ||||
| ▲ Show 20 Lines • Show All 53 Lines • Show Last 20 Lines | |||||