Blender V4.3
blender::ed::sculpt_paint::filter Namespace Reference

Classes

struct  Cache
 

Enumerations

enum class  FilterOrientation { Local = 0 , World = 1 , View = 2 }
 
enum class  MeshFilterType {
  Smooth = 0 , Scale = 1 , Inflate = 2 , Sphere = 3 ,
  Random = 4 , Relax = 5 , RelaxFaceSets = 6 , SurfaceSmooth = 7 ,
  Sharpen = 8 , EnhanceDetails = 9 , EraseDisplacement = 10
}
 
enum  eMeshFilterDeformAxis { MESH_FILTER_DEFORM_X = 1 << 0 , MESH_FILTER_DEFORM_Y = 1 << 1 , MESH_FILTER_DEFORM_Z = 1 << 2 }
 
enum  { FILTER_MESH_MODAL_CANCEL = 1 , FILTER_MESH_MODAL_CONFIRM }
 

Functions

void cache_init (bContext *C, Object &ob, const Sculpt &sd, undo::Type undo_type, const float mval_fl[2], float area_normal_radius, float start_strength)
 
void register_operator_props (wmOperatorType *ot)
 
float3x3 to_orientation_space (const filter::Cache &filter_cache)
 
float3x3 to_object_space (const filter::Cache &filter_cache)
 
void zero_disabled_axis_components (const filter::Cache &filter_cache, MutableSpan< float3 > vectors)
 
static bool sculpt_mesh_filter_needs_pmap (MeshFilterType filter_type)
 
static bool sculpt_mesh_filter_is_continuous (MeshFilterType type)
 
static BLI_NOINLINE void clamp_factors (const MutableSpan< float > factors, const float min, const float max)
 
static void calc_smooth_filter (const Depsgraph &depsgraph, const Sculpt &sd, const float strength, Object &object, const IndexMask &node_mask)
 
static void calc_inflate_filter (const Depsgraph &depsgraph, const Sculpt &sd, const float strength, Object &object, const IndexMask &node_mask)
 
static void calc_scale_filter (const Depsgraph &depsgraph, const Sculpt &sd, const float strength, Object &object, const IndexMask &node_mask)
 
static BLI_NOINLINE void calc_sphere_translations (const Span< float3 > positions, const Span< float > factors, const MutableSpan< float3 > translations)
 
static void calc_sphere_filter (const Depsgraph &depsgraph, const Sculpt &sd, const float strength, Object &object, const IndexMask &node_mask)
 
static BLI_NOINLINE void randomize_factors (const Span< float3 > positions, const int seed, const MutableSpan< float > factors)
 
static void calc_random_filter (const Depsgraph &depsgraph, const Sculpt &sd, const float strength, Object &object, const IndexMask &node_mask)
 
static void calc_relax_filter (const Depsgraph &depsgraph, const Sculpt &sd, const float strength, Object &object, const IndexMask &node_mask)
 
static void calc_relax_face_sets_filter (const Depsgraph &depsgraph, const Sculpt &sd, const float strength, Object &object, const IndexMask &node_mask)
 
static void calc_surface_smooth_filter (const Depsgraph &depsgraph, const Sculpt &sd, const float strength, Object &object, const IndexMask &node_mask)
 
static BLI_NOINLINE void calc_sharpen_detail_translations (const filter::Cache &filter_cache, const Span< float3 > positions, const Span< float3 > smooth_positions, const Span< float > sharpen_factors, const Span< float3 > detail_directions, const MutableSpan< float3 > translations)
 
static void calc_sharpen_filter (const Depsgraph &depsgraph, const Sculpt &sd, const float strength, Object &object, const IndexMask &node_mask)
 
static void calc_enhance_details_filter (const Depsgraph &depsgraph, const Sculpt &sd, const float strength, Object &object, const IndexMask &node_mask)
 
static void calc_erase_displacement_filter (const Depsgraph &depsgraph, const Sculpt &sd, const float strength, Object &object, const IndexMask &node_mask)
 
static void mesh_filter_surface_smooth_init (Object &object, const float shape_preservation, const float current_vertex_displacement)
 
static void calc_limit_surface_positions (const Object &object, MutableSpan< float3 > limit_positions)
 
static void mesh_filter_sharpen_init (const Depsgraph &depsgraph, const Object &object, const float smooth_ratio, const float intensify_detail_strength, const int curvature_smooth_iterations, filter::Cache &filter_cache)
 
wmKeyMapmodal_keymap (wmKeyConfig *keyconf)
 
static void sculpt_mesh_update_status_bar (bContext *C, wmOperator *)
 
static void sculpt_mesh_filter_apply (bContext *C, wmOperator *op)
 
static void sculpt_mesh_update_strength (wmOperator *op, SculptSession &ss, float2 prev_press_mouse, float2 mouse)
 
static void sculpt_mesh_filter_apply_with_history (bContext *C, wmOperator *op)
 
static void sculpt_mesh_filter_end (bContext *C)
 
static int sculpt_mesh_filter_confirm (SculptSession &ss, wmOperator *op, const MeshFilterType filter_type)
 
static void sculpt_mesh_filter_cancel (bContext *C, wmOperator *)
 
static int sculpt_mesh_filter_modal (bContext *C, wmOperator *op, const wmEvent *event)
 
static void sculpt_filter_specific_init (const Depsgraph &depsgraph, const MeshFilterType filter_type, wmOperator *op, Object &object)
 
static int sculpt_mesh_filter_start (bContext *C, wmOperator *op)
 
static int sculpt_mesh_filter_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
static int sculpt_mesh_filter_exec (bContext *C, wmOperator *op)
 
static void sculpt_mesh_ui_exec (bContext *, wmOperator *op)
 
void SCULPT_OT_mesh_filter (wmOperatorType *ot)
 

Variables

static EnumPropertyItem prop_mesh_filter_types []
 
static EnumPropertyItem prop_mesh_filter_deform_axis_items []
 
