Blender V4.3
sculpt_intern.hh File Reference
#include <optional>
#include <queue>
#include "BKE_attribute.hh"
#include "BKE_paint.hh"
#include "BKE_pbvh_api.hh"
#include "BKE_subdiv_ccg.hh"
#include "BLI_array.hh"
#include "BLI_generic_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 "DNA_brush_enums.h"
#include "ED_view3d.hh"

Go to the source code of this file.

Classes

class  blender::ed::sculpt_paint::PositionDeformData
 
struct  SculptCursorGeometryInfo
 
struct  SculptRakeData
 
struct  blender::ed::sculpt_paint::StrokeCache
 
struct  blender::ed::sculpt_paint::OrigPositionData
 

Namespaces

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

Sculpt Types
#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::Image , 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::flush_update_step (bContext *C, UpdateType update_type)
 
void blender::ed::sculpt_paint::flush_update_done (const bContext *C, Object &ob, UpdateType update_type)
 
void blender::ed::sculpt_paint::geometry_preview_lines_update (Depsgraph &depsgraph, Object &object, SculptSession &ss, float radius)
 
Span< float3blender::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, Vector< BMVert *, 64 > &r_neighbors)
 
Span< BMVert * > blender::ed::sculpt_paint::vert_neighbors_get_interior_bmesh (BMVert &vert, Vector< BMVert *, 64 > &r_neighbors)
 
Span< intblender::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::calc_brush_plane (const Depsgraph &depsgraph, const Brush &brush, Object &ob, const IndexMask &node_mask, float3 &r_area_no, float3 &r_area_co)
 
std::optional< float3blender::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])
 
std::optional< intblender::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)
 
Vector< intblender::ed::sculpt_paint::find_symm_verts_mesh (const Depsgraph &depsgraph, const Object &object, const int original_vert, const float max_distance)
 
Vector< intblender::ed::sculpt_paint::find_symm_verts_grids (const Object &object, const int original_vert, const float max_distance)
 
Vector< intblender::ed::sculpt_paint::find_symm_verts_bmesh (const Object &object, const int original_vert, const float max_distance)
 
Vector< intblender::ed::sculpt_paint::find_symm_verts (const Depsgraph &depsgraph, const Object &object, const int original_vert, const float max_distance)
 
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)
 
void blender::ed::sculpt_paint::calc_smooth_translations (const Depsgraph &depsgraph, const Object &object, const IndexMask &node_mask, const MutableSpan< float3 > translations)
 
void SCULPT_cache_calc_brushdata_symm (blender::ed::sculpt_paint::StrokeCache &cache, ePaintSymmetryFlags symm, char axis, float angle)
 
std::optional< OrigPositionDatablender::ed::sculpt_paint::orig_position_data_lookup_mesh_all_verts (const Object &object, const bke::pbvh::MeshNode &node)
 
std::optional< OrigPositionDatablender::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< OrigPositionDatablender::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< float4blender::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 SCULPT_get_redraw_rect (const ARegion &region, const RegionView3D &rv3d, const Object &ob, rcti &rect)
 
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::SCULPT_OT_set_pivot_position (wmOperatorType *ot)
 
void blender::ed::sculpt_paint::filter::SCULPT_OT_mesh_filter (wmOperatorType *ot)
 
wmKeyMapblender::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)
 
void blender::ed::sculpt_paint::multiplane_scrape_preview_draw (const uint gpuattr, const Brush &brush, const SculptSession &ss, const float outline_col[3], const float outline_alpha)
 
float blender::ed::sculpt_paint::clay_thumb_get_stabilized_pressure (const StrokeCache &cache)
 
void blender::ed::sculpt_paint::SCULPT_OT_brush_stroke (wmOperatorType *ot)
 
float blender::ed::sculpt_paint::sculpt_calc_radius (const ViewContext &vc, const Brush &brush, const Scene &scene, const float3 location)
 
Sculpt Poll Functions
bool SCULPT_mode_poll (bContext *C)
 
bool SCULPT_mode_poll_view3d (bContext *C)
 
