|
Blender V5.0
|
Classes | |
| struct | Settings |
| struct | Cache |
| struct | AccumulatedVert |
Enumerations | |
| enum class | BoundaryAutomaskMode { Edges = 1 , FaceSets = 2 } |
Functions | |
| const Cache * | active_cache_get (const SculptSession &ss) |
| std::unique_ptr< Cache > | cache_init (const Depsgraph &depsgraph, const Sculpt &sd, const Brush *brush, Object &ob) |
| Cache & | filter_cache_ensure (const Depsgraph &depsgraph, const Sculpt &sd, Object &ob) |
| Cache & | stroke_cache_ensure (const Depsgraph &depsgraph, const Sculpt &sd, const Brush *brush, Object &ob) |
| bool | mode_enabled (const Sculpt &sd, const Brush *br, eAutomasking_flag mode) |
| bool | is_enabled (const Sculpt &sd, const Object &object, const Brush *br) |
| void | calc_vert_factors (const Depsgraph &depsgraph, const Object &object, const Cache &automasking, const bke::pbvh::MeshNode &node, Span< int > verts, MutableSpan< float > factors) |
| void | calc_vert_factors (const Depsgraph &depsgraph, const Object &object, const Cache *cache, const bke::pbvh::MeshNode &node, Span< int > verts, MutableSpan< float > factors) |
| void | calc_grids_factors (const Depsgraph &depsgraph, const Object &object, const Cache &automasking, const bke::pbvh::GridsNode &node, Span< int > grids, MutableSpan< float > factors) |
| void | calc_grids_factors (const Depsgraph &depsgraph, const Object &object, const Cache *cache, const bke::pbvh::GridsNode &node, Span< int > grids, MutableSpan< float > factors) |
| void | calc_vert_factors (const Depsgraph &depsgraph, const Object &object, const Cache &automasking, const bke::pbvh::BMeshNode &node, const Set< BMVert *, 0 > &verts, MutableSpan< float > factors) |
| void | calc_vert_factors (const Depsgraph &depsgraph, const Object &object, const Cache *cache, const bke::pbvh::BMeshNode &node, const Set< BMVert *, 0 > &verts, MutableSpan< float > factors) |
| void | calc_face_factors (const Depsgraph &depsgraph, const Object &object, OffsetIndices< int > faces, Span< int > corner_verts, const Cache &automasking, const bke::pbvh::MeshNode &node, Span< int > face_indices, MutableSpan< float > factors) |
| static int | calc_effective_bits (const Sculpt &sd, const Brush *brush) |
| static float | normal_calc (const float3 &compare_normal, const float3 &normal, float limit_lower, float limit_upper) |
| static bool | is_constrained_by_radius (const Brush *br) |
| static int | boundary_propagation_steps (const Sculpt &sd, const Brush *brush) |
| static bool | needs_factors_cache (const Sculpt &sd, const Brush *brush) |
| static float | calc_brush_normal_factor (const Cache &automasking, const Object &object, const float3 &normal) |
| static float | calc_view_normal_factor (const Cache &automasking, const Object &object, const float3 &normal) |
| static bool | calc_view_occlusion_factor (const Depsgraph &depsgraph, Cache &automasking, const Object &object, const int vert, const float3 &vert_position) |
| static float | calc_cavity_factor (const Cache &automasking, float factor) |
| static void | calc_blurred_cavity_mesh (const Depsgraph &depsgraph, const Object &object, const Cache &automasking, const int steps, const int vert, MutableSpan< float > cavity_factors) |
| static void | calc_blurred_cavity_grids (const Object &object, const Cache &automasking, const int steps, const SubdivCCGCoord vert, MutableSpan< float > cavity_factors) |
| static void | calc_blurred_cavity_bmesh (const Cache &automasking, const int steps, BMVert *vert, MutableSpan< float > cavity_factors) |
| static float | process_cavity_factor (const Cache &automasking, float factor) |
| static void | calc_cavity_factor_mesh (const Depsgraph &depsgraph, const Cache &automasking, const Object &object, const int vert) |
| static void | calc_cavity_factor_grids (const CCGKey &key, const Cache &automasking, const Object &object, const int vert) |
| static void | calc_cavity_factor_bmesh (const Cache &automasking, BMVert *vert, const int vert_i) |
| static void | fill_topology_automasking_factors_mesh (const Depsgraph &depsgraph, const Sculpt &sd, Object &ob, const Span< float3 > vert_positions, MutableSpan< float > factors) |
| static void | fill_topology_automasking_factors_grids (const Sculpt &sd, Object &ob, const SubdivCCG &subdiv_ccg, MutableSpan< float > factors) |
| static void | fill_topology_automasking_factors_bmesh (const Sculpt &sd, Object &ob, BMesh &bm, MutableSpan< float > factors) |
| static void | fill_topology_automasking_factors (const Depsgraph &depsgraph, const Sculpt &sd, Object &ob, MutableSpan< float > factors) |
| static void | init_face_sets_masking (const Sculpt &sd, Object &ob, MutableSpan< float > factors) |
| static void | init_boundary_masking_mesh (Object &object, const Depsgraph &depsgraph, const BoundaryAutomaskMode mode, const int propagation_steps, MutableSpan< float > factors) |
| static void | init_boundary_masking_grids (Object &object, const BoundaryAutomaskMode mode, const int propagation_steps, MutableSpan< float > factors) |
| static void | init_boundary_masking_bmesh (Object &object, const BoundaryAutomaskMode mode, const int propagation_steps, MutableSpan< float > factors) |
| static void | init_boundary_masking (Object &object, const Depsgraph &depsgraph, const BoundaryAutomaskMode mode, const int propagation_steps, MutableSpan< float > factors) |
| static void | cache_settings_update (Cache &automasking, Object &object, const Sculpt &sd, const Brush *brush) |
| static void | normal_occlusion_automasking_fill (const Depsgraph &depsgraph, Cache &automasking, Object &ob, eAutomasking_flag mode, MutableSpan< float > factors) |
Variables | |
| static constexpr int | EDGE_DISTANCE_INF = -1 |
|
strong |
| Enumerator | |
|---|---|
| Edges | |
| FaceSets | |
Definition at line 1303 of file sculpt_automasking.cc.
| const Cache * blender::ed::sculpt_paint::auto_mask::active_cache_get | ( | const SculptSession & | ss | ) |
Returns the auto-masking cache depending on the active tool. Used for code that can run both for brushes and filter.
Definition at line 43 of file sculpt_automasking.cc.
References blender::ed::sculpt_paint::filter::Cache::automasking, blender::ed::sculpt_paint::StrokeCache::automasking, SculptSession::cache, and SculptSession::filter_cache.
Referenced by blender::ed::sculpt_paint::cloth::apply_filter_forces_bmesh(), blender::ed::sculpt_paint::cloth::apply_filter_forces_grids(), blender::ed::sculpt_paint::cloth::apply_filter_forces_mesh(), blender::ed::sculpt_paint::cloth::calc_constraint_factors(), blender::ed::sculpt_paint::cloth::calc_forces_bmesh(), blender::ed::sculpt_paint::cloth::calc_forces_grids(), blender::ed::sculpt_paint::cloth::calc_forces_mesh(), and blender::ed::sculpt_paint::cloth::do_simulation_step().
|
static |
Definition at line 164 of file sculpt_automasking.cc.
References Brush::automasking_boundary_edges_propagation_steps, Sculpt::automasking_boundary_edges_propagation_steps, Brush::automasking_flags, BRUSH_AUTOMASKING_BOUNDARY_EDGES, and BRUSH_AUTOMASKING_BOUNDARY_FACE_SETS.
Referenced by cache_init(), and needs_factors_cache().
| std::unique_ptr< Cache > blender::ed::sculpt_paint::auto_mask::cache_init | ( | const Depsgraph & | depsgraph, |
| const Sculpt & | sd, | ||
| const Brush * | brush, | ||
| Object & | ob ) |
Creates and initializes an auto-masking cache.
For auto-masking modes that cannot be calculated in real time, data is also stored at the vertex level prior to the stroke starting.
Definition at line 1632 of file sculpt_automasking.cc.
References SculptSession::active_vert_index(), Brush::automasking_cavity_curve, Sculpt::automasking_cavity_curve, BKE_curvemapping_init(), boundary_propagation_steps(), BRUSH_AUTOMASKING_BOUNDARY_EDGES, BRUSH_AUTOMASKING_BOUNDARY_FACE_SETS, BRUSH_AUTOMASKING_CAVITY_ALL, BRUSH_AUTOMASKING_CAVITY_USE_CURVE, BRUSH_AUTOMASKING_FACE_SETS, BRUSH_AUTOMASKING_TOPOLOGY, BRUSH_AUTOMASKING_VIEW_NORMAL, BRUSH_AUTOMASKING_VIEW_OCCLUSION, cache_init(), cache_settings_update(), calc_effective_bits(), depsgraph, Edges, blender::ed::sculpt_paint::boundary::ensure_boundary_info(), blender::ed::sculpt_paint::islands::ensure_cache(), FaceSets, fill_topology_automasking_factors(), init_boundary_masking(), init_face_sets_masking(), is_constrained_by_radius(), is_enabled(), mode_enabled(), needs_factors_cache(), normal_occlusion_automasking_fill(), Object::sculpt, SCULPT_vertex_count_get(), blender::ed::sculpt_paint::auto_mask::Cache::Unknown, blender::ed::sculpt_paint::islands::vert_id_get(), and blender::ed::sculpt_paint::vert_random_access_ensure().
Referenced by cache_init(), filter_cache_ensure(), blender::ed::sculpt_paint::mask::mask_from_boundary_exec(), blender::ed::sculpt_paint::mask::mask_from_cavity_exec(), and stroke_cache_ensure().
|
static |
Definition at line 1519 of file sculpt_automasking.cc.
References blender::ed::sculpt_paint::face_set::active_face_set_get(), Brush::automasking_cavity_blur_steps, Sculpt::automasking_cavity_blur_steps, Brush::automasking_cavity_curve, Sculpt::automasking_cavity_curve, Brush::automasking_cavity_factor, Sculpt::automasking_cavity_factor, Brush::automasking_flags, Brush::automasking_start_normal_falloff, Sculpt::automasking_start_normal_falloff, Brush::automasking_start_normal_limit, Sculpt::automasking_start_normal_limit, Brush::automasking_view_normal_falloff, Sculpt::automasking_view_normal_falloff, Brush::automasking_view_normal_limit, Sculpt::automasking_view_normal_limit, BRUSH_AUTOMASKING_BRUSH_NORMAL, BRUSH_AUTOMASKING_CAVITY_ALL, BRUSH_AUTOMASKING_VIEW_NORMAL, cache_settings_update(), calc_effective_bits(), blender::ed::sculpt_paint::auto_mask::Settings::cavity_blur_steps, blender::ed::sculpt_paint::auto_mask::Settings::cavity_curve, blender::ed::sculpt_paint::auto_mask::Settings::cavity_factor, blender::ed::sculpt_paint::auto_mask::Settings::flags, blender::ed::sculpt_paint::auto_mask::Settings::initial_face_set, blender::ed::sculpt_paint::auto_mask::Cache::settings, blender::ed::sculpt_paint::auto_mask::Settings::start_normal_falloff, blender::ed::sculpt_paint::auto_mask::Settings::start_normal_limit, blender::ed::sculpt_paint::auto_mask::Settings::view_normal_falloff, and blender::ed::sculpt_paint::auto_mask::Settings::view_normal_limit.
Referenced by cache_init(), and cache_settings_update().
|
static |
Definition at line 473 of file sculpt_automasking.cc.
References blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add_new(), BLI_assert, BM_elem_index_get, calc_cavity_factor(), BMVert::co, blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::contains(), blender::ed::sculpt_paint::auto_mask::AccumulatedVert::count, blender::ed::sculpt_paint::auto_mask::AccumulatedVert::distance, blender::math::distance(), blender::math::dot(), float, BMVert::no, blender::ed::sculpt_paint::auto_mask::AccumulatedVert::normal, blender::math::normalize(), blender::ed::sculpt_paint::auto_mask::AccumulatedVert::position, and blender::ed::sculpt_paint::vert_neighbors_get_bmesh().
Referenced by calc_cavity_factor_bmesh().
|
static |
Definition at line 372 of file sculpt_automasking.cc.
References blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add_new(), BKE_subdiv_ccg_key_top_level(), BKE_subdiv_ccg_neighbor_coords_get(), BLI_assert, calc_cavity_factor(), blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::contains(), SubdivCCGNeighbors::coords, blender::ed::sculpt_paint::auto_mask::AccumulatedVert::count, blender::ed::sculpt_paint::auto_mask::AccumulatedVert::distance, blender::math::distance(), blender::math::dot(), float, SubdivCCGCoord::from_index(), blender::ed::sculpt_paint::auto_mask::AccumulatedVert::normal, blender::math::normalize(), normals, SubdivCCG::normals, blender::ed::sculpt_paint::auto_mask::AccumulatedVert::position, SubdivCCG::positions, SculptSession::subdiv_ccg, and SubdivCCGCoord::to_index().
Referenced by calc_cavity_factor_grids().
|
static |
Definition at line 265 of file sculpt_automasking.cc.
References blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add_new(), BLI_assert, calc_cavity_factor(), blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::contains(), blender::ed::sculpt_paint::auto_mask::AccumulatedVert::count, depsgraph, blender::ed::sculpt_paint::auto_mask::AccumulatedVert::distance, blender::math::distance(), blender::math::dot(), blender::bke::Face, faces, float, blender::bke::AttributeAccessor::lookup(), blender::ed::sculpt_paint::auto_mask::AccumulatedVert::normal, blender::math::normalize(), blender::ed::sculpt_paint::auto_mask::AccumulatedVert::position, blender::math::safe_divide(), blender::ed::sculpt_paint::vert_neighbors_get_mesh(), blender::bke::pbvh::vert_normals_eval(), and blender::bke::pbvh::vert_positions_eval().
Referenced by calc_cavity_factor_mesh().
|
static |
Definition at line 189 of file sculpt_automasking.cc.
References SculptSession::cache, SculptSession::filter_cache, blender::ed::sculpt_paint::filter::Cache::initial_normal, blender::ed::sculpt_paint::StrokeCache::initial_normal_symm, M_PI, normal_calc(), blender::ed::sculpt_paint::auto_mask::Cache::settings, blender::ed::sculpt_paint::auto_mask::Settings::start_normal_falloff, and blender::ed::sculpt_paint::auto_mask::Settings::start_normal_limit.
Referenced by calc_face_factors(), calc_grids_factors(), calc_vert_factors(), and calc_vert_factors().
|
static |
Definition at line 246 of file sculpt_automasking.cc.
References BRUSH_AUTOMASKING_CAVITY_INVERTED, blender::ed::sculpt_paint::auto_mask::Settings::cavity_factor, CLAMP, fabsf, blender::ed::sculpt_paint::auto_mask::Settings::flags, blender::ed::sculpt_paint::auto_mask::Cache::settings, sign(), and signf().
Referenced by calc_blurred_cavity_bmesh(), calc_blurred_cavity_grids(), and calc_blurred_cavity_mesh().
|
static |
Definition at line 610 of file sculpt_automasking.cc.
References calc_blurred_cavity_bmesh(), blender::ed::sculpt_paint::auto_mask::Settings::cavity_blur_steps, blender::ed::sculpt_paint::auto_mask::Cache::cavity_factor, and blender::ed::sculpt_paint::auto_mask::Cache::settings.
Referenced by blender::ed::sculpt_paint::auto_mask::Cache::calc_cavity_factor().
|
static |
Definition at line 596 of file sculpt_automasking.cc.
References calc_blurred_cavity_grids(), blender::ed::sculpt_paint::auto_mask::Settings::cavity_blur_steps, blender::ed::sculpt_paint::auto_mask::Cache::cavity_factor, SubdivCCGCoord::from_index(), and blender::ed::sculpt_paint::auto_mask::Cache::settings.
Referenced by blender::ed::sculpt_paint::auto_mask::Cache::calc_cavity_factor().
|
static |
Definition at line 581 of file sculpt_automasking.cc.
References calc_blurred_cavity_mesh(), blender::ed::sculpt_paint::auto_mask::Settings::cavity_blur_steps, blender::ed::sculpt_paint::auto_mask::Cache::cavity_factor, depsgraph, and blender::ed::sculpt_paint::auto_mask::Cache::settings.
Referenced by blender::ed::sculpt_paint::auto_mask::Cache::calc_cavity_factor().
|
static |
Definition at line 95 of file sculpt_automasking.cc.
References Brush::automasking_flags, Sculpt::automasking_flags, BRUSH_AUTOMASKING_CAVITY_ALL, BRUSH_AUTOMASKING_CAVITY_NORMAL, and BRUSH_AUTOMASKING_CAVITY_USE_CURVE.
Referenced by cache_init(), cache_settings_update(), and needs_factors_cache().
| void blender::ed::sculpt_paint::auto_mask::calc_face_factors | ( | const Depsgraph & | depsgraph, |
| const Object & | object, | ||
| OffsetIndices< int > | faces, | ||
| Span< int > | corner_verts, | ||
| const Cache & | automasking, | ||
| const bke::pbvh::MeshNode & | node, | ||
| Span< int > | face_indices, | ||
| MutableSpan< float > | factors ) |
Calculate all auto-masking influence on each face.
Definition at line 733 of file sculpt_automasking.cc.
References BLI_assert, BLI_SCOPED_DEFER, SculptVertexInfo::boundary, blender::ed::sculpt_paint::StrokeCache::brush, BRUSH_AUTOMASKING_BOUNDARY_EDGES, BRUSH_AUTOMASKING_BOUNDARY_FACE_SETS, BRUSH_AUTOMASKING_BRUSH_NORMAL, BRUSH_AUTOMASKING_CAVITY_ALL, BRUSH_AUTOMASKING_FACE_SETS, BRUSH_AUTOMASKING_TOPOLOGY, BRUSH_AUTOMASKING_VIEW_NORMAL, BRUSH_AUTOMASKING_VIEW_OCCLUSION, SculptSession::cache, calc_brush_normal_factor(), calc_view_normal_factor(), calc_view_occlusion_factor(), blender::ed::sculpt_paint::auto_mask::Cache::cavity_factor, depsgraph, blender::bke::Face, faces, blender::ed::sculpt_paint::auto_mask::Cache::factor, SculptSession::filter_cache, blender::ed::sculpt_paint::auto_mask::Settings::flags, i, blender::Span< T >::index_range(), blender::ed::sculpt_paint::auto_mask::Settings::initial_face_set, blender::ed::sculpt_paint::auto_mask::Settings::initial_island_nr, Array< T, InlineBufferCapacity, Allocator >::is_empty(), blender::bke::AttributeAccessor::lookup(), blender::ed::sculpt_paint::StrokeCache::paint_face_set, process_cavity_factor(), blender::math::rcp(), Brush::sculpt_brush_type, SCULPT_BRUSH_TYPE_DRAW_FACE_SETS, blender::ed::sculpt_paint::auto_mask::Cache::settings, blender::Span< T >::size(), blender::Span< T >::slice(), sum(), blender::ed::sculpt_paint::auto_mask::Settings::topology_use_brush_limit, blender::ed::sculpt_paint::face_set::vert_face_set_get(), blender::ed::sculpt_paint::face_set::vert_has_face_set(), blender::ed::sculpt_paint::face_set::vert_has_unique_face_set(), blender::ed::sculpt_paint::islands::vert_id_get(), blender::ed::sculpt_paint::boundary::vert_is_boundary(), blender::bke::pbvh::vert_normals_eval(), blender::bke::pbvh::vert_positions_eval(), and SculptSession::vertex_info.
| void blender::ed::sculpt_paint::auto_mask::calc_grids_factors | ( | const Depsgraph & | depsgraph, |
| const Object & | object, | ||
| const Cache & | automasking, | ||
| const bke::pbvh::GridsNode & | node, | ||
| Span< int > | grids, | ||
| MutableSpan< float > | factors ) |
Definition at line 844 of file sculpt_automasking.cc.
References Geometry::attributes, BKE_subdiv_ccg_key_top_level(), BLI_assert, SculptVertexInfo::boundary, blender::ed::sculpt_paint::StrokeCache::brush, BRUSH_AUTOMASKING_BOUNDARY_EDGES, BRUSH_AUTOMASKING_BOUNDARY_FACE_SETS, BRUSH_AUTOMASKING_BRUSH_NORMAL, BRUSH_AUTOMASKING_CAVITY_ALL, BRUSH_AUTOMASKING_FACE_SETS, BRUSH_AUTOMASKING_TOPOLOGY, BRUSH_AUTOMASKING_VIEW_NORMAL, BRUSH_AUTOMASKING_VIEW_OCCLUSION, SculptSession::cache, calc_brush_normal_factor(), calc_view_normal_factor(), calc_view_occlusion_factor(), blender::ed::sculpt_paint::auto_mask::Cache::cavity_factor, depsgraph, blender::bke::Face, faces, blender::ed::sculpt_paint::auto_mask::Cache::factor, SculptSession::filter_cache, blender::ed::sculpt_paint::auto_mask::Settings::flags, SubdivCCGCoord::from_index(), CCGKey::grid_area, i, blender::Span< T >::index_range(), blender::ed::sculpt_paint::auto_mask::Settings::initial_face_set, blender::ed::sculpt_paint::auto_mask::Settings::initial_island_nr, Array< T, InlineBufferCapacity, Allocator >::is_empty(), blender::Span< T >::is_empty(), blender::bke::AttributeAccessor::lookup(), blender::ed::sculpt_paint::orig_position_data_lookup_grids(), blender::ed::sculpt_paint::StrokeCache::paint_face_set, process_cavity_factor(), Brush::sculpt_brush_type, SCULPT_BRUSH_TYPE_DRAW_FACE_SETS, SCULPT_FACE_SET_NONE, blender::ed::sculpt_paint::auto_mask::Cache::settings, SculptSession::subdiv_ccg, blender::ed::sculpt_paint::auto_mask::Settings::topology_use_brush_limit, blender::ed::sculpt_paint::face_set::vert_has_unique_face_set(), blender::ed::sculpt_paint::islands::vert_id_get(), blender::ed::sculpt_paint::boundary::vert_is_boundary(), and SculptSession::vertex_info.
Referenced by blender::ed::sculpt_paint::cloth::apply_filter_forces_grids(), blender::ed::sculpt_paint::mask::apply_mask_grids(), blender::ed::sculpt_paint::boundary::calc_bend_grids(), blender::ed::sculpt_paint::cloth::calc_constraint_factors(), blender::ed::sculpt_paint::filter::calc_enhance_details_filter(), blender::ed::sculpt_paint::filter::calc_erase_displacement_filter(), blender::ed::sculpt_paint::calc_factors_common_from_orig_data_grids(), blender::ed::sculpt_paint::calc_factors_common_grids(), blender::ed::sculpt_paint::cloth::calc_forces_grids(), blender::ed::sculpt_paint::boundary::calc_grab_grids(), blender::ed::sculpt_paint::brushes::calc_grids(), blender::ed::sculpt_paint::pose::calc_grids(), calc_grids_factors(), blender::ed::sculpt_paint::filter::calc_inflate_filter(), blender::ed::sculpt_paint::boundary::calc_inflate_grids(), blender::ed::sculpt_paint::filter::calc_random_filter(), blender::ed::sculpt_paint::filter::calc_relax_face_sets_filter(), blender::ed::sculpt_paint::filter::calc_relax_filter(), blender::ed::sculpt_paint::filter::calc_scale_filter(), blender::ed::sculpt_paint::filter::calc_sharpen_filter(), blender::ed::sculpt_paint::boundary::calc_slide_grids(), blender::ed::sculpt_paint::filter::calc_smooth_filter(), blender::ed::sculpt_paint::filter::calc_sphere_filter(), blender::ed::sculpt_paint::filter::calc_surface_smooth_filter(), blender::ed::sculpt_paint::boundary::calc_twist_grids(), blender::ed::sculpt_paint::cloth::do_simulation_step(), and blender::ed::sculpt_paint::brushes::sample_node_surface_grids().
|
inline |
Definition at line 148 of file sculpt_automask.hh.
References calc_grids_factors(), and depsgraph.
| void blender::ed::sculpt_paint::auto_mask::calc_vert_factors | ( | const Depsgraph & | depsgraph, |
| const Object & | object, | ||
| const Cache & | automasking, | ||
| const bke::pbvh::BMeshNode & | node, | ||
| const Set< BMVert *, 0 > & | verts, | ||
| MutableSpan< float > | factors ) |
Definition at line 974 of file sculpt_automasking.cc.
References BLI_assert, BLI_SCOPED_DEFER, bm, SculptSession::bm, BM_elem_index_get, SculptSession::bm_log, blender::ed::sculpt_paint::StrokeCache::brush, BRUSH_AUTOMASKING_BOUNDARY_EDGES, BRUSH_AUTOMASKING_BOUNDARY_FACE_SETS, BRUSH_AUTOMASKING_BRUSH_NORMAL, BRUSH_AUTOMASKING_CAVITY_ALL, BRUSH_AUTOMASKING_FACE_SETS, BRUSH_AUTOMASKING_TOPOLOGY, BRUSH_AUTOMASKING_VIEW_NORMAL, BRUSH_AUTOMASKING_VIEW_OCCLUSION, SculptSession::cache, calc_brush_normal_factor(), calc_view_normal_factor(), calc_view_occlusion_factor(), blender::ed::sculpt_paint::auto_mask::Cache::cavity_factor, CD_PROP_INT32, CustomData_get_offset_named(), depsgraph, blender::ed::sculpt_paint::auto_mask::Cache::factor, SculptSession::filter_cache, blender::ed::sculpt_paint::auto_mask::Settings::flags, i, blender::ed::sculpt_paint::auto_mask::Settings::initial_face_set, blender::ed::sculpt_paint::auto_mask::Settings::initial_island_nr, Array< T, InlineBufferCapacity, Allocator >::is_empty(), blender::Array< T, InlineBufferCapacity, Allocator >::is_empty(), blender::ed::sculpt_paint::orig_position_data_gather_bmesh(), blender::ed::sculpt_paint::StrokeCache::paint_face_set, process_cavity_factor(), Brush::sculpt_brush_type, SCULPT_BRUSH_TYPE_DRAW_FACE_SETS, blender::ed::sculpt_paint::auto_mask::Cache::settings, blender::ed::sculpt_paint::auto_mask::Settings::topology_use_brush_limit, blender::ed::sculpt_paint::face_set::vert_face_set_get(), blender::ed::sculpt_paint::face_set::vert_has_face_set(), blender::ed::sculpt_paint::face_set::vert_has_unique_face_set(), blender::ed::sculpt_paint::islands::vert_id_get(), blender::ed::sculpt_paint::boundary::vert_is_boundary(), and verts.
| void blender::ed::sculpt_paint::auto_mask::calc_vert_factors | ( | const Depsgraph & | depsgraph, |
| const Object & | object, | ||
| const Cache & | automasking, | ||
| const bke::pbvh::MeshNode & | node, | ||
| Span< int > | verts, | ||
| MutableSpan< float > | factors ) |
Calculate all auto-masking influence on each vertex.
Definition at line 620 of file sculpt_automasking.cc.
References BLI_assert, SculptVertexInfo::boundary, blender::ed::sculpt_paint::StrokeCache::brush, BRUSH_AUTOMASKING_BOUNDARY_EDGES, BRUSH_AUTOMASKING_BOUNDARY_FACE_SETS, BRUSH_AUTOMASKING_BRUSH_NORMAL, BRUSH_AUTOMASKING_CAVITY_ALL, BRUSH_AUTOMASKING_FACE_SETS, BRUSH_AUTOMASKING_TOPOLOGY, BRUSH_AUTOMASKING_VIEW_NORMAL, BRUSH_AUTOMASKING_VIEW_OCCLUSION, SculptSession::cache, calc_brush_normal_factor(), calc_view_normal_factor(), calc_view_occlusion_factor(), blender::ed::sculpt_paint::auto_mask::Cache::cavity_factor, depsgraph, blender::bke::Face, blender::ed::sculpt_paint::auto_mask::Cache::factor, SculptSession::filter_cache, blender::ed::sculpt_paint::auto_mask::Settings::flags, i, blender::ed::sculpt_paint::auto_mask::Settings::initial_face_set, blender::ed::sculpt_paint::auto_mask::Settings::initial_island_nr, Array< T, InlineBufferCapacity, Allocator >::is_empty(), blender::bke::AttributeAccessor::lookup(), blender::ed::sculpt_paint::orig_position_data_lookup_mesh(), blender::ed::sculpt_paint::StrokeCache::paint_face_set, process_cavity_factor(), Brush::sculpt_brush_type, SCULPT_BRUSH_TYPE_DRAW_FACE_SETS, blender::ed::sculpt_paint::auto_mask::Cache::settings, blender::ed::sculpt_paint::auto_mask::Settings::topology_use_brush_limit, blender::ed::sculpt_paint::face_set::vert_face_set_get(), blender::ed::sculpt_paint::face_set::vert_has_face_set(), blender::ed::sculpt_paint::face_set::vert_has_unique_face_set(), blender::ed::sculpt_paint::islands::vert_id_get(), blender::ed::sculpt_paint::boundary::vert_is_boundary(), blender::bke::pbvh::vert_normals_eval(), blender::bke::pbvh::vert_positions_eval(), SculptSession::vertex_info, and verts.
Referenced by blender::ed::sculpt_paint::cloth::apply_filter_forces_bmesh(), blender::ed::sculpt_paint::cloth::apply_filter_forces_mesh(), blender::ed::sculpt_paint::mask::apply_mask_bmesh(), blender::ed::sculpt_paint::mask::apply_mask_mesh(), blender::ed::sculpt_paint::boundary::calc_bend_bmesh(), blender::ed::sculpt_paint::boundary::calc_bend_mesh(), blender::ed::sculpt_paint::brushes::calc_bmesh(), blender::ed::sculpt_paint::pose::calc_bmesh(), blender::ed::sculpt_paint::cloth::calc_constraint_factors(), blender::ed::sculpt_paint::filter::calc_enhance_details_filter(), blender::ed::sculpt_paint::brushes::calc_faces(), blender::ed::sculpt_paint::calc_factors_common_bmesh(), blender::ed::sculpt_paint::calc_factors_common_from_orig_data_bmesh(), blender::ed::sculpt_paint::calc_factors_common_from_orig_data_mesh(), blender::ed::sculpt_paint::calc_factors_common_mesh(), blender::ed::sculpt_paint::calc_factors_common_mesh_indexed(), blender::ed::sculpt_paint::cloth::calc_forces_bmesh(), blender::ed::sculpt_paint::cloth::calc_forces_mesh(), blender::ed::sculpt_paint::boundary::calc_grab_bmesh(), blender::ed::sculpt_paint::boundary::calc_grab_mesh(), blender::ed::sculpt_paint::boundary::calc_inflate_bmesh(), blender::ed::sculpt_paint::filter::calc_inflate_filter(), blender::ed::sculpt_paint::boundary::calc_inflate_mesh(), blender::ed::sculpt_paint::pose::calc_mesh(), blender::ed::sculpt_paint::filter::calc_random_filter(), blender::ed::sculpt_paint::filter::calc_relax_face_sets_filter(), blender::ed::sculpt_paint::filter::calc_relax_filter(), blender::ed::sculpt_paint::filter::calc_scale_filter(), blender::ed::sculpt_paint::filter::calc_sharpen_filter(), blender::ed::sculpt_paint::boundary::calc_slide_bmesh(), blender::ed::sculpt_paint::boundary::calc_slide_mesh(), blender::ed::sculpt_paint::filter::calc_smooth_filter(), blender::ed::sculpt_paint::filter::calc_sphere_filter(), blender::ed::sculpt_paint::filter::calc_surface_smooth_filter(), blender::ed::sculpt_paint::boundary::calc_twist_bmesh(), blender::ed::sculpt_paint::boundary::calc_twist_mesh(), calc_vert_factors(), calc_vert_factors(), blender::ed::sculpt_paint::color::color_filter_task(), blender::ed::sculpt_paint::color::do_color_smooth_task(), blender::ed::sculpt_paint::color::do_paint_brush_task(), blender::ed::sculpt_paint::cloth::do_simulation_step(), blender::ed::sculpt_paint::color::do_smear_brush_task(), blender::ed::sculpt_paint::brushes::sample_node_surface_bmesh(), and blender::ed::sculpt_paint::brushes::sample_node_surface_mesh().
|
inline |
Definition at line 165 of file sculpt_automask.hh.
References calc_vert_factors(), depsgraph, and verts.
|
inline |
Definition at line 131 of file sculpt_automask.hh.
References calc_vert_factors(), depsgraph, and verts.
|
static |
Definition at line 210 of file sculpt_automasking.cc.
References SculptSession::cache, SculptSession::filter_cache, M_PI, normal_calc(), blender::ed::sculpt_paint::auto_mask::Cache::settings, blender::ed::sculpt_paint::filter::Cache::view_normal, blender::ed::sculpt_paint::auto_mask::Settings::view_normal_falloff, blender::ed::sculpt_paint::auto_mask::Settings::view_normal_limit, and blender::ed::sculpt_paint::StrokeCache::view_normal_symm.
Referenced by calc_face_factors(), calc_grids_factors(), calc_vert_factors(), calc_vert_factors(), and normal_occlusion_automasking_fill().
|
static |
Definition at line 232 of file sculpt_automasking.cc.
References depsgraph, blender::ed::sculpt_paint::auto_mask::Cache::Occluded, blender::ed::sculpt_paint::auto_mask::Cache::occlusion, blender::ed::sculpt_paint::auto_mask::Cache::Unknown, blender::ed::sculpt_paint::vertex_is_occluded(), and blender::ed::sculpt_paint::auto_mask::Cache::Visible.
Referenced by calc_face_factors(), calc_grids_factors(), calc_vert_factors(), calc_vert_factors(), and normal_occlusion_automasking_fill().
|
static |
Definition at line 1201 of file sculpt_automasking.cc.
References SculptSession::active_vert(), SculptSession::bm, blender::bke::pbvh::BMesh, depsgraph, fill_topology_automasking_factors_bmesh(), fill_topology_automasking_factors_grids(), fill_topology_automasking_factors_mesh(), blender::bke::pbvh::Grids, blender::bke::pbvh::Mesh, blender::bke::object::pbvh_get(), Object::sculpt, SculptSession::subdiv_ccg, and blender::bke::pbvh::vert_positions_eval().
Referenced by cache_init().
|
static |
Definition at line 1165 of file sculpt_automasking.cc.
References SculptSession::active_vert(), blender::ed::sculpt_paint::flood_fill::FillDataBMesh::add_initial(), BKE_paint_brush_for_read(), bm, SculptSession::bm, BM_elem_index_get, BM_mesh_elem_count(), BM_VERT, SculptSession::cache, BMVert::co, blender::ed::sculpt_paint::flood_fill::FillDataBMesh::execute(), blender::ed::sculpt_paint::find_symm_verts_bmesh(), is_constrained_by_radius(), Sculpt::paint, blender::ed::sculpt_paint::StrokeCache::radius, Object::sculpt, SCULPT_is_vertex_inside_brush_radius_symm(), and SCULPT_mesh_symmetry_xyz_get().
Referenced by fill_topology_automasking_factors().
|
static |
Definition at line 1122 of file sculpt_automasking.cc.
References SculptSession::active_vert_index(), blender::ed::sculpt_paint::flood_fill::FillDataGrids::add_initial(), BKE_paint_brush_for_read(), BKE_subdiv_ccg_key_top_level(), SculptSession::cache, blender::ed::sculpt_paint::flood_fill::FillDataGrids::execute(), blender::ed::sculpt_paint::find_symm_verts_grids(), is_constrained_by_radius(), Sculpt::paint, SubdivCCG::positions, blender::ed::sculpt_paint::StrokeCache::radius, Object::sculpt, SCULPT_is_vertex_inside_brush_radius_symm(), SCULPT_mesh_symmetry_xyz_get(), blender::Span< T >::size(), and SubdivCCGCoord::to_index().
Referenced by fill_topology_automasking_factors().
|
static |
Definition at line 1083 of file sculpt_automasking.cc.
References SculptSession::active_vert(), blender::ed::sculpt_paint::flood_fill::FillDataMesh::add_initial(), BKE_paint_brush_for_read(), SculptSession::cache, Object::data, depsgraph, blender::ed::sculpt_paint::flood_fill::FillDataMesh::execute(), blender::ed::sculpt_paint::find_symm_verts_mesh(), is_constrained_by_radius(), Sculpt::paint, blender::ed::sculpt_paint::StrokeCache::radius, Object::sculpt, SCULPT_is_vertex_inside_brush_radius_symm(), SCULPT_mesh_symmetry_xyz_get(), and blender::Span< T >::size().
Referenced by fill_topology_automasking_factors().
| Cache & blender::ed::sculpt_paint::auto_mask::filter_cache_ensure | ( | const Depsgraph & | depsgraph, |
| const Sculpt & | sd, | ||
| Object & | ob ) |
If the FilterCache#automask cache doesn't exist, create and return it.
Definition at line 1720 of file sculpt_automasking.cc.
References blender::ed::sculpt_paint::filter::Cache::automasking, BLI_assert, cache_init(), depsgraph, SculptSession::filter_cache, filter_cache_ensure(), is_enabled(), and Object::sculpt.
Referenced by filter_cache_ensure(), blender::ed::sculpt_paint::cloth::sculpt_cloth_filter_invoke(), blender::ed::sculpt_paint::color::sculpt_color_filter_init(), and blender::ed::sculpt_paint::filter::sculpt_mesh_filter_start().
|
static |
Definition at line 1499 of file sculpt_automasking.cc.
References blender::bke::pbvh::BMesh, depsgraph, blender::bke::pbvh::Grids, init_boundary_masking(), init_boundary_masking_bmesh(), init_boundary_masking_grids(), init_boundary_masking_mesh(), blender::bke::pbvh::Mesh, and blender::bke::object::pbvh_get().
Referenced by cache_init(), and init_boundary_masking().
|
static |
Definition at line 1441 of file sculpt_automasking.cc.
References bm, SculptSession::bm, BM_elem_index_get, BM_mesh_elem_count(), BM_VERT, BM_vert_at_index(), CD_PROP_INT32, CustomData_get_offset_named(), EDGE_DISTANCE_INF, Edges, FaceSets, float, i, init_boundary_masking_bmesh(), pow2f(), blender::ed::sculpt_paint::face_set::vert_has_unique_face_set(), blender::ed::sculpt_paint::boundary::vert_is_boundary(), and blender::ed::sculpt_paint::vert_neighbors_get_bmesh().
Referenced by init_boundary_masking(), and init_boundary_masking_bmesh().
|
static |
Definition at line 1371 of file sculpt_automasking.cc.
References BKE_subdiv_ccg_key_top_level(), BKE_subdiv_ccg_neighbor_coords_get(), SculptVertexInfo::boundary, SubdivCCGNeighbors::coords, EDGE_DISTANCE_INF, Edges, blender::bke::Face, faces, FaceSets, float, SubdivCCGCoord::from_index(), i, blender::Span< T >::index_range(), init_boundary_masking_grids(), blender::bke::AttributeAccessor::lookup(), SubdivCCG::positions, pow2f(), blender::Span< T >::size(), SculptSession::subdiv_ccg, SubdivCCGCoord::to_index(), blender::ed::sculpt_paint::face_set::vert_has_unique_face_set(), blender::ed::sculpt_paint::boundary::vert_is_boundary(), and SculptSession::vertex_info.
Referenced by init_boundary_masking(), and init_boundary_masking_grids().
|
static |
Definition at line 1308 of file sculpt_automasking.cc.
References SculptVertexInfo::boundary, depsgraph, EDGE_DISTANCE_INF, Edges, blender::bke::Face, faces, FaceSets, float, i, init_boundary_masking_mesh(), blender::bke::AttributeAccessor::lookup(), pow2f(), blender::ed::sculpt_paint::face_set::vert_has_unique_face_set(), blender::ed::sculpt_paint::boundary::vert_is_boundary(), blender::ed::sculpt_paint::vert_neighbors_get_mesh(), blender::bke::pbvh::vert_positions_eval(), and SculptSession::vertex_info.
Referenced by init_boundary_masking(), and init_boundary_masking_mesh().
|
static |
Definition at line 1230 of file sculpt_automasking.cc.
References blender::ed::sculpt_paint::face_set::active_face_set_get(), Geometry::attributes, BKE_paint_brush_for_read(), Object::data, blender::bke::Face, faces, SubdivCCG::grid_area, blender::bke::pbvh::Grids, blender::Span< T >::is_empty(), is_enabled(), blender::bke::AttributeAccessor::lookup(), blender::bke::pbvh::Mesh, Sculpt::paint, blender::threading::parallel_for(), blender::bke::object::pbvh_get(), Object::sculpt, and SculptSession::subdiv_ccg.
Referenced by cache_init().
|
static |
Definition at line 141 of file sculpt_automasking.cc.
References ELEM, Brush::falloff_shape, PAINT_FALLOFF_SHAPE_TUBE, Brush::sculpt_brush_type, SCULPT_BRUSH_TYPE_GRAB, SCULPT_BRUSH_TYPE_ROTATE, and SCULPT_BRUSH_TYPE_THUMB.
Referenced by cache_init(), fill_topology_automasking_factors_bmesh(), fill_topology_automasking_factors_grids(), fill_topology_automasking_factors_mesh(), and needs_factors_cache().
| bool blender::ed::sculpt_paint::auto_mask::is_enabled | ( | const Sculpt & | sd, |
| const Object & | object, | ||
| const Brush * | br ) |
Definition at line 65 of file sculpt_automasking.cc.
References BRUSH_AUTOMASKING_BOUNDARY_EDGES, BRUSH_AUTOMASKING_BOUNDARY_FACE_SETS, BRUSH_AUTOMASKING_BRUSH_NORMAL, BRUSH_AUTOMASKING_CAVITY_ALL, BRUSH_AUTOMASKING_FACE_SETS, BRUSH_AUTOMASKING_TOPOLOGY, BRUSH_AUTOMASKING_VIEW_NORMAL, mode_enabled(), and blender::ed::sculpt_paint::dyntopo::stroke_is_dyntopo().
Referenced by cache_init(), blender::ed::sculpt_paint::do_brush_action(), filter_cache_ensure(), init_face_sets_masking(), blender::ed::sculpt_paint::cloth::sculpt_cloth_filter_invoke(), blender::ed::sculpt_paint::cloth::sculpt_cloth_filter_modal(), blender::ed::sculpt_paint::color::sculpt_color_filter_apply(), blender::ed::sculpt_paint::color::sculpt_color_filter_init(), blender::ed::sculpt_paint::filter::sculpt_mesh_filter_apply(), blender::ed::sculpt_paint::filter::sculpt_mesh_filter_start(), blender::ed::sculpt_paint::sculpt_needs_connectivity_info(), and stroke_cache_ensure().
| bool blender::ed::sculpt_paint::auto_mask::mode_enabled | ( | const Sculpt & | sd, |
| const Brush * | br, | ||
| eAutomasking_flag | mode ) |
Definition at line 54 of file sculpt_automasking.cc.
References Brush::automasking_flags, and Sculpt::automasking_flags.
Referenced by cache_init(), and is_enabled().
|
static |
Definition at line 173 of file sculpt_automasking.cc.
References boundary_propagation_steps(), BRUSH_AUTOMASKING_BOUNDARY_EDGES, BRUSH_AUTOMASKING_BOUNDARY_FACE_SETS, BRUSH_AUTOMASKING_TOPOLOGY, calc_effective_bits(), and is_constrained_by_radius().
Referenced by cache_init().
|
static |
Definition at line 117 of file sculpt_automasking.cc.
References angle(), blender::math::dot(), and blender::math::safe_acos().
Referenced by calc_brush_normal_factor(), and calc_view_normal_factor().
|
static |
Definition at line 1557 of file sculpt_automasking.cc.
References bm, SculptSession::bm, blender::bke::pbvh::BMesh, BRUSH_AUTOMASKING_VIEW_NORMAL, BRUSH_AUTOMASKING_VIEW_OCCLUSION, calc_view_normal_factor(), calc_view_occlusion_factor(), depsgraph, blender::bke::pbvh::Grids, blender::bke::pbvh::Mesh, normal_occlusion_automasking_fill(), SubdivCCG::normals, blender::threading::parallel_for(), blender::bke::object::pbvh_get(), SubdivCCG::positions, Object::sculpt, SCULPT_vertex_count_get(), SculptSession::subdiv_ccg, blender::bke::pbvh::vert_normals_eval(), and blender::bke::pbvh::vert_positions_eval().
Referenced by cache_init(), and normal_occlusion_automasking_fill().
|
static |
Definition at line 566 of file sculpt_automasking.cc.
References BKE_curvemapping_evaluateF(), BRUSH_AUTOMASKING_CAVITY_ALL, BRUSH_AUTOMASKING_CAVITY_INVERTED, BRUSH_AUTOMASKING_CAVITY_USE_CURVE, blender::ed::sculpt_paint::auto_mask::Settings::cavity_curve, blender::ed::sculpt_paint::auto_mask::Settings::flags, and blender::ed::sculpt_paint::auto_mask::Cache::settings.
Referenced by calc_face_factors(), calc_grids_factors(), calc_vert_factors(), and calc_vert_factors().
| Cache & blender::ed::sculpt_paint::auto_mask::stroke_cache_ensure | ( | const Depsgraph & | depsgraph, |
| const Sculpt & | sd, | ||
| const Brush * | brush, | ||
| Object & | ob ) |
If the StrokeCache#automask cache doesn't exist, create and return it.
Definition at line 1731 of file sculpt_automasking.cc.
References blender::ed::sculpt_paint::StrokeCache::automasking, BLI_assert, SculptSession::cache, cache_init(), depsgraph, is_enabled(), Object::sculpt, and stroke_cache_ensure().
Referenced by blender::ed::sculpt_paint::do_brush_action(), and stroke_cache_ensure().
|
staticconstexpr |
Definition at line 1301 of file sculpt_automasking.cc.
Referenced by init_boundary_masking_bmesh(), init_boundary_masking_grids(), and init_boundary_masking_mesh().