static EnumPropertyItem prop_mesh_filter_orientation_items []
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
FILTER_MESH_MODAL_CANCEL 
FILTER_MESH_MODAL_CONFIRM 

Definition at line 2112 of file sculpt_filter_mesh.cc.

◆ eMeshFilterDeformAxis

Enumerator
MESH_FILTER_DEFORM_X 
MESH_FILTER_DEFORM_Y 
MESH_FILTER_DEFORM_Z 

Definition at line 275 of file sculpt_filter_mesh.cc.

◆ FilterOrientation

Enumerator
Local 
World 
View 

Definition at line 43 of file sculpt_filter.hh.

◆ MeshFilterType

Enumerator
Smooth 
Scale 
Inflate 
Sphere 
Random 
Relax 
RelaxFaceSets 
SurfaceSmooth 
Sharpen 
EnhanceDetails 
EraseDisplacement 

Definition at line 230 of file sculpt_filter_mesh.cc.

Function Documentation

◆ cache_init()

void blender::ed::sculpt_paint::filter::cache_init ( bContext * C,
Object & ob,
const Sculpt & sd,
undo::Type undo_type,
const float mval_fl[2],
float area_normal_radius,
float start_strength )

Definition at line 129 of file sculpt_filter_mesh.cc.

References add_v3_v3(), UnifiedPaintSettings::average_stroke_accum, UnifiedPaintSettings::average_stroke_counter, BKE_brush_size_get(), BKE_brush_unprojected_radius_get(), BKE_brush_use_locked_size(), BKE_paint_brush_for_read(), blender::ed::sculpt_paint::calc_area_normal(), copy_m3_m4(), copy_m4_m4(), copy_v3_v3(), CTX_data_ensure_evaluated_depsgraph(), CTX_data_scene(), depsgraph, ED_view3d_viewcontext_init(), SculptSession::filter_cache, blender::ed::sculpt_paint::filter::Cache::initial_normal, invert_m4_m4(), SculptSession::last_normal, UnifiedPaintSettings::last_stroke_valid, mul_m3_v3(), mul_m4_v3(), blender::ed::sculpt_paint::node_fully_masked_or_hidden(), blender::ed::sculpt_paint::node_in_sphere(), blender::ed::sculpt_paint::filter::Cache::node_mask, blender::ed::sculpt_paint::filter::Cache::node_mask_memory, normalize_v3_v3(), blender::ed::sculpt_paint::filter::Cache::obmat, blender::ed::sculpt_paint::filter::Cache::obmat_inv, Sculpt::paint, paint_calc_object_space_radius(), blender::bke::object::pbvh_get(), blender::MatBase< T, NumCol, NumRow, Alignment >::ptr(), blender::ed::sculpt_paint::undo::push_nodes(), blender::ed::sculpt_paint::filter::Cache::random_seed, Object::runtime, ViewContext::rv3d, Object::sculpt, SCULPT_stroke_get_location(), blender::bke::pbvh::search_nodes(), UnifiedPaintSettings::size, blender::math::square(), blender::ed::sculpt_paint::filter::Cache::start_filter_strength, blender::ed::sculpt_paint::filter::Cache::vc, blender::ed::sculpt_paint::filter::Cache::view_normal, RegionView3D::viewinv, blender::ed::sculpt_paint::filter::Cache::viewmat, RegionView3D::viewmat, and blender::ed::sculpt_paint::filter::Cache::viewmat_inv.

Referenced by blender::ed::sculpt_paint::init_transform(), blender::ed::sculpt_paint::cloth::sculpt_cloth_filter_invoke(), and blender::ed::sculpt_paint::color::sculpt_color_filter_init().

◆ calc_enhance_details_filter()

static void blender::ed::sculpt_paint::filter::calc_enhance_details_filter ( const Depsgraph & depsgraph,
const Sculpt & sd,
const float strength,
Object & object,
const IndexMask & node_mask )
static

Definition at line 1809 of file sculpt_filter_mesh.cc.

References blender::ed::sculpt_paint::apply_translations(), blender::Array< T, InlineBufferCapacity, Allocator >::as_span(), blender::ed::sculpt_paint::filter::Cache::automasking, BKE_pbvh_bmesh_node_unique_verts(), bm, SculptSession::bm, SculptSession::bm_log, blender::bke::pbvh::BMesh, blender::ed::sculpt_paint::auto_mask::calc_grids_factors(), blender::ed::sculpt_paint::auto_mask::calc_vert_factors(), blender::ed::sculpt_paint::clip_and_lock_translations(), blender::ed::sculpt_paint::PositionDeformData::deform(), depsgraph, blender::ed::sculpt_paint::filter::Cache::detail_directions, blender::ed::sculpt_paint::PositionDeformData::eval, blender::ed::sculpt_paint::LocalData::factors, SculptSession::filter_cache, blender::index_mask::IndexMask::foreach_index(), blender::ed::sculpt_paint::gather_bmesh_positions(), blender::ed::sculpt_paint::gather_data_bmesh(), blender::ed::sculpt_paint::gather_data_grids(), blender::ed::sculpt_paint::gather_data_mesh(), blender::ed::sculpt_paint::gather_grids_positions(), blender::bke::pbvh::Grids, blender::ed::sculpt_paint::MeshAttributeData::hide_vert, blender::threading::EnumerableThreadSpecific< T >::local(), blender::ed::sculpt_paint::MeshAttributeData::mask, blender::bke::pbvh::Mesh, blender::bke::pbvh::Tree::nodes(), blender::ed::sculpt_paint::orig_position_data_gather_bmesh(), blender::ed::sculpt_paint::orig_position_data_get_grids(), blender::ed::sculpt_paint::orig_position_data_get_mesh(), blender::bke::object::pbvh_get(), blender::ed::sculpt_paint::LocalData::positions, blender::ed::sculpt_paint::OrigPositionData::positions, blender::ed::sculpt_paint::reset_translations_to_original(), blender::Vector< T, InlineBufferCapacity, Allocator >::resize(), blender::ed::sculpt_paint::scale_factors(), blender::ed::sculpt_paint::scale_translations(), SculptSession::subdiv_ccg, blender::ed::sculpt_paint::LocalData::translations, blender::bke::pbvh::Tree::type(), verts, and zero_disabled_axis_components().