bool SCULPT_poll (bContext *C)
 
bool SCULPT_brush_cursor_poll (bContext *C)
 
bool SCULPT_handles_colors_report (const Object &object, ReportList *reports)
 
Sculpt Update Functions
void SCULPT_tag_update_overlays (bContext *C)
 
Stroke Functions
bool SCULPT_stroke_get_location_ex (bContext *C, float out[3], const float mval[2], bool force_original, bool check_closest, bool limit_closest_radius)
 
bool SCULPT_stroke_get_location (bContext *C, float out[3], const float mouse[2], bool force_original)
 
bool SCULPT_cursor_geometry_info_update (bContext *C, SculptCursorGeometryInfo *out, const float mouse[2], bool use_sampled_normal)
 
void SCULPT_stroke_modifiers_check (const bContext *C, Object &ob, const Brush &brush)
 
float SCULPT_raycast_init (ViewContext *vc, const float mval[2], float ray_start[3], float ray_end[3], float ray_normal[3], bool original)
 
ePaintSymmetryFlags SCULPT_mesh_symmetry_xyz_get (const Object &object)
 
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)
 
void sculpt_project_v3_normal_align (const SculptSession &ss, float normal_weight, float grab_delta[3])
 
Brush Utilities.
bool SCULPT_brush_type_needs_all_pbvh_nodes (const Brush &brush)
 
float SCULPT_brush_plane_offset_get (const Sculpt &sd, const SculptSession &ss)
 
ePaintSymmetryAreas SCULPT_get_vertex_symm_area (const float co[3])
 
bool SCULPT_check_vertex_pivot_symmetry (const float vco[3], const float pco[3], char symm)
 
bool SCULPT_is_vertex_inside_brush_radius_symm (const float vertex[3], const float br_co[3], float radius, char symm)
 
bool SCULPT_is_symmetry_iteration_valid (char i, char symm)
 
blender::float3 SCULPT_flip_v3_by_symm_area (const blender::float3 &vector, ePaintSymmetryFlags symm, ePaintSymmetryAreas symmarea, const blender::float3 &pivot)
 
void SCULPT_flip_quat_by_symm_area (float quat[4], ePaintSymmetryFlags symm, ePaintSymmetryAreas symmarea, const float pivot[3])
 
const floatSCULPT_brush_frontface_normal_from_falloff_shape (const SculptSession &ss, char falloff_shape)
 
void SCULPT_cube_tip_init (const Sculpt &sd, const Object &ob, const Brush &brush, float mat[4][4])
 
void sculpt_apply_texture (const SculptSession &ss, const Brush &brush, const float brush_point[3], int thread_id, float *r_value, float r_rgba[4])
 
void SCULPT_calc_vertex_displacement (const SculptSession &ss, const Brush &brush, float rgba[3], float r_offset[3])
 
void SCULPT_tilt_apply_to_normal (float r_normal[3], blender::ed::sculpt_paint::StrokeCache *cache, float tilt_strength)
 
void SCULPT_tilt_effective_normal_get (const SculptSession &ss, const Brush &brush, float r_no[3])
 
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)
 
Brushes
bool SCULPT_paint_image_canvas_get (PaintModeSettings &paint_mode_settings, Object &ob, Image **r_image, ImageUser **r_image_user) ATTR_NONNULL()
 Get the image canvas for painting on the given object.
 
void SCULPT_do_paint_brush_image (const Scene &scene, const Depsgraph &depsgraph, PaintModeSettings &paint_mode_settings, const Sculpt &sd, Object &ob, const blender::IndexMask &node_mask)
 
bool SCULPT_use_image_paint_brush (PaintModeSettings &settings, Object &ob)
 
bool SCULPT_brush_type_is_paint (int tool)
 
bool SCULPT_brush_type_is_mask (int tool)
 
BLI_INLINE bool SCULPT_brush_type_is_attribute_only (int tool)
 
Sculpt Mode Toggle Operator
void blender::ed::sculpt_paint::ensure_valid_pivot (const Object &ob, Scene &scene)
 

