Blender V5.0
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.h"
#include "BLI_enumerable_thread_specific.hh"
#include "BLI_listbase.h"
#include "BLI_math_axis_angle.hh"
#include "BLI_math_geom.h"
#include "BLI_math_matrix.h"
#include "BLI_math_matrix.hh"
#include "BLI_math_rotation.h"
#include "BLI_rect.h"
#include "BLI_set.hh"
#include "BLI_span.hh"
#include "BLI_task.h"
#include "BLI_task.hh"
#include "BLI_utildefines.h"
#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_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 "BLI_math_rotation_legacy.hh"
#include "BLI_math_vector.hh"
#include "NOD_texture.h"
#include "DEG_depsgraph.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/brushes/brushes.hh"
#include "mesh_brush_common.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::NearestVertData

Namespaces

namespace  blender
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

Typedefs

using blender::ed::sculpt_paint::BrushActionFunc
using float3

Enumerations

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 }

Functions

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::report_if_shape_key_is_locked (const Object &ob, ReportList *reports)
void blender::ed::sculpt_paint::vert_random_access_ensure (Object &object)
int SCULPT_vertex_count_get (const Object &object)
Span< float3blender::ed::sculpt_paint::vert_positions_for_grab_active_get (const Depsgraph &depsgraph, const Object &object)
ePaintSymmetryFlags SCULPT_mesh_symmetry_xyz_get (const Object &object)
int blender::ed::sculpt_paint::face_set::active_face_set_get (const Object &object)
int blender::ed::sculpt_paint::face_set::vert_face_set_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_get (const int, const BMVert &)
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_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::vert_has_unique_face_set (const int, const BMVert &)
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::boundary::vert_is_boundary (const GroupedSpan< int > vert_to_face_map, const Span< bool > hide_poly, const BitSpan boundary, const int vert)
bool blender::ed::sculpt_paint::boundary::vert_is_boundary (const OffsetIndices< int > faces, const Span< int > corner_verts, const BitSpan boundary, const SubdivCCG &subdiv_ccg, const SubdivCCGCoord vert)
bool blender::ed::sculpt_paint::boundary::vert_is_boundary (BMVert *vert)
bool SCULPT_stroke_is_main_symmetry_pass (const blender::ed::sculpt_paint::StrokeCache &cache)
bool SCULPT_stroke_is_first_brush_step (const blender::ed::sculpt_paint::StrokeCache &cache)
bool SCULPT_stroke_is_first_brush_step_of_symmetry_pass (const blender::ed::sculpt_paint::StrokeCache &cache)
bool SCULPT_check_vertex_pivot_symmetry (const float vco[3], const float pco[3], const char symm)
void sculpt_project_v3_normal_align (const SculptSession &ss, const float normal_weight, float grab_delta[3])
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< SubdivCCGCoordblender::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 SCULPT_is_vertex_inside_brush_radius_symm (const float vertex[3], const float br_co[3], float radius, char symm)
void SCULPT_tag_update_overlays (bContext *C)
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)
const floatSCULPT_brush_frontface_normal_from_falloff_shape (const SculptSession &ss, char falloff_shape)
static float calc_overlap (const blender::ed::sculpt_paint::StrokeCache &cache, const ePaintSymmetryFlags symm, const char axis, const float angle)
static float calc_radial_symmetry_feather (const Mesh &mesh, const blender::ed::sculpt_paint::StrokeCache &cache, const ePaintSymmetryFlags symm, const char axis)
static float calc_symmetry_feather (const Sculpt &sd, const Mesh &mesh, const blender::ed::sculpt_paint::StrokeCache &cache)
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, AverageDataFlags::Normal)
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, SampleLocalData &tls, 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< float3blender::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])
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)
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)
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 IndexMask blender::ed::sculpt_paint::pbvh_gather_texpaint (Object &ob, const Brush &brush, const bool use_original, const float radius_scale, 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])
static void blender::ed::sculpt_paint::calc_brush_local_mat (const float rotation, const Object &ob, 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)
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)
static void blender::ed::sculpt_paint::dynamic_topology_update (const Depsgraph &depsgraph, const Scene &, Sculpt &sd, Object &ob, const Brush &brush, PaintModeSettings &)
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, 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 void blender::ed::sculpt_paint::do_brush_action (const Depsgraph &depsgraph, const Scene &, Sculpt &sd, Object &ob, const Brush &brush, PaintModeSettings &paint_mode_settings)
static void blender::ed::sculpt_paint::do_tiled (const Depsgraph &depsgraph, const Scene &scene, Sculpt &sd, Object &ob, const Brush &brush, PaintModeSettings &paint_mode_settings, const BrushActionFunc action)
static void blender::ed::sculpt_paint::do_radial_symmetry (const Depsgraph &depsgraph, const Scene &scene, Sculpt &sd, Object &ob, const Brush &brush, PaintModeSettings &paint_mode_settings, const BrushActionFunc action, const ePaintSymmetryFlags symm, const int axis, const float)
static void blender::ed::sculpt_paint::sculpt_fix_noise_tear (const Sculpt &sd, Object &ob)
static void blender::ed::sculpt_paint::do_symmetrical_brush_actions (const Depsgraph &depsgraph, const Scene &scene, Sculpt &sd, Object &ob, const BrushActionFunc action, PaintModeSettings &paint_mode_settings)
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 (const bContext *C, Paint *paint, StrokeCache *cache)
static void blender::ed::sculpt_paint::smooth_brush_toggle_off (Paint *paint, StrokeCache *cache)
static void blender::ed::sculpt_paint::sculpt_update_cache_invariants (bContext *C, Sculpt &sd, SculptSession &ss, const wmOperator &op, const float mval[2])
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_invariants_update (StrokeCache &cache, const Brush &brush)
static void blender::ed::sculpt_paint::sculpt_update_cache_variants (bContext *C, Sculpt &sd, Object &ob, PointerRNA *ptr)
static bool blender::ed::sculpt_paint::sculpt_needs_connectivity_info (const Sculpt &sd, const Brush &brush, const Object &object, int stroke_mode)
static void blender::ed::sculpt_paint::sculpt_raycast_cb (bke::pbvh::Node &node, RaycastData &rd, float *tmin)
static void blender::ed::sculpt_paint::sculpt_find_nearest_to_ray_cb (bke::pbvh::Node &node, FindNearestToRayData &fntrd, float *tmin)
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)
bool blender::ed::sculpt_paint::cursor_geometry_info_update (bContext *C, CursorGeometryInfo *out, const float2 &mval, const bool use_sampled_normal)
static bool blender::ed::sculpt_paint::stroke_get_location_bvh_ex (bContext *C, float3 &out, const float2 &mval, const bool force_original, const bool check_closest, const bool limit_closest_radius)
bool blender::ed::sculpt_paint::stroke_get_location_bvh (bContext *C, float out[3], const float mval[2], const bool force_original)
static void blender::ed::sculpt_paint::tag_mesh_positions_changed (Object &object, const bool use_pbvh_draw)
void blender::ed::sculpt_paint::flush_update_step (const bContext *C, const UpdateType update_type)
void blender::ed::sculpt_paint::flush_update_done (const bContext *C, Object &ob, const UpdateType update_type)
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 ImplicitSharingInfoblender::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)
bool blender::ed::sculpt_paint::color_supported_check (const Scene &scene, Object &object, ReportList *reports)
static bool blender::ed::sculpt_paint::stroke_test_start (bContext *C, wmOperator *op, const float mval[2])
static void blender::ed::sculpt_paint::stroke_update_step (bContext *C, wmOperator *, PaintStroke *stroke, PointerRNA *itemptr)
static void blender::ed::sculpt_paint::brush_exit_tex (Sculpt &sd)
static void blender::ed::sculpt_paint::stroke_done (const bContext *C, PaintStroke *)
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)
void blender::ed::sculpt_paint::boundary::ensure_boundary_info (Object &object)
bool blender::ed::sculpt_paint::vertex_is_occluded (const Depsgraph &depsgraph, const Object &object, const float3 &position, bool original)
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_mesh (Span< T > src, Span< int > indices, MutableSpan< T > dst)
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_mesh (Span< T > src, Span< int > indices, MutableSpan< T > dst)
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_mesh< bool > (Span< bool >, Span< int >, MutableSpan< bool >)
template void blender::ed::sculpt_paint::gather_data_mesh< int > (Span< int >, Span< int >, MutableSpan< int >)
template void blender::ed::sculpt_paint::gather_data_mesh< float > (Span< float >, Span< int >, MutableSpan< float >)
template void blender::ed::sculpt_paint::gather_data_mesh< float3 > (Span< float3 >, Span< int >, MutableSpan< float3 >)
template void blender::ed::sculpt_paint::gather_data_mesh< float4 > (Span< float4 >, Span< int >, MutableSpan< float4 >)
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_mesh< bool > (Span< bool >, Span< int >, MutableSpan< bool >)
template void blender::ed::sculpt_paint::scatter_data_mesh< int > (Span< int >, Span< int >, MutableSpan< int >)
template void blender::ed::sculpt_paint::scatter_data_mesh< float > (Span< float >, Span< int >, MutableSpan< float >)
template void blender::ed::sculpt_paint::scatter_data_mesh< float3 > (Span< float3 >, Span< int >, MutableSpan< float3 >)
template void blender::ed::sculpt_paint::scatter_data_mesh< float4 > (Span< float4 >, Span< int >, MutableSpan< float4 >)
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_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, Vector< float > &r_factors, Vector< float > &r_distances)
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, Vector< float > &r_factors, Vector< float > &r_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_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_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, Vector< float > &r_factors, Vector< 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 (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 (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::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 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, 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, 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 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)
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)
Generic Brush Utilities
static float brush_flip (const Brush &brush, const blender::ed::sculpt_paint::StrokeCache &cache)
static float brush_strength (const Sculpt &sd, const blender::ed::sculpt_paint::StrokeCache &cache, const float feather, const PaintModeSettings &)
void sculpt_apply_texture (const SculptSession &ss, const Brush &brush, const float brush_point[3], const int thread_id, float *r_value, float r_rgba[4])
void SCULPT_calc_vertex_displacement (const SculptSession &ss, const Brush &brush, float translation[3])
static void update_brush_local_mat (const Sculpt &sd, Object &ob)
Texture painting
static bool sculpt_needs_pbvh_pixels (PaintModeSettings &paint_mode_settings, const Brush &brush, Object &ob)
static void sculpt_pbvh_update_pixels (const Depsgraph &depsgraph, PaintModeSettings &paint_mode_settings, Object &ob)
Generic Brush Plane & Symmetry Utilities
ePaintSymmetryAreas SCULPT_get_vertex_symm_area (const float co[3])
static void flip_qt_qt (float out[4], const float in[4], const ePaintSymmetryFlags symm)
static void flip_qt (float quat[4], const ePaintSymmetryFlags symm)
float3 SCULPT_flip_v3_by_symm_area (const float3 &vector, const ePaintSymmetryFlags symm, const ePaintSymmetryAreas symmarea, const float3 &pivot)
void SCULPT_flip_quat_by_symm_area (float quat[4], const ePaintSymmetryFlags symm, const ePaintSymmetryAreas symmarea, const float pivot[3])