Referenced by sculpt_mesh_filter_apply().

◆ calc_erase_displacement_filter()

static void blender::ed::sculpt_paint::filter::calc_erase_displacement_filter ( const Depsgraph & depsgraph,
const Sculpt & sd,
const float strength,
Object & object,
const IndexMask & node_mask )
static

◆ calc_inflate_filter()

static void blender::ed::sculpt_paint::filter::calc_inflate_filter ( const Depsgraph & depsgraph,
const Sculpt & sd,
const float strength,
Object & object,
const IndexMask & node_mask )
static

Definition at line 479 of file sculpt_filter_mesh.cc.

References blender::ed::sculpt_paint::apply_translations(), blender::ed::sculpt_paint::filter::Cache::automasking, BKE_pbvh_bmesh_node_unique_verts(), bm, SculptSession::bm, SculptSession::bm_log, blender::bke::pbvh::BMesh, blender::ed::sculpt_paint::auto_mask::calc_grids_factors(), blender::ed::sculpt_paint::auto_mask::calc_vert_factors(), blender::ed::sculpt_paint::clip_and_lock_translations(), blender::MutableSpan< T >::copy_from(), depsgraph, blender::ed::sculpt_paint::LocalData::factors, SculptSession::filter_cache, blender::index_mask::IndexMask::foreach_index(), blender::ed::sculpt_paint::gather_bmesh_positions(), blender::ed::sculpt_paint::gather_data_mesh(), blender::ed::sculpt_paint::gather_grids_positions(), blender::bke::pbvh::Grids, blender::threading::EnumerableThreadSpecific< T >::local(), blender::bke::pbvh::Mesh, blender::bke::pbvh::Tree::nodes(), blender::ed::sculpt_paint::OrigPositionData::normals, blender::ed::sculpt_paint::orig_position_data_gather_bmesh(), blender::ed::sculpt_paint::orig_position_data_get_grids(), blender::ed::sculpt_paint::orig_position_data_get_mesh(), blender::bke::object::pbvh_get(), blender::bke::Point, blender::ed::sculpt_paint::LocalData::positions, blender::ed::sculpt_paint::OrigPositionData::positions, blender::ed::sculpt_paint::reset_translations_to_original(), blender::Vector< T, InlineBufferCapacity, Allocator >::resize(), blender::ed::sculpt_paint::scale_factors(), blender::ed::sculpt_paint::scale_translations(), SculptSession::subdiv_ccg, blender::ed::sculpt_paint::LocalData::translations, blender::bke::pbvh::Tree::type(), verts, and zero_disabled_axis_components().

Referenced by sculpt_mesh_filter_apply().

◆ calc_limit_surface_positions()

static void blender::ed::sculpt_paint::filter::calc_limit_surface_positions ( const Object & object,
MutableSpan< float3 > limit_positions )
static

◆ calc_random_filter()

static void blender::ed::sculpt_paint::filter::calc_random_filter ( const Depsgraph & depsgraph,
const Sculpt & sd,
const float strength,
Object & object,
const IndexMask & node_mask )
static

Definition at line 831 of file sculpt_filter_mesh.cc.

References blender::ed::sculpt_paint::apply_translations(), blender::ed::sculpt_paint::filter::Cache::automasking, BKE_pbvh_bmesh_node_unique_verts(), bm, SculptSession::bm, SculptSession::bm_log, blender::bke::pbvh::BMesh, blender::ed::sculpt_paint::auto_mask::calc_grids_factors(), blender::ed::sculpt_paint::auto_mask::calc_vert_factors(), blender::ed::sculpt_paint::clip_and_lock_translations(), blender::MutableSpan< T >::copy_from(), blender::ed::sculpt_paint::PositionDeformData::deform(), depsgraph, blender::ed::sculpt_paint::PositionDeformData::eval, blender::ed::sculpt_paint::LocalData::factors, SculptSession::filter_cache, blender::index_mask::IndexMask::foreach_index(), blender::ed::sculpt_paint::gather_bmesh_positions(), blender::ed::sculpt_paint::gather_data_mesh(), blender::ed::sculpt_paint::gather_grids_positions(), blender::bke::pbvh::Grids, blender::ed::sculpt_paint::MeshAttributeData::hide_vert, blender::threading::EnumerableThreadSpecific< T >::local(), blender::ed::sculpt_paint::MeshAttributeData::mask, blender::bke::pbvh::Mesh, blender::bke::pbvh::Tree::nodes(), blender::ed::sculpt_paint::OrigPositionData::normals, blender::ed::sculpt_paint::orig_position_data_gather_bmesh(), blender::ed::sculpt_paint::orig_position_data_get_grids(), blender::ed::sculpt_paint::orig_position_data_get_mesh(), blender::bke::object::pbvh_get(), blender::ed::sculpt_paint::LocalData::positions, blender::ed::sculpt_paint::OrigPositionData::positions, blender::ed::sculpt_paint::filter::Cache::random_seed, randomize_factors(), blender::ed::sculpt_paint::reset_translations_to_original(), blender::Vector< T, InlineBufferCapacity, Allocator >::resize(), blender::ed::sculpt_paint::scale_factors(), blender::ed::sculpt_paint::scale_translations(), SculptSession::subdiv_ccg, blender::ed::sculpt_paint::LocalData::translations, blender::bke::pbvh::Tree::type(), verts, and zero_disabled_axis_components().

Referenced by sculpt_mesh_filter_apply().

◆ calc_relax_face_sets_filter()

