Blender V5.3
sculpt.cc File Reference
#include <cmath>
#include <cstdlib>
#include <cstring>
#include "MEM_guardedalloc.h"
#include "CLG_log.h"
#include "BLI_array_utils.hh"
#include "BLI_atomic_disjoint_set.hh"
#include "BLI_dial_2d.hh"
#include "BLI_enum_flags.hh"
#include "BLI_enumerable_thread_specific.hh"
#include "BLI_listbase.hh"
#include "BLI_math_axis_angle.hh"
#include "BLI_math_geom_c.hh"
#include "BLI_math_matrix.hh"
#include "BLI_math_matrix_c.hh"
#include "BLI_math_rotation_c.hh"
#include "BLI_math_rotation_legacy.hh"
#include "BLI_math_vector.hh"
#include "BLI_rect.hh"
#include "BLI_set.hh"
#include "BLI_span.hh"
#include "BLI_task.hh"
#include "BLI_task_c.hh"
#include "BLI_vector.hh"
#include "DNA_brush_types.h"
#include "DNA_customdata_types.h"
#include "DNA_key_types.h"
#include "DNA_node_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "BKE_attribute.hh"
#include "BKE_brush.hh"
#include "BKE_bvhutils.hh"
#include "BKE_ccg.hh"
#include "BKE_colortools.hh"
#include "BKE_context.hh"
#include "BKE_customdata.hh"
#include "BKE_global.hh"
#include "BKE_image.hh"
#include "BKE_key.hh"
#include "BKE_layer.hh"
#include "BKE_lib_id.hh"
#include "BKE_mesh.hh"
#include "BKE_modifier.hh"
#include "BKE_multires.hh"
#include "BKE_node_runtime.hh"
#include "BKE_object.hh"
#include "BKE_object_types.hh"
#include "BKE_paint.hh"
#include "BKE_paint_bvh.hh"
#include "BKE_paint_types.hh"
#include "BKE_report.hh"
#include "BKE_subdiv_ccg.hh"
#include "BLT_translation.hh"
#include "NOD_texture.h"
#include "PRF_profile.hh"
#include "DEG_depsgraph.hh"
#include "DEG_depsgraph_query.hh"
#include "WM_api.hh"
#include "WM_toolsystem.hh"
#include "WM_types.hh"
#include "ED_paint.hh"
#include "ED_screen.hh"
#include "ED_sculpt.hh"
#include "ED_view3d.hh"
#include "../paint_intern.hh"
#include "sculpt_automask.hh"
#include "sculpt_boundary.hh"
#include "sculpt_cloth.hh"
#include "sculpt_color.hh"
#include "sculpt_dyntopo.hh"
#include "sculpt_face_set.hh"
#include "sculpt_filter.hh"
#include "sculpt_hide.hh"
#include "sculpt_intern.hh"
#include "sculpt_islands.hh"
#include "sculpt_pose.hh"
#include "sculpt_undo.hh"
#include "RNA_access.hh"
#include "RNA_define.hh"
#include "bmesh.hh"
#include "editors/sculpt_paint/mesh/brushes/brushes.hh"
#include "mesh_brush_common.hh"
#include "mesh_paint.hh"

Go to the source code of this file.

Classes

struct  blender::ed::sculpt_paint::AreaNormalCenterData
struct  blender::ed::sculpt_paint::SampleLocalData
struct  blender::ed::sculpt_paint::RaycastData
struct  blender::ed::sculpt_paint::FindNearestToRayData
struct  blender::ed::sculpt_paint::SculptPaintStroke
struct  blender::ed::sculpt_paint::NearestVertData

Namespaces

namespace  blender
 BMesh Iterators.
namespace  blender::ed
namespace  blender::ed::sculpt_paint
namespace  blender::ed::sculpt_paint::face_set
namespace  blender::ed::sculpt_paint::boundary
namespace  blender::ed::sculpt_paint::dyntopo
namespace  blender::ed::sculpt_paint::undo
namespace  blender::ed::sculpt_paint::islands

Enumerations

enum class  blender::StrokeFlags : uint8_t { blender::ClipX = 1 , blender::ClipY = 2 , blender::ClipZ = 4 }

Functions