Variables

static CLG_LogRef LOG = {"sculpt"}

Sculpt Brush Utilities

enum class  StrokeFlags : uint8_t { ClipX = 1 , ClipY = 2 , ClipZ = 4 }
void SCULPT_cache_calc_brushdata_symm (blender::ed::sculpt_paint::StrokeCache &cache, const ePaintSymmetryFlags symm, const char axis, const float angle)
bool SCULPT_mode_poll (bContext *C)
bool SCULPT_mode_poll_view3d (bContext *C)
bool SCULPT_poll (bContext *C)
static bool is_brush_related_tool (bContext *C)
bool SCULPT_brush_cursor_poll (bContext *C)
static const char * sculpt_brush_type_name (const Sculpt &sd)
void SCULPT_stroke_modifiers_check (const bContext *C, Object &ob, const Brush &brush)
static void brush_init_tex (const Sculpt &sd, SculptSession &ss)
static void brush_stroke_init (bContext *C)
static void restore_from_undo_step_if_necessary (const Depsgraph &depsgraph, const Sculpt &sd, Object &ob)
static bool over_mesh (bContext *C, wmOperator *, const float mval[2])
static void stroke_undo_begin (const bContext *C, wmOperator *op)
static void stroke_undo_end (const bContext *C, Brush *brush)
Span< int > SCULPT_fake_neighbors_ensure (const Depsgraph &depsgraph, Object &ob, const float max_dist)
void SCULPT_fake_neighbors_free (Object &ob)
void SCULPT_cube_tip_init (const Sculpt &, const Object &ob, const Brush &brush, float mat[4][4])