static void blender::ed::sculpt_paint::filter::calc_relax_face_sets_filter ( const Depsgraph & depsgraph,
const Sculpt & sd,
const float strength,
Object & object,
const IndexMask & node_mask )
static

Definition at line 1093 of file sculpt_filter_mesh.cc.

References blender::ed::sculpt_paint::apply_translations(), Geometry::attributes, blender::ed::sculpt_paint::filter::Cache::automasking, BKE_pbvh_bmesh_node_unique_verts(), bm, SculptSession::bm, blender::bke::pbvh::BMesh, SculptVertexInfo::boundary, blender::ed::sculpt_paint::auto_mask::calc_grids_factors(), blender::ed::sculpt_paint::smooth::calc_relaxed_translations_bmesh(), blender::ed::sculpt_paint::smooth::calc_relaxed_translations_faces(), blender::ed::sculpt_paint::smooth::calc_relaxed_translations_grids(), blender::ed::sculpt_paint::auto_mask::calc_vert_factors(), CD_PROP_INT32, clamp_factors(), blender::ed::sculpt_paint::clip_and_lock_translations(), CustomData_get_offset_named(), blender::ed::sculpt_paint::PositionDeformData::deform(), depsgraph, blender::ed::sculpt_paint::PositionDeformData::eval, blender::bke::Face, blender::ed::sculpt_paint::MeshAttributeData::face_sets, blender::ed::sculpt_paint::LocalData::factors, SculptSession::filter_cache, blender::ed::sculpt_paint::face_set::filter_verts_with_unique_face_sets_bmesh(), blender::ed::sculpt_paint::face_set::filter_verts_with_unique_face_sets_grids(), blender::ed::sculpt_paint::face_set::filter_verts_with_unique_face_sets_mesh(), blender::index_mask::IndexMask::foreach_index(), blender::ed::sculpt_paint::gather_bmesh_positions(), blender::ed::sculpt_paint::gather_grids_positions(), blender::bke::pbvh::Grids, blender::ed::sculpt_paint::MeshAttributeData::hide_poly, blender::ed::sculpt_paint::MeshAttributeData::hide_vert, blender::ed::sculpt_paint::filter::Cache::iteration_count, blender::threading::EnumerableThreadSpecific< T >::local(), blender::ed::sculpt_paint::MeshAttributeData::mask, blender::bke::pbvh::Mesh, blender::bke::pbvh::Tree::nodes(), blender::bke::object::pbvh_get(), BMesh::pdata, blender::ed::sculpt_paint::LocalData::positions, blender::Vector< T, InlineBufferCapacity, Allocator >::resize(), blender::ed::sculpt_paint::scale_factors(), SculptSession::subdiv_ccg, blender::ed::sculpt_paint::LocalData::translations, blender::bke::pbvh::Tree::type(), blender::bke::pbvh::update_normals(), blender::bke::pbvh::vert_normals_eval(), SculptSession::vertex_info, verts, and zero_disabled_axis_components().

Referenced by sculpt_mesh_filter_apply().

◆ calc_relax_filter()

static void blender::ed::sculpt_paint::filter::calc_relax_filter ( const Depsgraph & depsgraph,
const Sculpt & sd,
const float strength,
Object & object,
const IndexMask & node_mask )
static

Definition at line 943 of file sculpt_filter_mesh.cc.

References blender::ed::sculpt_paint::apply_translations(), Geometry::attributes, blender::ed::sculpt_paint::filter::Cache::automasking, BKE_pbvh_bmesh_node_unique_verts(), bm, SculptSession::bm, blender::bke::pbvh::BMesh, SculptVertexInfo::boundary, blender::ed::sculpt_paint::auto_mask::calc_grids_factors(), blender::ed::sculpt_paint::smooth::calc_relaxed_translations_bmesh(), blender::ed::sculpt_paint::smooth::calc_relaxed_translations_faces(), blender::ed::sculpt_paint::smooth::calc_relaxed_translations_grids(), blender::ed::sculpt_paint::auto_mask::calc_vert_factors(), CD_PROP_INT32, clamp_factors(), blender::ed::sculpt_paint::clip_and_lock_translations(), CustomData_get_offset_named(), blender::ed::sculpt_paint::PositionDeformData::deform(), depsgraph, blender::ed::sculpt_paint::PositionDeformData::eval, blender::bke::Face, blender::ed::sculpt_paint::MeshAttributeData::face_sets, blender::ed::sculpt_paint::LocalData::factors, SculptSession::filter_cache, blender::index_mask::IndexMask::foreach_index(), blender::ed::sculpt_paint::gather_bmesh_positions(), blender::ed::sculpt_paint::gather_grids_positions(), blender::bke::pbvh::Grids, blender::ed::sculpt_paint::MeshAttributeData::hide_poly, blender::ed::sculpt_paint::MeshAttributeData::hide_vert, blender::threading::EnumerableThreadSpecific< T >::local(), blender::ed::sculpt_paint::MeshAttributeData::mask, blender::bke::pbvh::Mesh, blender::bke::pbvh::Tree::nodes(), blender::bke::object::pbvh_get(), BMesh::pdata, blender::ed::sculpt_paint::LocalData::positions, blender::Vector< T, InlineBufferCapacity, Allocator >::resize(), blender::ed::sculpt_paint::scale_factors(), SculptSession::subdiv_ccg, blender::ed::sculpt_paint::LocalData::translations, blender::bke::pbvh::Tree::type(), blender::bke::pbvh::update_normals(), blender::bke::pbvh::vert_normals_eval(), SculptSession::vertex_info, verts, and zero_disabled_axis_components().

Referenced by sculpt_mesh_filter_apply().

◆ calc_scale_filter()

static void blender::ed::sculpt_paint::filter::calc_scale_filter ( const Depsgraph & depsgraph,
const Sculpt & sd,
const float strength,
Object & object,
const IndexMask & node_mask )
static

Definition at line 589 of file sculpt_filter_mesh.cc.

