Blender V5.0
sculpt_intern.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2006 by Nicholas Bishop. All rights reserved.
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#pragma once
10
11#include <optional>
12
13#include "BKE_paint.hh"
14#include "BKE_paint_bvh.hh"
15#include "BKE_subdiv_ccg.hh"
16
17#include "BLI_array.hh"
21#include "BLI_set.hh"
22#include "BLI_span.hh"
23#include "BLI_vector.hh"
24
25#include "DNA_brush_enums.h"
26#include "DNA_brush_types.h"
27
28#include "ED_view3d.hh"
29
31namespace auto_mask {
32struct Cache;
33}
34namespace boundary {
35struct SculptBoundary;
36}
37namespace cloth {
38struct SimulationData;
39}
40namespace pose {
41struct IKChain;
42}
43namespace undo {
44struct Node;
45enum class Type : int8_t;
46} // namespace undo
47} // namespace blender::ed::sculpt_paint
48struct bContext;
49struct BMLog;
50struct Dial;
52struct Image;
53struct ImageUser;
54struct Key;
55struct KeyBlock;
56struct Object;
58struct ReportList;
59struct wmKeyConfig;
60struct wmKeyMap;
61struct wmOperatorType;
62
63/* -------------------------------------------------------------------- */
66
68
77
83 public:
90
91 private:
97 std::optional<MutableSpan<float3>> eval_mut_;
98
103 std::optional<Span<float3x3>> deform_imats_;
104
109
110 std::optional<ShapeKeyData> shape_key_data_;
111
112 public:
113 PositionDeformData(const Depsgraph &depsgraph, Object &object_orig);
114 void deform(MutableSpan<float3> translations, Span<int> verts) const;
115};
116
125
126} // namespace blender::ed::sculpt_paint
127
128/* Factor of brush to have rake point following behind
129 * (could be configurable but this is reasonable default). */
130#define SCULPT_RAKE_BRUSH_FACTOR 0.25f
131
137
140 /* Displaces the elements from their original coordinates. */
142 /* Displaces the elements incrementally from their previous position. */
144};
145}
146/* Defines how transform tools are going to apply its displacement. */
147
149
150static constexpr int plane_brush_max_rolling_average_num = 20;
151
157 /* Invariants */
158 float initial_radius = 0.0f;
160 struct {
161 uint8_t flag = 0;
167
176
177 /* Variants */
178 float radius = 0.0f;
179 float radius_squared = 0.0f;
184 float stroke_distance = 0.0f;
185
191
192 /* Original pixel radius with the pressure curve applied for dyntopo detail size */
194
195 bool is_last_valid = false;
196
197 bool pen_flip = false;
198
205 bool invert = false;
206 float pressure = 0.0f;
207 float hardness = 0.0f;
214 float bstrength = 0.0f;
215 float normal_weight = 0.0f; /* from brush (with optional override) */
217
223 /* Position of the mouse event in screen space, not modified by the stroke type. */
225
226 struct {
230
231 /* The rest is temporary storage that isn't saved as a property */
232
233 /* Store initial starting points for perlin noise on the beginning of each stroke when using
234 * color jitter. */
235 std::optional<blender::float3> initial_hsv_jitter;
236 /* Beginning of stroke may do some things special. */
237 bool first_time = false;
238
239 /* from ED_view3d_ob_project_mat_get(). */
241
242 /* TODO: Clean this up! */
243 ViewContext *vc = nullptr;
244 const Brush *brush = nullptr;
245 const Paint *paint = nullptr;
246
247 float special_rotation = 0.0f;
252
253 /* Screen-space rotation defined by mouse motion. */
254 std::optional<math::Quaternion> rake_rotation;
255 std::optional<math::Quaternion> rake_rotation_symm;
257
258 /* The face set being painted. */
260
266 int symmetry = 0;
267 /* The symmetry pass we are currently on between 0 and 7. */
271
282
294
295 /* used to shift the plane around when doing tiled strokes */
297 int tile_pass = 0;
298
303
308 bool accum = false;
309
310 /* Paint Brush. */
311 struct {
312 float flow = 0.0f;
313
315 float wet_mix = 0.0f;
316 float wet_persistence = 0.0f;
317
318 std::optional<float> density_seed;
319 float density = 0.0f;
320
328
329 /* Pose brush */
330 std::unique_ptr<pose::IKChain> pose_ik_chain;
331
332 /* Enhance Details. */
334
335 /* Clay Thumb brush */
336 struct {
337 /* Angle of the front tilting plane of the brush to simulate clay accumulation. */
338 float front_angle = 0.0f;
339 /* Stores the last 10 pressure samples to get a stabilized strength and radius variation. */
340 std::array<float, 10> pressure_stabilizer;
342
344
345 /* Plane Brush */
346 struct {
347 std::optional<float3> last_normal;
348 std::optional<float3> last_center;
353
362 bool first_time = false;
364
365 /* Cloth brush */
366 std::unique_ptr<cloth::SimulationData> cloth_sim;
371
372 /* Boundary brush */
373 std::array<std::unique_ptr<boundary::SculptBoundary>, PAINT_SYMM_AREAS> boundaries;
374
375 /* Surface Smooth Brush */
376 /* Stores the displacement produced by the laplacian step of HC smooth. */
378
379 /* Layer brush */
381
382 /* Amount to rotate the vertices when using rotate brush. */
383 float vertex_rotation = 0.0f;
384 Dial *dial = nullptr;
385
388 /* Smooth tool copies the size of the current tool. */
390
397 bool alt_smooth = false;
398
399 float plane_trim_squared = 0.0f;
400
401 bool supports_gravity = false;
404
405 std::unique_ptr<auto_mask::Cache> automasking;
406
409
411 ~StrokeCache();
412};
413
414} // namespace blender::ed::sculpt_paint
415
417
418/* -------------------------------------------------------------------- */
421
427bool SCULPT_poll(bContext *C);
428
433
442bool color_supported_check(const Scene &scene, Object &object, ReportList *reports);
443} // namespace blender::ed::sculpt_paint
444
446
447/* -------------------------------------------------------------------- */
450
452
456void flush_update_step(const bContext *C, UpdateType update_type);
460void flush_update_done(const bContext *C, Object &ob, UpdateType update_type);
461
462} // namespace blender::ed::sculpt_paint
463
469
470/* -------------------------------------------------------------------- */
473
481bool stroke_get_location_bvh(bContext *C, float out[3], const float mval[2], bool force_original);
482
487
496 const float2 &mval,
497 bool use_sampled_normal);
498
500 Object &object,
501 SculptSession &ss,
502 float radius);
503
504} // namespace blender::ed::sculpt_paint
505
506void SCULPT_stroke_modifiers_check(const bContext *C, Object &ob, const Brush &brush);
508float raycast_init(ViewContext *vc,
509 const float2 &mval,
510 float3 &ray_start,
511 float3 &ray_end,
512 float3 &ray_normal,
513 bool original);
514}
515
516/* Symmetry */
518
537
544 float normal_weight,
545 float grab_delta[3]);
546
548
549/* -------------------------------------------------------------------- */
552
556} // namespace blender::ed::sculpt_paint
557
558int SCULPT_vertex_count_get(const Object &object);
559
561bool vertex_is_occluded(const Depsgraph &depsgraph,
562 const Object &object,
563 const float3 &position,
564 bool original);
565
569Span<float3> vert_positions_for_grab_active_get(const Depsgraph &depsgraph, const Object &object);
570
574
576 Span<int> corner_verts,
577 GroupedSpan<int> vert_to_face,
578 Span<bool> hide_poly,
579 int vert,
580 Vector<int> &r_neighbors);
581} // namespace blender::ed::sculpt_paint
582
583/* Fake Neighbors */
584
585#define FAKE_NEIGHBOR_NONE -1
586
593 Object &ob,
594 float max_dist);
596
598
599/* -------------------------------------------------------------------- */
602
604
605float brush_plane_offset_get(const Brush &brush, const SculptSession &ss);
606
613void calc_brush_plane(const Depsgraph &depsgraph,
614 const Brush &brush,
615 Object &ob,
616 const IndexMask &node_mask,
617 float3 &r_area_no,
618 float3 &r_area_co);
619
620std::optional<float3> calc_area_normal(const Depsgraph &depsgraph,
621 const Brush &brush,
622 const Object &ob,
623 const IndexMask &node_mask);
624
629void calc_area_normal_and_center(const Depsgraph &depsgraph,
630 const Brush &brush,
631 const Object &ob,
632 const IndexMask &node_mask,
633 float r_area_no[3],
634 float r_area_co[3]);
635void calc_area_center(const Depsgraph &depsgraph,
636 const Brush &brush,
637 const Object &ob,
638 const IndexMask &node_mask,
639 float r_area_co[3]);
640
641std::optional<int> nearest_vert_calc_mesh(const bke::pbvh::Tree &pbvh,
642 Span<float3> vert_positions,
643 Span<bool> hide_vert,
644 const float3 &location,
645 float max_distance,
646 bool use_original);
647std::optional<SubdivCCGCoord> nearest_vert_calc_grids(const bke::pbvh::Tree &pbvh,
648 const SubdivCCG &subdiv_ccg,
649 const float3 &location,
650 float max_distance,
651 bool use_original);
652std::optional<BMVert *> nearest_vert_calc_bmesh(const bke::pbvh::Tree &pbvh,
653 const float3 &location,
654 float max_distance,
655 bool use_original);
656} // namespace blender::ed::sculpt_paint
657
659bool SCULPT_check_vertex_pivot_symmetry(const float vco[3], const float pco[3], char symm);
663bool SCULPT_is_vertex_inside_brush_radius_symm(const float vertex[3],
664 const float br_co[3],
665 float radius,
666 char symm);
669 ePaintSymmetryAreas symmarea,
670 const blender::float3 &pivot);
671void SCULPT_flip_quat_by_symm_area(float quat[4],
673 ePaintSymmetryAreas symmarea,
674 const float pivot[3]);
675
677
683 const Object &object,
684 int original_vert,
685 float max_distance = std::numeric_limits<float>::max());
687 int original_vert,
688 float max_distance = std::numeric_limits<float>::max());
690 int original_vert,
691 float max_distance = std::numeric_limits<float>::max());
692Vector<int> find_symm_verts(const Depsgraph &depsgraph,
693 const Object &object,
694 int original_vert,
695 float max_distance = std::numeric_limits<float>::max());
696
697bool node_fully_masked_or_hidden(const bke::pbvh::Node &node);
698bool node_in_sphere(const bke::pbvh::Node &node,
699 const float3 &location,
700 float radius_sq,
701 bool original);
702bool node_in_cylinder(const DistRayAABB_Precalc &ray_dist_precalc,
703 const bke::pbvh::Node &node,
704 float radius_sq,
705 bool original);
706IndexMask gather_nodes(const bke::pbvh::Tree &pbvh,
707 eBrushFalloffShape falloff_shape,
708 bool use_original,
709 const float3 &location,
710 float radius_sq,
711 const std::optional<float3> &ray_direction,
712 IndexMaskMemory &memory);
713
714} // namespace blender::ed::sculpt_paint
715
717 char falloff_shape);
718void SCULPT_cube_tip_init(const Sculpt &sd, const Object &ob, const Brush &brush, float mat[4][4]);
719
722 const Brush &brush,
723 const float brush_point[3],
724 int thread_id,
725 float *r_value,
726 float r_rgba[4]);
727
733 const Brush &brush,
734 float translation[3]);
735
741 const float4x4 &view_inverse,
742 const float3 &normal,
743 const float2 &tilt,
744 float tilt_strength);
745float3 tilt_apply_to_normal(const float3 &normal, const StrokeCache &cache, float tilt_strength);
746
750float3 tilt_effective_normal_get(const SculptSession &ss, const Brush &brush);
751} // namespace blender::ed::sculpt_paint
752
760void calc_smooth_translations(const Depsgraph &depsgraph,
761 const Object &object,
762 const IndexMask &node_mask,
763 MutableSpan<float3> translations);
764
765} // namespace blender::ed::sculpt_paint
766
773 char axis,
774 float angle);
775
777
782
786std::optional<OrigPositionData> orig_position_data_lookup_mesh_all_verts(
787 const Object &object, const bke::pbvh::MeshNode &node);
788std::optional<OrigPositionData> orig_position_data_lookup_mesh(const Object &object,
789 const bke::pbvh::MeshNode &node);
791 const bke::pbvh::MeshNode &node)
792{
793 const std::optional<OrigPositionData> result = orig_position_data_lookup_mesh(object, node);
794 BLI_assert(result.has_value());
795 return *result;
796}
797
798std::optional<OrigPositionData> orig_position_data_lookup_grids(const Object &object,
799 const bke::pbvh::GridsNode &node);
801 const bke::pbvh::GridsNode &node)
802{
803 const std::optional<OrigPositionData> result = orig_position_data_lookup_grids(object, node);
804 BLI_assert(result.has_value());
805 return *result;
806}
807
808void orig_position_data_gather_bmesh(const BMLog &bm_log,
809 const Set<BMVert *, 0> &verts,
810 MutableSpan<float3> positions,
812
813std::optional<Span<float4>> orig_color_data_lookup_mesh(const Object &object,
814 const bke::pbvh::MeshNode &node);
816{
817 return *orig_color_data_lookup_mesh(object, node);
818}
819
820std::optional<Span<int>> orig_face_set_data_lookup_mesh(const Object &object,
821 const bke::pbvh::MeshNode &node);
822
823std::optional<Span<int>> orig_face_set_data_lookup_grids(const Object &object,
824 const bke::pbvh::GridsNode &node);
825
826std::optional<Span<float>> orig_mask_data_lookup_mesh(const Object &object,
827 const bke::pbvh::MeshNode &node);
828
829std::optional<Span<float>> orig_mask_data_lookup_grids(const Object &object,
830 const bke::pbvh::GridsNode &node);
831
832inline bool brush_type_is_paint(const int tool)
833{
835}
836
837inline bool brush_type_is_mask(const int tool)
838{
839 return ELEM(tool, SCULPT_BRUSH_TYPE_MASK);
840}
841
843{
844 return brush_type_is_paint(tool) || brush_type_is_mask(tool) ||
846}
847
854
855void ensure_valid_pivot(const Object &ob, Paint &paint);
856
859 const Paint &paint,
860 const Brush &brush,
861 const float3 &location,
862 float scale_factor = 1.0);
863} // namespace blender::ed::sculpt_paint
864
866
867/* -------------------------------------------------------------------- */
870
878bool SCULPT_paint_image_canvas_get(PaintModeSettings &paint_mode_settings,
879 Object &ob,
880 Image **r_image,
881 ImageUser **r_image_user) ATTR_NONNULL();
882void SCULPT_do_paint_brush_image(const Depsgraph &depsgraph,
883 PaintModeSettings &paint_mode_settings,
884 const Sculpt &sd,
885 Object &ob,
886 const blender::IndexMask &node_mask);
888
890
891/* -------------------------------------------------------------------- */
894
896
898
899}
900
902
904void modal_keymap(wmKeyConfig *keyconf);
905
906} // namespace blender::ed::sculpt_paint::expand
907
911
918
920
926
931
932} // namespace blender::ed::sculpt_paint::face_set
933
935
937
938}
939
941
944
945} // namespace blender::ed::sculpt_paint::filter
946
949}
950
952void SCULPT_OT_color_filter(wmOperatorType *ot);
953}
954
956
957void SCULPT_OT_mask_filter(wmOperatorType *ot);
958void SCULPT_OT_mask_init(wmOperatorType *ot);
959
960} // namespace blender::ed::sculpt_paint::mask
961
963
964void SCULPT_OT_detail_flood_fill(wmOperatorType *ot);
965void SCULPT_OT_sample_detail_size(wmOperatorType *ot);
966void SCULPT_OT_dyntopo_detail_size_edit(wmOperatorType *ot);
967void SCULPT_OT_dynamic_topology_toggle(wmOperatorType *ot);
968
969} // namespace blender::ed::sculpt_paint::dyntopo
970
#define PAINT_SYMM_AREAS
Definition BKE_paint.hh:115
ePaintSymmetryAreas
Definition BKE_paint.hh:108
#define SCULPT_FACE_SET_NONE
Definition BKE_paint.hh:324
A BVH for high poly meshes.
#define BLI_assert(a)
Definition BLI_assert.h:46
#define ATTR_NONNULL(...)
#define BLI_INLINE
#define ELEM(...)
@ SCULPT_BRUSH_TYPE_MASK
@ SCULPT_BRUSH_TYPE_DRAW_FACE_SETS
@ SCULPT_BRUSH_TYPE_DRAW
@ SCULPT_BRUSH_TYPE_SMEAR
@ SCULPT_BRUSH_TYPE_PAINT
eBrushFalloffShape
@ BRUSH_USE_COLOR_AS_DISPLACEMENT
struct Brush Brush
struct Object Object
ePaintSymmetryFlags
@ MTEX_MAP_MODE_AREA
static double angle(const Eigen::Vector3d &v1, const Eigen::Vector3d &v2)
Definition IK_Math.h:117
#define C
Definition RandGen.cpp:29
BPy_StructRNA * depsgraph
void deform(MutableSpan< float3 > translations, Span< int > verts) const
Definition sculpt.cc:7462
PositionDeformData(const Depsgraph &depsgraph, Object &object_orig)
Definition sculpt.cc:7444
static float verts[][3]
static float normals[][3]
#define out
static char faces[256]
void SCULPT_OT_cloth_filter(wmOperatorType *ot)
void SCULPT_OT_color_filter(wmOperatorType *ot)
void SCULPT_OT_detail_flood_fill(wmOperatorType *ot)
void SCULPT_OT_sample_detail_size(wmOperatorType *ot)
void SCULPT_OT_dynamic_topology_toggle(wmOperatorType *ot)
void SCULPT_OT_dyntopo_detail_size_edit(wmOperatorType *ot)
void modal_keymap(wmKeyConfig *keyconf)
void SCULPT_OT_expand(wmOperatorType *ot)
void SCULPT_OT_face_set_lasso_gesture(wmOperatorType *ot)
void SCULPT_OT_face_set_line_gesture(wmOperatorType *ot)
void SCULPT_OT_face_set_polyline_gesture(wmOperatorType *ot)
void SCULPT_OT_face_sets_init(wmOperatorType *ot)
void SCULPT_OT_face_sets_create(wmOperatorType *ot)
void SCULPT_OT_face_set_change_visibility(wmOperatorType *ot)
void SCULPT_OT_face_sets_randomize_colors(wmOperatorType *ot)
void SCULPT_OT_face_sets_edit(wmOperatorType *ot)
void SCULPT_OT_face_set_box_gesture(wmOperatorType *ot)
void SCULPT_OT_mesh_filter(wmOperatorType *ot)
wmKeyMap * modal_keymap(wmKeyConfig *keyconf)
void SCULPT_OT_mask_filter(wmOperatorType *ot)
void SCULPT_OT_mask_init(wmOperatorType *ot)
void SCULPT_OT_project_line_gesture(wmOperatorType *ot)
void SCULPT_OT_trim_lasso_gesture(wmOperatorType *ot)
void SCULPT_OT_trim_box_gesture(wmOperatorType *ot)
void SCULPT_OT_trim_line_gesture(wmOperatorType *ot)
void SCULPT_OT_trim_polyline_gesture(wmOperatorType *ot)
bool stroke_get_location_bvh(bContext *C, float out[3], const float mval[2], const bool force_original)
Definition sculpt.cc:4940
std::optional< Span< float > > orig_mask_data_lookup_grids(const Object &object, const bke::pbvh::GridsNode &node)
void calc_smooth_translations(const Depsgraph &depsgraph, const Object &object, const IndexMask &node_mask, const MutableSpan< float3 > translations)
bool node_in_sphere(const bke::pbvh::Node &node, const float3 &location, const float radius_sq, const bool original)
Definition sculpt.cc:2429
bool node_in_cylinder(const DistRayAABB_Precalc &ray_dist_precalc, const bke::pbvh::Node &node, const float radius_sq, const bool original)
Definition sculpt.cc:2439
std::optional< Span< int > > orig_face_set_data_lookup_mesh(const Object &object, const bke::pbvh::MeshNode &node)
void vert_random_access_ensure(Object &object)
Definition sculpt.cc:141
std::optional< int > 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)
Definition sculpt.cc:592
Vector< int > find_symm_verts_grids(const Object &object, const int original_vert, const float max_distance)
bool node_fully_masked_or_hidden(const bke::pbvh::Node &node)
Definition sculpt.cc:2418
float3 tilt_effective_normal_get(const SculptSession &ss, const Brush &brush)
Definition sculpt.cc:2718
Vector< BMVert *, 64 > BMeshNeighborVerts
std::optional< OrigPositionData > orig_position_data_lookup_grids(const Object &object, const bke::pbvh::GridsNode &node)
void orig_position_data_gather_bmesh(const BMLog &bm_log, const Set< BMVert *, 0 > &verts, MutableSpan< float3 > positions, MutableSpan< float3 > normals)
void ensure_valid_pivot(const Object &ob, Paint &paint)
Vector< int > find_symm_verts_mesh(const Depsgraph &depsgraph, const Object &object, const int original_vert, const float max_distance)
bool color_supported_check(const Scene &scene, Object &object, ReportList *reports)
Definition sculpt.cc:5474
float raycast_init(ViewContext *vc, const float2 &mval, float3 &r_ray_start, float3 &r_ray_end, float3 &r_ray_normal, bool original)
Definition sculpt.cc:4644
bool brush_type_is_paint(const int tool)
bool cursor_geometry_info_update(bContext *C, CursorGeometryInfo *out, const float2 &mval, const bool use_sampled_normal)
Definition sculpt.cc:4685
IndexMask 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)
Definition sculpt.cc:2502
void flush_update_done(const bContext *C, Object &ob, const UpdateType update_type)
Definition sculpt.cc:5146
std::optional< Span< float4 > > orig_color_data_lookup_mesh(const Object &object, const bke::pbvh::MeshNode &node)
Span< float4 > orig_color_data_get_mesh(const Object &object, const bke::pbvh::MeshNode &node)
void SCULPT_OT_brush_stroke(wmOperatorType *ot)
Definition sculpt.cc:5767
void calc_brush_plane(const Depsgraph &depsgraph, const Brush &brush, Object &ob, const IndexMask &node_mask, float3 &r_area_no, float3 &r_area_co)
Definition sculpt.cc:2910
Span< BMVert * > vert_neighbors_get_interior_bmesh(BMVert &vert, BMeshNeighborVerts &r_neighbors)
Definition sculpt.cc:402
std::optional< float3 > calc_area_normal(const Depsgraph &depsgraph, const Brush &brush, const Object &ob, const IndexMask &node_mask)
Definition sculpt.cc:1833
Span< BMVert * > vert_neighbors_get_bmesh(BMVert &vert, BMeshNeighborVerts &r_neighbors)
Definition sculpt.cc:387
OrigPositionData orig_position_data_get_mesh(const Object &object, const bke::pbvh::MeshNode &node)
bool vertex_is_occluded(const Depsgraph &depsgraph, const Object &object, const float3 &position, bool original)
Definition sculpt.cc:6128
OrigPositionData orig_position_data_get_grids(const Object &object, const bke::pbvh::GridsNode &node)
void calc_area_center(const Depsgraph &depsgraph, const Brush &brush, const Object &ob, const IndexMask &node_mask, float r_area_co[3])
Definition sculpt.cc:1731
float object_space_radius_get(const ViewContext &vc, const Paint &paint, const Brush &brush, const float3 &location, const float scale_factor)
Definition sculpt.cc:114
void flush_update_step(const bContext *C, const UpdateType update_type)
Definition sculpt.cc:5098
BLI_INLINE bool brush_type_is_attribute_only(const int tool)
static constexpr int plane_brush_max_rolling_average_num
float brush_plane_offset_get(const Brush &brush, const SculptSession &ss)
Definition sculpt.cc:2993
std::optional< BMVert * > nearest_vert_calc_bmesh(const bke::pbvh::Tree &pbvh, const float3 &location, const float max_distance, const bool use_original)
Definition sculpt.cc:693
std::optional< Span< float > > orig_mask_data_lookup_mesh(const Object &object, const bke::pbvh::MeshNode &node)
std::optional< SubdivCCGCoord > nearest_vert_calc_grids(const bke::pbvh::Tree &pbvh, const SubdivCCG &subdiv_ccg, const float3 &location, const float max_distance, const bool use_original)
Definition sculpt.cc:639
std::optional< OrigPositionData > orig_position_data_lookup_mesh_all_verts(const Object &object, const bke::pbvh::MeshNode &node)
void 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])
Definition sculpt.cc:2028
std::optional< OrigPositionData > orig_position_data_lookup_mesh(const Object &object, const bke::pbvh::MeshNode &node)
Vector< int > find_symm_verts(const Depsgraph &depsgraph, const Object &object, const int original_vert, const float max_distance)
std::optional< Span< int > > orig_face_set_data_lookup_grids(const Object &object, const bke::pbvh::GridsNode &node)
Span< int > 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)
Definition sculpt.cc:429
bool brush_uses_vector_displacement(const Brush &brush)
bool brush_type_is_mask(const int tool)
void SCULPT_OT_set_pivot_position(wmOperatorType *ot)
void geometry_preview_lines_update(Depsgraph &depsgraph, Object &object, SculptSession &ss, float radius)
Definition grab.cc:231
Span< float3 > vert_positions_for_grab_active_get(const Depsgraph &depsgraph, const Object &object)
Definition sculpt.cc:169
float3 tilt_apply_to_normal(const Object &object, const float4x4 &view_inverse, const float3 &normal, const float2 &tilt, const float tilt_strength)
Definition sculpt.cc:2690
Vector< int > find_symm_verts_bmesh(const Object &object, const int original_vert, const float max_distance)
MatBase< float, 4, 4 > float4x4
VecBase< float, 4 > float4
VecBase< float, 2 > float2
VecBase< float, 3 > float3
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])
Definition sculpt.cc:2322
bool SCULPT_stroke_is_first_brush_step_of_symmetry_pass(const blender::ed::sculpt_paint::StrokeCache &cache)
Definition sculpt.cc:542
void SCULPT_flip_quat_by_symm_area(float quat[4], ePaintSymmetryFlags symm, ePaintSymmetryAreas symmarea, const float pivot[3])
Definition sculpt.cc:2889
bool SCULPT_brush_cursor_poll(bContext *C)
Definition sculpt.cc:3734
ePaintSymmetryFlags SCULPT_mesh_symmetry_xyz_get(const Object &object)
Definition sculpt.cc:184
const float * SCULPT_brush_frontface_normal_from_falloff_shape(const SculptSession &ss, char falloff_shape)
Definition sculpt.cc:1180
void SCULPT_stroke_modifiers_check(const bContext *C, Object &ob, const Brush &brush)
Definition sculpt.cc:4468
blender::float3 SCULPT_flip_v3_by_symm_area(const blender::float3 &vector, ePaintSymmetryFlags symm, ePaintSymmetryAreas symmarea, const blender::float3 &pivot)
bool SCULPT_check_vertex_pivot_symmetry(const float vco[3], const float pco[3], char symm)
Definition sculpt.cc:548
bool SCULPT_mode_poll_view3d(bContext *C)
Definition sculpt.cc:3683
void SCULPT_do_paint_brush_image(const Depsgraph &depsgraph, PaintModeSettings &paint_mode_settings, const Sculpt &sd, Object &ob, const blender::IndexMask &node_mask)
bool SCULPT_mode_poll(bContext *C)
Definition sculpt.cc:3677
void SCULPT_calc_vertex_displacement(const SculptSession &ss, const Brush &brush, float translation[3])
Definition sculpt.cc:2388
bool SCULPT_stroke_is_main_symmetry_pass(const blender::ed::sculpt_paint::StrokeCache &cache)
Definition sculpt.cc:530
int SCULPT_vertex_count_get(const Object &object)
Definition sculpt.cc:151
blender::Span< int > SCULPT_fake_neighbors_ensure(const Depsgraph &depsgraph, Object &ob, float max_dist)
Definition sculpt.cc:6098
void SCULPT_fake_neighbors_free(Object &ob)
Definition sculpt.cc:6120
void SCULPT_cache_calc_brushdata_symm(blender::ed::sculpt_paint::StrokeCache &cache, ePaintSymmetryFlags symm, char axis, float angle)
Definition sculpt.cc:3465
bool SCULPT_is_vertex_inside_brush_radius_symm(const float vertex[3], const float br_co[3], float radius, char symm)
Definition sculpt.cc:742
bool SCULPT_use_image_paint_brush(PaintModeSettings &settings, Object &ob)
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.
bool SCULPT_poll(bContext *C)
Definition sculpt.cc:3689
ePaintSymmetryAreas SCULPT_get_vertex_symm_area(const float co[3])
Definition sculpt.cc:2825
void SCULPT_cube_tip_init(const Sculpt &sd, const Object &ob, const Brush &brush, float mat[4][4])
Definition sculpt.cc:6328
bool SCULPT_stroke_is_first_brush_step(const blender::ed::sculpt_paint::StrokeCache &cache)
Definition sculpt.cc:536
void sculpt_project_v3_normal_align(const SculptSession &ss, float normal_weight, float grab_delta[3])
Definition sculpt.cc:567
void SCULPT_tag_update_overlays(bContext *C)
Definition sculpt.cc:759
char sculpt_brush_type
struct MTex mtex
char brush_map_mode
blender::float3 follow_co
static std::optional< ShapeKeyData > from_object(Object &object)
Definition sculpt.cc:7416
Vector< MutableSpan< float3 > > dependent_keys
std::optional< math::Quaternion > rake_rotation
std::unique_ptr< pose::IKChain > pose_ik_chain
struct blender::ed::sculpt_paint::StrokeCache::@216032235377206062040134367360200004271263147147 paint_brush
struct blender::ed::sculpt_paint::StrokeCache::@177302106234056170131152043023217207016132071266 clay_thumb_brush
std::unique_ptr< auto_mask::Cache > automasking
struct blender::ed::sculpt_paint::StrokeCache::@341056124057116163146344066210332230262122242125 plane_brush
struct blender::ed::sculpt_paint::StrokeCache::@120056277040371114166010206352311170205127263324 mirror_modifier_clip
std::optional< math::Quaternion > rake_rotation_symm
struct blender::ed::sculpt_paint::StrokeCache::@002250273023223321360377071017315321037224215265 displacement_smear
std::unique_ptr< cloth::SimulationData > cloth_sim
std::array< float, 10 > pressure_stabilizer
std::array< std::unique_ptr< boundary::SculptBoundary >, PAINT_SYMM_AREAS > boundaries
std::optional< blender::float3 > initial_hsv_jitter
wmOperatorType * ot
Definition wm_files.cc:4237