Blender V5.3
sculpt_intern.hh File Reference
#include <optional>
#include "BKE_brush.hh"
#include "BKE_bvhutils.hh"
#include "BKE_image_wrappers.hh"
#include "BKE_paint.hh"
#include "BKE_paint_bvh.hh"
#include "BKE_subdiv_ccg.hh"
#include "BLI_array.hh"
#include "BLI_math_matrix_types.hh"
#include "BLI_math_quaternion_types.hh"
#include "BLI_math_vector_types.hh"
#include "BLI_set.hh"
#include "BLI_span.hh"
#include "BLI_vector.hh"
#include "IMB_colormanagement.hh"
#include "DNA_brush_enums.h"
#include "DNA_brush_types.h"
#include "ED_view3d.hh"

Go to the source code of this file.

Classes

struct  blender::ed::sculpt_paint::ShapeKeyData
class  blender::ed::sculpt_paint::PositionDeformData
struct  blender::ed::sculpt_paint::SculptRakeData
struct  blender::ed::sculpt_paint::ProjectBrushTarget
struct  blender::ed::sculpt_paint::StrokeToggleSettings
struct  blender::ed::sculpt_paint::StrokeCache
struct  blender::ed::sculpt_paint::ActiveElementInfo
struct  blender::ed::sculpt_paint::CursorGeometryInfo
struct  blender::ed::sculpt_paint::OrigPositionData

Namespaces

namespace  blender
 BMesh Iterators.
namespace  blender::ed
namespace  blender::ed::sculpt_paint
namespace  blender::ed::sculpt_paint::auto_mask
namespace  blender::ed::sculpt_paint::boundary
namespace  blender::ed::sculpt_paint::cloth
namespace  blender::ed::sculpt_paint::pose
namespace  blender::ed::sculpt_paint::undo
namespace  blender::bke
namespace  blender::bke::bvh
namespace  blender::ed::sculpt_paint::expand
namespace  blender::ed::sculpt_paint::project
namespace  blender::ed::sculpt_paint::trim
namespace  blender::ed::sculpt_paint::face_set
namespace  blender::ed::sculpt_paint::filter
namespace  blender::ed::sculpt_paint::color
namespace  blender::ed::sculpt_paint::mask
namespace  blender::ed::sculpt_paint::dyntopo

Macros

#define SCULPT_RAKE_BRUSH_FACTOR   0.25f

Enumerations

enum class  blender::ed::sculpt_paint::UpdateType {
  blender::ed::sculpt_paint::Position , blender::ed::sculpt_paint::Mask , blender::ed::sculpt_paint::Visibility , blender::ed::sculpt_paint::Color ,
  blender::ed::sculpt_paint::FaceSet
}
enum class  blender::ed::sculpt_paint::TransformDisplacementMode { blender::ed::sculpt_paint::Original = 0 , blender::ed::sculpt_paint::Incremental = 1 }

Functions