Sculpt mesh accessor API

#define FAKE_NEIGHBOR_NONE   -1
 
void SCULPT_vertex_random_access_ensure (Object &object)
 
int SCULPT_vertex_count_get (const Object &object)
 
bool SCULPT_vertex_is_occluded (const Depsgraph &depsgraph, const Object &object, const blender::float3 &position, bool original)
 
blender::Span< intSCULPT_fake_neighbors_ensure (const Depsgraph &depsgraph, Object &ob, float max_dist)
 
void SCULPT_fake_neighbors_free (Object &ob)
 

Macro Definition Documentation

◆ FAKE_NEIGHBOR_NONE

◆ SCULPT_RAKE_BRUSH_FACTOR

#define SCULPT_RAKE_BRUSH_FACTOR   0.25f

Definition at line 131 of file sculpt_intern.hh.

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

Function Documentation

◆ 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 3617 of file sculpt.cc.

References is_brush_related_tool(), and SCULPT_mode_poll().

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

◆ SCULPT_brush_frontface_normal_from_falloff_shape()

◆ SCULPT_brush_plane_offset_get()

◆ SCULPT_brush_type_is_attribute_only()

BLI_INLINE bool SCULPT_brush_type_is_attribute_only ( int tool)

◆ SCULPT_brush_type_is_mask()

bool SCULPT_brush_type_is_mask ( int tool)
inline

◆ SCULPT_brush_type_is_paint()

◆ SCULPT_brush_type_needs_all_pbvh_nodes()

◆ 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 3346 of file sculpt.cc.

References 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::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::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_cursor_geometry_info_update()

bool SCULPT_cursor_geometry_info_update ( bContext * C,
SculptCursorGeometryInfo * out,
const float mouse[2],
bool use_sampled_normal )

Gets the normal, location and active vertex location of the geometry under the cursor. This also updates the active vertex and cursor related data of the SculptSession using the mouse position

Definition at line 4580 of file sculpt.cc.

References SculptSession::active_face_index, SculptSession::active_grid_index, SculptSession::active_vert_position(), add_v3_v3(), BKE_base_is_visible(), BKE_brush_size_get(), BKE_brush_unprojected_radius_get(), BKE_brush_use_locked_size(), BKE_paint_brush_for_read(), BKE_paint_get_active_from_context(), blender::bke::pbvh::BMesh, SculptSession::clear_active_vert(), copy_m3_m4(), copy_v3_v3(), CTX_data_active_base(), CTX_data_depsgraph_pointer(), CTX_data_scene(), CTX_wm_view3d(), SculptSession::cursor_location, SculptSession::cursor_normal, SculptSession::cursor_radius, SculptSession::cursor_sampled_normal, SculptSession::cursor_view_normal, Object::data, depsgraph, ED_view3d_viewcontext_init(), blender::bke::Face, blender::bke::pbvh::Grids, invert_m4_m4(), isect_ray_tri_watertight_v3_precalc(), blender::bke::AttributeAccessor::lookup(), blender::bke::pbvh::Mesh, mul_m3_v3(), mul_v3_fl(), normalize_v3_v3(), ViewContext::obact, SculptRaycastData::original, paint_calc_object_space_radius(), blender::bke::object::pbvh_get(), blender::bke::pbvh::raycast(), Object::runtime, SculptSession::rv3d, ViewContext::rv3d, Object::sculpt, sculpt_raycast_cb(), SCULPT_raycast_init(), SCULPT_stroke_modifiers_check(), SCULPT_vertex_random_access_ensure(), SculptSession::set_active_vert(), SculptSession::subdiv_ccg, blender::bke::pbvh::Tree::type(), blender::bke::pbvh::update_normals(), SculptSession::v3d, ViewContext::v3d, blender::bke::pbvh::vert_positions_eval(), RegionView3D::viewinv, and zero_v3().

