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_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 "ED_view3d.h"
#include "paint_intern.h"
#include "sculpt_intern.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "UI_interface.h"
#include "bmesh.h"
#include <math.h>
#include <stdlib.h>
Go to the source code of this file.
Typedefs | |
typedef enum eSculptMeshFilterType | eSculptMeshFilterType |
typedef enum eMeshFilterDeformAxis | eMeshFilterDeformAxis |
Enumerations | |
enum | eSculptMeshFilterType { MESH_FILTER_SMOOTH = 0 , MESH_FILTER_SCALE = 1 , MESH_FILTER_INFLATE = 2 , MESH_FILTER_SPHERE = 3 , MESH_FILTER_RANDOM = 4 , MESH_FILTER_RELAX = 5 , MESH_FILTER_RELAX_FACE_SETS = 6 , MESH_FILTER_SURFACE_SMOOTH = 7 , MESH_FILTER_SHARPEN = 8 , MESH_FILTER_ENHANCE_DETAILS = 9 , MESH_FILTER_ERASE_DISPLACEMENT = 10 } |
enum | eMeshFilterDeformAxis { MESH_FILTER_DEFORM_X = 1 << 0 , MESH_FILTER_DEFORM_Y = 1 << 1 , MESH_FILTER_DEFORM_Z = 1 << 2 } |
Variables | |
static EnumPropertyItem | prop_mesh_filter_types [] |
static EnumPropertyItem | prop_mesh_filter_deform_axis_items [] |
static EnumPropertyItem | prop_mesh_filter_orientation_items [] |
typedef enum eMeshFilterDeformAxis eMeshFilterDeformAxis |
typedef enum eSculptMeshFilterType eSculptMeshFilterType |
Enumerator | |
---|---|
MESH_FILTER_DEFORM_X | |
MESH_FILTER_DEFORM_Y | |
MESH_FILTER_DEFORM_Z |
Definition at line 230 of file sculpt_filter_mesh.c.
Definition at line 185 of file sculpt_filter_mesh.c.
|
static |
Definition at line 94 of file sculpt_filter_mesh.c.
References data, node, and SCULPT_undo_push_node().
Referenced by SCULPT_filter_cache_init().
|
static |
Definition at line 468 of file sculpt_filter_mesh.c.
References FilterCache::detail_directions, SculptSession::filter_cache, MEM_malloc_arrayN, SCULPT_neighbor_coords_average(), SCULPT_vertex_co_get(), SCULPT_vertex_count_get(), and sub_v3_v3v3().
Referenced by sculpt_mesh_filter_invoke().
|
static |
Definition at line 495 of file sculpt_filter_mesh.c.
References SculptSession::filter_cache, FilterCache::limit_surface_co, MEM_malloc_arrayN, SCULPT_vertex_count_get(), and SCULPT_vertex_limit_surface_get().
Referenced by sculpt_mesh_filter_invoke().
|
static |
Definition at line 507 of file sculpt_filter_mesh.c.
References add_v3_v3(), FilterCache::detail_directions, SculptSession::filter_cache, SculptVertexNeighborIter::index, len_v3(), MEM_malloc_arrayN, mul_v3_v3fl(), pow2f(), SCULPT_neighbor_coords_average(), SCULPT_vertex_co_get(), SCULPT_vertex_count_get(), SCULPT_VERTEX_NEIGHBORS_ITER_BEGIN, SCULPT_VERTEX_NEIGHBORS_ITER_END, FilterCache::sharpen_curvature_smooth_iterations, FilterCache::sharpen_factor, FilterCache::sharpen_intensify_detail_strength, FilterCache::sharpen_smooth_ratio, and sub_v3_v3v3().
Referenced by sculpt_mesh_filter_invoke().
|
static |
Definition at line 567 of file sculpt_filter_mesh.c.
References FilterCache::automasking, BKE_pbvh_vertex_iter_begin, BKE_pbvh_vertex_iter_end, clamp_f(), PBVHVertexIter::co, data, fade(), SculptSession::filter_cache, PBVHVertexIter::index, PBVHVertexIter::mask, node, SculptSession::pbvh, PBVH_ITER_UNIQUE, SCULPT_automasking_factor_get(), SCULPT_surface_smooth_displace_step(), FilterCache::surface_smooth_current_vertex, and FilterCache::surface_smooth_laplacian_disp.
Referenced by sculpt_mesh_filter_modal().
|
static |
Definition at line 482 of file sculpt_filter_mesh.c.
References SculptSession::filter_cache, MEM_malloc_arrayN, SCULPT_vertex_count_get(), FilterCache::surface_smooth_current_vertex, FilterCache::surface_smooth_laplacian_disp, and FilterCache::surface_smooth_shape_preservation.
Referenced by sculpt_mesh_filter_invoke().
|
static |
Definition at line 273 of file sculpt_filter_mesh.c.
References add_v3_v3(), add_v3_v3v3(), FilterCache::automasking, BKE_pbvh_node_mark_update(), BKE_pbvh_vert_tag_update_normal(), BKE_pbvh_vertex_iter_begin, BKE_pbvh_vertex_iter_end, BLI_hash_int_2d(), clamp_f(), PBVHVertexIter::co, SculptOrigVertData::co, copy_v3_v3(), data, FilterCache::detail_directions, ELEM, FilterCache::enabled_axis, fabsf, fade(), SculptSession::filter_cache, hash, PBVHVertexIter::index, SculptVertexNeighborIter::index, FilterCache::iteration_count, FilterCache::limit_surface_co, madd_v3_v3fl(), madd_v3_v3v3fl(), PBVHVertexIter::mask, MESH_FILTER_ENHANCE_DETAILS, MESH_FILTER_ERASE_DISPLACEMENT, MESH_FILTER_INFLATE, MESH_FILTER_RANDOM, MESH_FILTER_RELAX, MESH_FILTER_RELAX_FACE_SETS, MESH_FILTER_SCALE, MESH_FILTER_SHARPEN, MESH_FILTER_SMOOTH, MESH_FILTER_SPHERE, MESH_FILTER_SURFACE_SMOOTH, mid_v3_v3v3(), mul_m3_v3(), mul_v3_fl(), mul_v3_v3fl(), PBVHVertexIter::mvert, SculptOrigVertData::no, node, normal, normalize_v3_v3(), SculptSession::pbvh, PBVH_ITER_UNIQUE, pow2f(), FilterCache::random_seed, scale_m3_fl(), SCULPT_automasking_factor_get(), SCULPT_filter_to_object_space(), SCULPT_filter_to_orientation_space(), SCULPT_neighbor_coords_average(), SCULPT_neighbor_coords_average_interior(), SCULPT_orig_vert_data_init(), SCULPT_orig_vert_data_update(), SCULPT_relax_vertex(), SCULPT_surface_smooth_laplacian_step(), SCULPT_UNDO_COORDS, SCULPT_vertex_co_get(), SCULPT_vertex_has_unique_face_set(), SCULPT_VERTEX_NEIGHBORS_ITER_BEGIN, SCULPT_VERTEX_NEIGHBORS_ITER_END, FilterCache::sharpen_factor, FilterCache::sharpen_intensify_detail_strength, FilterCache::sharpen_smooth_ratio, sub_v3_v3v3(), FilterCache::surface_smooth_laplacian_disp, FilterCache::surface_smooth_shape_preservation, transform(), and unit_m3().
Referenced by sculpt_mesh_filter_modal().
void SCULPT_filter_cache_free | ( | SculptSession * | ss | ) |
Definition at line 164 of file sculpt_filter_mesh.c.
References FilterCache::automasking, FilterCache::cloth_sim, FilterCache::detail_directions, SculptSession::filter_cache, FilterCache::limit_surface_co, FilterCache::mask_update_it, MEM_SAFE_FREE, FilterCache::nodes, FilterCache::normal_factor, FilterCache::pre_smoothed_color, FilterCache::prev_face_set, FilterCache::prev_mask, SCULPT_automasking_cache_free(), SCULPT_cloth_simulation_free(), FilterCache::sharpen_factor, and FilterCache::surface_smooth_laplacian_disp.
Referenced by ED_sculpt_end_transform(), sculpt_cloth_filter_modal(), sculpt_color_filter_modal(), sculpt_mask_expand_cancel(), sculpt_mask_expand_modal(), and sculpt_mesh_filter_modal().
Definition at line 104 of file sculpt_filter_mesh.c.
References BKE_pbvh_ensure_node_loops(), BKE_pbvh_node_mark_normals_update(), BKE_pbvh_parallel_range_settings(), BKE_pbvh_search_gather(), BKE_pbvh_type(), BKE_pbvh_update_normals(), BLI_task_parallel_range(), C, center, copy_m4_m4(), CTX_data_ensure_evaluated_depsgraph(), data, depsgraph, ED_view3d_viewcontext_init(), SculptSession::filter_cache, filter_cache_init_task_cb(), invert_m4_m4(), MEM_callocN, FilterCache::nodes, NULL, FilterCache::obmat, Object::obmat, FilterCache::obmat_inv, SculptSearchSphereData::original, SculptSession::pbvh, PBVH_GRIDS, FilterCache::random_seed, ViewContext::rv3d, Object::sculpt, SCULPT_search_sphere_cb(), SCULPT_UNDO_COLOR, FilterCache::totnode, RegionView3D::viewinv, FilterCache::viewmat, RegionView3D::viewmat, and FilterCache::viewmat_inv.
Referenced by ED_sculpt_init_transform(), sculpt_cloth_filter_invoke(), sculpt_color_filter_invoke(), and sculpt_mesh_filter_invoke().
void SCULPT_filter_to_object_space | ( | float | r_v[3], |
struct FilterCache * | filter_cache | ||
) |
Definition at line 67 of file sculpt_filter_mesh.c.
References mul_mat3_m4_v3(), FilterCache::obmat_inv, FilterCache::orientation, SCULPT_FILTER_ORIENTATION_LOCAL, SCULPT_FILTER_ORIENTATION_VIEW, SCULPT_FILTER_ORIENTATION_WORLD, and FilterCache::viewmat_inv.
Referenced by cloth_filter_apply_forces_task_cb(), mesh_filter_task_cb(), and SCULPT_filter_zero_disabled_axis_components().
void SCULPT_filter_to_orientation_space | ( | float | r_v[3], |
struct FilterCache * | filter_cache | ||
) |
Definition at line 51 of file sculpt_filter_mesh.c.
References mul_mat3_m4_v3(), FilterCache::obmat, FilterCache::orientation, SCULPT_FILTER_ORIENTATION_LOCAL, SCULPT_FILTER_ORIENTATION_VIEW, SCULPT_FILTER_ORIENTATION_WORLD, and FilterCache::viewmat.
Referenced by mesh_filter_task_cb(), and SCULPT_filter_zero_disabled_axis_components().
void SCULPT_filter_zero_disabled_axis_components | ( | float | r_v[3], |
struct FilterCache * | filter_cache | ||
) |
Definition at line 83 of file sculpt_filter_mesh.c.
References FilterCache::enabled_force_axis, SCULPT_filter_to_object_space(), and SCULPT_filter_to_orientation_space().
Referenced by cloth_filter_apply_displacement_to_deform_co(), and cloth_filter_apply_forces_to_vertices().
|
static |
Definition at line 658 of file sculpt_filter_mesh.c.
References FilterCache::active_face_set, FilterCache::automasking, BKE_sculpt_update_object_for_edit(), C, CTX_data_active_object(), CTX_data_depsgraph_pointer(), CTX_data_tool_settings(), depsgraph, FilterCache::enabled_axis, SculptSession::filter_cache, MESH_FILTER_DEFORM_X, MESH_FILTER_DEFORM_Y, MESH_FILTER_DEFORM_Z, MESH_FILTER_ENHANCE_DETAILS, mesh_filter_enhance_details_init_directions(), MESH_FILTER_ERASE_DISPLACEMENT, mesh_filter_init_limit_surface_co(), MESH_FILTER_SHARPEN, mesh_filter_sharpen_init(), MESH_FILTER_SURFACE_SMOOTH, mesh_filter_surface_smooth_init(), wmEvent::mval, NULL, OPERATOR_CANCELLED, OPERATOR_RUNNING_MODAL, FilterCache::orientation, wmOperator::ptr, RNA_enum_get(), RNA_float_get(), RNA_int_get(), Object::sculpt, ToolSettings::sculpt, SCULPT_automasking_cache_init(), SCULPT_boundary_info_ensure(), SCULPT_cursor_geometry_info_update(), SCULPT_FACE_SET_NONE, SCULPT_filter_cache_init(), SCULPT_is_automasking_enabled(), sculpt_mesh_filter_needs_pmap(), SCULPT_UNDO_COORDS, SCULPT_undo_push_begin(), SCULPT_vertex_random_access_ensure(), UNPACK2, and WM_event_add_modal_handler().
Referenced by SCULPT_OT_mesh_filter().
|
static |
Definition at line 594 of file sculpt_filter_mesh.c.
References BKE_pbvh_parallel_range_settings(), BKE_pbvh_update_normals(), BKE_sculpt_update_object_for_edit(), BLI_task_parallel_range(), C, CTX_data_active_object(), CTX_data_depsgraph_pointer(), CTX_data_tool_settings(), data, SculptSession::deform_modifiers_active, depsgraph, ELEM, SculptSession::filter_cache, FilterCache::iteration_count, KM_RELEASE, LEFTMOUSE, len, MESH_FILTER_RELAX, MESH_FILTER_RELAX_FACE_SETS, MESH_FILTER_SURFACE_SMOOTH, mesh_filter_surface_smooth_displace_task_cb(), mesh_filter_task_cb(), MOUSEMOVE, FilterCache::nodes, OPERATOR_FINISHED, OPERATOR_RUNNING_MODAL, SculptSession::pbvh, wmOperator::ptr, RNA_enum_get(), RNA_float_get(), Object::sculpt, ToolSettings::sculpt, SCULPT_filter_cache_free(), SCULPT_flush_stroke_deform(), SCULPT_flush_update_done(), SCULPT_flush_update_step(), sculpt_mesh_filter_needs_pmap(), SCULPT_undo_push_end(), SCULPT_UPDATE_COORDS, SCULPT_vertex_random_access_ensure(), SculptSession::shapekey_active, SculptSession::subdiv_ccg, FilterCache::totnode, wmEvent::type, UI_DPI_FAC, and wmEvent::val.
Referenced by SCULPT_OT_mesh_filter().
|
static |
Definition at line 262 of file sculpt_filter_mesh.c.
References ELEM, MESH_FILTER_ENHANCE_DETAILS, MESH_FILTER_RELAX, MESH_FILTER_RELAX_FACE_SETS, MESH_FILTER_SHARPEN, MESH_FILTER_SMOOTH, and MESH_FILTER_SURFACE_SMOOTH.
Referenced by sculpt_mesh_filter_invoke(), and sculpt_mesh_filter_modal().
void SCULPT_OT_mesh_filter | ( | struct wmOperatorType * | ot | ) |
Definition at line 738 of file sculpt_filter_mesh.c.
References wmOperatorType::description, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::invoke, MESH_FILTER_DEFORM_X, MESH_FILTER_DEFORM_Y, MESH_FILTER_DEFORM_Z, MESH_FILTER_INFLATE, wmOperatorType::modal, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, prop_mesh_filter_deform_axis_items, prop_mesh_filter_orientation_items, prop_mesh_filter_types, RNA_def_enum(), RNA_def_enum_flag(), RNA_def_float(), RNA_def_int(), SCULPT_FILTER_ORIENTATION_LOCAL, sculpt_mesh_filter_invoke(), sculpt_mesh_filter_modal(), SCULPT_mode_poll(), and wmOperatorType::srna.
Referenced by ED_operatortypes_sculpt().
|
static |
Definition at line 236 of file sculpt_filter_mesh.c.
Referenced by SCULPT_OT_mesh_filter().
|
static |
Definition at line 243 of file sculpt_filter_mesh.c.
Referenced by SCULPT_OT_mesh_filter().
|
static |
Definition at line 199 of file sculpt_filter_mesh.c.
Referenced by SCULPT_OT_mesh_filter().