References blender::ed::sculpt_paint::apply_translations(), blender::ed::sculpt_paint::filter::Cache::automasking, BKE_pbvh_bmesh_node_unique_verts(), bm, SculptSession::bm, SculptSession::bm_log, blender::bke::pbvh::BMesh, blender::ed::sculpt_paint::auto_mask::calc_grids_factors(), blender::ed::sculpt_paint::auto_mask::calc_vert_factors(), blender::ed::sculpt_paint::clip_and_lock_translations(), blender::MutableSpan< T >::copy_from(), blender::ed::sculpt_paint::PositionDeformData::deform(), depsgraph, blender::ed::sculpt_paint::PositionDeformData::eval, blender::ed::sculpt_paint::LocalData::factors, SculptSession::filter_cache, blender::index_mask::IndexMask::foreach_index(), blender::ed::sculpt_paint::gather_bmesh_positions(), blender::ed::sculpt_paint::gather_data_mesh(), blender::ed::sculpt_paint::gather_grids_positions(), blender::bke::pbvh::Grids, blender::ed::sculpt_paint::MeshAttributeData::hide_vert, blender::threading::EnumerableThreadSpecific< T >::local(), blender::ed::sculpt_paint::MeshAttributeData::mask, blender::bke::pbvh::Mesh, blender::bke::pbvh::Tree::nodes(), blender::ed::sculpt_paint::orig_position_data_gather_bmesh(), blender::ed::sculpt_paint::orig_position_data_get_grids(), blender::ed::sculpt_paint::orig_position_data_get_mesh(), blender::bke::object::pbvh_get(), blender::ed::sculpt_paint::LocalData::positions, blender::ed::sculpt_paint::OrigPositionData::positions, blender::ed::sculpt_paint::reset_translations_to_original(), blender::Vector< T, InlineBufferCapacity, Allocator >::resize(), blender::ed::sculpt_paint::scale_factors(), blender::ed::sculpt_paint::scale_translations(), SculptSession::subdiv_ccg, blender::ed::sculpt_paint::LocalData::translations, blender::bke::pbvh::Tree::type(), verts, and zero_disabled_axis_components().

Referenced by sculpt_mesh_filter_apply().

◆ calc_sharpen_detail_translations()

static BLI_NOINLINE void blender::ed::sculpt_paint::filter::calc_sharpen_detail_translations ( const filter::Cache & filter_cache,
const Span< float3 > positions,
const Span< float3 > smooth_positions,
const Span< float > sharpen_factors,
const Span< float3 > detail_directions,
const MutableSpan< float3 > translations )
static

◆ calc_sharpen_filter()

static void blender::ed::sculpt_paint::filter::calc_sharpen_filter ( const Depsgraph & depsgraph,
const Sculpt & sd,
const float strength,
Object & object,
const IndexMask & node_mask )
static

Definition at line 1555 of file sculpt_filter_mesh.cc.

References blender::ed::sculpt_paint::apply_translations(), blender::Array< T, InlineBufferCapacity, Allocator >::as_span(), blender::ed::sculpt_paint::filter::Cache::automasking, blender::ed::sculpt_paint::smooth::average_data_grids(), BKE_pbvh_bmesh_node_unique_verts(), BKE_subdiv_ccg_key_top_level(), BKE_subdiv_ccg_neighbor_coords_get(), bm, SculptSession::bm, BM_elem_index_get, BM_mesh_elem_index_ensure(), BM_VERT, blender::bke::pbvh::BMesh, blender::ed::sculpt_paint::auto_mask::calc_grids_factors(), calc_sharpen_detail_translations(), blender::ed::sculpt_paint::auto_mask::calc_vert_factors(), blender::ed::sculpt_paint::calc_vert_neighbors(), CCG_grid_xy_to_index(), clamp_factors(), blender::ed::sculpt_paint::clip_and_lock_translations(), SubdivCCGNeighbors::coords, blender::ed::sculpt_paint::PositionDeformData::deform(), depsgraph, blender::ed::sculpt_paint::filter::Cache::detail_directions, blender::ed::sculpt_paint::PositionDeformData::eval, blender::ed::sculpt_paint::LocalData::factors, SculptSession::filter_cache, blender::index_mask::IndexMask::foreach_index(), blender::ed::sculpt_paint::gather_bmesh_positions(), blender::ed::sculpt_paint::gather_data_bmesh(), blender::ed::sculpt_paint::gather_data_grids(), blender::ed::sculpt_paint::gather_data_mesh(), blender::ed::sculpt_paint::gather_grids_positions(), CCGKey::grid_area, CCGKey::grid_size, blender::bke::pbvh::Grids, blender::ed::sculpt_paint::MeshAttributeData::hide_poly, blender::ed::sculpt_paint::MeshAttributeData::hide_vert, blender::Span< T >::index_range(), blender::threading::EnumerableThreadSpecific< T >::local(), blender::ed::sculpt_paint::MeshAttributeData::mask, blender::bke::pbvh::Mesh, blender::ed::sculpt_paint::smooth::neighbor_data_average_mesh_check_loose(), blender::ed::sculpt_paint::smooth::neighbor_position_average_bmesh(), blender::bke::pbvh::Tree::nodes(), blender::bke::object::pbvh_get(), blender::ed::sculpt_paint::LocalData::positions, SubdivCCG::positions, blender::Vector< T, InlineBufferCapacity, Allocator >::resize(), blender::ed::sculpt_paint::scale_factors(), blender::ed::sculpt_paint::scale_translations(), blender::ed::sculpt_paint::filter::Cache::sharpen_factor, SculptSession::subdiv_ccg, blender::ed::sculpt_paint::LocalData::translations, blender::bke::pbvh::Tree::type(), blender::ed::sculpt_paint::vert_neighbors_get_bmesh(), verts, x, and zero_disabled_axis_components().

Referenced by sculpt_mesh_filter_apply().

◆ calc_smooth_filter()

