Blender V4.5
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
246 float special_rotation = 0.0f;
251
252 /* Screen-space rotation defined by mouse motion. */
253 std::optional<math::Quaternion> rake_rotation;
254 std::optional<math::Quaternion> rake_rotation_symm;
256
257 /* The face set being painted. */
259
265 int symmetry = 0;
266 /* The symmetry pass we are currently on between 0 and 7. */
270
281
293
294 /* used to shift the plane around when doing tiled strokes */
296 int tile_pass = 0;
297
302
307 bool accum = false;
308
309 /* Paint Brush. */
310 struct {
311 float flow = 0.0f;
312
314 float wet_mix = 0.0f;
315 float wet_persistence = 0.0f;
316
317 std::optional<float> density_seed;
318 float density = 0.0f;
319
327
328 /* Pose brush */
329 std::unique_ptr<pose::IKChain> pose_ik_chain;
330
331 /* Enhance Details. */
333
334 /* Clay Thumb brush */
335 struct {
336 /* Angle of the front tilting plane of the brush to simulate clay accumulation. */
337 float front_angle = 0.0f;
338 /* Stores the last 10 pressure samples to get a stabilized strength and radius variation. */
339 std::array<float, 10> pressure_stabilizer;
341
343
344 /* Plane Brush */
345 struct {
346 std::optional<float3> last_normal;
347 std::optional<float3> last_center;
352
361 bool first_time = false;
363
364 /* Cloth brush */
365 std::unique_ptr<cloth::SimulationData> cloth_sim;
370
371 /* Boundary brush */
372 std::array<std::unique_ptr<boundary::SculptBoundary>, PAINT_SYMM_AREAS> boundaries;
373
374 /* Surface Smooth Brush */
375 /* Stores the displacement produced by the laplacian step of HC smooth. */
377
378 /* Layer brush */
380
381 /* Amount to rotate the vertices when using rotate brush. */
382 float vertex_rotation = 0.0f;
383 Dial *dial = nullptr;
384
387 /* Smooth tool copies the size of the current tool. */
389
396 bool alt_smooth = false;
397
398 float plane_trim_squared = 0.0f;
399
400 bool supports_gravity = false;
403
404 std::unique_ptr<auto_mask::Cache> automasking;
405
408
410 ~StrokeCache();
411};
412
413} // namespace blender::ed::sculpt_paint
414
416
417/* -------------------------------------------------------------------- */
420
426bool SCULPT_poll(bContext *C);
427
432
441bool color_supported_check(const Scene &scene, Object &object, ReportList *reports);
442} // namespace blender::ed::sculpt_paint
443
445
446/* -------------------------------------------------------------------- */
449
451
455void flush_update_step(const bContext *C, UpdateType update_type);
459void flush_update_done(const bContext *C, Object &ob, UpdateType update_type);
460
461} // namespace blender::ed::sculpt_paint
462
468
469/* -------------------------------------------------------------------- */
472
480bool stroke_get_location_bvh(bContext *C, float out[3], const float mval[2], bool force_original);
481
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, Scene &scene);
856
859 const Scene &scene,
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 Scene &scene,
883 const Depsgraph &depsgraph,
884 PaintModeSettings &paint_mode_settings,
885 const Sculpt &sd,
886 Object &ob,
887 const blender::IndexMask &node_mask);
889
891
892/* -------------------------------------------------------------------- */
895
897
899
900}
901
903
905void modal_keymap(wmKeyConfig *keyconf);
906
907} // namespace blender::ed::sculpt_paint::expand
908
912
919
921
927
932
933} // namespace blender::ed::sculpt_paint::face_set
934
936
938
939}
940
942
945
946} // namespace blender::ed::sculpt_paint::filter
947
950}
951
953void SCULPT_OT_color_filter(wmOperatorType *ot);
954}
955
957
958void SCULPT_OT_mask_filter(wmOperatorType *ot);
959void SCULPT_OT_mask_init(wmOperatorType *ot);
960
961} // namespace blender::ed::sculpt_paint::mask
962
964
965void SCULPT_OT_detail_flood_fill(wmOperatorType *ot);
966void SCULPT_OT_sample_detail_size(wmOperatorType *ot);
967void SCULPT_OT_dyntopo_detail_size_edit(wmOperatorType *ot);
968void SCULPT_OT_dynamic_topology_toggle(wmOperatorType *ot);
969
970} // namespace blender::ed::sculpt_paint::dyntopo
971
#define PAINT_SYMM_AREAS
Definition BKE_paint.hh:143
ePaintSymmetryAreas
Definition BKE_paint.hh:136
#define SCULPT_FACE_SET_NONE
Definition BKE_paint.hh:344
A BVH for high poly meshes.
#define BLI_assert(a)
Definition BLI_assert.h:46
#define ATTR_NONNULL(...)
#define BLI_INLINE
#define ELEM(...)
float[3] Vector
float[4] Color
@ 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
ReportList * reports
Definition WM_types.hh:1025
BPy_StructRNA * depsgraph
void deform(MutableSpan< float3 > translations, Span< int > verts) const
Definition sculpt.cc:7445
PositionDeformData(const Depsgraph &depsgraph, Object &object_orig)
Definition sculpt.cc:7427
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:4921
float object_space_radius_get(const ViewContext &vc, const Scene &scene, const Brush &brush, const float3 &location, const float scale_factor)
Definition sculpt.cc:115
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:2410
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:2420
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:142
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:593
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:2399
float3 tilt_effective_normal_get(const SculptSession &ss, const Brush &brush)
Definition sculpt.cc:2699
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, Scene &scene)
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:5459
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:4623
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:4664
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:2483
void flush_update_done(const bContext *C, Object &ob, const UpdateType update_type)
Definition sculpt.cc:5131
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:5753
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:2891
Span< BMVert * > vert_neighbors_get_interior_bmesh(BMVert &vert, BMeshNeighborVerts &r_neighbors)
Definition sculpt.cc:403
std::optional< float3 > calc_area_normal(const Depsgraph &depsgraph, const Brush &brush, const Object &ob, const IndexMask &node_mask)
Definition sculpt.cc:1814
Span< BMVert * > vert_neighbors_get_bmesh(BMVert &vert, BMeshNeighborVerts &r_neighbors)
Definition sculpt.cc:388
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:6114
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:1712
void flush_update_step(const bContext *C, const UpdateType update_type)
Definition sculpt.cc:5083
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:2974
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:694
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:640
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:2010
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:430
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:170
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:2671
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:2303
bool SCULPT_stroke_is_first_brush_step_of_symmetry_pass(const blender::ed::sculpt_paint::StrokeCache &cache)
Definition sculpt.cc:543
void SCULPT_flip_quat_by_symm_area(float quat[4], ePaintSymmetryFlags symm, ePaintSymmetryAreas symmarea, const float pivot[3])
Definition sculpt.cc:2870
bool SCULPT_brush_cursor_poll(bContext *C)
Definition sculpt.cc:3717
ePaintSymmetryFlags SCULPT_mesh_symmetry_xyz_get(const Object &object)
Definition sculpt.cc:185
const float * SCULPT_brush_frontface_normal_from_falloff_shape(const SculptSession &ss, char falloff_shape)
Definition sculpt.cc:1181
void SCULPT_stroke_modifiers_check(const bContext *C, Object &ob, const Brush &brush)
Definition sculpt.cc:4447
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)
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:549
bool SCULPT_mode_poll_view3d(bContext *C)
Definition sculpt.cc:3666
bool SCULPT_mode_poll(bContext *C)
Definition sculpt.cc:3660
void SCULPT_calc_vertex_displacement(const SculptSession &ss, const Brush &brush, float translation[3])
Definition sculpt.cc:2369
bool SCULPT_stroke_is_main_symmetry_pass(const blender::ed::sculpt_paint::StrokeCache &cache)
Definition sculpt.cc:531
int SCULPT_vertex_count_get(const Object &object)
Definition sculpt.cc:152
blender::Span< int > SCULPT_fake_neighbors_ensure(const Depsgraph &depsgraph, Object &ob, float max_dist)
Definition sculpt.cc:6084
void SCULPT_fake_neighbors_free(Object &ob)
Definition sculpt.cc:6106
void SCULPT_cache_calc_brushdata_symm(blender::ed::sculpt_paint::StrokeCache &cache, ePaintSymmetryFlags symm, char axis, float angle)
Definition sculpt.cc:3446
bool SCULPT_is_vertex_inside_brush_radius_symm(const float vertex[3], const float br_co[3], float radius, char symm)
Definition sculpt.cc:743
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:3672
ePaintSymmetryAreas SCULPT_get_vertex_symm_area(const float co[3])
Definition sculpt.cc:2806
void SCULPT_cube_tip_init(const Sculpt &sd, const Object &ob, const Brush &brush, float mat[4][4])
Definition sculpt.cc:6314
bool SCULPT_stroke_is_first_brush_step(const blender::ed::sculpt_paint::StrokeCache &cache)
Definition sculpt.cc:537
void sculpt_project_v3_normal_align(const SculptSession &ss, float normal_weight, float grab_delta[3])
Definition sculpt.cc:568
void SCULPT_tag_update_overlays(bContext *C)
Definition sculpt.cc:760
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:7399
Vector< MutableSpan< float3 > > dependent_keys
struct blender::ed::sculpt_paint::StrokeCache::@311364231114302125055074143272255322205255231210 mirror_modifier_clip
std::optional< math::Quaternion > rake_rotation
std::unique_ptr< pose::IKChain > pose_ik_chain
struct blender::ed::sculpt_paint::StrokeCache::@075344042046246333255345044274002164343034264126 displacement_smear
struct blender::ed::sculpt_paint::StrokeCache::@304264133216251371224021372200355026016144364316 clay_thumb_brush
std::unique_ptr< auto_mask::Cache > automasking
struct blender::ed::sculpt_paint::StrokeCache::@140233062077157027106001372232256125135050036057 paint_brush
struct blender::ed::sculpt_paint::StrokeCache::@356307137154005365075150012170202326075161346056 plane_brush
std::optional< math::Quaternion > rake_rotation_symm
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:4226