Detailed Description

Implements the Sculpt Mode Brushes.

Definition in file sculpt.cc.

Typedef Documentation

◆ float3

Definition at line 619 of file BLI_math_vector_types.hh.

Enumeration Type Documentation

◆ StrokeFlags

enum class StrokeFlags : uint8_t
strong
Enumerator
ClipX 
ClipY 
ClipZ 

Definition at line 3823 of file sculpt.cc.

Function Documentation

◆ brush_flip()

float brush_flip ( const Brush & brush,
const blender::ed::sculpt_paint::StrokeCache & cache )
static

Calculates the sign of the direction of the brush stroke, typically indicates whether the stroke will deform a surface inwards or outwards along the brush normal.

Definition at line 2161 of file sculpt.cc.

References BRUSH_DIR_IN, Brush::flag, blender::ed::sculpt_paint::StrokeCache::invert, invert(), and blender::ed::sculpt_paint::StrokeCache::pen_flip.

Referenced by brush_strength(), and blender::ed::sculpt_paint::sculpt_update_cache_invariants().

◆ brush_init_tex()

◆ brush_strength()

float brush_strength ( const Sculpt & sd,
const blender::ed::sculpt_paint::StrokeCache & cache,
const float feather,
const PaintModeSettings &  )
static

Return modified brush strength. Includes the direction of the brush, positive values pull vertices, negative values push. Uses tablet pressure and a special multiplier found experimentally to scale the strength factor.