static void blender::ed::sculpt_paint::filter::calc_smooth_filter ( const Depsgraph & depsgraph,
const Sculpt & sd,
const float strength,
Object & object,
const IndexMask & node_mask )
static

Definition at line 336 of file sculpt_filter_mesh.cc.

References blender::ed::sculpt_paint::apply_translations(), blender::ed::sculpt_paint::filter::Cache::automasking, BKE_pbvh_bmesh_node_unique_verts(), bm, SculptSession::bm, SculptSession::bm_log, blender::bke::pbvh::BMesh, SculptVertexInfo::boundary, blender::ed::sculpt_paint::auto_mask::calc_grids_factors(), blender::ed::sculpt_paint::auto_mask::calc_vert_factors(), blender::ed::sculpt_paint::calc_vert_neighbors_interior(), clamp_factors(), blender::ed::sculpt_paint::clip_and_lock_translations(), blender::ed::sculpt_paint::PositionDeformData::deform(), depsgraph, blender::ed::sculpt_paint::PositionDeformData::eval, blender::ed::sculpt_paint::LocalData::factors, SculptSession::filter_cache, blender::index_mask::IndexMask::foreach_index(), blender::ed::sculpt_paint::gather_bmesh_positions(), blender::ed::sculpt_paint::gather_data_mesh(), blender::ed::sculpt_paint::gather_grids_positions(), blender::bke::pbvh::Grids, blender::ed::sculpt_paint::MeshAttributeData::hide_poly, blender::ed::sculpt_paint::MeshAttributeData::hide_vert, blender::threading::EnumerableThreadSpecific< T >::local(), blender::ed::sculpt_paint::MeshAttributeData::mask, blender::bke::pbvh::Mesh, blender::ed::sculpt_paint::smooth::neighbor_data_average_mesh_check_loose(), blender::ed::sculpt_paint::smooth::neighbor_position_average_interior_bmesh(), blender::ed::sculpt_paint::smooth::neighbor_position_average_interior_grids(), blender::bke::pbvh::Tree::nodes(), blender::ed::sculpt_paint::orig_position_data_gather_bmesh(), blender::ed::sculpt_paint::orig_position_data_get_grids(), blender::ed::sculpt_paint::orig_position_data_get_mesh(), blender::bke::object::pbvh_get(), blender::ed::sculpt_paint::LocalData::positions, blender::ed::sculpt_paint::OrigPositionData::positions, blender::ed::sculpt_paint::reset_translations_to_original(), blender::Vector< T, InlineBufferCapacity, Allocator >::resize(), blender::ed::sculpt_paint::scale_factors(), blender::ed::sculpt_paint::scale_translations(), SculptSession::subdiv_ccg, blender::ed::sculpt_paint::LocalData::translations, blender::ed::sculpt_paint::translations_from_new_positions(), blender::bke::pbvh::Tree::type(), SculptSession::vertex_info, verts, and zero_disabled_axis_components().

Referenced by sculpt_mesh_filter_apply().

◆ calc_sphere_filter()

static void blender::ed::sculpt_paint::filter::calc_sphere_filter ( const Depsgraph & depsgraph,
const Sculpt & sd,
const float strength,
Object & object,
const IndexMask & node_mask )
static

Definition at line 714 of file sculpt_filter_mesh.cc.

References blender::ed::sculpt_paint::apply_translations(), blender::ed::sculpt_paint::filter::Cache::automasking, BKE_pbvh_bmesh_node_unique_verts(), bm, SculptSession::bm, SculptSession::bm_log, blender::bke::pbvh::BMesh, blender::ed::sculpt_paint::auto_mask::calc_grids_factors(), calc_sphere_translations(), blender::ed::sculpt_paint::auto_mask::calc_vert_factors(), blender::ed::sculpt_paint::clip_and_lock_translations(), blender::ed::sculpt_paint::PositionDeformData::deform(), depsgraph, blender::ed::sculpt_paint::PositionDeformData::eval, blender::ed::sculpt_paint::LocalData::factors, SculptSession::filter_cache, blender::index_mask::IndexMask::foreach_index(), blender::ed::sculpt_paint::gather_bmesh_positions(), blender::ed::sculpt_paint::gather_data_mesh(), blender::ed::sculpt_paint::gather_grids_positions(), blender::bke::pbvh::Grids, blender::ed::sculpt_paint::MeshAttributeData::hide_vert, blender::threading::EnumerableThreadSpecific< T >::local(), blender::ed::sculpt_paint::MeshAttributeData::mask, blender::bke::pbvh::Mesh, blender::bke::pbvh::Tree::nodes(), blender::ed::sculpt_paint::orig_position_data_gather_bmesh(), blender::ed::sculpt_paint::orig_position_data_get_grids(), blender::ed::sculpt_paint::orig_position_data_get_mesh(), blender::bke::object::pbvh_get(), blender::ed::sculpt_paint::LocalData::positions, blender::ed::sculpt_paint::OrigPositionData::positions, blender::ed::sculpt_paint::reset_translations_to_original(), blender::Vector< T, InlineBufferCapacity, Allocator >::resize(), blender::ed::sculpt_paint::scale_factors(), SculptSession::subdiv_ccg, blender::ed::sculpt_paint::LocalData::translations, blender::bke::pbvh::Tree::type(), verts, and zero_disabled_axis_components().

Referenced by sculpt_mesh_filter_apply().

◆ calc_sphere_translations()

static BLI_NOINLINE void blender::ed::sculpt_paint::filter::calc_sphere_translations ( const Span< float3 > positions,
const Span< float > factors,
const MutableSpan< float3 > translations )
static

◆ calc_surface_smooth_filter()

static void blender::ed::sculpt_paint::filter::calc_surface_smooth_filter ( const Depsgraph & depsgraph,
const Sculpt & sd,
const float strength,
Object & object,
const IndexMask & node_mask )
static

Definition at line 1270 of file sculpt_filter_mesh.cc.