Referenced by blender::ed::sculpt_paint::face_set::active_update_and_get(), blender::ed::sculpt_paint::face_set::change_visibility_invoke(), blender::ed::sculpt_paint::face_set::edit_op_invoke(), blender::ed::sculpt_paint::trim::initialize_cursor_info(), blender::ed::sculpt_paint::mask::mask_by_color_invoke(), blender::ed::sculpt_paint::paint_cursor_sculpt_session_update_and_init(), blender::ed::sculpt_paint::dyntopo::sample_detail_voxel(), blender::ed::sculpt_paint::cloth::sculpt_cloth_filter_invoke(), blender::ed::sculpt_paint::color::sculpt_color_filter_init(), blender::ed::sculpt_paint::filter::sculpt_mesh_filter_start(), blender::ed::sculpt_paint::stroke_test_start(), and blender::ed::sculpt_paint::expand::target_vert_update_and_get().

◆ SCULPT_do_paint_brush_image()

◆ SCULPT_fake_neighbors_ensure()

blender::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 5795 of file sculpt.cc.

References SculptFakeNeighbors::current_max_distance, depsgraph, SculptFakeNeighbors::fake_neighbor_index, SculptSession::fake_neighbors, blender::Array< T, InlineBufferCapacity, Allocator >::is_empty(), and Object::sculpt.

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

◆ SCULPT_fake_neighbors_free()

void SCULPT_fake_neighbors_free ( Object & ob)

◆ SCULPT_flip_quat_by_symm_area()

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

◆ SCULPT_flip_v3_by_symm_area()

blender::float3 SCULPT_flip_v3_by_symm_area ( const blender::float3 & vector,
ePaintSymmetryFlags symm,
ePaintSymmetryAreas symmarea,
const blender::float3 & pivot )

◆ SCULPT_get_redraw_rect()

bool SCULPT_get_redraw_rect ( const ARegion & region,
const RegionView3D & rv3d,
const Object & ob,
rcti & rect )

Get a screen-space rectangle of the modified area.

Definition at line 1191 of file sculpt.cc.

References BKE_pbvh_redraw_BB(), bounds(), and paint_convert_bb_to_rect().

Referenced by blender::ed::sculpt_paint::flush_update_step(), and wpaint_stroke_update_step().

◆ SCULPT_get_vertex_symm_area()

◆ SCULPT_handles_colors_report()

bool SCULPT_handles_colors_report ( const Object & object,
ReportList * reports )

Returns true if sculpt session can handle color attributes (pbvh->type() == bke::pbvh::Type::Mesh). If false an error message will be shown to the user. Operators should return OPERATOR_CANCELLED in this case.

NOTE: Does not check if a color attribute actually exists. Calling code must handle this itself; in most cases a call to BKE_sculpt_color_layer_create_if_needed() is sufficient.

Definition at line 5177 of file sculpt.cc.

References BKE_report(), BLI_assert_unreachable, blender::bke::pbvh::BMesh, blender::bke::pbvh::Grids, blender::bke::pbvh::Mesh, blender::bke::object::pbvh_get(), and RPT_ERROR.

Referenced by blender::ed::sculpt_paint::mask::mask_by_color_invoke(), blender::ed::sculpt_paint::sample_color_invoke(), blender::ed::sculpt_paint::sculpt_brush_stroke_invoke(), and blender::ed::sculpt_paint::color::sculpt_color_filter_init().

◆ SCULPT_is_symmetry_iteration_valid()

◆ 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 186 of file sculpt.cc.

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 3560 of file sculpt.cc.

References 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 3566 of file sculpt.cc.

References CTX_wm_region_view3d(), ED_gpencil_session_active(), 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_paint_image_canvas_get()

bool SCULPT_paint_image_canvas_get ( PaintModeSettings & paint_mode_settings,
Object & ob,
Image ** r_image,
ImageUser ** r_image_user )

Get the image canvas for painting on the given object.

Returns
true if an image is found. The #r_image and #r_image_user fields are filled with the image and image user. Returns false when the image isn't found. In the later case the r_image and r_image_user are set to NULL.

Definition at line 471 of file sculpt_paint_image.cc.