void blender::ed::sculpt_paint::SCULPT_OT_brush_stroke (wmOperatorType *ot)
void blender::ed::sculpt_paint::expand::SCULPT_OT_expand (wmOperatorType *ot)
void blender::ed::sculpt_paint::expand::modal_keymap (wmKeyConfig *keyconf)
void blender::ed::sculpt_paint::project::SCULPT_OT_project_line_gesture (wmOperatorType *ot)
void blender::ed::sculpt_paint::trim::SCULPT_OT_trim_lasso_gesture (wmOperatorType *ot)
void blender::ed::sculpt_paint::trim::SCULPT_OT_trim_box_gesture (wmOperatorType *ot)
void blender::ed::sculpt_paint::trim::SCULPT_OT_trim_line_gesture (wmOperatorType *ot)
void blender::ed::sculpt_paint::trim::SCULPT_OT_trim_polyline_gesture (wmOperatorType *ot)
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)
void blender::ed::sculpt_paint::SCULPT_OT_set_pivot_position (wmOperatorType *ot)
void blender::ed::sculpt_paint::SCULPT_OT_paint_mask_extract (wmOperatorType *ot)
void blender::ed::sculpt_paint::SCULPT_OT_face_set_extract (wmOperatorType *ot)
void blender::ed::sculpt_paint::SCULPT_OT_paint_mask_slice (wmOperatorType *ot)
void blender::ed::sculpt_paint::filter::SCULPT_OT_mesh_filter (wmOperatorType *ot)
wmKeyMap * blender::ed::sculpt_paint::filter::modal_keymap (wmKeyConfig *keyconf)
void blender::ed::sculpt_paint::cloth::SCULPT_OT_cloth_filter (wmOperatorType *ot)
void blender::ed::sculpt_paint::color::SCULPT_OT_color_filter (wmOperatorType *ot)
void blender::ed::sculpt_paint::mask::SCULPT_OT_mask_filter (wmOperatorType *ot)
void blender::ed::sculpt_paint::mask::SCULPT_OT_mask_init (wmOperatorType *ot)
void blender::ed::sculpt_paint::dyntopo::SCULPT_OT_dynamic_topology_toggle (wmOperatorType *ot)
Sculpt Brush Utilities
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)
bool blender::ed::sculpt_paint::brush_cursor_poll (bContext *C)
void blender::ed::sculpt_paint::tag_update_overlays (bContext *C)
ePaintSymmetryFlags blender::ed::sculpt_paint::mesh_symmetry_xyz_get (const Object &object)
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)
float3 blender::ed::sculpt_paint::grab_delta_get (const Brush &brush, const StrokeCache &cache)
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)
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)
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::check_vertex_pivot_symmetry (const float vco[3], const float pco[3], const char symm)
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::cache_calc_brushdata_symm (StrokeCache &cache, const ePaintSymmetryFlags symm, const char axis, const float angle)
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)
Sculpt Poll Functions
bool blender::ed::sculpt_paint::color_supported_check (const Scene &scene, Object &object, ReportList *reports)
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)
Stroke Functions
std::optional< float3 > blender::ed::sculpt_paint::stroke_get_location_bvh (bContext *C, const float2 mval, const bool force_original)
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< 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)
void blender::ed::sculpt_paint::geometry_preview_lines_update (Depsgraph &depsgraph, Object &object, SculptSession &ss, float radius)
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)
Generic Brush Utilities
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::calc_motion_normal_from_angle (const ViewContext &vc, const float3 &tip_location, const float angle)
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)
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)
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])
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)
Generic Brush Plane & Symmetry Utilities
float blender::ed::sculpt_paint::brush_plane_offset_get (const Brush &brush, const SculptSession &ss)
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)
ePaintSymmetryAreas blender::ed::sculpt_paint::get_vertex_symm_area (const float co[3])
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])
Calculate Normal and Center

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

Functions are:

Note
These are all very similar, when changing one, check others.
std::optional< float3 > blender::ed::sculpt_paint::calc_area_normal (const Depsgraph &depsgraph, const Brush &brush, const Object &ob, const IndexMask &node_mask)
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])
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])
Brush Utilities.
Vector< int > blender::ed::sculpt_paint::find_symm_verts_mesh (const Depsgraph &depsgraph, const Object &object, const int original_vert, const float max_distance)
Vector< int > blender::ed::sculpt_paint::find_symm_verts_grids (const Object &object, const int original_vert, const float max_distance)
Vector< int > blender::ed::sculpt_paint::find_symm_verts_bmesh (const Object &object, const int original_vert, const float max_distance)
Vector< int > blender::ed::sculpt_paint::find_symm_verts (const Depsgraph &depsgraph, const Object &object, const int original_vert, const float max_distance)
std::array< int, PAINT_SYMM_AREAS > blender::ed::sculpt_paint::find_all_symm_verts_mesh (const Depsgraph &depsgraph, const Object &object, const int original_vert, const float max_distance)
std::array< int, PAINT_SYMM_AREAS > blender::ed::sculpt_paint::find_all_symm_verts_grids (const Object &object, const int original_vert, const float max_distance)
std::array< int, PAINT_SYMM_AREAS > blender::ed::sculpt_paint::find_all_symm_verts_bmesh (const Object &object, const int original_vert, const float max_distance)
std::array< int, PAINT_SYMM_AREAS > blender::ed::sculpt_paint::find_all_symm_verts (const Depsgraph &depsgraph, const Object &object, const int original_vert, const float max_distance)
float4x4 blender::ed::sculpt_paint::cube_tip_init (const Object &ob, const Brush &brush)
void blender::ed::sculpt_paint::calc_smooth_translations (const Depsgraph &depsgraph, const Object &object, const IndexMask &node_mask, const MutableSpan< float3 > translations)
std::optional< OrigPositionData > blender::ed::sculpt_paint::orig_position_data_lookup_mesh_all_verts (const Object &object, const bke::pbvh::MeshNode &node)
std::optional< OrigPositionData > blender::ed::sculpt_paint::orig_position_data_lookup_mesh (const Object &object, const bke::pbvh::MeshNode &node)
OrigPositionData blender::ed::sculpt_paint::orig_position_data_get_mesh (const Object &object, const bke::pbvh::MeshNode &node)
std::optional< OrigPositionData > blender::ed::sculpt_paint::orig_position_data_lookup_grids (const Object &object, const bke::pbvh::GridsNode &node)
OrigPositionData blender::ed::sculpt_paint::orig_position_data_get_grids (const Object &object, const bke::pbvh::GridsNode &node)
void blender::ed::sculpt_paint::orig_position_data_gather_bmesh (const BMLog &bm_log, const Set< BMVert *, 0 > &verts, MutableSpan< float3 > positions, MutableSpan< float3 > normals)
std::optional< Span< float4 > > blender::ed::sculpt_paint::orig_color_data_lookup_mesh (const Object &object, const bke::pbvh::MeshNode &node)
Span< float4 > blender::ed::sculpt_paint::orig_color_data_get_mesh (const Object &object, const bke::pbvh::MeshNode &node)
std::optional< Span< int > > blender::ed::sculpt_paint::orig_face_set_data_lookup_mesh (const Object &object, const bke::pbvh::MeshNode &node)
std::optional< Span< int > > blender::ed::sculpt_paint::orig_face_set_data_lookup_grids (const Object &object, const bke::pbvh::GridsNode &node)
std::optional< Span< float > > blender::ed::sculpt_paint::orig_mask_data_lookup_mesh (const Object &object, const bke::pbvh::MeshNode &node)
std::optional< Span< float > > blender::ed::sculpt_paint::orig_mask_data_lookup_grids (const Object &object, const bke::pbvh::GridsNode &node)
bool blender::ed::sculpt_paint::brush_type_is_paint (const int tool)
bool blender::ed::sculpt_paint::brush_type_is_mask (const int tool)
BLI_INLINE bool blender::ed::sculpt_paint::brush_type_is_attribute_only (const int tool)
bool blender::ed::sculpt_paint::brush_uses_vector_displacement (const Brush &brush)
Sculpt Paint Mesh
const float * blender::ed::sculpt_paint::brush_frontface_normal_from_falloff_shape (const SculptSession &ss, char falloff_shape)
Global Mesh Operators