References blender::ed::sculpt_paint::apply_translations(), blender::MutableSpan< T >::as_span(), blender::ed::sculpt_paint::filter::Cache::automasking, blender::ed::sculpt_paint::smooth::average_data_bmesh(), blender::ed::sculpt_paint::smooth::average_data_grids(), beta(), BKE_pbvh_bmesh_node_unique_verts(), bm, SculptSession::bm, SculptSession::bm_log, blender::bke::pbvh::BMesh, blender::ed::sculpt_paint::auto_mask::calc_grids_factors(), blender::ed::sculpt_paint::auto_mask::calc_vert_factors(), blender::ed::sculpt_paint::calc_vert_neighbors(), clamp_factors(), blender::ed::sculpt_paint::clip_and_lock_translations(), blender::ed::sculpt_paint::PositionDeformData::deform(), depsgraph, blender::ed::sculpt_paint::PositionDeformData::eval, blender::ed::sculpt_paint::LocalData::factors, SculptSession::filter_cache, blender::index_mask::IndexMask::foreach_index(), blender::ed::sculpt_paint::gather_bmesh_positions(), blender::ed::sculpt_paint::gather_data_bmesh(), blender::ed::sculpt_paint::gather_data_grids(), blender::ed::sculpt_paint::gather_data_mesh(), blender::ed::sculpt_paint::gather_grids_positions(), blender::bke::pbvh::Grids, blender::ed::sculpt_paint::MeshAttributeData::hide_poly, blender::ed::sculpt_paint::MeshAttributeData::hide_vert, blender::threading::EnumerableThreadSpecific< T >::local(), blender::ed::sculpt_paint::MeshAttributeData::mask, blender::bke::pbvh::Mesh, blender::ed::sculpt_paint::smooth::neighbor_data_average_mesh_check_loose(), blender::ed::sculpt_paint::smooth::neighbor_position_average_bmesh(), blender::bke::pbvh::Tree::nodes(), blender::ed::sculpt_paint::orig_position_data_gather_bmesh(), blender::ed::sculpt_paint::orig_position_data_get_grids(), blender::ed::sculpt_paint::orig_position_data_get_mesh(), blender::bke::object::pbvh_get(), blender::ed::sculpt_paint::LocalData::positions, blender::ed::sculpt_paint::OrigPositionData::positions, SubdivCCG::positions, blender::Vector< T, InlineBufferCapacity, Allocator >::resize(), blender::ed::sculpt_paint::scale_factors(), blender::ed::sculpt_paint::scale_translations(), blender::ed::sculpt_paint::scatter_data_bmesh(), blender::ed::sculpt_paint::scatter_data_grids(), blender::ed::sculpt_paint::scatter_data_mesh(), blender::Span< T >::size(), SculptSession::subdiv_ccg, blender::ed::sculpt_paint::filter::Cache::surface_smooth_current_vertex, blender::ed::sculpt_paint::smooth::surface_smooth_displace_step(), blender::ed::sculpt_paint::filter::Cache::surface_smooth_laplacian_disp, blender::ed::sculpt_paint::smooth::surface_smooth_laplacian_step(), blender::ed::sculpt_paint::filter::Cache::surface_smooth_shape_preservation, blender::ed::sculpt_paint::LocalData::translations, blender::bke::pbvh::Tree::type(), verts, and zero_disabled_axis_components().

Referenced by sculpt_mesh_filter_apply().

◆ clamp_factors()

static BLI_NOINLINE void blender::ed::sculpt_paint::filter::clamp_factors ( const MutableSpan< float > factors,
const float min,
const float max )
static

◆ mesh_filter_sharpen_init()

static void blender::ed::sculpt_paint::filter::mesh_filter_sharpen_init ( const Depsgraph & depsgraph,
const Object & object,
const float smooth_ratio,
const float intensify_detail_strength,
const int curvature_smooth_iterations,
filter::Cache & filter_cache )
static

Definition at line 1987 of file sculpt_filter_mesh.cc.

References blender::MutableSpan< T >::as_span(), blender::ed::sculpt_paint::smooth::average_data_bmesh(), blender::ed::sculpt_paint::smooth::average_data_grids(), BKE_pbvh_bmesh_node_unique_verts(), BKE_subdiv_ccg_key_top_level(), blender::bke::pbvh::BMesh, blender::ed::sculpt_paint::calc_smooth_translations(), blender::ed::sculpt_paint::calc_vert_neighbors(), depsgraph, blender::ed::sculpt_paint::filter::Cache::detail_directions, blender::index_mask::IndexMask::foreach_index(), CCGKey::grid_area, blender::bke::pbvh::Grids, blender::math::length(), blender::threading::EnumerableThreadSpecific< T >::local(), blender::bke::pbvh::Mesh, mesh_filter_sharpen_init(), blender::ed::sculpt_paint::smooth::neighbor_data_average_mesh_check_loose(), blender::ed::sculpt_paint::filter::Cache::node_mask, blender::bke::pbvh::Tree::nodes(), blender::bke::object::pbvh_get(), pow2f(), blender::Array< T, InlineBufferCapacity, Allocator >::reinitialize(), blender::ed::sculpt_paint::scatter_data_bmesh(), blender::ed::sculpt_paint::scatter_data_grids(), blender::ed::sculpt_paint::scatter_data_mesh(), SCULPT_vertex_count_get(), blender::ed::sculpt_paint::filter::Cache::sharpen_curvature_smooth_iterations, blender::ed::sculpt_paint::filter::Cache::sharpen_factor, blender::ed::sculpt_paint::filter::Cache::sharpen_intensify_detail_strength, blender::ed::sculpt_paint::filter::Cache::sharpen_smooth_ratio, blender::Span< T >::size(), SculptSession::subdiv_ccg, blender::bke::pbvh::Tree::type(), and verts.

Referenced by mesh_filter_sharpen_init(), and sculpt_filter_specific_init().

◆ mesh_filter_surface_smooth_init()