int blender::ed::sculpt_paint::face_set::active_face_set_get (const Object &object)
int blender::ed::sculpt_paint::face_set::vert_face_set_max_get (const GroupedSpan< int > vert_to_face_map, const Span< int > face_sets, const int vert)
int blender::ed::sculpt_paint::face_set::vert_face_set_get (const SubdivCCG &subdiv_ccg, const Span< int > face_sets, const int grid)
int blender::ed::sculpt_paint::face_set::vert_face_set_max_get (const int, const BMVert &)
Set< int > blender::ed::sculpt_paint::face_set::vert_face_sets_get (const GroupedSpan< int > vert_to_face_map, const Span< int > face_sets, const int vert)
bool blender::ed::sculpt_paint::face_set::vert_has_face_set (const GroupedSpan< int > vert_to_face_map, const Span< int > face_sets, const int vert, const int face_set)
bool blender::ed::sculpt_paint::face_set::vert_has_face_set (const SubdivCCG &subdiv_ccg, const Span< int > face_sets, const int grid, const int face_set)
bool blender::ed::sculpt_paint::face_set::vert_has_face_set (const int face_set_offset, const BMVert &vert, const int face_set)
bool blender::ed::sculpt_paint::face_set::vert_has_any_face_set (const GroupedSpan< int > vert_to_face_map, const Span< int > face_sets, int vert, const Set< int > &allowed_face_sets)
bool blender::ed::sculpt_paint::face_set::vert_has_unique_face_set (const GroupedSpan< int > vert_to_face_map, const Span< int > face_sets, int vert)
static bool blender::ed::sculpt_paint::face_set::sculpt_check_unique_face_set_for_edge_in_base_mesh (const GroupedSpan< int > vert_to_face_map, const Span< int > face_sets, const Span< int > corner_verts, const OffsetIndices< int > faces, int v1, int v2)
bool blender::ed::sculpt_paint::face_set::vert_has_unique_face_set (const OffsetIndices< int > faces, const Span< int > corner_verts, const GroupedSpan< int > vert_to_face_map, const Span< int > face_sets, const SubdivCCG &subdiv_ccg, SubdivCCGCoord coord)
bool blender::ed::sculpt_paint::face_set::coord_has_face_set (const OffsetIndices< int > faces, const Span< int > corner_verts, const GroupedSpan< int > vert_to_face_map, const Span< int > face_sets, const SubdivCCG &subdiv_ccg, const SubdivCCGCoord coord, const int face_set)
bool blender::ed::sculpt_paint::face_set::coord_has_any_face_set (const OffsetIndices< int > faces, const Span< int > corner_verts, const GroupedSpan< int > vert_to_face_map, const Span< int > face_sets, const SubdivCCG &subdiv_ccg, const SubdivCCGCoord coord, const Set< int > &allowed_face_sets)
bool blender::ed::sculpt_paint::face_set::vert_has_unique_face_set (const int, const BMVert &)
void blender::ed::sculpt_paint::boundary::ensure_boundary_info (Object &object)
SculptBoundaryInfoCache blender::ed::sculpt_paint::boundary::create_boundary_info (const Mesh &mesh)
bool blender::ed::sculpt_paint::boundary::vert_is_boundary (const GroupedSpan< int > vert_to_face_map, const Span< bool > hide_poly, const BitSpan boundary_verts, const int vert)
bool blender::ed::sculpt_paint::boundary::vert_is_boundary (const OffsetIndices< int > faces, const Span< int > corner_verts, const BitSpan boundary_verts, const Set< OrderedEdge > &boundary_edges, const SubdivCCG &subdiv_ccg, const SubdivCCGCoord vert)
bool blender::ed::sculpt_paint::boundary::vert_is_boundary (BMVert *vert)
static void blender::ed::sculpt_paint::rake_data_update (SculptRakeData *srd, const float co[3])
bool blender::ed::sculpt_paint::dyntopo::stroke_is_dyntopo (const Object &object, const Brush &brush)
static void blender::ed::sculpt_paint::undo::restore_mask_from_undo_step (Object &object)
static void blender::ed::sculpt_paint::undo::restore_color_from_undo_step (Object &object)
static void blender::ed::sculpt_paint::undo::restore_face_set_from_undo_step (Object &object)
void blender::ed::sculpt_paint::undo::restore_position_from_undo_step (const Depsgraph &depsgraph, Object &object)
static void blender::ed::sculpt_paint::undo::restore_from_undo_step (const Depsgraph &depsgraph, const Sculpt &sd, Object &object)
static void blender::ed::sculpt_paint::sculpt_init_mirror_clipping (const Object &ob, const SculptSession &ss)
static void blender::ed::sculpt_paint::smooth_brush_toggle_on (Main *bmain, Paint *paint, StrokeToggleSettings &toggle_settings)
static void blender::ed::sculpt_paint::smooth_brush_toggle_off (Paint *paint, StrokeCache *cache)
static void blender::ed::sculpt_paint::mask_brush_toggle_on (Main *bmain, Paint *paint, StrokeToggleSettings &toggle_settings)
static void blender::ed::sculpt_paint::mask_brush_toggle_off (Paint *paint, StrokeCache *cache)
static void blender::ed::sculpt_paint::init_scene_project_brush_targets (const Depsgraph &depsgraph, ViewLayer &view_layer, const View3D &v3d, const Object &active_object, StrokeCache &cache)
static float blender::ed::sculpt_paint::brush_dynamic_size_get (const Brush &brush, const StrokeCache &cache, float initial_size)
static bool blender::ed::sculpt_paint::need_delta_from_anchored_origin (const Brush &brush)
static bool blender::ed::sculpt_paint::need_delta_for_tip_orientation (const Brush &brush)
static void blender::ed::sculpt_paint::brush_delta_update (const Depsgraph &depsgraph, Paint &paint, const Object &ob, const Brush &brush)
static void blender::ed::sculpt_paint::cache_paint_brush_variants_update (StrokeCache &cache, const Brush &brush)
static void blender::ed::sculpt_paint::sculpt_raycast_cb (bke::pbvh::Node &node, RaycastData &rd, float *distance)
static void blender::ed::sculpt_paint::sculpt_find_nearest_to_ray_cb (bke::pbvh::Node &node, FindNearestToRayData &fntrd, float *tmin)
static std::optional< float3 > blender::ed::sculpt_paint::stroke_get_location_bvh_ex (Depsgraph &depsgraph, ViewContext &vc, const Paint &paint, const Sculpt *sd, const float2 &mval, const bool force_original, const bool check_closest, const bool limit_closest_radius)
static void blender::ed::sculpt_paint::brush_init_tex (const Sculpt &sd, SculptSession &ss)
static StrokeToggleSettings blender::ed::sculpt_paint::create_toggle_settings (const wmOperator &op, Main &bmain, Paint &paint)
static void blender::ed::sculpt_paint::brush_stroke_init (bContext *C, const wmOperator *op)
static void blender::ed::sculpt_paint::restore_from_undo_step_if_necessary (const Depsgraph &depsgraph, const Sculpt &sd, Object &ob)
static void blender::ed::sculpt_paint::tag_mesh_positions_changed (Object &object, const bool use_pbvh_draw)
static void blender::ed::sculpt_paint::replace_attribute (const bke::AttributeAccessor src_attributes, const StringRef name, const bke::AttrDomain domain, const bke::AttrType data_type, bke::MutableAttributeAccessor dst_attributes)
static bool blender::ed::sculpt_paint::attribute_matches (const bke::AttributeAccessor a, const bke::AttributeAccessor b, const StringRef name)
static bool blender::ed::sculpt_paint::topology_matches (const Mesh &a, const Mesh &b)
static void blender::ed::sculpt_paint::store_sculpt_entire_mesh (const wmOperator &op, const Scene &scene, Object &object, Mesh *new_mesh)
static const ImplicitSharingInfo * blender::ed::sculpt_paint::get_vertex_group_sharing_info (const Mesh &mesh)
void blender::ed::sculpt_paint::store_mesh_from_eval (const wmOperator &op, const Scene &scene, const Depsgraph &depsgraph, const RegionView3D *rv3d, Object &object, Mesh *new_mesh)
static bool blender::ed::sculpt_paint::over_mesh (bContext *C, wmOperator *, const float mval[2])
static bool blender::ed::sculpt_paint::over_mesh (Depsgraph &depsgraph, ViewContext &vc, const Sculpt &sd, const Brush *brush, wmOperator *, const float mval[2])
static void blender::ed::sculpt_paint::stroke_cache_init (ViewContext &vc, const Sculpt &sd, const Brush &brush, Object &ob, const float mval[2])
static void blender::ed::sculpt_paint::stroke_cache_update (ViewContext &vc, const Depsgraph &depsgraph, Paint &paint, Brush &brush, Object &object, const PaintStroke::StrokeStep &stroke_step)
static void blender::ed::sculpt_paint::brush_exit_tex (Sculpt &sd)
static wmOperatorStatus blender::ed::sculpt_paint::sculpt_brush_stroke_invoke (bContext *C, wmOperator *op, const wmEvent *event)
static wmOperatorStatus blender::ed::sculpt_paint::sculpt_brush_stroke_exec (bContext *C, wmOperator *op)
static void blender::ed::sculpt_paint::sculpt_brush_stroke_cancel (bContext *C, wmOperator *op)
static wmOperatorStatus blender::ed::sculpt_paint::brush_stroke_modal (bContext *C, wmOperator *op, const wmEvent *event)
static void blender::ed::sculpt_paint::redo_empty_ui (bContext *, wmOperator *)
void blender::ed::sculpt_paint::SCULPT_OT_brush_stroke (wmOperatorType *ot)
static void blender::ed::sculpt_paint::fake_neighbor_init (Object &object, const float max_dist)
static void blender::ed::sculpt_paint::pose_fake_neighbors_free (SculptSession &ss)
static void blender::ed::sculpt_paint::fake_neighbor_search_mesh (const SculptSession &ss, const Span< float3 > vert_positions, const Span< bool > hide_vert, const float3 &location, const float max_distance_sq, const int island_id, const bke::pbvh::MeshNode &node, NearestVertData &nvtd)
static void blender::ed::sculpt_paint::fake_neighbor_search_grids (const SculptSession &ss, const CCGKey &key, const Span< float3 > positions, const BitGroupVector<> &grid_hidden, const float3 &location, const float max_distance_sq, const int island_id, const bke::pbvh::GridsNode &node, NearestVertData &nvtd)
static void blender::ed::sculpt_paint::fake_neighbor_search_bmesh (const SculptSession &ss, const float3 &location, const float max_distance_sq, const int island_id, const bke::pbvh::BMeshNode &node, NearestVertData &nvtd)
static void blender::ed::sculpt_paint::fake_neighbor_search (const Depsgraph &depsgraph, const Object &ob, const float max_distance_sq, MutableSpan< int > fake_neighbors)
int blender::ed::sculpt_paint::islands::vert_id_get (const SculptSession &ss, const int vert)
void blender::ed::sculpt_paint::islands::invalidate (SculptSession &ss)
static SculptTopologyIslandCache blender::ed::sculpt_paint::islands::vert_disjoint_set_to_islands (const AtomicDisjointSet &vert_sets, const int verts_num)
static SculptTopologyIslandCache blender::ed::sculpt_paint::islands::calc_topology_islands_mesh (const Mesh &mesh)
static SculptTopologyIslandCache blender::ed::sculpt_paint::islands::calc_topology_islands_grids (const Object &object)
static SculptTopologyIslandCache blender::ed::sculpt_paint::islands::calc_topology_islands_bmesh (const Object &object)
static SculptTopologyIslandCache blender::ed::sculpt_paint::islands::calculate_cache (const Object &object)
void blender::ed::sculpt_paint::islands::ensure_cache (Object &object)
void blender::ed::sculpt_paint::gather_bmesh_positions (const Set< BMVert *, 0 > &verts, MutableSpan< float3 > positions)
void blender::ed::sculpt_paint::gather_grids_normals (const SubdivCCG &subdiv_ccg, Span< int > grids, MutableSpan< float3 > normals)
void blender::ed::sculpt_paint::gather_bmesh_normals (const Set< BMVert *, 0 > &verts, MutableSpan< float3 > normals)
template<typename T>
void blender::ed::sculpt_paint::gather_data_grids (const SubdivCCG &subdiv_ccg, Span< T > src, Span< int > grids, MutableSpan< T > node_data)
template<typename T>
void blender::ed::sculpt_paint::gather_data_bmesh (Span< T > src, const Set< BMVert *, 0 > &verts, MutableSpan< T > node_data)
template<typename T>
void blender::ed::sculpt_paint::scatter_data_grids (const SubdivCCG &subdiv_ccg, Span< T > node_data, Span< int > grids, MutableSpan< T > dst)
template<typename T>
void blender::ed::sculpt_paint::scatter_data_bmesh (Span< T > node_data, const Set< BMVert *, 0 > &verts, MutableSpan< T > dst)
template void blender::ed::sculpt_paint::gather_data_grids< int > (const SubdivCCG &, Span< int >, Span< int >, MutableSpan< int >)
template void blender::ed::sculpt_paint::gather_data_grids< float > (const SubdivCCG &, Span< float >, Span< int >, MutableSpan< float >)
template void blender::ed::sculpt_paint::gather_data_grids< float3 > (const SubdivCCG &, Span< float3 >, Span< int >, MutableSpan< float3 >)
template void blender::ed::sculpt_paint::gather_data_bmesh< int > (Span< int >, const Set< BMVert *, 0 > &, MutableSpan< int >)
template void blender::ed::sculpt_paint::gather_data_bmesh< float > (Span< float >, const Set< BMVert *, 0 > &, MutableSpan< float >)
template void blender::ed::sculpt_paint::gather_data_bmesh< float3 > (Span< float3 >, const Set< BMVert *, 0 > &, MutableSpan< float3 >)
template void blender::ed::sculpt_paint::scatter_data_grids< float > (const SubdivCCG &, Span< float >, Span< int >, MutableSpan< float >)
template void blender::ed::sculpt_paint::scatter_data_grids< float3 > (const SubdivCCG &, Span< float3 >, Span< int >, MutableSpan< float3 >)
template void blender::ed::sculpt_paint::scatter_data_bmesh< float > (Span< float >, const Set< BMVert *, 0 > &, MutableSpan< float >)
template void blender::ed::sculpt_paint::scatter_data_bmesh< float3 > (Span< float3 >, const Set< BMVert *, 0 > &, MutableSpan< float3 >)
void blender::ed::sculpt_paint::calc_local_positions (Span< float3 > vert_positions, Span< int > verts, const float4x4 &mat, const float3 &plane_center, const float3 &view_normal, eBrushFalloffShape falloff_shape, MutableSpan< float3 > local_positions)
void blender::ed::sculpt_paint::calc_local_positions (Span< float3 > positions, const float4x4 &mat, const float3 &plane_center, const float3 &view_normal, eBrushFalloffShape falloff_shape, MutableSpan< float3 > local_positions)
void blender::ed::sculpt_paint::calc_local_positions (Span< float3 > vert_positions, Span< int > verts, const float4x4 &mat, const float3 &plane_center, const float3 &view_normal, eBrushFalloffShape falloff_shape, MutableSpan< float2 > xy_positions, MutableSpan< float > z_positions)
void blender::ed::sculpt_paint::calc_local_positions (Span< float3 > positions, const float4x4 &mat, const float3 &plane_center, const float3 &view_normal, eBrushFalloffShape falloff_shape, MutableSpan< float2 > xy_positions, MutableSpan< float > z_positions)
void blender::ed::sculpt_paint::calc_factors_common_mesh_indexed (const Depsgraph &depsgraph, const Brush &brush, const Object &object, const MeshAttributeData &attribute_data, Span< float3 > vert_positions, Span< float3 > vert_normals, const bke::pbvh::MeshNode &node, MutableSpan< float > factors, MutableSpan< float > distances)
void blender::ed::sculpt_paint::calc_factors_common_mesh (const Depsgraph &depsgraph, const Brush &brush, const Object &object, const MeshAttributeData &attribute_data, Span< float3 > positions, Span< float3 > vert_normals, const bke::pbvh::MeshNode &node, MutableSpan< float > factors, MutableSpan< float > distances)
void blender::ed::sculpt_paint::calc_factors_common_grids (const Depsgraph &depsgraph, const Brush &brush, const Object &object, Span< float3 > positions, const bke::pbvh::GridsNode &node, Vector< float > &r_factors, Vector< float > &r_distances)
void blender::ed::sculpt_paint::calc_cube_tip_factors_common_grids (const Depsgraph &depsgraph, const Brush &brush, const Object &object, const float4x4 &mat, Span< float3 > positions, const bke::pbvh::GridsNode &node, Vector< float > &r_factors, Vector< float > &r_distances)
void blender::ed::sculpt_paint::calc_factors_common_bmesh (const Depsgraph &depsgraph, const Brush &brush, const Object &object, Span< float3 > positions, bke::pbvh::BMeshNode &node, Vector< float > &r_factors, Vector< float > &r_distances)
void blender::ed::sculpt_paint::calc_cube_tip_factors_common_bmesh (const Depsgraph &depsgraph, const Brush &brush, const Object &object, const float4x4 &mat, Span< float3 > positions, bke::pbvh::BMeshNode &node, Vector< float > &r_factors, Vector< float > &r_distances)
void blender::ed::sculpt_paint::calc_factors_common_from_orig_data_mesh (const Depsgraph &depsgraph, const Brush &brush, const Object &object, const MeshAttributeData &attribute_data, Span< float3 > positions, Span< float3 > normals, const bke::pbvh::MeshNode &node, MutableSpan< float > r_factors, MutableSpan< float > r_distances)
void blender::ed::sculpt_paint::calc_factors_common_from_orig_data_grids (const Depsgraph &depsgraph, const Brush &brush, const Object &object, Span< float3 > positions, Span< float3 > normals, const bke::pbvh::GridsNode &node, Vector< float > &r_factors, Vector< float > &r_distances)
void blender::ed::sculpt_paint::calc_factors_common_from_orig_data_bmesh (const Depsgraph &depsgraph, const Brush &brush, const Object &object, Span< float3 > positions, Span< float3 > normals, bke::pbvh::BMeshNode &node, Vector< float > &r_factors, Vector< float > &r_distances)
void blender::ed::sculpt_paint::fill_factor_from_hide (Span< bool > hide_vert, Span< int > verts, MutableSpan< float > r_factors)
void blender::ed::sculpt_paint::fill_factor_from_hide (const SubdivCCG &subdiv_ccg, Span< int > grids, MutableSpan< float > r_factors)
void blender::ed::sculpt_paint::fill_factor_from_hide (const Set< BMVert *, 0 > &verts, MutableSpan< float > r_factors)
void blender::ed::sculpt_paint::fill_factor_from_hide_and_mask (Span< bool > hide_vert, Span< float > mask, Span< int > verts, MutableSpan< float > r_factors)
void blender::ed::sculpt_paint::fill_factor_from_hide_and_mask (const BMesh &bm, const Set< BMVert *, 0 > &verts, MutableSpan< float > r_factors)
void blender::ed::sculpt_paint::fill_factor_from_hide_and_mask (const SubdivCCG &subdiv_ccg, Span< int > grids, MutableSpan< float > r_factors)
void blender::ed::sculpt_paint::calc_front_face (const float3 &view_normal, Span< float3 > vert_normals, Span< int > verts, MutableSpan< float > factors)
void blender::ed::sculpt_paint::calc_front_face (const float3 &view_normal, Span< float3 > normals, MutableSpan< float > factors)
void blender::ed::sculpt_paint::calc_front_face (const float3 &view_normal, const SubdivCCG &subdiv_ccg, Span< int > grids, MutableSpan< float > factors)
void blender::ed::sculpt_paint::calc_front_face (const float3 &view_normal, const Set< BMVert *, 0 > &verts, MutableSpan< float > factors)
void blender::ed::sculpt_paint::calc_front_face (const float3 &view_normal, const Set< BMFace *, 0 > &faces, MutableSpan< float > factors)
void blender::ed::sculpt_paint::filter_region_clip_factors (const SculptSession &ss, Span< float3 > vert_positions, Span< int > verts, MutableSpan< float > factors)
void blender::ed::sculpt_paint::filter_region_clip_factors (const SculptSession &ss, Span< float3 > positions, MutableSpan< float > factors)
void blender::ed::sculpt_paint::calc_brush_distances_squared (const SculptSession &ss, Span< float3 > positions, Span< int > verts, eBrushFalloffShape falloff_shape, MutableSpan< float > r_distances)
void blender::ed::sculpt_paint::calc_brush_distances (const SculptSession &ss, Span< float3 > vert_positions, Span< int > vert, eBrushFalloffShape falloff_shape, MutableSpan< float > r_distances)
void blender::ed::sculpt_paint::calc_brush_distances_squared (const SculptSession &ss, Span< float3 > positions, eBrushFalloffShape falloff_shape, MutableSpan< float > r_distances)
void blender::ed::sculpt_paint::calc_brush_distances (const SculptSession &ss, Span< float3 > positions, eBrushFalloffShape falloff_shape, MutableSpan< float > r_distances)
void blender::ed::sculpt_paint::filter_distances_with_radius (float radius, Span< float > distances, MutableSpan< float > factors)
template<typename T>
void blender::ed::sculpt_paint::calc_brush_cube_distances (const Brush &brush, const Span< T > positions, const MutableSpan< float > r_distances)
template void blender::ed::sculpt_paint::calc_brush_cube_distances< float2 > (const Brush &brush, const Span< float2 > positions, MutableSpan< float > r_distances)
template void blender::ed::sculpt_paint::calc_brush_cube_distances< float3 > (const Brush &brush, const Span< float3 > positions, MutableSpan< float > r_distances)
void blender::ed::sculpt_paint::apply_hardness_to_distances (float radius, float hardness, MutableSpan< float > distances)
void blender::ed::sculpt_paint::calc_brush_strength_factors (const StrokeCache &cache, const Brush &brush, Span< float > distances, MutableSpan< float > factors)
void blender::ed::sculpt_paint::calc_brush_texture_factors (PaintMode paint_mode, const SculptSession &ss, const Brush &brush, Span< float3 > vert_positions, Span< int > vert, MutableSpan< float > factors)
void blender::ed::sculpt_paint::calc_brush_texture_factors (PaintMode paint_mode, const SculptSession &ss, const Brush &brush, Span< float3 > positions, MutableSpan< float > factors)
void blender::ed::sculpt_paint::reset_translations_to_original (MutableSpan< float3 > translations, Span< float3 > positions, Span< float3 > orig_positions)
static bool blender::ed::sculpt_paint::contains_nan (const Span< float > values)
void blender::ed::sculpt_paint::apply_translations (Span< float3 > translations, Span< int > verts, MutableSpan< float3 > positions)
void blender::ed::sculpt_paint::apply_translations (Span< float3 > translations, Span< int > grids, SubdivCCG &subdiv_ccg)
void blender::ed::sculpt_paint::apply_translations (Span< float3 > translations, const Set< BMVert *, 0 > &verts)
void blender::ed::sculpt_paint::project_translations (MutableSpan< float3 > translations, const float3 &plane)
void blender::ed::sculpt_paint::apply_crazyspace_to_translations (Span< float3x3 > deform_imats, Span< int > verts, MutableSpan< float3 > translations)
void blender::ed::sculpt_paint::clip_and_lock_translations (const Sculpt &sd, const SculptSession &ss, Span< float3 > positions, Span< int > verts, MutableSpan< float3 > translations)
void blender::ed::sculpt_paint::clip_and_lock_translations (const Sculpt &sd, const SculptSession &ss, Span< float3 > positions, MutableSpan< float3 > translations)
void blender::ed::sculpt_paint::filter_translations (MutableSpan< float3 > translations, Span< float > factors)
void blender::ed::sculpt_paint::scale_translations (MutableSpan< float3 > translations, Span< float > factors)
void blender::ed::sculpt_paint::scale_translations (MutableSpan< float3 > translations, float factor)
void blender::ed::sculpt_paint::scale_factors (MutableSpan< float > factors, float strength)
void blender::ed::sculpt_paint::scale_factors (MutableSpan< float > factors, Span< float > strengths)
void blender::ed::sculpt_paint::translations_from_offset_and_factors (const float3 &offset, Span< float > factors, MutableSpan< float3 > r_translations)
void blender::ed::sculpt_paint::translations_from_new_positions (Span< float3 > new_positions, Span< int > verts, Span< float3 > old_positions, MutableSpan< float3 > translations)
void blender::ed::sculpt_paint::translations_from_new_positions (Span< float3 > new_positions, Span< float3 > old_positions, MutableSpan< float3 > translations)
OffsetIndices< int > blender::ed::sculpt_paint::create_node_vert_offsets (Span< bke::pbvh::MeshNode > nodes, const IndexMask &node_mask, Array< int > &node_data)
OffsetIndices< int > blender::ed::sculpt_paint::create_node_vert_offsets (const CCGKey &key, Span< bke::pbvh::GridsNode > nodes, const IndexMask &node_mask, Array< int > &node_data)
OffsetIndices< int > blender::ed::sculpt_paint::create_node_vert_offsets_bmesh (Span< bke::pbvh::BMeshNode > nodes, const IndexMask &node_mask, Array< int > &node_data)
GroupedSpan< int > blender::ed::sculpt_paint::calc_vert_neighbors (OffsetIndices< int > faces, Span< int > corner_verts, GroupedSpan< int > vert_to_face, Span< bool > hide_poly, Span< int > verts, Vector< int > &r_offset_data, Vector< int > &r_data)
GroupedSpan< int > blender::ed::sculpt_paint::calc_vert_neighbors (const SubdivCCG &subdiv_ccg, Span< int > grids, Vector< int > &r_offset_data, Vector< int > &r_data)
GroupedSpan< BMVert * > blender::ed::sculpt_paint::calc_vert_neighbors (Set< BMVert *, 0 > verts, Vector< int > &r_offset_data, Vector< BMVert * > &r_data)
template<bool use_factors>
static GroupedSpan< int > blender::ed::sculpt_paint::calc_vert_neighbors_interior_impl (const OffsetIndices< int > faces, const Span< int > corner_verts, const GroupedSpan< int > vert_to_face, const BitSpan boundary_verts, const Set< OrderedEdge > &boundary_edges, const Span< bool > hide_poly, const Span< int > verts, const Span< float > factors, Vector< int > &r_offset_data, Vector< int > &r_data)
GroupedSpan< int > blender::ed::sculpt_paint::calc_vert_neighbors_interior (OffsetIndices< int > faces, Span< int > corner_verts, GroupedSpan< int > vert_to_face, BitSpan boundary_verts, const Set< OrderedEdge > &boundary_edges, Span< bool > hide_poly, Span< int > verts, Span< float > factors, Vector< int > &r_offset_data, Vector< int > &r_data)
GroupedSpan< int > blender::ed::sculpt_paint::calc_vert_neighbors_interior (OffsetIndices< int > faces, Span< int > corner_verts, GroupedSpan< int > vert_to_face, BitSpan boundary_verts, const Set< OrderedEdge > &boundary_edges, Span< bool > hide_poly, Span< int > verts, Vector< int > &r_offset_data, Vector< int > &r_data)
void blender::ed::sculpt_paint::calc_vert_neighbors_interior (OffsetIndices< int > faces, Span< int > corner_verts, BitSpan boundary_verts, const Set< OrderedEdge > &boundary_edges, const SubdivCCG &subdiv_ccg, Span< int > grids, MutableSpan< Vector< SubdivCCGCoord > > result)
void blender::ed::sculpt_paint::calc_vert_neighbors_interior (const Set< BMVert *, 0 > &verts, MutableSpan< Vector< BMVert * > > result)
void blender::ed::sculpt_paint::calc_translations_to_plane (Span< float3 > vert_positions, Span< int > verts, const float4 &plane, MutableSpan< float3 > translations)
void blender::ed::sculpt_paint::calc_translations_to_plane (Span< float3 > positions, const float4 &plane, MutableSpan< float3 > translations)
void blender::ed::sculpt_paint::filter_verts_outside_symmetry_area (Span< float3 > positions, const float3 &pivot, ePaintSymmetryFlags symm, MutableSpan< float > factors)
void blender::ed::sculpt_paint::filter_plane_trim_limit_factors (const Brush &brush, const StrokeCache &cache, Span< float3 > translations, MutableSpan< float > factors)
void blender::ed::sculpt_paint::filter_below_plane_factors (Span< float3 > vert_positions, Span< int > verts, const float4 &plane, MutableSpan< float > factors)
void blender::ed::sculpt_paint::filter_below_plane_factors (Span< float3 > positions, const float4 &plane, MutableSpan< float > factors)
void blender::ed::sculpt_paint::filter_above_plane_factors (Span< float3 > vert_positions, Span< int > verts, const float4 &plane, MutableSpan< float > factors)
void blender::ed::sculpt_paint::filter_above_plane_factors (Span< float3 > positions, const float4 &plane, MutableSpan< float > factors)
void blender::ed::sculpt_paint::mask_overlay_check (bContext &C, wmOperator &op)
void blender::ed::sculpt_paint::face_set_overlay_check (bContext &C, wmOperator &op)
Sculpt Brush Utilities
float blender::ed::sculpt_paint::object_space_radius_get (const ViewContext &vc, const Paint &paint, const Brush &brush, const float3 &location, const float scale_factor)
bool blender::ed::sculpt_paint::shape_key_check (const Object &ob, ReportList *reports)
void blender::ed::sculpt_paint::vert_random_access_ensure (Object &object)
int blender::ed::sculpt_paint::vertex_count_get (const Object &object)
Span< float3 > blender::ed::sculpt_paint::vert_positions_for_grab_active_get (const Depsgraph &depsgraph, const Object &object)
ePaintSymmetryFlags blender::ed::sculpt_paint::mesh_symmetry_xyz_get (const Object &object)
Span< BMVert * > blender::ed::sculpt_paint::vert_neighbors_get_bmesh (BMVert &vert, BMeshNeighborVerts &r_neighbors)
Span< BMVert * > blender::ed::sculpt_paint::vert_neighbors_get_interior_bmesh (BMVert &vert, BMeshNeighborVerts &r_neighbors)
Span< int > blender::ed::sculpt_paint::vert_neighbors_get_mesh (const OffsetIndices< int > faces, const Span< int > corner_verts, const GroupedSpan< int > vert_to_face, const Span< bool > hide_poly, const int vert, Vector< int > &r_neighbors)
void blender::ed::sculpt_paint::append_neighbors_to_vector (const OffsetIndices< int > faces, const Span< int > corner_verts, const GroupedSpan< int > vert_to_face, const Span< bool > hide_poly, const int vert, Vector< int > &r_data)
bool blender::ed::sculpt_paint::stroke_is_main_symmetry_pass (const StrokeCache &cache)
bool blender::ed::sculpt_paint::stroke_is_first_brush_step (const StrokeCache &cache)
bool blender::ed::sculpt_paint::stroke_is_first_brush_step_of_symmetry_pass (const StrokeCache &cache)
bool blender::ed::sculpt_paint::check_vertex_pivot_symmetry (const float vco[3], const float pco[3], const char symm)
static void blender::ed::sculpt_paint::sculpt_project_v3_normal_align (const StrokeCache &cache, const float normal_weight, float grab_delta[3])
float3 blender::ed::sculpt_paint::grab_delta_get (const Brush &brush, const StrokeCache &cache)
std::optional< int > blender::ed::sculpt_paint::nearest_vert_calc_mesh (const bke::pbvh::Tree &pbvh, const Span< float3 > vert_positions, const Span< bool > hide_vert, const float3 &location, const float max_distance, const bool use_original)
std::optional< SubdivCCGCoord > blender::ed::sculpt_paint::nearest_vert_calc_grids (const bke::pbvh::Tree &pbvh, const SubdivCCG &subdiv_ccg, const float3 &location, const float max_distance, const bool use_original)
std::optional< BMVert * > blender::ed::sculpt_paint::nearest_vert_calc_bmesh (const bke::pbvh::Tree &pbvh, const float3 &location, const float max_distance, const bool use_original)
bool blender::ed::sculpt_paint::is_vertex_inside_brush_radius_symm (const float vertex[3], const float br_co[3], float radius, char symm)
void blender::ed::sculpt_paint::tag_update_overlays (bContext *C)
static void blender::ed::sculpt_paint::dynamic_topology_update (const Depsgraph &depsgraph, const Scene &scene, const Brush &brush, Object &ob, PaintModeData *)
static bool blender::ed::sculpt_paint::brush_type_needs_all_pbvh_nodes (const Brush &brush)
static brushes::CursorSampleResult blender::ed::sculpt_paint::calc_brush_node_mask (const Depsgraph &depsgraph, const Sculpt &sd, Object &ob, const Brush &brush, IndexMaskMemory &memory)
static void blender::ed::sculpt_paint::push_undo_nodes (const Depsgraph &depsgraph, Object &ob, const Brush &brush, const IndexMask &node_mask)
static const char * blender::ed::sculpt_paint::sculpt_brush_type_name (const Brush &brush)
static void blender::ed::sculpt_paint::do_brush_action (const Depsgraph &depsgraph, const Scene &scene, const Brush &brush, Object &ob, PaintModeData *)
void blender::ed::sculpt_paint::cache_calc_brushdata_symm (StrokeCache &cache, const ePaintSymmetryFlags symm, const char axis, const float angle)
static void blender::ed::sculpt_paint::sculpt_fix_noise_tear (const Sculpt &sd, Object &ob)
bool blender::ed::sculpt_paint::sculpt_mode_poll (bContext *C)
bool blender::ed::sculpt_paint::sculpt_mode_poll_view3d (bContext *C)
bool blender::ed::sculpt_paint::sculpt_mode_and_brush_poll (bContext *C)
static bool blender::ed::sculpt_paint::is_brush_related_tool (bContext *C)
bool blender::ed::sculpt_paint::brush_cursor_poll (bContext *C)
Brush Capabilities