Operators that work on the mesh as a whole.

void blender::ed::sculpt_paint::face_set::SCULPT_OT_face_sets_randomize_colors (wmOperatorType *ot)
void blender::ed::sculpt_paint::face_set::SCULPT_OT_face_set_change_visibility (wmOperatorType *ot)
void blender::ed::sculpt_paint::face_set::SCULPT_OT_face_sets_init (wmOperatorType *ot)
void blender::ed::sculpt_paint::face_set::SCULPT_OT_face_sets_create (wmOperatorType *ot)
void blender::ed::sculpt_paint::face_set::SCULPT_OT_face_sets_edit (wmOperatorType *ot)
Gesture Operators

Operators that modify face sets based on a selected area.

void blender::ed::sculpt_paint::face_set::SCULPT_OT_face_set_lasso_gesture (wmOperatorType *ot)
void blender::ed::sculpt_paint::face_set::SCULPT_OT_face_set_box_gesture (wmOperatorType *ot)
void blender::ed::sculpt_paint::face_set::SCULPT_OT_face_set_line_gesture (wmOperatorType *ot)
void blender::ed::sculpt_paint::face_set::SCULPT_OT_face_set_polyline_gesture (wmOperatorType *ot)
Detail Flood Fill
void blender::ed::sculpt_paint::dyntopo::SCULPT_OT_detail_flood_fill (wmOperatorType *ot)
Sample Detail Size
void blender::ed::sculpt_paint::dyntopo::SCULPT_OT_sample_detail_size (wmOperatorType *ot)
Dyntopo Detail Size Edit Operator
void blender::ed::sculpt_paint::dyntopo::SCULPT_OT_dyntopo_detail_size_edit (wmOperatorType *ot)

Variables

static constexpr int blender::ed::sculpt_paint::face_set_none_id = 0
static constexpr int blender::ed::sculpt_paint::plane_brush_max_rolling_average_num = 20

Sculpt mesh accessor API

#define FAKE_NEIGHBOR_NONE   -1
using blender::ed::sculpt_paint::BMeshNeighborVerts = Vector<BMVert *, 64>
bool blender::ed::sculpt_paint::vertex_is_occluded (const Depsgraph &depsgraph, const Object &object, const float3 &position, bool original)
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)

Macro Definition Documentation

◆ FAKE_NEIGHBOR_NONE

◆ SCULPT_RAKE_BRUSH_FACTOR

#define SCULPT_RAKE_BRUSH_FACTOR   0.25f