Definition at line 2175 of file sculpt.cc.

References BKE_brush_alpha_get(), BKE_brush_use_alpha_pressure(), BKE_curvemapping_evaluateF(), BKE_paint_brush_for_read(), BLI_assert_unreachable, BRUSH_CLOTH_DEFORM_EXPAND, BRUSH_CLOTH_DEFORM_GRAB, BRUSH_CLOTH_DEFORM_SNAKE_HOOK, brush_flip(), BRUSH_MASK_DRAW, BRUSH_MASK_SMOOTH, BRUSH_PLANE_SWAP_HEIGHT_AND_DEPTH, Brush::cloth_deform_type, Brush::curve_strength, Brush::mask_tool, blender::bke::PaintRuntime::overlap_factor, Sculpt::paint, Brush::plane_inversion_mode, pow4f(), powf, blender::ed::sculpt_paint::StrokeCache::pressure, Paint::runtime, Brush::sculpt_brush_type, SCULPT_BRUSH_TYPE_BLOB, SCULPT_BRUSH_TYPE_BOUNDARY, SCULPT_BRUSH_TYPE_CLAY, SCULPT_BRUSH_TYPE_CLAY_STRIPS, SCULPT_BRUSH_TYPE_CLAY_THUMB, SCULPT_BRUSH_TYPE_CLOTH, SCULPT_BRUSH_TYPE_CREASE, SCULPT_BRUSH_TYPE_DISPLACEMENT_ERASER, SCULPT_BRUSH_TYPE_DISPLACEMENT_SMEAR, SCULPT_BRUSH_TYPE_DRAW, SCULPT_BRUSH_TYPE_DRAW_FACE_SETS, SCULPT_BRUSH_TYPE_DRAW_SHARP, SCULPT_BRUSH_TYPE_ELASTIC_DEFORM, SCULPT_BRUSH_TYPE_GRAB, SCULPT_BRUSH_TYPE_INFLATE, SCULPT_BRUSH_TYPE_LAYER, SCULPT_BRUSH_TYPE_MASK, SCULPT_BRUSH_TYPE_MULTIPLANE_SCRAPE, SCULPT_BRUSH_TYPE_NUDGE, SCULPT_BRUSH_TYPE_PAINT, SCULPT_BRUSH_TYPE_PINCH, SCULPT_BRUSH_TYPE_PLANE, SCULPT_BRUSH_TYPE_POSE, SCULPT_BRUSH_TYPE_ROTATE, SCULPT_BRUSH_TYPE_SIMPLIFY, SCULPT_BRUSH_TYPE_SLIDE_RELAX, SCULPT_BRUSH_TYPE_SMEAR, SCULPT_BRUSH_TYPE_SMOOTH, SCULPT_BRUSH_TYPE_SNAKE_HOOK, and SCULPT_BRUSH_TYPE_THUMB.