Avoid duplicate checks, internal logic only, share logic with #rna_def_sculpt_capabilities where possible.

static bool blender::ed::sculpt_paint::brush_type_needs_original (const char sculpt_brush_type)
static bool blender::ed::sculpt_paint::brush_uses_topology_rake (const SculptSession &ss, const Brush &brush)
static int blender::ed::sculpt_paint::sculpt_brush_needs_normal (const SculptSession &ss, const Brush &brush)
static bool blender::ed::sculpt_paint::brush_needs_rake_rotation (const Brush &brush)
Sculpt Paint Mesh
const float * blender::ed::sculpt_paint::brush_frontface_normal_from_falloff_shape (const SculptSession &ss, char falloff_shape)
Generic Brush Utilities
static float blender::ed::sculpt_paint::brush_flip (const Brush &brush, const StrokeCache &cache)
static float blender::ed::sculpt_paint::brush_strength (const Sculpt &sd, const StrokeCache &cache)
void blender::ed::sculpt_paint::apply_brush_texture (const PaintMode paint_mode, const SculptSession &ss, const Brush &brush, const float brush_point[3], const int thread_id, float *r_value, float4 &r_rgba)
void blender::ed::sculpt_paint::calc_vertex_displacement (const SculptSession &ss, const Brush &brush, float translation[3])
bool blender::ed::sculpt_paint::node_fully_masked_or_hidden (const bke::pbvh::Node &node)
bool blender::ed::sculpt_paint::node_in_sphere (const bke::pbvh::Node &node, const float3 &location, const float radius_sq, const bool original)
bool blender::ed::sculpt_paint::node_in_cylinder (const DistRayAABB_Precalc &ray_dist_precalc, const bke::pbvh::Node &node, const float radius_sq, const bool original)
bool blender::ed::sculpt_paint::node_in_box (const float4x4 &mat, const Bounds< float3 > &bounds, const float3 &brush_center, const float3 &brush_half_lengths, const bool test_z_axis)
bool blender::ed::sculpt_paint::node_in_box_positive_z (const float4x4 &mat, const Bounds< float3 > &bounds)
static IndexMask blender::ed::sculpt_paint::pbvh_gather_cursor_update (Object &ob, bool use_original, IndexMaskMemory &memory)
static IndexMask blender::ed::sculpt_paint::pbvh_gather_generic (Object &ob, const Brush &brush, const bool use_original, const float radius_scale, IndexMaskMemory &memory)
static IndexMask blender::ed::sculpt_paint::pbvh_gather_generic_cube (Object &ob, const Brush &brush, const float4x4 &brush_local_mat, const bool use_original, IndexMaskMemory &memory)
IndexMask blender::ed::sculpt_paint::gather_nodes (const bke::pbvh::Tree &pbvh, const eBrushFalloffShape falloff_shape, const bool use_original, const float3 &location, const float radius_sq, const std::optional< float3 > &ray_direction, IndexMaskMemory &memory)
static float3 blender::ed::sculpt_paint::calc_sculpt_normal (const Depsgraph &depsgraph, const Sculpt &sd, Object &ob, const IndexMask &node_mask)
static void blender::ed::sculpt_paint::update_sculpt_normal (const Depsgraph &depsgraph, const Sculpt &sd, Object &ob, const brushes::CursorSampleResult &cursor_sample_result)
static void blender::ed::sculpt_paint::calc_local_from_screen (const ViewContext &vc, const float center[3], const float screen_dir[2], float r_local_dir[3])
float3 blender::ed::sculpt_paint::calc_motion_normal_from_angle (const ViewContext &vc, const float3 &tip_location, const float angle)
void blender::ed::sculpt_paint::calc_brush_local_mat (const float3 &tip_normal, const float3 &motion_normal_local, const float3 &tip_location, const float radius, float local_mat[4][4], float local_mat_inv[4][4])
float3 blender::ed::sculpt_paint::tilt_apply_to_normal (const Object &object, const float4x4 &view_inverse, const float3 &normal, const float2 &tilt, const float tilt_strength)
float3 blender::ed::sculpt_paint::tilt_apply_to_normal (const float3 &normal, const StrokeCache &cache, const float tilt_strength)
float3 blender::ed::sculpt_paint::tilt_effective_normal_get (const SculptSession &ss, const Brush &brush)
static void blender::ed::sculpt_paint::update_brush_local_mat (const Sculpt &sd, Object &ob)
Generic Brush Plane & Symmetry Utilities
ePaintSymmetryAreas blender::ed::sculpt_paint::get_vertex_symm_area (const float co[3])
static void blender::ed::sculpt_paint::flip_qt_qt (float out[4], const float in[4], const ePaintSymmetryFlags symm)
static void blender::ed::sculpt_paint::flip_qt (float quat[4], const ePaintSymmetryFlags symm)
float3 blender::ed::sculpt_paint::flip_v3_by_symm_area (const float3 &vector, const ePaintSymmetryFlags symm, const ePaintSymmetryAreas symmarea, const float3 &pivot)
void blender::ed::sculpt_paint::flip_quat_by_symm_area (float quat[4], const ePaintSymmetryFlags symm, const ePaintSymmetryAreas symmarea, const float pivot[3])
void blender::ed::sculpt_paint::calc_brush_plane (const Depsgraph &depsgraph, const Brush &brush, Object &ob, const IndexMask &node_mask, float3 &r_area_no, float3 &r_area_co)
float blender::ed::sculpt_paint::brush_plane_offset_get (const Brush &brush, const SculptSession &ss)
Stroke Functions
void blender::ed::sculpt_paint::stroke_modifiers_check (Depsgraph &depsgraph, Object &ob, const Brush *brush)
float blender::ed::sculpt_paint::raycast_init (ViewContext *vc, const float2 &mval, float3 &r_ray_start, float3 &r_ray_end, float3 &r_ray_normal, bool original)
std::optional< ActiveElementInfo > blender::ed::sculpt_paint::active_element_info_get (ViewContext &vc, const float2 &mval)
std::optional< CursorGeometryInfo > blender::ed::sculpt_paint::cursor_geometry_info_update (bContext *C, const float2 &mval, const bool use_sampled_normal)
std::optional< CursorGeometryInfo > blender::ed::sculpt_paint::cursor_geometry_info_update (Depsgraph &depsgraph, const Paint &paint, const Sculpt *sd, ViewContext &vc, const Base *base, const float2 &mval, const bool use_sampled_normal)
std::optional< float3 > blender::ed::sculpt_paint::stroke_get_location_bvh (Depsgraph &depsgraph, ViewContext &vc, const Sculpt &sd, const Brush *brush, const float mval[2], const bool force_original)
std::optional< float3 > blender::ed::sculpt_paint::stroke_get_location_bvh (Depsgraph &depsgraph, ViewContext &vc, const Paint &paint, const Brush *brush, const float2 mval, const bool force_original)
std::optional< float3 > blender::ed::sculpt_paint::stroke_get_location_bvh (bContext *C, const float2 mval, const bool force_original)
Sculpt Update Functions
void blender::ed::sculpt_paint::flush_update_step (bContext *C, const UpdateType update_type)
void blender::ed::sculpt_paint::flush_update_step (ViewContext &vc, Object &object, const UpdateType update_type)
void blender::ed::sculpt_paint::flush_update_done (bContext *C, Object &ob, const UpdateType update_type)
void blender::ed::sculpt_paint::flush_update_done (ViewContext &vc, const wmWindowManager &wm, Object &ob, const UpdateType update_type)
Sculpt Poll Functions
bool blender::ed::sculpt_paint::color_supported_check (const Scene &scene, Object &object, ReportList *reports)
Sculpt mesh accessor API
Span< int > blender::ed::sculpt_paint::fake_neighbors_ensure (const Depsgraph &depsgraph, Object &ob, const float max_dist)
void blender::ed::sculpt_paint::fake_neighbors_free (Object &ob)
bool blender::ed::sculpt_paint::vertex_is_occluded (const Depsgraph &depsgraph, const Object &object, const float3 &position, bool original)
Brush Utilities.
float4x4 blender::ed::sculpt_paint::cube_tip_init (const Object &ob, const Brush &brush)