References blender::ed::sculpt_paint::paint::image::ImageData::image, blender::ed::sculpt_paint::paint::image::ImageData::image_user, and blender::ed::sculpt_paint::paint::image::ImageData::init_active_image().

Referenced by sculpt_needs_pbvh_pixels(), and sculpt_pbvh_update_pixels().

◆ SCULPT_poll()

bool SCULPT_poll ( bContext * C)

Checks for a brush, not just sculpt mode.

Definition at line 3572 of file sculpt.cc.

References 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_raycast_init()

◆ SCULPT_stroke_get_location()

◆ SCULPT_stroke_get_location_ex()

bool SCULPT_stroke_get_location_ex ( bContext * C,
float out[3],
const float mval[2],
bool force_original,
bool check_closest,
bool limit_closest_radius )

Do a ray-cast in the tree to find the 3d brush location (This allows us to ignore the GL depth buffer) Returns 0 if the ray doesn't hit the mesh, non-zero otherwise.

If check_closest is true and the ray test fails a point closest to the ray will be found. If limit_closest_radius is true then the closest point will be tested against the active brush radius.

Definition at line 4743 of file sculpt.cc.

References blender::ed::sculpt_paint::StrokeCache::accum, add_v3_v3(), BKE_paint_brush(), BKE_paint_get_active_from_context(), SculptSession::bm, BM_mesh_elem_index_ensure(), BM_mesh_elem_table_ensure(), BM_VERT, blender::bke::pbvh::BMesh, SculptSession::cache, copy_v3_v3(), SculptRaycastData::corner_tris, SculptRaycastData::corner_verts, CTX_data_depsgraph_pointer(), CTX_data_scene(), Object::data, depsgraph, SculptRaycastData::depth, ED_view3d_viewcontext_init(), blender::bke::Face, SculptRaycastData::faces, blender::bke::pbvh::find_nearest_to_ray(), blender::bke::pbvh::Grids, SculptRaycastData::hide_poly, SculptRaycastData::hit, SculptRaycastData::isect_precalc, isect_ray_tri_watertight_v3_precalc(), blender::bke::AttributeAccessor::lookup(), blender::bke::pbvh::Mesh, mul_v3_fl(), ViewContext::obact, SculptRaycastData::object, SculptFindNearestToRayData::original, SculptRaycastData::original, blender::bke::object::pbvh_get(), SculptRaycastData::ray_normal, SculptRaycastData::ray_start, blender::bke::pbvh::raycast(), Object::sculpt, sculpt_find_nearest_to_ray_cb(), sculpt_raycast_cb(), SCULPT_raycast_init(), SCULPT_stroke_modifiers_check(), SCULPT_vertex_random_access_ensure(), SculptRaycastData::ss, SculptRaycastData::subdiv_ccg, SculptSession::subdiv_ccg, blender::bke::pbvh::Tree::type(), SculptRaycastData::vert_positions, and blender::bke::pbvh::vert_positions_eval().

Referenced by over_mesh(), and SCULPT_stroke_get_location().

◆ 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 507 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::do_brush_action(), blender::ed::sculpt_paint::cloth::do_cloth_brush(), blender::ed::sculpt_paint::do_enhance_details_brush(), and blender::ed::sculpt_paint::color::do_paint_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_tilt_apply_to_normal()

◆ SCULPT_tilt_effective_normal_get()

void SCULPT_tilt_effective_normal_get ( const SculptSession & ss,
const Brush & brush,
float r_no[3] )

◆ SCULPT_use_image_paint_brush()

◆ SCULPT_vertex_count_get()

int SCULPT_vertex_count_get ( const Object & object)

Definition at line 153 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::do_brush_action(), blender::ed::sculpt_paint::do_enhance_details_brush(), blender::ed::sculpt_paint::do_layer_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().

◆ SCULPT_vertex_is_occluded()

bool SCULPT_vertex_is_occluded ( const Depsgraph & depsgraph,
const Object & object,
const blender::float3 & position,
bool original )

◆ SCULPT_vertex_random_access_ensure()

void SCULPT_vertex_random_access_ensure ( Object & object)