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 3,655 Lines • ▼ Show 20 Lines | if (!filter_boundary_face_sets || | ||||
| count++; | count++; | ||||
| } | } | ||||
| } | } | ||||
| sculpt_vertex_neighbors_iter_end(ni); | sculpt_vertex_neighbors_iter_end(ni); | ||||
| if (count > 0) { | if (count > 0) { | ||||
| mul_v3_fl(smooth_pos, 1.0f / (float)count); | mul_v3_fl(smooth_pos, 1.0f / (float)count); | ||||
| } | } | ||||
| else { | |||||
| copy_v3_v3(r_final_pos, vd->co); | |||||
| return; | |||||
| } | |||||
| float plane[4]; | float plane[4]; | ||||
| float smooth_closest_plane[3]; | float smooth_closest_plane[3]; | ||||
| float vno[3]; | float vno[3]; | ||||
| if (vd->no) { | if (vd->no) { | ||||
| normal_short_to_float_v3(vno, vd->no); | normal_short_to_float_v3(vno, vd->no); | ||||
| } | } | ||||
| else { | else { | ||||
| copy_v3_v3(vno, vd->fno); | copy_v3_v3(vno, vd->fno); | ||||
| } | } | ||||
| if (is_zero_v3(vno)) { | |||||
| copy_v3_v3(r_final_pos, vd->co); | |||||
| return; | |||||
| } | |||||
| plane_from_point_normal_v3(plane, vd->co, vno); | plane_from_point_normal_v3(plane, vd->co, vno); | ||||
| closest_to_plane_v3(smooth_closest_plane, plane, smooth_pos); | closest_to_plane_v3(smooth_closest_plane, plane, smooth_pos); | ||||
| sub_v3_v3v3(final_disp, smooth_closest_plane, vd->co); | sub_v3_v3v3(final_disp, smooth_closest_plane, vd->co); | ||||
| mul_v3_fl(final_disp, factor); | mul_v3_fl(final_disp, factor); | ||||
| add_v3_v3v3(r_final_pos, vd->co, final_disp); | add_v3_v3v3(r_final_pos, vd->co, final_disp); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 7,478 Lines • Show Last 20 Lines | |||||