Variables

static CLG_LogRef blender::LOG = {"sculpt"}

Calculate Normal and Center

Calculate geometry surrounding the brush center. (optionally using original coordinates).

Functions are:

  • #calc_area_center
  • #calc_area_normal
  • #calc_area_normal_and_center
Note
These are all very similar, when changing one, check others.
enum class  blender::ed::sculpt_paint::AverageDataFlags : uint8_t { blender::ed::sculpt_paint::Position = 1 << 0 , blender::ed::sculpt_paint::Normal = 1 << 1 , blender::ed::sculpt_paint::All = Position | Normal }
static float blender::ed::sculpt_paint::area_normal_and_center_get_normal_radius (const SculptSession &ss, const Brush &brush)
static float blender::ed::sculpt_paint::area_normal_and_center_get_position_radius (const SculptSession &ss, const Brush &brush)
static float blender::ed::sculpt_paint::area_normal_calc_weight (const float distance, const float radius_inv)
static float3 blender::ed::sculpt_paint::area_center_calc_weighted (const float3 &test_location, const float distance, const float radius_inv, const float3 &co)
static void blender::ed::sculpt_paint::accumulate_area_center (const float3 &test_location, const float3 &position, const float distance, const float radius_inv, const int flip_index, AreaNormalCenterData &anctd)
static void blender::ed::sculpt_paint::accumulate_area_normal (const float3 &normal, const float distance, const float radius_inv, const int flip_index, AreaNormalCenterData &anctd)
 blender::ed::sculpt_paint::ENUM_OPERATORS (AverageDataFlags)
