Blender
V3.3
|
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
#include "BLI_hash.h"
#include "BLI_math.h"
#include "BLI_task.h"
#include "DNA_brush_types.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "BKE_brush.h"
#include "BKE_context.h"
#include "BKE_mesh.h"
#include "BKE_mesh_mapping.h"
#include "BKE_object.h"
#include "BKE_paint.h"
#include "BKE_pbvh.h"
#include "BKE_scene.h"
#include "DEG_depsgraph.h"
#include "WM_api.h"
#include "WM_message.h"
#include "WM_toolsystem.h"
#include "WM_types.h"
#include "ED_object.h"
#include "ED_screen.h"
#include "ED_sculpt.h"
#include "paint_intern.h"
#include "sculpt_intern.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "bmesh.h"
#include <math.h>
#include <stdlib.h>
Go to the source code of this file.
|
static |
Definition at line 199 of file sculpt_smooth.c.
References BKE_pbvh_vert_tag_update_normal(), BKE_pbvh_vertex_iter_begin, BKE_pbvh_vertex_iter_end, BLI_task_parallel_thread_id(), StrokeCache::bstrength, SculptSession::cache, CLAMP, PBVHVertexIter::co, data, StrokeCache::detail_directions, SculptBrushTest::dist, fade(), PBVHVertexIter::fno, PBVHVertexIter::index, madd_v3_v3v3fl(), PBVHVertexIter::mask, PBVHVertexIter::mvert, PBVHVertexIter::no, SculptSession::pbvh, PBVH_ITER_UNIQUE, SCULPT_brush_strength_factor(), SCULPT_brush_test_init_with_falloff_shape(), SCULPT_clip(), sqrtf, and blender::threading::enumerable_thread_specific_utils::thread_id.
Referenced by SCULPT_enhance_details_brush().
|
static |
Definition at line 279 of file sculpt_smooth.c.
References BKE_pbvh_vert_tag_update_normal(), BKE_pbvh_vertex_iter_begin, BKE_pbvh_vertex_iter_end, BLI_task_parallel_thread_id(), CLAMP, PBVHVertexIter::co, data, SculptBrushTest::dist, fade(), PBVHVertexIter::fno, PBVHVertexIter::index, madd_v3_v3v3fl(), PBVHVertexIter::mask, PBVHVertexIter::mvert, PBVHVertexIter::no, SculptSession::pbvh, PBVH_ITER_UNIQUE, SCULPT_brush_strength_factor(), SCULPT_brush_test_init_with_falloff_shape(), SCULPT_clip(), SCULPT_neighbor_coords_average_interior(), SCULPT_neighbor_mask_average(), blender::compositor::smooth_mask(), sqrtf, sub_v3_v3v3(), and blender::threading::enumerable_thread_specific_utils::thread_id.
Referenced by SCULPT_smooth().
For bmesh: Average surrounding verts based on an orthogonality measure. Naturally converges to a quad-like structure.
Definition at line 89 of file sculpt_smooth.c.
References add_v3_v3(), BM_edge_is_boundary(), BM_EDGES_OF_VERT, BM_ITER_ELEM, BMVert::co, copy_v3_v3(), dot_v3v3(), e, madd_v3_v3fl(), mul_v3_v3fl(), BMVert::no, normalize_v3(), sub_v3_v3(), sub_v3_v3v3(), v, and zero_v3().
Referenced by do_topology_rake_bmesh_task_cb_ex().
Definition at line 381 of file sculpt_smooth.c.
References StrokeCache::bstrength, SculptSession::cache, Object::sculpt, SCULPT_enhance_details_brush(), and SCULPT_smooth().
Referenced by do_brush_action().
Definition at line 526 of file sculpt_smooth.c.
References BKE_paint_brush(), BKE_pbvh_parallel_range_settings(), BLI_task_parallel_range(), data, Sculpt::paint, SCULPT_do_surface_smooth_brush_displace_task_cb_ex(), SCULPT_do_surface_smooth_brush_laplacian_task_cb_ex(), and Brush::surface_smooth_iterations.
Referenced by do_brush_action().
|
static |
Definition at line 491 of file sculpt_smooth.c.
References beta(), BKE_pbvh_vertex_iter_begin, BKE_pbvh_vertex_iter_end, BLI_task_parallel_thread_id(), StrokeCache::bstrength, SculptSession::cache, PBVHVertexIter::co, data, SculptBrushTest::dist, fade(), PBVHVertexIter::fno, PBVHVertexIter::index, PBVHVertexIter::mask, PBVHVertexIter::no, SculptSession::pbvh, PBVH_ITER_UNIQUE, SCULPT_brush_strength_factor(), SCULPT_brush_test_init_with_falloff_shape(), SCULPT_surface_smooth_displace_step(), sqrtf, Brush::surface_smooth_current_vertex, StrokeCache::surface_smooth_laplacian_disp, and blender::threading::enumerable_thread_specific_utils::thread_id.
Referenced by SCULPT_do_surface_smooth_brush().
|
static |
Definition at line 446 of file sculpt_smooth.c.
References BKE_pbvh_vert_tag_update_normal(), BKE_pbvh_vertex_iter_begin, BKE_pbvh_vertex_iter_end, BLI_task_parallel_thread_id(), StrokeCache::bstrength, SculptSession::cache, clamp_f(), PBVHVertexIter::co, SculptOrigVertData::co, data, SculptBrushTest::dist, fade(), PBVHVertexIter::fno, PBVHVertexIter::index, madd_v3_v3fl(), PBVHVertexIter::mask, PBVHVertexIter::mvert, PBVHVertexIter::no, SculptSession::pbvh, PBVH_ITER_UNIQUE, SCULPT_brush_strength_factor(), SCULPT_brush_test_init_with_falloff_shape(), SCULPT_orig_vert_data_init(), SCULPT_orig_vert_data_update(), SCULPT_surface_smooth_laplacian_step(), SCULPT_UNDO_COORDS, sqrtf, StrokeCache::surface_smooth_laplacian_disp, Brush::surface_smooth_shape_preservation, and blender::threading::enumerable_thread_specific_utils::thread_id.
Referenced by SCULPT_do_surface_smooth_brush().
|
static |
Definition at line 244 of file sculpt_smooth.c.
References BKE_paint_brush(), BKE_pbvh_parallel_range_settings(), BLI_task_parallel_range(), SculptSession::cache, data, StrokeCache::detail_directions, do_enhance_details_brush_task_cb_ex(), MEM_malloc_arrayN, Sculpt::paint, Object::sculpt, SCULPT_boundary_info_ensure(), SCULPT_neighbor_coords_average(), SCULPT_stroke_is_first_brush_step(), SCULPT_vertex_co_get(), SCULPT_vertex_count_get(), SCULPT_vertex_random_access_ensure(), and sub_v3_v3v3().
Referenced by SCULPT_do_smooth_brush().
void SCULPT_neighbor_color_average | ( | SculptSession * | ss, |
float | result[4], | ||
int | index | ||
) |
Definition at line 175 of file sculpt_smooth.c.
References add_v4_v4(), SculptVertexNeighborIter::index, mul_v4_v4fl(), result, SCULPT_vertex_color_get(), SCULPT_VERTEX_NEIGHBORS_ITER_BEGIN, and SCULPT_VERTEX_NEIGHBORS_ITER_END.
Referenced by color_filter_task_cb(), and do_color_smooth_task_cb_exec().
void SCULPT_neighbor_coords_average | ( | SculptSession * | ss, |
float | result[3], | ||
int | index | ||
) |
Definition at line 137 of file sculpt_smooth.c.
References add_v3_v3(), copy_v3_v3(), SculptVertexNeighborIter::index, mul_v3_v3fl(), result, SCULPT_vertex_co_get(), SCULPT_VERTEX_NEIGHBORS_ITER_BEGIN, and SCULPT_VERTEX_NEIGHBORS_ITER_END.
Referenced by mesh_filter_enhance_details_init_directions(), mesh_filter_sharpen_init(), mesh_filter_task_cb(), SCULPT_enhance_details_brush(), and SCULPT_surface_smooth_laplacian_step().
void SCULPT_neighbor_coords_average_interior | ( | SculptSession * | ss, |
float | result[3], | ||
int | index | ||
) |
Mask the mesh boundaries smoothing only the mesh surface without using auto-masking.
Definition at line 49 of file sculpt_smooth.c.
References add_v3_v3(), copy_v3_v3(), SculptVertexNeighborIter::index, mul_v3_v3fl(), result, SCULPT_vertex_co_get(), SCULPT_vertex_is_boundary(), SCULPT_VERTEX_NEIGHBORS_ITER_BEGIN, and SCULPT_VERTEX_NEIGHBORS_ITER_END.
Referenced by do_smooth_brush_task_cb_ex(), and mesh_filter_task_cb().
float SCULPT_neighbor_mask_average | ( | SculptSession * | ss, |
int | index | ||
) |
Definition at line 157 of file sculpt_smooth.c.
References SculptVertexNeighborIter::index, SCULPT_vertex_mask_get(), SCULPT_VERTEX_NEIGHBORS_ITER_BEGIN, and SCULPT_VERTEX_NEIGHBORS_ITER_END.
Referenced by do_smooth_brush_task_cb_ex(), and mask_filter_task_cb().
void SCULPT_smooth | ( | Sculpt * | sd, |
Object * | ob, | ||
PBVHNode ** | nodes, | ||
const int | totnode, | ||
float | bstrength, | ||
const bool | smooth_mask | ||
) |
Definition at line 334 of file sculpt_smooth.c.
References BKE_paint_brush(), BKE_pbvh_parallel_range_settings(), BKE_pbvh_type(), BLI_assert_msg, BLI_task_parallel_range(), CLAMP, count, data, do_smooth_brush_task_cb_ex(), fract(), Sculpt::paint, SculptSession::pbvh, PBVH_FACES, SculptSession::pmap, Object::sculpt, SCULPT_boundary_info_ensure(), SCULPT_vertex_random_access_ensure(), blender::compositor::smooth_mask(), and type.
Referenced by do_brush_action(), SCULPT_do_mask_brush(), and SCULPT_do_smooth_brush().
void SCULPT_surface_smooth_displace_step | ( | SculptSession * | ss, |
float * | co, | ||
float(*) | laplacian_disp[3], | ||
const int | v_index, | ||
const float | beta, | ||
const float | fade | ||
) |
Definition at line 422 of file sculpt_smooth.c.
References add_v3_v3(), beta(), clamp_f(), fade(), SculptVertexNeighborIter::index, madd_v3_v3fl(), mul_v3_fl(), mul_v3_v3fl(), SCULPT_VERTEX_NEIGHBORS_ITER_BEGIN, SCULPT_VERTEX_NEIGHBORS_ITER_END, and sub_v3_v3().
Referenced by mesh_filter_surface_smooth_displace_task_cb(), and SCULPT_do_surface_smooth_brush_displace_task_cb_ex().
void SCULPT_surface_smooth_laplacian_step | ( | SculptSession * | ss, |
float * | disp, | ||
const float | co[3], | ||
float(*) | laplacian_disp[3], | ||
const int | v_index, | ||
const float | origco[3], | ||
const float | alpha | ||
) |
Definition at line 402 of file sculpt_smooth.c.
References add_v3_v3v3(), mul_v3_v3fl(), SCULPT_neighbor_coords_average(), and sub_v3_v3v3().
Referenced by mesh_filter_task_cb(), and SCULPT_do_surface_smooth_brush_laplacian_task_cb_ex().