Referenced by blender::ed::sculpt_paint::brushes::do_smooth_brush(), blender::ed::sculpt_paint::brushes::do_smooth_mask_brush(), blender::ed::sculpt_paint::do_symmetrical_brush_actions(), do_vpaint_brush_blur_loops(), do_vpaint_brush_blur_verts(), do_vpaint_brush_smear(), do_wpaint_brush_blur(), do_wpaint_brush_draw(), do_wpaint_brush_smear(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::soft_eraser(), blender::ed::sculpt_paint::vwpaint::test_brush_angle_falloff(), vpaint_blend_stroke(), and vpaint_do_draw().

◆ brush_stroke_init()

◆ calc_overlap()

◆ calc_radial_symmetry_feather()

float calc_radial_symmetry_feather ( const Mesh & mesh,
const blender::ed::sculpt_paint::StrokeCache & cache,
const ePaintSymmetryFlags symm,
const char axis )
static

Definition at line 1214 of file sculpt.cc.

References angle(), calc_overlap(), i, and M_PI.

Referenced by calc_symmetry_feather().

◆ calc_symmetry_feather()

◆ flip_qt()

void flip_qt ( float quat[4],
const ePaintSymmetryFlags symm )
static

Definition at line 2863 of file sculpt.cc.

References flip_qt_qt().

Referenced by SCULPT_flip_quat_by_symm_area().

◆ flip_qt_qt()

void flip_qt_qt ( float out[4],
const float in[4],
const ePaintSymmetryFlags symm )
static

◆ is_brush_related_tool()

bool is_brush_related_tool ( bContext * C)
static

While most non-brush tools in sculpt mode do not use the brush cursor, the trim tools and the filter tools are expected to have the cursor visible so that some functionality is easier to visually estimate.

See: #122856

Definition at line 3702 of file sculpt.cc.

References BKE_paint_brush(), BKE_paint_get_active_from_context(), C, CTX_data_active_object(), CTX_wm_area(), CTX_wm_region(), ELEM, bToolRef_Runtime::keymap, ot, ARegion::regiontype, RGN_TYPE_WINDOW, bToolRef::runtime, ScrArea::runtime, SPACE_IMAGE, SPACE_VIEW3D, ScrArea::spacetype, ScrArea_Runtime::tool, and WM_operatortype_find().

Referenced by SCULPT_brush_cursor_poll().

◆ over_mesh()

◆ restore_from_undo_step_if_necessary()

◆ sculpt_apply_texture()

◆ SCULPT_brush_cursor_poll()

bool SCULPT_brush_cursor_poll ( bContext * C)

Determines whether or not the brush cursor should be shown in the viewport

Definition at line 3734 of file sculpt.cc.

References C, is_brush_related_tool(), blender::ed::sculpt_paint::paint_brush_cursor_poll(), and SCULPT_mode_poll().

Referenced by blender::ed::sculpt_paint::object_sculpt_mode_enter().

◆ SCULPT_brush_frontface_normal_from_falloff_shape()

◆ sculpt_brush_type_name()

◆ SCULPT_cache_calc_brushdata_symm()

void SCULPT_cache_calc_brushdata_symm ( blender::ed::sculpt_paint::StrokeCache & cache,
ePaintSymmetryFlags symm,
char axis,
float angle )

Flip all the edit-data across the axis/axes specified by symm. Used to calculate multiple modifications to the mesh when symmetry is enabled.

Definition at line 3465 of file sculpt.cc.

References angle(), flip_qt_qt(), frac(), blender::ed::sculpt_paint::StrokeCache::grab_delta, blender::ed::sculpt_paint::StrokeCache::grab_delta_symm, blender::ed::sculpt_paint::StrokeCache::gravity_direction, blender::ed::sculpt_paint::StrokeCache::gravity_direction_symm, blender::MatBase< float, 4, 4 >::identity(), blender::ed::sculpt_paint::StrokeCache::initial_location, blender::ed::sculpt_paint::StrokeCache::initial_location_symm, blender::ed::sculpt_paint::StrokeCache::initial_normal, blender::ed::sculpt_paint::StrokeCache::initial_normal_symm, blender::ed::sculpt_paint::StrokeCache::last_location, blender::ed::sculpt_paint::StrokeCache::last_location_symm, blender::ed::sculpt_paint::StrokeCache::location, blender::ed::sculpt_paint::StrokeCache::location_symm, mul_m4_v3(), mul_v3_fl(), PAINT_SYMMETRY_FEATHER, blender::ed::sculpt_paint::StrokeCache::plane_offset, printf, blender::MatBase< T, NumCol, NumRow, Alignment >::ptr(), blender::ed::sculpt_paint::StrokeCache::rake_rotation, blender::ed::sculpt_paint::StrokeCache::rake_rotation_symm, rotate_m4(), blender::ed::sculpt_paint::StrokeCache::supports_gravity, blender::ed::sculpt_paint::StrokeCache::symm_rot_mat, blender::ed::sculpt_paint::StrokeCache::symm_rot_mat_inv, blender::ed::sculpt_paint::symmetry_flip(), blender::ed::sculpt_paint::StrokeCache::view_normal, blender::ed::sculpt_paint::StrokeCache::view_normal_symm, and zero_v3().

Referenced by blender::ed::sculpt_paint::do_radial_symmetry(), blender::ed::sculpt_paint::do_symmetrical_brush_actions(), vpaint_do_paint(), vpaint_do_symmetrical_brush_actions(), wpaint_do_paint(), and wpaint_do_symmetrical_brush_actions().

◆ SCULPT_calc_vertex_displacement()

◆ SCULPT_check_vertex_pivot_symmetry()

◆ SCULPT_cube_tip_init()

◆ SCULPT_fake_neighbors_ensure()

Span< int > SCULPT_fake_neighbors_ensure ( const Depsgraph & depsgraph,
Object & ob,
float max_dist )

This allows the sculpt brushes to work on meshes with multiple connected components as if they had only one connected component. These neighbors are calculated for each vertex using the minimum distance to a vertex that is in a different connected component.

Definition at line 6098 of file sculpt.cc.

References SculptFakeNeighbors::current_max_distance, depsgraph, blender::ed::sculpt_paint::islands::ensure_cache(), SculptFakeNeighbors::fake_neighbor_index, blender::ed::sculpt_paint::fake_neighbor_init(), blender::ed::sculpt_paint::fake_neighbor_search(), SculptSession::fake_neighbors, Array< T, InlineBufferCapacity, Allocator >::is_empty(), and Object::sculpt.

Referenced by blender::ed::sculpt_paint::pose::ik_chain_init().

◆ SCULPT_fake_neighbors_free()

◆ SCULPT_flip_quat_by_symm_area()

void SCULPT_flip_quat_by_symm_area ( float quat[4],
const ePaintSymmetryFlags symm,
const ePaintSymmetryAreas symmarea,
const float pivot[3] )

◆ SCULPT_flip_v3_by_symm_area()

◆ SCULPT_get_vertex_symm_area()

◆ SCULPT_is_vertex_inside_brush_radius_symm()

bool SCULPT_is_vertex_inside_brush_radius_symm ( const float vertex[3],
const float br_co[3],
float radius,
char symm )

◆ SCULPT_mesh_symmetry_xyz_get()

ePaintSymmetryFlags SCULPT_mesh_symmetry_xyz_get ( const Object & object)

Definition at line 184 of file sculpt.cc.

References Mesh::symmetry.

Referenced by blender::ed::sculpt_paint::boundary::calc_bend_bmesh(), blender::ed::sculpt_paint::boundary::calc_bend_grids(), blender::ed::sculpt_paint::boundary::calc_bend_mesh(), blender::ed::sculpt_paint::boundary::calc_grab_bmesh(), blender::ed::sculpt_paint::boundary::calc_grab_grids(), blender::ed::sculpt_paint::boundary::calc_grab_mesh(), blender::ed::sculpt_paint::boundary::calc_inflate_bmesh(), blender::ed::sculpt_paint::boundary::calc_inflate_grids(), blender::ed::sculpt_paint::boundary::calc_inflate_mesh(), blender::ed::sculpt_paint::pose::calc_pose_origin_and_factor_bmesh(), blender::ed::sculpt_paint::pose::calc_pose_origin_and_factor_grids(), blender::ed::sculpt_paint::pose::calc_pose_origin_and_factor_mesh(), blender::ed::sculpt_paint::boundary::calc_slide_bmesh(), blender::ed::sculpt_paint::boundary::calc_slide_grids(), blender::ed::sculpt_paint::boundary::calc_slide_mesh(), blender::ed::sculpt_paint::boundary::calc_smooth_bmesh(), blender::ed::sculpt_paint::boundary::calc_smooth_grids(), blender::ed::sculpt_paint::boundary::calc_smooth_mesh(), blender::ed::sculpt_paint::boundary::calc_twist_bmesh(), blender::ed::sculpt_paint::boundary::calc_twist_grids(), blender::ed::sculpt_paint::boundary::calc_twist_mesh(), blender::ed::sculpt_paint::cursor_draw_point_with_symmetry(), blender::ed::sculpt_paint::pose::do_pose_brush(), blender::ed::sculpt_paint::do_symmetrical_brush_actions(), blender::ed::sculpt_paint::auto_mask::fill_topology_automasking_factors_bmesh(), blender::ed::sculpt_paint::auto_mask::fill_topology_automasking_factors_grids(), blender::ed::sculpt_paint::auto_mask::fill_topology_automasking_factors_mesh(), blender::ed::sculpt_paint::expand::find_active_connected_components_from_vert(), blender::ed::sculpt_paint::find_symm_verts_bmesh(), blender::ed::sculpt_paint::find_symm_verts_grids(), blender::ed::sculpt_paint::find_symm_verts_mesh(), blender::ed::sculpt_paint::pose::grow_pose_factor(), blender::ed::sculpt_paint::pose::ik_chain_init_face_sets_bmesh(), blender::ed::sculpt_paint::pose::ik_chain_init_face_sets_grids(), blender::ed::sculpt_paint::pose::ik_chain_init_face_sets_mesh(), blender::ed::sculpt_paint::gesture::init_common(), blender::ed::sculpt_paint::expand::reposition_pivot(), blender::ed::sculpt_paint::sculpt_transform_all_vertices(), blender::ed::sculpt_paint::set_pivot_position_exec(), blender::ed::sculpt_paint::transform_node_bmesh(), blender::ed::sculpt_paint::transform_node_grids(), blender::ed::sculpt_paint::transform_node_mesh(), blender::ed::sculpt_paint::transform_radius_elastic(), vpaint_do_symmetrical_brush_actions(), and wpaint_do_symmetrical_brush_actions().

◆ SCULPT_mode_poll()

bool SCULPT_mode_poll ( bContext * C)

Definition at line 3677 of file sculpt.cc.

References C, CTX_data_active_object(), Object::mode, and OB_MODE_SCULPT.

Referenced by ED_keymap_paint(), blender::ed::sculpt_paint::no_multires_poll(), blender::ed::sculpt_paint::mask::PAINT_OT_mask_flood_fill(), blender::ed::sculpt_paint::dyntopo::sculpt_and_constant_or_manual_detail_poll(), blender::ed::sculpt_paint::dyntopo::sculpt_and_dynamic_topology_poll(), SCULPT_brush_cursor_poll(), SCULPT_mode_poll_view3d(), blender::ed::sculpt_paint::cloth::SCULPT_OT_cloth_filter(), blender::ed::sculpt_paint::color::SCULPT_OT_color_filter(), blender::ed::sculpt_paint::dyntopo::SCULPT_OT_dynamic_topology_toggle(), blender::ed::sculpt_paint::expand::SCULPT_OT_expand(), blender::ed::sculpt_paint::face_set::SCULPT_OT_face_set_change_visibility(), blender::ed::sculpt_paint::face_set::SCULPT_OT_face_sets_create(), blender::ed::sculpt_paint::face_set::SCULPT_OT_face_sets_edit(), blender::ed::sculpt_paint::face_set::SCULPT_OT_face_sets_init(), blender::ed::sculpt_paint::face_set::SCULPT_OT_face_sets_randomize_colors(), blender::ed::sculpt_paint::mask::SCULPT_OT_mask_by_color(), blender::ed::sculpt_paint::mask::SCULPT_OT_mask_filter(), blender::ed::sculpt_paint::mask::SCULPT_OT_mask_from_boundary(), blender::ed::sculpt_paint::mask::SCULPT_OT_mask_from_cavity(), blender::ed::sculpt_paint::mask::SCULPT_OT_mask_init(), blender::ed::sculpt_paint::filter::SCULPT_OT_mesh_filter(), blender::ed::sculpt_paint::SCULPT_OT_optimize(), blender::ed::sculpt_paint::SCULPT_OT_sample_color(), blender::ed::sculpt_paint::dyntopo::SCULPT_OT_sample_detail_size(), blender::ed::sculpt_paint::SCULPT_OT_set_persistent_base(), blender::ed::sculpt_paint::SCULPT_OT_set_pivot_position(), and SCULPT_poll().

◆ SCULPT_mode_poll_view3d()

bool SCULPT_mode_poll_view3d ( bContext * C)

Definition at line 3683 of file sculpt.cc.

References C, CTX_wm_region_view3d(), and SCULPT_mode_poll().

Referenced by blender::ed::sculpt_paint::hide::PAINT_OT_hide_show(), blender::ed::sculpt_paint::hide::PAINT_OT_hide_show_all(), blender::ed::sculpt_paint::hide::PAINT_OT_hide_show_lasso_gesture(), blender::ed::sculpt_paint::hide::PAINT_OT_hide_show_line_gesture(), blender::ed::sculpt_paint::hide::PAINT_OT_hide_show_masked(), blender::ed::sculpt_paint::hide::PAINT_OT_hide_show_polyline_gesture(), blender::ed::sculpt_paint::mask::PAINT_OT_mask_box_gesture(), blender::ed::sculpt_paint::mask::PAINT_OT_mask_lasso_gesture(), blender::ed::sculpt_paint::mask::PAINT_OT_mask_line_gesture(), blender::ed::sculpt_paint::mask::PAINT_OT_mask_polyline_gesture(), blender::ed::sculpt_paint::hide::PAINT_OT_visibility_filter(), blender::ed::sculpt_paint::hide::PAINT_OT_visibility_invert(), blender::ed::sculpt_paint::face_set::SCULPT_OT_face_set_box_gesture(), blender::ed::sculpt_paint::face_set::SCULPT_OT_face_set_lasso_gesture(), blender::ed::sculpt_paint::face_set::SCULPT_OT_face_set_line_gesture(), blender::ed::sculpt_paint::face_set::SCULPT_OT_face_set_polyline_gesture(), blender::ed::sculpt_paint::project::SCULPT_OT_project_line_gesture(), blender::ed::sculpt_paint::trim::SCULPT_OT_trim_box_gesture(), blender::ed::sculpt_paint::trim::SCULPT_OT_trim_lasso_gesture(), blender::ed::sculpt_paint::trim::SCULPT_OT_trim_line_gesture(), and blender::ed::sculpt_paint::trim::SCULPT_OT_trim_polyline_gesture().

◆ sculpt_needs_pbvh_pixels()

bool sculpt_needs_pbvh_pixels ( PaintModeSettings & paint_mode_settings,
const Brush & brush,
Object & ob )
static

◆ sculpt_pbvh_update_pixels()

void sculpt_pbvh_update_pixels ( const Depsgraph & depsgraph,
PaintModeSettings & paint_mode_settings,
Object & ob )
static

◆ SCULPT_poll()

bool SCULPT_poll ( bContext * C)

Checks for a brush, not just sculpt mode.

Definition at line 3689 of file sculpt.cc.

References C, blender::ed::sculpt_paint::paint_brush_tool_poll(), and SCULPT_mode_poll().

Referenced by blender::ed::sculpt_paint::SCULPT_OT_brush_stroke().

◆ sculpt_project_v3_normal_align()

void sculpt_project_v3_normal_align ( const SculptSession & ss,
float normal_weight,
float grab_delta[3] )

◆ SCULPT_stroke_is_first_brush_step()

bool SCULPT_stroke_is_first_brush_step ( const blender::ed::sculpt_paint::StrokeCache & cache)

Return true only once per stroke on the first symmetry pass, regardless of the symmetry passes enabled.

This should be used for functionality that needs to be computed once per stroke of a particular tool (allocating memory, updating random seeds...).

Definition at line 536 of file sculpt.cc.

References blender::ed::sculpt_paint::StrokeCache::first_time, blender::ed::sculpt_paint::StrokeCache::mirror_symmetry_pass, blender::ed::sculpt_paint::StrokeCache::radial_symmetry_pass, and blender::ed::sculpt_paint::StrokeCache::tile_pass.

Referenced by blender::ed::sculpt_paint::brushes::do_surface_smooth_brush().

◆ SCULPT_stroke_is_first_brush_step_of_symmetry_pass()

◆ SCULPT_stroke_is_main_symmetry_pass()

bool SCULPT_stroke_is_main_symmetry_pass ( const blender::ed::sculpt_paint::StrokeCache & cache)

◆ SCULPT_stroke_modifiers_check()

◆ SCULPT_tag_update_overlays()

◆ SCULPT_vertex_count_get()

int SCULPT_vertex_count_get ( const Object & object)

Definition at line 151 of file sculpt.cc.

References BKE_pbvh_get_grid_num_verts(), BLI_assert, SculptSession::bm, BM_mesh_elem_count(), BM_VERT, blender::bke::pbvh::BMesh, blender::bke::pbvh::Grids, blender::bke::pbvh::Mesh, OB_MESH, and blender::bke::object::pbvh_get().

Referenced by blender::ed::sculpt_paint::expand::boundary_from_enabled(), blender::ed::sculpt_paint::expand::boundary_topology_falloff_create(), blender::ed::sculpt_paint::cloth::brush_simulation_create(), blender::ed::sculpt_paint::auto_mask::cache_init(), blender::ed::sculpt_paint::expand::calc_topology_falloff_from_verts(), blender::ed::sculpt_paint::cloth::cloth_brush_satisfy_constraints(), blender::ed::sculpt_paint::expand::diagonals_falloff_create(), blender::ed::sculpt_paint::brushes::do_enhance_details_brush(), blender::ed::sculpt_paint::brushes::do_layer_brush(), blender::ed::sculpt_paint::brushes::do_surface_smooth_brush(), blender::ed::sculpt_paint::expand::enabled_state_to_bitmap(), blender::ed::sculpt_paint::fake_neighbor_init(), blender::ed::sculpt_paint::pose::grow_pose_factor(), blender::ed::sculpt_paint::pose::ik_chain_init_topology(), blender::ed::sculpt_paint::expand::init_from_face_set_boundary(), blender::ed::sculpt_paint::filter::mesh_filter_sharpen_init(), blender::ed::sculpt_paint::filter::mesh_filter_surface_smooth_init(), blender::ed::sculpt_paint::auto_mask::normal_occlusion_automasking_fill(), blender::ed::sculpt_paint::expand::normals_falloff_create(), blender::ed::sculpt_paint::expand::original_state_store(), blender::ed::sculpt_paint::expand::sculpt_expand_invoke(), blender::ed::sculpt_paint::expand::sculpt_expand_modal(), blender::ed::sculpt_paint::filter::sculpt_filter_specific_init(), blender::ed::sculpt_paint::mask::sculpt_mask_filter_exec(), blender::ed::sculpt_paint::expand::spherical_falloff_create(), blender::ed::sculpt_paint::expand::topology_falloff_create(), blender::ed::sculpt_paint::expand::topology_from_state_boundary(), blender::ed::sculpt_paint::expand::update_max_vert_falloff_value(), and blender::ed::sculpt_paint::hide::visibility_filter_exec().

◆ stroke_undo_begin()

◆ stroke_undo_end()

◆ update_brush_local_mat()

Variable Documentation

◆ LOG

CLG_LogRef LOG = {"sculpt"}
static

Definition at line 109 of file sculpt.cc.