static void blender::ed::sculpt_paint::calc_area_normal_and_center_node_mesh (const Object &object, const Span< float3 > vert_positions, const Span< float3 > vert_normals, const Span< bool > hide_vert, const Brush &brush, const AverageDataFlags flag, const bke::pbvh::MeshNode &node, AreaNormalCenterData &anctd)
static void blender::ed::sculpt_paint::calc_area_normal_and_center_node_grids (const Object &object, const Brush &brush, const AverageDataFlags flag, const bke::pbvh::GridsNode &node, SampleLocalData &tls, AreaNormalCenterData &anctd)
static void blender::ed::sculpt_paint::calc_area_normal_and_center_node_bmesh (const Object &object, const Brush &brush, const AverageDataFlags flag, const bool has_bm_orco, const bke::pbvh::BMeshNode &node, SampleLocalData &tls, AreaNormalCenterData &anctd)
static AreaNormalCenterData blender::ed::sculpt_paint::calc_area_normal_and_center_reduce (const AreaNormalCenterData &a, const AreaNormalCenterData &b)
void blender::ed::sculpt_paint::calc_area_center (const Depsgraph &depsgraph, const Brush &brush, const Object &ob, const IndexMask &node_mask, float r_area_co[3])
std::optional< float3 > blender::ed::sculpt_paint::calc_area_normal (const Depsgraph &depsgraph, const Brush &brush, const Object &ob, const IndexMask &node_mask)
static void blender::ed::sculpt_paint::calc_stabilized_plane (const Brush &brush, StrokeCache &cache, const float3 &plane_normal, const float3 &plane_center, float3 &r_stabilized_normal, float3 &r_stabilized_center)
void blender::ed::sculpt_paint::calc_area_normal_and_center (const Depsgraph &depsgraph, const Brush &brush, const Object &ob, const IndexMask &node_mask, float r_area_no[3], float r_area_co[3])

Detailed Description

Implements the Sculpt Mode Brushes.

Definition in file sculpt.cc.