◆ modal_keymap()

◆ randomize_factors()

static BLI_NOINLINE void blender::ed::sculpt_paint::filter::randomize_factors ( const Span< float3 > positions,
const int seed,
const MutableSpan< float > factors )
static

◆ register_operator_props()

◆ sculpt_filter_specific_init()

◆ sculpt_mesh_filter_apply()

◆ sculpt_mesh_filter_apply_with_history()

◆ sculpt_mesh_filter_cancel()

◆ sculpt_mesh_filter_confirm()

◆ sculpt_mesh_filter_end()

◆ sculpt_mesh_filter_exec()

◆ sculpt_mesh_filter_invoke()

static int blender::ed::sculpt_paint::filter::sculpt_mesh_filter_invoke ( bContext * C,
wmOperator * op,
const wmEvent * event )
static

◆ sculpt_mesh_filter_is_continuous()

static bool blender::ed::sculpt_paint::filter::sculpt_mesh_filter_is_continuous ( MeshFilterType type)
static

Definition at line 318 of file sculpt_filter_mesh.cc.

References ELEM, Relax, RelaxFaceSets, Sharpen, and Smooth.

Referenced by sculpt_mesh_filter_confirm(), and sculpt_mesh_filter_modal().

◆ sculpt_mesh_filter_modal()

◆ sculpt_mesh_filter_needs_pmap()

static bool blender::ed::sculpt_paint::filter::sculpt_mesh_filter_needs_pmap ( MeshFilterType filter_type)
static

Definition at line 307 of file sculpt_filter_mesh.cc.

References ELEM, EnhanceDetails, Relax, RelaxFaceSets, Sharpen, Smooth, and SurfaceSmooth.

Referenced by sculpt_mesh_filter_start().

◆ sculpt_mesh_filter_start()

static int blender::ed::sculpt_paint::filter::sculpt_mesh_filter_start ( bContext * C,
wmOperator * op )
static

◆ sculpt_mesh_ui_exec()

static void blender::ed::sculpt_paint::filter::sculpt_mesh_ui_exec ( bContext * ,
wmOperator * op )
static

◆ sculpt_mesh_update_status_bar()

static void blender::ed::sculpt_paint::filter::sculpt_mesh_update_status_bar ( bContext * C,
wmOperator *  )
static

◆ sculpt_mesh_update_strength()

◆ SCULPT_OT_mesh_filter()

◆ to_object_space()

◆ to_orientation_space()

◆ zero_disabled_axis_components()

Variable Documentation

◆ prop_mesh_filter_deform_axis_items

EnumPropertyItem blender::ed::sculpt_paint::filter::prop_mesh_filter_deform_axis_items[]
static
Initial value:
= {
{MESH_FILTER_DEFORM_X, "X", 0, "X", "Deform in the X axis"},
{MESH_FILTER_DEFORM_Y, "Y", 0, "Y", "Deform in the Y axis"},
{MESH_FILTER_DEFORM_Z, "Z", 0, "Z", "Deform in the Z axis"},
{0, nullptr, 0, nullptr, nullptr},
}

Definition at line 281 of file sculpt_filter_mesh.cc.

Referenced by SCULPT_OT_mesh_filter().

◆ prop_mesh_filter_orientation_items

EnumPropertyItem blender::ed::sculpt_paint::filter::prop_mesh_filter_orientation_items[]
static
Initial value:
= {
{int(FilterOrientation::Local),
"LOCAL",
0,
"Local",
"Use the local axis to limit the displacement"},
{int(FilterOrientation::World),
"WORLD",
0,
"World",
"Use the global axis to limit the displacement"},
{int(FilterOrientation::View),
"VIEW",
0,
"View",
"Use the view axis to limit the displacement"},
{0, nullptr, 0, nullptr, nullptr},
}
draw_view push_constant(Type::INT, "radiance_src") .push_constant(Type capture_info_buf storage_buf(1, Qualifier::READ, "ObjectBounds", "bounds_buf[]") .push_constant(Type draw_view int

Definition at line 288 of file sculpt_filter_mesh.cc.

Referenced by SCULPT_OT_mesh_filter().

◆ prop_mesh_filter_types

EnumPropertyItem blender::ed::sculpt_paint::filter::prop_mesh_filter_types[]
static
Initial value:
= {
{int(MeshFilterType::Smooth), "SMOOTH", 0, "Smooth", "Smooth mesh"},
{int(MeshFilterType::Scale), "SCALE", 0, "Scale", "Scale mesh"},
{int(MeshFilterType::Inflate), "INFLATE", 0, "Inflate", "Inflate mesh"},
{int(MeshFilterType::Sphere), "SPHERE", 0, "Sphere", "Morph into sphere"},
{int(MeshFilterType::Random), "RANDOM", 0, "Random", "Randomize vertex positions"},
{int(MeshFilterType::Relax), "RELAX", 0, "Relax", "Relax mesh"},
{int(MeshFilterType::RelaxFaceSets),
"RELAX_FACE_SETS",
0,
"Relax Face Sets",
"Smooth the edges of all the Face Sets"},
{int(MeshFilterType::SurfaceSmooth),
"SURFACE_SMOOTH",
0,
"Surface Smooth",
"Smooth the surface of the mesh, preserving the volume"},
{int(MeshFilterType::Sharpen), "SHARPEN", 0, "Sharpen", "Sharpen the cavities of the mesh"},
{int(MeshFilterType::EnhanceDetails),
"ENHANCE_DETAILS",
0,
"Enhance Details",
"Enhance the high frequency surface detail"},
{int(MeshFilterType::EraseDisplacement),
"ERASE_DISPLACEMENT",
0,
"Erase Displacement",
"Deletes the displacement of the Multires Modifier"},
{0, nullptr, 0, nullptr, nullptr},
}

Definition at line 244 of file sculpt_filter_mesh.cc.

Referenced by SCULPT_OT_mesh_filter().