Blender  V3.3
sculpt_intern.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2006 by Nicholas Bishop. All rights reserved. */
3 
8 #pragma once
9 
10 #include "DNA_brush_types.h"
11 #include "DNA_key_types.h"
12 #include "DNA_listBase.h"
13 #include "DNA_meshdata_types.h"
14 #include "DNA_scene_types.h"
15 #include "DNA_vec_types.h"
16 
17 #include "BKE_paint.h"
18 #include "BKE_pbvh.h"
19 #include "BLI_bitmap.h"
20 #include "BLI_compiler_attrs.h"
21 #include "BLI_compiler_compat.h"
22 #include "BLI_gsqueue.h"
23 #include "BLI_threads.h"
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 struct AutomaskingCache;
30 struct Image;
31 struct ImageUser;
32 struct KeyBlock;
33 struct Object;
34 struct SculptUndoNode;
35 struct bContext;
36 struct PaintModeSettings;
37 
38 /* Updates */
39 
40 /* -------------------------------------------------------------------- */
44 typedef enum SculptUpdateType {
51 
52 typedef struct SculptCursorGeometryInfo {
53  float location[3];
54  float normal[3];
55  float active_vertex_co[3];
57 
58 #define SCULPT_VERTEX_NEIGHBOR_FIXED_CAPACITY 256
59 
60 typedef struct SculptVertexNeighborIter {
61  /* Storage */
62  int *neighbors;
63  int size;
64  int capacity;
66 
67  /* Internal iterator. */
69  int i;
70 
71  /* Public */
72  int index;
75 
76 /* Sculpt Original Data */
77 typedef struct {
78  struct BMLog *bm_log;
79 
81  float (*coords)[3];
82  float (*normals)[3];
83  const float *vmasks;
84  float (*colors)[4];
85 
86  /* Original coordinate, normal, and mask. */
87  const float *co;
88  const float *no;
89  float mask;
90  const float *col;
92 
93 /* Flood Fill. */
94 typedef struct {
98 
99 typedef enum eBoundaryAutomaskMode {
103 
104 /* Undo */
105 
106 typedef enum {
117 
118 /* Storage of geometry for the undo node.
119  * Is used as a storage for either original or modified geometry. */
120 typedef struct SculptUndoNodeGeometry {
121  /* Is used for sanity check, helping with ensuring that two and only two
122  * geometry pushes happened in the undo stack. */
124 
129  int totvert;
130  int totedge;
131  int totloop;
132  int totpoly;
134 
135 typedef struct SculptUndoNode {
137 
139 
140  char idname[MAX_ID_NAME]; /* Name instead of pointer. */
141  void *node; /* only during push, not valid afterwards! */
142 
143  float (*co)[3];
144  float (*orig_co)[3];
145  float (*no)[3];
146  float (*col)[4];
147  float *mask;
148  int totvert;
149 
152  int totloop;
153 
154  /* non-multires */
155  int maxvert; /* to verify if totvert it still the same */
156  int *index; /* Unique vertex indices, to restore into right location */
157  int maxloop;
159 
161 
162  /* multires */
163  int maxgrid; /* same for grid */
164  int gridsize; /* same for grid */
165  int totgrid; /* to restore into right location */
166  int *grids; /* to restore into right location */
168 
169  /* bmesh */
171  bool applied;
172 
173  /* shape keys */
174  char shapeName[sizeof(((KeyBlock *)0))->name];
175 
176  /* Geometry modification operations.
177  *
178  * Original geometry is stored before some modification is run and is used to restore state of
179  * the object when undoing the operation
180  *
181  * Modified geometry is stored after the modification and is used to redo the modification. */
185 
186  /* Geometry at the bmesh enter moment. */
188 
189  /* pivot */
190  float pivot_pos[3];
191  float pivot_rot[4];
192 
193  /* Sculpt Face Sets */
194  int *face_sets;
195 
196  size_t undo_size;
198 
199 /* Factor of brush to have rake point following behind
200  * (could be configurable but this is reasonable default). */
201 #define SCULPT_RAKE_BRUSH_FACTOR 0.25f
202 
204  float follow_dist;
205  float follow_co[3];
206 };
207 
213 typedef struct SculptThreadedTaskData {
214  struct bContext *C;
215  struct Sculpt *sd;
216  struct Object *ob;
217  const struct Brush *brush;
218  struct PBVHNode **nodes;
219  int totnode;
220 
221  struct VPaint *vp;
222  struct WPaintData *wpd;
224  unsigned int *lcol;
225  struct Mesh *me;
226  /* For passing generic params. */
227  void *custom_data;
228 
229  /* Data specific to some callbacks. */
230 
231  /* NOTE: even if only one or two of those are used at a time,
232  * keeping them separated, names help figuring out
233  * what it is, and memory overhead is ridiculous anyway. */
235  float angle;
236  float strength;
239 
241  float *offset;
242  float *grab_delta;
243  float *cono;
244  float *area_no;
245  float *area_no_sp;
246  float *area_co;
247  float (*mat)[4];
248  float (*vertCos)[3];
249 
250  /* When true, the displacement stored in the proxies will be applied to the original coordinates
251  * instead of to the current coordinates. */
253 
254  /* X and Z vectors aligned to the stroke direction for operations where perpendicular vectors to
255  * the stroke direction are needed. */
257 
261 
264 
265  /* 0=towards view, 1=flipped */
268  int *count_no;
269  int *count_co;
270 
272 
274 
275  float *prev_mask;
276 
277  float *pose_factor;
280 
283 
286 
287  /* Stabilized strength for the Clay Thumb brush. */
289 
295 
296  float transform_mats[8][4][4];
301 
302  /* Boundary brush */
304 
309 
313 
314  /* Mask By Color Tool */
315 
319 
320  /* Index of the vertex that is going to be used as a reference for the colors. */
323 
324  int face_set;
326 
329 
331 
333 
334 /*************** Brush testing declarations ****************/
335 typedef struct SculptBrushTest {
337  float radius;
338  float location[3];
339  float dist;
341 
343  float symm_rot_mat_inv[4][4];
344 
345  /* For circle (not sphere) projection. */
346  float plane_view[4];
347 
348  /* Some tool code uses a plane for its calculations. */
349  float plane_tool[4];
350 
351  /* View3d clipping - only set rv3d for clipping */
354 
355 typedef bool (*SculptBrushTestFn)(SculptBrushTest *test, const float co[3]);
356 
357 typedef struct {
358  struct Sculpt *sd;
359  struct SculptSession *ss;
361  const float *center;
362  bool original;
363  /* This ignores fully masked and fully hidden nodes. */
366 
367 typedef struct {
368  struct Sculpt *sd;
369  struct SculptSession *ss;
371  bool original;
375 
376 /* Sculpt Filters */
382 
383 /* Defines how transform tools are going to apply its displacement. */
385  /* Displaces the elements from their original coordinates. */
387  /* Displaces the elements incrementally from their previous position. */
390 
391 #define SCULPT_CLAY_STABILIZER_LEN 10
392 
393 typedef struct AutomaskingSettings {
394  /* Flags from eAutomasking_flag. */
395  int flags;
398 
399 typedef struct AutomaskingCache {
401  /* Precomputed auto-mask factor indexed by vertex, owned by the auto-masking system and
402  * initialized in #SCULPT_automasking_cache_init when needed. */
403  float *factor;
405 
406 typedef struct FilterCache {
407  bool enabled_axis[3];
410 
411  /* Used for alternating between filter operations in filters that need to apply different ones to
412  * achieve certain effects. */
414 
415  /* Stores the displacement produced by the laplacian step of HC smooth. */
419 
420  /* Sharpen mesh filter. */
426 
427  /* Filter orientation. */
429  float obmat[4][4];
430  float obmat_inv[4][4];
431  float viewmat[4][4];
432  float viewmat_inv[4][4];
433 
434  /* Displacement eraser. */
436 
437  /* unmasked nodes */
439  int totnode;
440 
441  /* Cloth filter. */
444 
445  /* mask expand iteration caches */
450  float *edge_factor;
451  float *prev_mask;
453 
456 
458 
460 
461  /* Auto-masking. */
463 
464  /* Pre-smoothed colors used by sharpening. Colors are HSL. */
467 
472 typedef struct StrokeCache {
473  /* Invariants */
475  float scale[3];
476  int flag;
477  float clip_tolerance[3];
478  float clip_mirror_mtx[4][4];
479  float initial_mouse[2];
480 
481  /* Variants */
482  float radius;
484  float true_location[3];
486  float location[3];
487  float last_location[3];
489 
490  /* Used for alternating between deformation in brushes that need to apply different ones to
491  * achieve certain effects. */
493 
494  /* Original pixel radius with the pressure curve applied for dyntopo detail size */
496 
498 
499  bool pen_flip;
500  bool invert;
501  float pressure;
502  float bstrength;
503  float normal_weight; /* from brush (with optional override) */
504  float x_tilt;
505  float y_tilt;
506 
507  /* Position of the mouse corresponding to the stroke location, modified by the paint_stroke
508  * operator according to the stroke type. */
509  float mouse[2];
510  /* Position of the mouse event in screen space, not modified by the stroke type. */
511  float mouse_event[2];
512 
515 
516  /* Multires Displacement Smear. */
519 
520  /* The rest is temporary storage that isn't saved as a property */
521 
522  bool first_time; /* Beginning of stroke may do some things special */
523 
524  /* from ED_view3d_ob_project_mat_get() */
525  float projection_mat[4][4];
526 
527  /* Clean this up! */
528  struct ViewContext *vc;
529  const struct Brush *brush;
530 
534 
535  /* screen-space rotation defined by mouse motion */
538  struct SculptRakeData rake_data;
539 
540  /* Face Sets */
542 
543  /* Symmetry index between 0 and 7 bit combo 0 is Brush only;
544  * 1 is X mirror; 2 is Y mirror; 3 is XY; 4 is Z; 5 is XZ; 6 is YZ; 7 is XYZ */
545  int symmetry;
546  int mirror_symmetry_pass; /* The symmetry pass we are currently on between 0 and 7. */
548  float view_normal[3];
549 
550  /* sculpt_normal gets calculated by calc_sculpt_normal(), then the
551  * sculpt_normal_symm gets updated quickly with the usual symmetry
552  * transforms */
553  float sculpt_normal[3];
555 
556  /* Used for area texture mode, local_mat gets calculated by
557  * calc_brush_local_mat() and used in tex_strength(). */
558  float brush_local_mat[4][4];
559 
560  float plane_offset[3]; /* used to shift the plane around when doing tiled strokes */
562 
563  float last_center[3];
565  float symm_rot_mat[4][4];
566  float symm_rot_mat_inv[4][4];
567  bool original;
569 
570  /* Paint Brush. */
571  struct {
572  float hardness;
573  float flow;
574  float wet_mix;
576  float density;
578 
579  /* Pose brush */
581 
582  /* Enhance Details. */
584 
585  /* Clay Thumb brush */
586  /* Angle of the front tilting plane of the brush to simulate clay accumulation. */
588  /* Stores pressure samples to get an stabilized strength and radius variation. */
591 
592  /* Cloth brush */
596  float initial_normal[3];
598 
599  /* Boundary brush */
601 
602  /* Surface Smooth Brush */
603  /* Stores the displacement produced by the laplacian step of HC smooth. */
605 
606  /* Layer brush */
608 
609  float vertex_rotation; /* amount to rotate the vertices when using rotate brush */
610  struct Dial *dial;
611 
614  int saved_smooth_size; /* smooth tool copies the size of the current tool */
616 
618 
622 
623  /* Auto-masking. */
625 
626  float stroke_local_mat[4][4];
628 
631 
632  rcti previous_r; /* previous redraw rectangle */
633  rcti current_r; /* current redraw rectangle */
634 
636 
637 /* -------------------------------------------------------------------- */
651 
657 
662 
663 #define EXPAND_SYMM_AREAS 8
664 
665 typedef struct ExpandCache {
666  /* Target data elements that the expand operation will affect. */
668 
669  /* Falloff data. */
671 
672  /* Indexed by vertex index, precalculated falloff value of that vertex (without any falloff
673  * editing modification applied). */
674  float *vert_falloff;
675  /* Max falloff value in *vert_falloff. */
677 
678  /* Indexed by base mesh poly index, precalculated falloff value of that face. These values are
679  * calculated from the per vertex falloff (*vert_falloff) when needed. */
680  float *face_falloff;
682 
683  /* Falloff value of the active element (vertex or base mesh face) that Expand will expand to. */
685 
686  /* When set to true, expand skips all falloff computations and considers all elements as enabled.
687  */
689 
690  /* Initial mouse and cursor data from where the current falloff started. This data can be changed
691  * during the execution of Expand by moving the origin. */
693  float initial_mouse[2];
696 
697  /* Maximum number of vertices allowed in the SculptSession for previewing the falloff using
698  * geodesic distances. */
700 
701  /* Original falloff type before starting the move operation. */
703  /* Falloff type using when moving the origin for preview. */
705 
706  /* Face set ID that is going to be used when creating a new Face Set. */
708 
709  /* Face Set ID of the Face set selected for editing. */
711 
712  /* Mouse position since the last time the origin was moved. Used for reference when moving the
713  * initial position of Expand. */
715 
716  /* Active components checks. */
717  /* Indexed by symmetry pass index, contains the connected component ID found in
718  * SculptSession->vertex_info.connected_component. Other connected components not found in this
719  * array will be ignored by Expand. */
721 
722  /* Snapping. */
723  /* GSet containing all Face Sets IDs that Expand will use to snap the new data. */
725 
726  /* Texture distortion data. */
728  struct Scene *scene;
729  struct MTex *mtex;
730 
731  /* Controls how much texture distortion will be applied to the current falloff */
733 
734  /* Cached PBVH nodes. This allows to skip gathering all nodes from the PBVH each time expand
735  * needs to update the state of the elements. */
737  int totnode;
738 
739  /* Expand state options. */
740 
741  /* Number of loops (times that the falloff is going to be repeated). */
743 
744  /* Invert the falloff result. */
745  bool invert;
746 
747  /* When set to true, preserves the previous state of the data and adds the new one on top. */
748  bool preserve;
749 
750  /* When set to true, the mask or colors will be applied as a gradient. */
752 
753  /* When set to true, Expand will use the Brush falloff curve data to shape the gradient. */
755 
756  /* When set to true, Expand will move the origin (initial active vertex and cursor position)
757  * instead of updating the active vertex and active falloff. */
758  bool move;
759 
760  /* When set to true, Expand will snap the new data to the Face Sets IDs found in
761  * *original_face_sets. */
762  bool snap;
763 
764  /* When set to true, Expand will use the current Face Set ID to modify an existing Face Set
765  * instead of creating a new one. */
767 
768  /* When set to true, Expand will reposition the sculpt pivot to the boundary of the expand result
769  * after finishing the operation. */
771 
772  /* Color target data type related data. */
773  float fill_color[4];
774  short blend_mode;
775 
776  /* Face Sets at the first step of the expand operation, before starting modifying the active
777  * vertex and active falloff. These are not the original Face Sets of the sculpt before starting
778  * the operator as they could have been modified by Expand when initializing the operator and
779  * before starting changing the active vertex. These Face Sets are used for restoring and
780  * checking the Face Sets state while the Expand operation modal runs. */
782 
783  /* Original data of the sculpt as it was before running the Expand operator. */
792 /* -------------------------------------------------------------------- */
796 bool SCULPT_mode_poll(struct bContext *C);
797 bool SCULPT_mode_poll_view3d(struct bContext *C);
801 bool SCULPT_poll(struct bContext *C);
802 bool SCULPT_poll_view3d(struct bContext *C);
803 
814 bool SCULPT_handles_colors_report(struct SculptSession *ss, struct ReportList *reports);
815 
818 /* -------------------------------------------------------------------- */
823 void SCULPT_flush_update_done(const bContext *C, Object *ob, SculptUpdateType update_flags);
824 
825 void SCULPT_pbvh_clear(Object *ob);
826 
830 void SCULPT_flush_stroke_deform(struct Sculpt *sd, Object *ob, bool is_proxy_used);
831 
838 /* -------------------------------------------------------------------- */
842 /* Stroke */
843 
850  float out[3],
851  const float mouse[2],
852  bool force_original);
859  const float mouse[2],
860  bool use_sampled_normal);
861 void SCULPT_geometry_preview_lines_update(bContext *C, struct SculptSession *ss, float radius);
862 
863 void SCULPT_stroke_modifiers_check(const bContext *C, Object *ob, const Brush *brush);
864 float SCULPT_raycast_init(struct ViewContext *vc,
865  const float mval[2],
866  float ray_start[3],
867  float ray_end[3],
868  float ray_normal[3],
869  bool original);
870 
871 /* Symmetry */
873 
891 
894 /* -------------------------------------------------------------------- */
900 
901 int SCULPT_vertex_count_get(struct SculptSession *ss);
902 const float *SCULPT_vertex_co_get(struct SculptSession *ss, int index);
903 
905 void SCULPT_vertex_normal_get(SculptSession *ss, int index, float no[3]);
906 
907 float SCULPT_vertex_mask_get(struct SculptSession *ss, int index);
908 void SCULPT_vertex_color_get(const SculptSession *ss, int index, float r_color[4]);
909 void SCULPT_vertex_color_set(SculptSession *ss, int index, const float color[4]);
910 
912 bool SCULPT_has_colors(const SculptSession *ss);
913 
915 bool SCULPT_has_loop_colors(const struct Object *ob);
916 
917 const float *SCULPT_vertex_persistent_co_get(SculptSession *ss, int index);
918 void SCULPT_vertex_persistent_normal_get(SculptSession *ss, int index, float no[3]);
919 
923 const float *SCULPT_vertex_co_for_grab_active_get(SculptSession *ss, int index);
924 
929 void SCULPT_vertex_limit_surface_get(SculptSession *ss, int index, float r_co[3]);
930 
936  int deform_target,
937  PBVHVertexIter *iter);
938 
940  int index,
941  bool include_duplicates,
943 
945 #define SCULPT_VERTEX_NEIGHBORS_ITER_BEGIN(ss, v_index, neighbor_iterator) \
946  SCULPT_vertex_neighbors_get(ss, v_index, false, &neighbor_iterator); \
947  for (neighbor_iterator.i = 0; neighbor_iterator.i < neighbor_iterator.size; \
948  neighbor_iterator.i++) { \
949  neighbor_iterator.index = neighbor_iterator.neighbors[neighbor_iterator.i];
950 
953 #define SCULPT_VERTEX_DUPLICATES_AND_NEIGHBORS_ITER_BEGIN(ss, v_index, neighbor_iterator) \
954  SCULPT_vertex_neighbors_get(ss, v_index, true, &neighbor_iterator); \
955  for (neighbor_iterator.i = neighbor_iterator.size - 1; neighbor_iterator.i >= 0; \
956  neighbor_iterator.i--) { \
957  neighbor_iterator.index = neighbor_iterator.neighbors[neighbor_iterator.i]; \
958  neighbor_iterator.is_duplicate = (neighbor_iterator.i >= \
959  neighbor_iterator.size - neighbor_iterator.num_duplicates);
960 
961 #define SCULPT_VERTEX_NEIGHBORS_ITER_END(neighbor_iterator) \
962  } \
963  if (neighbor_iterator.neighbors != neighbor_iterator.neighbors_fixed) { \
964  MEM_freeN(neighbor_iterator.neighbors); \
965  } \
966  ((void)0)
967 
971 
972 /* Returns PBVH deformed vertices array if shape keys or deform modifiers are used, otherwise
973  * returns mesh original vertices array. */
975 
976 /* Fake Neighbors */
977 
978 #define FAKE_NEIGHBOR_NONE -1
979 
980 void SCULPT_fake_neighbors_ensure(struct Sculpt *sd, Object *ob, float max_dist);
983 void SCULPT_fake_neighbors_free(struct Object *ob);
984 
985 /* Vertex Info. */
986 void SCULPT_boundary_info_ensure(Object *object);
987 /* Boundary Info needs to be initialized in order to use this function. */
988 bool SCULPT_vertex_is_boundary(const SculptSession *ss, int index);
989 
991 
994 /* -------------------------------------------------------------------- */
998 void SCULPT_vertex_visible_set(SculptSession *ss, int index, bool visible);
999 bool SCULPT_vertex_visible_get(SculptSession *ss, int index);
1000 
1003 
1006 /* -------------------------------------------------------------------- */
1011 int SCULPT_vertex_face_set_get(SculptSession *ss, int index);
1012 void SCULPT_vertex_face_set_set(SculptSession *ss, int index, int face_set);
1013 
1014 bool SCULPT_vertex_has_face_set(SculptSession *ss, int index, int face_set);
1016 
1018 
1019 void SCULPT_face_set_visibility_set(SculptSession *ss, int face_set, bool visible);
1020 bool SCULPT_vertex_all_face_sets_visible_get(const SculptSession *ss, int index);
1022 
1024 void SCULPT_face_sets_visibility_all_set(SculptSession *ss, bool visible);
1025 
1028 /* -------------------------------------------------------------------- */
1037  Object *ob,
1038  PBVHNode *node,
1049  Object *ob,
1050  struct SculptUndoNode *unode);
1053 /* -------------------------------------------------------------------- */
1058 {
1059  if (brush->sculpt_tool == SCULPT_TOOL_ELASTIC_DEFORM) {
1060  /* Elastic deformations in any brush need all nodes to avoid artifacts as the effect
1061  * of the Kelvinlet is not constrained by the radius. */
1062  return true;
1063  }
1064 
1065  if (brush->sculpt_tool == SCULPT_TOOL_POSE) {
1066  /* Pose needs all nodes because it applies all symmetry iterations at the same time
1067  * and the IK chain can grow to any area of the model. */
1068  /* TODO: This can be optimized by filtering the nodes after calculating the chain. */
1069  return true;
1070  }
1071 
1072  if (brush->sculpt_tool == SCULPT_TOOL_BOUNDARY) {
1073  /* Boundary needs all nodes because it is not possible to know where the boundary
1074  * deformation is going to be propagated before calculating it. */
1075  /* TODO: after calculating the boundary info in the first iteration, it should be
1076  * possible to get the nodes that have vertices included in any boundary deformation
1077  * and cache them. */
1078  return true;
1079  }
1080 
1081  if (brush->sculpt_tool == SCULPT_TOOL_SNAKE_HOOK &&
1083  /* Snake hook in elastic deform type has same requirements as the elastic deform tool. */
1084  return true;
1085  }
1086  return false;
1087 }
1088 
1089 void SCULPT_calc_brush_plane(struct Sculpt *sd,
1090  struct Object *ob,
1091  struct PBVHNode **nodes,
1092  int totnode,
1093  float r_area_no[3],
1094  float r_area_co[3]);
1095 
1097  Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode, float r_area_no[3]);
1103  Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode, float r_area_no[3], float r_area_co[3]);
1105  Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode, float r_area_co[3]);
1106 
1107 int SCULPT_nearest_vertex_get(struct Sculpt *sd,
1108  struct Object *ob,
1109  const float co[3],
1110  float max_distance,
1111  bool use_original);
1112 
1113 int SCULPT_plane_point_side(const float co[3], const float plane[4]);
1114 int SCULPT_plane_trim(const struct StrokeCache *cache,
1115  const struct Brush *brush,
1116  const float val[3]);
1120 void SCULPT_clip(Sculpt *sd, SculptSession *ss, float co[3], const float val[3]);
1121 
1123 
1125 bool SCULPT_check_vertex_pivot_symmetry(const float vco[3], const float pco[3], char symm);
1129 bool SCULPT_is_vertex_inside_brush_radius_symm(const float vertex[3],
1130  const float br_co[3],
1131  float radius,
1132  char symm);
1133 bool SCULPT_is_symmetry_iteration_valid(char i, char symm);
1134 void SCULPT_flip_v3_by_symm_area(float v[3],
1135  ePaintSymmetryFlags symm,
1136  ePaintSymmetryAreas symmarea,
1137  const float pivot[3]);
1138 void SCULPT_flip_quat_by_symm_area(float quat[4],
1139  ePaintSymmetryFlags symm,
1140  ePaintSymmetryAreas symmarea,
1141  const float pivot[3]);
1142 
1146 void SCULPT_brush_test_init(struct SculptSession *ss, SculptBrushTest *test);
1147 
1148 bool SCULPT_brush_test_sphere(SculptBrushTest *test, const float co[3]);
1149 bool SCULPT_brush_test_sphere_sq(SculptBrushTest *test, const float co[3]);
1150 bool SCULPT_brush_test_sphere_fast(const SculptBrushTest *test, const float co[3]);
1152  const float co[3],
1153  const float local[4][4],
1154  float roundness);
1155 bool SCULPT_brush_test_circle_sq(SculptBrushTest *test, const float co[3]);
1159 bool SCULPT_search_sphere_cb(PBVHNode *node, void *data_v);
1163 bool SCULPT_search_circle_cb(PBVHNode *node, void *data_v);
1164 
1166 
1175  SculptBrushTest *test,
1176  char falloff_shape);
1178  char falloff_shape);
1179 
1184  const struct Brush *br,
1185  const float point[3],
1186  float len,
1187  const float vno[3],
1188  const float fno[3],
1189  float mask,
1190  int vertex_index,
1191  int thread_id);
1192 
1196 void SCULPT_tilt_apply_to_normal(float r_normal[3],
1197  struct StrokeCache *cache,
1198  float tilt_strength);
1199 
1203 void SCULPT_tilt_effective_normal_get(const SculptSession *ss, const Brush *brush, float r_no[3]);
1204 
1207 /* -------------------------------------------------------------------- */
1211 void SCULPT_floodfill_init(struct SculptSession *ss, SculptFloodFill *flood);
1212 void SCULPT_floodfill_add_active(struct Sculpt *sd,
1213  struct Object *ob,
1214  struct SculptSession *ss,
1215  SculptFloodFill *flood,
1216  float radius);
1218  struct Object *ob,
1219  struct SculptSession *ss,
1220  SculptFloodFill *flood,
1221  int index,
1222  float radius);
1223 void SCULPT_floodfill_add_initial(SculptFloodFill *flood, int index);
1226  struct SculptSession *ss,
1227  SculptFloodFill *flood,
1228  bool (*func)(SculptSession *ss, int from_v, int to_v, bool is_duplicate, void *userdata),
1229  void *userdata);
1231 
1234 /* -------------------------------------------------------------------- */
1243 };
1244 
1246 void SCULPT_dynamic_topology_enable_ex(struct Main *bmain,
1247  struct Depsgraph *depsgraph,
1248  Scene *scene,
1249  Object *ob);
1252  struct Depsgraph *depsgraph,
1253  Scene *scene,
1254  Object *ob);
1255 
1264 bool SCULPT_stroke_is_dynamic_topology(const SculptSession *ss, const Brush *brush);
1265 
1268 
1270 
1273 /* -------------------------------------------------------------------- */
1277 float SCULPT_automasking_factor_get(struct AutomaskingCache *automasking,
1278  SculptSession *ss,
1279  int vert);
1280 
1281 /* Returns the automasking cache depending on the active tool. Used for code that can run both for
1282  * brushes and filter. */
1284 
1286 void SCULPT_automasking_cache_free(struct AutomaskingCache *automasking);
1287 
1288 bool SCULPT_is_automasking_mode_enabled(const Sculpt *sd, const Brush *br, eAutomasking_flag mode);
1289 bool SCULPT_is_automasking_enabled(const Sculpt *sd, const SculptSession *ss, const Brush *br);
1290 
1292  eBoundaryAutomaskMode mode,
1293  int propagation_steps,
1294  float *automask_factor);
1297 /* -------------------------------------------------------------------- */
1307 float *SCULPT_geodesic_distances_create(struct Object *ob,
1308  struct GSet *initial_vertices,
1309  float limit_radius);
1311  struct Object *ob,
1312  int vertex,
1313  float limit_radius);
1314 float *SCULPT_geodesic_from_vertex(Object *ob, int vertex, float limit_radius);
1317 /* -------------------------------------------------------------------- */
1321 void SCULPT_filter_cache_init(struct bContext *C, Object *ob, Sculpt *sd, int undo_type);
1323 
1325  Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode, int smooth_iterations);
1326 
1327 /* Filter orientation utils. */
1328 void SCULPT_filter_to_orientation_space(float r_v[3], struct FilterCache *filter_cache);
1329 void SCULPT_filter_to_object_space(float r_v[3], struct FilterCache *filter_cache);
1330 void SCULPT_filter_zero_disabled_axis_components(float r_v[3], struct FilterCache *filter_cache);
1331 
1334 /* -------------------------------------------------------------------- */
1338 /* Main cloth brush function */
1339 void SCULPT_do_cloth_brush(struct Sculpt *sd,
1340  struct Object *ob,
1341  struct PBVHNode **nodes,
1342  int totnode);
1343 
1344 void SCULPT_cloth_simulation_free(struct SculptClothSimulation *cloth_sim);
1345 
1346 /* Public functions. */
1347 
1349  float cloth_mass,
1350  float cloth_damping,
1351  float cloth_softbody_strength,
1352  bool use_collisions,
1353  bool needs_deform_coords);
1355  struct SculptClothSimulation *cloth_sim);
1356 
1358  PBVHNode **nodes,
1359  int totnode);
1360 
1362  struct SculptClothSimulation *cloth_sim);
1363 
1365  struct Object *ob,
1366  struct SculptClothSimulation *cloth_sim,
1367  struct PBVHNode **nodes,
1368  int totnode);
1369 
1371  struct Object *ob,
1372  struct PBVHNode **nodes,
1373  int totnode,
1374  struct SculptClothSimulation *cloth_sim,
1375  float initial_location[3],
1376  float radius);
1377 
1382  const struct Brush *brush,
1383  const float location[3],
1384  const float normal[3],
1385  float rds,
1386  float line_width,
1387  const float outline_col[3],
1388  float alpha);
1390  struct SculptSession *ss,
1391  const float outline_col[3],
1392  float outline_alpha);
1393 
1395  Brush *brush,
1396  int *r_totnode);
1397 
1399 {
1400  return (brush->sculpt_tool == SCULPT_TOOL_CLOTH && ELEM(brush->cloth_deform_type,
1403  /* All brushes that are not the cloth brush deform the simulation using softbody
1404  * constraints instead of applying forces. */
1405  (brush->sculpt_tool != SCULPT_TOOL_CLOTH &&
1407 }
1410 /* -------------------------------------------------------------------- */
1418 void SCULPT_bmesh_four_neighbor_average(float avg[3], float direction[3], struct BMVert *v);
1419 
1420 void SCULPT_neighbor_coords_average(SculptSession *ss, float result[3], int index);
1421 float SCULPT_neighbor_mask_average(SculptSession *ss, int index);
1422 void SCULPT_neighbor_color_average(SculptSession *ss, float result[4], int index);
1423 
1427 void SCULPT_neighbor_coords_average_interior(SculptSession *ss, float result[3], int index);
1428 
1429 void SCULPT_smooth(
1430  Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode, float bstrength, bool smooth_mask);
1431 void SCULPT_do_smooth_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode);
1432 
1433 /* Surface Smooth Brush. */
1434 
1436  float *disp,
1437  const float co[3],
1438  float (*laplacian_disp)[3],
1439  int v_index,
1440  const float origco[3],
1441  float alpha);
1443  SculptSession *ss, float *co, float (*laplacian_disp)[3], int v_index, float beta, float fade);
1444 void SCULPT_do_surface_smooth_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode);
1445 
1446 /* Slide/Relax */
1447 void SCULPT_relax_vertex(struct SculptSession *ss,
1448  struct PBVHVertexIter *vd,
1449  float factor,
1450  bool filter_boundary_face_sets,
1451  float *r_final_pos);
1452 
1458 bool SCULPT_pbvh_calc_area_normal(const struct Brush *brush,
1459  Object *ob,
1460  PBVHNode **nodes,
1461  int totnode,
1462  bool use_threading,
1463  float r_area_no[3]);
1464 
1469 void SCULPT_cache_calc_brushdata_symm(StrokeCache *cache, char symm, char axis, float angle);
1470 void SCULPT_cache_free(StrokeCache *cache);
1471 
1472 /* -------------------------------------------------------------------- */
1479 
1484 void SCULPT_undo_push_begin(struct Object *ob, const char *name);
1485 void SCULPT_undo_push_end(struct Object *ob);
1486 void SCULPT_undo_push_end_ex(struct Object *ob, const bool use_nested_undo);
1487 
1490 void SCULPT_vertcos_to_key(Object *ob, KeyBlock *kb, const float (*vertCos)[3]);
1491 
1495 void SCULPT_update_object_bounding_box(struct Object *ob);
1496 
1500 bool SCULPT_get_redraw_rect(struct ARegion *region,
1501  struct RegionView3D *rv3d,
1502  Object *ob,
1503  rcti *rect);
1504 
1505 /* Operators. */
1506 
1507 /* -------------------------------------------------------------------- */
1511 void SCULPT_OT_expand(struct wmOperatorType *ot);
1512 void sculpt_expand_modal_keymap(struct wmKeyConfig *keyconf);
1515 /* -------------------------------------------------------------------- */
1521 
1524 
1528 /* -------------------------------------------------------------------- */
1537 
1540 /* -------------------------------------------------------------------- */
1547 /* -------------------------------------------------------------------- */
1551 /* Mesh Filter. */
1552 
1554 
1555 /* Cloth Filter. */
1556 
1558 
1559 /* Color Filter. */
1560 
1562 
1565 /* -------------------------------------------------------------------- */
1569 /* Mask filter and Dirty Mask. */
1570 
1572 void SCULPT_OT_dirty_mask(struct wmOperatorType *ot);
1573 
1574 /* Mask and Face Sets Expand. */
1575 
1577 
1578 /* Mask Init. */
1579 
1580 void SCULPT_OT_mask_init(struct wmOperatorType *ot);
1583 /* Detail size. */
1584 
1585 /* -------------------------------------------------------------------- */
1595 /* Dyntopo. */
1596 
1598 
1599 /* sculpt_brush_types.c */
1600 
1601 /* -------------------------------------------------------------------- */
1605 /* Pose Brush. */
1606 
1610 void SCULPT_do_pose_brush(struct Sculpt *sd,
1611  struct Object *ob,
1612  struct PBVHNode **nodes,
1613  int totnode);
1621 void SCULPT_pose_calc_pose_data(struct Sculpt *sd,
1622  struct Object *ob,
1623  struct SculptSession *ss,
1624  float initial_location[3],
1625  float radius,
1626  float pose_offset,
1627  float *r_pose_origin,
1628  float *r_pose_factor);
1629 void SCULPT_pose_brush_init(struct Sculpt *sd,
1630  struct Object *ob,
1631  struct SculptSession *ss,
1632  struct Brush *br);
1634  struct Object *ob,
1635  struct SculptSession *ss,
1636  struct Brush *br,
1637  const float initial_location[3],
1638  float radius);
1639 void SCULPT_pose_ik_chain_free(struct SculptPoseIKChain *ik_chain);
1640 
1641 /* Boundary Brush. */
1642 
1648  Brush *brush,
1649  int initial_vertex,
1650  float radius);
1651 void SCULPT_boundary_data_free(struct SculptBoundary *boundary);
1652 /* Main Brush Function. */
1653 void SCULPT_do_boundary_brush(struct Sculpt *sd,
1654  struct Object *ob,
1655  struct PBVHNode **nodes,
1656  int totnode);
1657 
1659  struct SculptSession *ss,
1660  const float outline_col[3],
1661  float outline_alpha);
1663 
1664 /* Multi-plane Scrape Brush. */
1665 /* Main Brush Function. */
1666 void SCULPT_do_multiplane_scrape_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode);
1668  Brush *brush,
1669  SculptSession *ss,
1670  const float outline_col[3],
1671  float outline_alpha);
1672 /* Draw Face Sets Brush. */
1673 void SCULPT_do_draw_face_sets_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode);
1674 
1675 /* Paint Brush. */
1676 void SCULPT_do_paint_brush(struct PaintModeSettings *paint_mode_settings,
1677  Sculpt *sd,
1678  Object *ob,
1679  PBVHNode **nodes,
1680  int totnode) ATTR_NONNULL();
1681 
1689 bool SCULPT_paint_image_canvas_get(struct PaintModeSettings *paint_mode_settings,
1690  struct Object *ob,
1691  struct Image **r_image,
1692  struct ImageUser **r_image_user) ATTR_NONNULL();
1693 void SCULPT_do_paint_brush_image(struct PaintModeSettings *paint_mode_settings,
1694  Sculpt *sd,
1695  Object *ob,
1696  PBVHNode **nodes,
1697  int totnode) ATTR_NONNULL();
1699 
1700 /* Smear Brush. */
1701 void SCULPT_do_smear_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode);
1702 
1704 
1705 void SCULPT_do_draw_brush(struct Sculpt *sd,
1706  struct Object *ob,
1707  struct PBVHNode **nodes,
1708  int totnode);
1709 
1710 void SCULPT_do_fill_brush(struct Sculpt *sd,
1711  struct Object *ob,
1712  struct PBVHNode **nodes,
1713  int totnode);
1714 void SCULPT_do_scrape_brush(struct Sculpt *sd,
1715  struct Object *ob,
1716  struct PBVHNode **nodes,
1717  int totnode);
1718 void SCULPT_do_clay_thumb_brush(struct Sculpt *sd,
1719  struct Object *ob,
1720  struct PBVHNode **nodes,
1721  int totnode);
1722 void SCULPT_do_flatten_brush(struct Sculpt *sd,
1723  struct Object *ob,
1724  struct PBVHNode **nodes,
1725  int totnode);
1726 void SCULPT_do_clay_brush(struct Sculpt *sd,
1727  struct Object *ob,
1728  struct PBVHNode **nodes,
1729  int totnode);
1730 void SCULPT_do_clay_strips_brush(struct Sculpt *sd,
1731  struct Object *ob,
1732  struct PBVHNode **nodes,
1733  int totnode);
1734 void SCULPT_do_snake_hook_brush(struct Sculpt *sd,
1735  struct Object *ob,
1736  struct PBVHNode **nodes,
1737  int totnode);
1738 void SCULPT_do_thumb_brush(struct Sculpt *sd,
1739  struct Object *ob,
1740  struct PBVHNode **nodes,
1741  int totnode);
1742 void SCULPT_do_rotate_brush(struct Sculpt *sd,
1743  struct Object *ob,
1744  struct PBVHNode **nodes,
1745  int totnode);
1746 void SCULPT_do_layer_brush(struct Sculpt *sd,
1747  struct Object *ob,
1748  struct PBVHNode **nodes,
1749  int totnode);
1750 void SCULPT_do_inflate_brush(struct Sculpt *sd,
1751  struct Object *ob,
1752  struct PBVHNode **nodes,
1753  int totnode);
1754 void SCULPT_do_nudge_brush(struct Sculpt *sd,
1755  struct Object *ob,
1756  struct PBVHNode **nodes,
1757  int totnode);
1758 void SCULPT_do_crease_brush(struct Sculpt *sd,
1759  struct Object *ob,
1760  struct PBVHNode **nodes,
1761  int totnode);
1762 void SCULPT_do_pinch_brush(struct Sculpt *sd,
1763  struct Object *ob,
1764  struct PBVHNode **nodes,
1765  int totnode);
1766 void SCULPT_do_grab_brush(struct Sculpt *sd,
1767  struct Object *ob,
1768  struct PBVHNode **nodes,
1769  int totnode);
1770 void SCULPT_do_elastic_deform_brush(struct Sculpt *sd,
1771  struct Object *ob,
1772  struct PBVHNode **nodes,
1773  int totnode);
1774 void SCULPT_do_draw_sharp_brush(struct Sculpt *sd,
1775  struct Object *ob,
1776  struct PBVHNode **nodes,
1777  int totnode);
1778 void SCULPT_do_slide_relax_brush(struct Sculpt *sd,
1779  struct Object *ob,
1780  struct PBVHNode **nodes,
1781  int totnode);
1782 
1784  struct Object *ob,
1785  struct PBVHNode **nodes,
1786  int totnode);
1788  struct Object *ob,
1789  struct PBVHNode **nodes,
1790  int totnode);
1791 void SCULPT_do_mask_brush_draw(struct Sculpt *sd,
1792  struct Object *ob,
1793  struct PBVHNode **nodes,
1794  int totnode);
1795 void SCULPT_do_mask_brush(struct Sculpt *sd,
1796  struct Object *ob,
1797  struct PBVHNode **nodes,
1798  int totnode);
1802  struct Sculpt *sd, struct Object *ob, struct PBVHNode **nodes, int totnode, float bstrength);
1803 
1804 /* end sculpt_brush_types.c */
1805 
1806 /* sculpt_ops.c */
1807 
1809 
1810 /* end sculpt_ops.c */
1811 
1813 {
1814  return ELEM(tool, SCULPT_TOOL_PAINT, SCULPT_TOOL_SMEAR);
1815 }
1816 
1817 #ifdef __cplusplus
1818 }
1819 #endif
typedef float(TangentPoint)[2]
#define PAINT_SYMM_AREAS
Definition: BKE_paint.h:118
ePaintSymmetryAreas
Definition: BKE_paint.h:112
A BVH for high poly meshes.
unsigned int BLI_bitmap
Definition: BLI_bitmap.h:16
#define ATTR_NONNULL(...)
#define BLI_INLINE
struct GSet GSet
Definition: BLI_ghash.h:340
unsigned int uint
Definition: BLI_sys_types.h:67
pthread_mutex_t ThreadMutex
Definition: BLI_threads.h:82
#define ELEM(...)
struct Depsgraph Depsgraph
Definition: DEG_depsgraph.h:35
#define MAX_ID_NAME
Definition: DNA_ID.h:337
eAutomasking_flag
@ BRUSH_DEFORM_TARGET_CLOTH_SIM
@ BRUSH_CLOTH_DEFORM_GRAB
@ BRUSH_CLOTH_DEFORM_SNAKE_HOOK
@ BRUSH_SNAKE_HOOK_DEFORM_ELASTIC
@ SCULPT_TOOL_CLOTH
@ SCULPT_TOOL_BOUNDARY
@ SCULPT_TOOL_PAINT
@ SCULPT_TOOL_POSE
@ SCULPT_TOOL_SMEAR
@ SCULPT_TOOL_ELASTIC_DEFORM
@ SCULPT_TOOL_SNAKE_HOOK
These structs are the foundation for all linked lists in the library system.
ePaintSymmetryFlags
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Sky Generate a procedural sky texture Noise Generate fractal Perlin noise Wave Generate procedural bands or rings with noise Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a point
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum Vector Perform vector math operation Invert a color
#define C
Definition: RandGen.cpp:25
ATTR_WARN_UNUSED_RESULT BMesh * bm
ATTR_WARN_UNUSED_RESULT const BMVert * v
SIMD_FORCE_INLINE btScalar angle(const btVector3 &v) const
Return the angle between this and another vector.
Definition: btVector3.h:356
OperationNode * node
Scene scene
const Depsgraph * depsgraph
int len
Definition: draw_manager.c:108
IconTextureDrawCall normal
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)
Definition: math_float4.h:513
static float smooth_mask(float x, float y)
static float limit_radius(const float3 &position_prev, const float3 &position, const float3 &position_next, const float angle_prev, const float angle, const float angle_next, const float radius_prev, const float radius, const float radius_next)
static const pxr::TfToken out("out", pxr::TfToken::Immortal)
MutableSpan< float3 > normals
CCL_NAMESPACE_BEGIN ccl_device float fade(float t)
Definition: noise.h:15
void SCULPT_OT_project_line_gesture(struct wmOperatorType *ot)
Definition: paint_mask.c:1794
void SCULPT_flush_stroke_deform(struct Sculpt *sd, Object *ob, bool is_proxy_used)
Definition: sculpt.c:3719
eSculptExpandFalloffType
@ SCULPT_EXPAND_FALLOFF_BOUNDARY_FACE_SET
@ SCULPT_EXPAND_FALLOFF_BOUNDARY_TOPOLOGY
@ SCULPT_EXPAND_FALLOFF_NORMALS
@ SCULPT_EXPAND_FALLOFF_SPHERICAL
@ SCULPT_EXPAND_FALLOFF_GEODESIC
@ SCULPT_EXPAND_FALLOFF_TOPOLOGY
@ SCULPT_EXPAND_FALLOFF_TOPOLOGY_DIAGONALS
@ SCULPT_EXPAND_FALLOFF_ACTIVE_FACE_SET
void SCULPT_OT_face_sets_init(struct wmOperatorType *ot)
bool SCULPT_brush_test_sphere(SculptBrushTest *test, const float co[3])
Definition: sculpt.c:1583
void SCULPT_undo_push_begin(struct Object *ob, const char *name)
Definition: sculpt_undo.c:1545
void SCULPT_cloth_brush_store_simulation_state(struct SculptSession *ss, struct SculptClothSimulation *cloth_sim)
void SCULPT_dynamic_topology_triangulate(struct BMesh *bm)
void SCULPT_orig_vert_data_update(SculptOrigVertData *orig_data, PBVHVertexIter *iter)
Definition: sculpt.c:1300
bool SCULPT_get_redraw_rect(struct ARegion *region, struct RegionView3D *rv3d, Object *ob, rcti *rect)
Definition: sculpt.c:1489
void sculpt_dynamic_topology_disable_with_undo(struct Main *bmain, struct Depsgraph *depsgraph, Scene *scene, Object *ob)
void SCULPT_floodfill_add_and_skip_initial(SculptFloodFill *flood, int index)
Definition: sculpt.c:1086
void SCULPT_tilt_apply_to_normal(float r_normal[3], struct StrokeCache *cache, float tilt_strength)
Definition: sculpt.c:2751
void SCULPT_visibility_sync_all_face_sets_to_vertices(struct Object *ob)
Definition: sculpt.c:557
BLI_INLINE bool SCULPT_tool_is_paint(int tool)
float * SCULPT_geodesic_distances_create(struct Object *ob, struct GSet *initial_vertices, float limit_radius)
void SCULPT_undo_push_end(struct Object *ob)
Definition: sculpt_undo.c:1575
void SCULPT_filter_zero_disabled_axis_components(float r_v[3], struct FilterCache *filter_cache)
void SCULPT_do_inflate_brush(struct Sculpt *sd, struct Object *ob, struct PBVHNode **nodes, int totnode)
struct SculptVertexNeighborIter SculptVertexNeighborIter
void SCULPT_OT_dyntopo_detail_size_edit(struct wmOperatorType *ot)
void SCULPT_orig_vert_data_init(SculptOrigVertData *data, Object *ob, PBVHNode *node, SculptUndoType type)
Definition: sculpt.c:1290
void SCULPT_OT_trim_lasso_gesture(struct wmOperatorType *ot)
Definition: paint_mask.c:1752
void SCULPT_boundary_info_ensure(Object *object)
Definition: sculpt.c:5848
void SCULPT_vertcos_to_key(Object *ob, KeyBlock *kb, const float(*vertCos)[3])
Definition: sculpt.c:3097
void SCULPT_filter_to_orientation_space(float r_v[3], struct FilterCache *filter_cache)
void SCULPT_flip_quat_by_symm_area(float quat[4], ePaintSymmetryFlags symm, ePaintSymmetryAreas symmarea, const float pivot[3])
Definition: sculpt.c:2882
void SCULPT_OT_mask_filter(struct wmOperatorType *ot)
float SCULPT_raycast_init(struct ViewContext *vc, const float mval[2], float ray_start[3], float ray_end[3], float ray_normal[3], bool original)
Definition: sculpt.c:4798
PBVHNode ** SCULPT_cloth_brush_affected_nodes_gather(SculptSession *ss, Brush *brush, int *r_totnode)
Definition: sculpt_cloth.c:106
int SCULPT_active_vertex_get(SculptSession *ss)
Definition: sculpt.c:271
void SCULPT_do_pinch_brush(struct Sculpt *sd, struct Object *ob, struct PBVHNode **nodes, int totnode)
void SCULPT_do_smear_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode)
bool SCULPT_poll(struct bContext *C)
Definition: sculpt.c:3973
bool SCULPT_stroke_get_location(struct bContext *C, float out[3], const float mouse[2], bool force_original)
Definition: sculpt.c:4964
bool SCULPT_cursor_geometry_info_update(bContext *C, SculptCursorGeometryInfo *out, const float mouse[2], bool use_sampled_normal)
Definition: sculpt.c:4835
bool SCULPT_use_image_paint_brush(struct PaintModeSettings *settings, Object *ob) ATTR_NONNULL()
int SCULPT_plane_point_side(const float co[3], const float plane[4])
Definition: sculpt.c:2996
void SCULPT_OT_face_set_lasso_gesture(struct wmOperatorType *ot)
Definition: paint_mask.c:1714
void SCULPT_face_set_visibility_set(SculptSession *ss, int face_set, bool visible)
Definition: sculpt.c:376
bool SCULPT_handles_colors_report(struct SculptSession *ss, struct ReportList *reports)
Definition: sculpt.c:5303
void SCULPT_do_mask_brush(struct Sculpt *sd, struct Object *ob, struct PBVHNode **nodes, int totnode)
void SCULPT_floodfill_execute(struct SculptSession *ss, SculptFloodFill *flood, bool(*func)(SculptSession *ss, int from_v, int to_v, bool is_duplicate, void *userdata), void *userdata)
Definition: sculpt.c:1143
bool SCULPT_vertex_has_face_set(SculptSession *ss, int index, int face_set)
Definition: sculpt.c:533
void SCULPT_vertex_persistent_normal_get(SculptSession *ss, int index, float no[3])
Definition: sculpt.c:239
bool SCULPT_vertex_is_boundary(const SculptSession *ss, int index)
Definition: sculpt.c:865
void SCULPT_cloth_plane_falloff_preview_draw(uint gpuattr, struct SculptSession *ss, const float outline_col[3], float outline_alpha)
float * SCULPT_boundary_automasking_init(Object *ob, eBoundaryAutomaskMode mode, int propagation_steps, float *automask_factor)
bool SCULPT_mode_poll_view3d(struct bContext *C)
Definition: sculpt.c:3963
float * SCULPT_geodesic_from_vertex(Object *ob, int vertex, float limit_radius)
void SCULPT_pose_brush_init(struct Sculpt *sd, struct Object *ob, struct SculptSession *ss, struct Brush *br)
Definition: sculpt_pose.c:957
bool SCULPT_vertex_has_unique_face_set(SculptSession *ss, int index)
Definition: sculpt.c:662
struct SculptUndoNodeGeometry SculptUndoNodeGeometry
struct SculptClothSimulation * SCULPT_cloth_brush_simulation_create(struct Object *ob, float cloth_mass, float cloth_damping, float cloth_softbody_strength, bool use_collisions, bool needs_deform_coords)
void SCULPT_do_scrape_brush(struct Sculpt *sd, struct Object *ob, struct PBVHNode **nodes, int totnode)
float * SCULPT_geodesic_from_vertex_and_symm(struct Sculpt *sd, struct Object *ob, int vertex, float limit_radius)
struct SculptPoseIKChain * SCULPT_pose_ik_chain_init(struct Sculpt *sd, struct Object *ob, struct SculptSession *ss, struct Brush *br, const float initial_location[3], float radius)
Definition: sculpt_pose.c:922
const float * SCULPT_brush_frontface_normal_from_falloff_shape(SculptSession *ss, char falloff_shape)
Definition: sculpt.c:1703
SculptBrushTestFn SCULPT_brush_test_init_with_falloff_shape(SculptSession *ss, SculptBrushTest *test, char falloff_shape)
Definition: sculpt.c:1686
void SCULPT_tilt_effective_normal_get(const SculptSession *ss, const Brush *brush, float r_no[3])
Definition: sculpt.c:2767
float SCULPT_clay_thumb_get_stabilized_pressure(struct StrokeCache *cache)
void SCULPT_do_paint_brush(struct PaintModeSettings *paint_mode_settings, Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode) ATTR_NONNULL()
struct SculptUndoNode SculptUndoNode
void SCULPT_do_displacement_smear_brush(struct Sculpt *sd, struct Object *ob, struct PBVHNode **nodes, int totnode)
void SCULPT_floodfill_init(struct SculptSession *ss, SculptFloodFill *flood)
Definition: sculpt.c:1072
bool SCULPT_vertex_any_face_set_visible_get(SculptSession *ss, int index)
Definition: sculpt.c:439
const float * SCULPT_vertex_co_for_grab_active_get(SculptSession *ss, int index)
Definition: sculpt.c:201
void SCULPT_calc_brush_plane(struct Sculpt *sd, struct Object *ob, struct PBVHNode **nodes, int totnode, float r_area_no[3], float r_area_co[3])
Definition: sculpt.c:2901
void SCULPT_do_clay_strips_brush(struct Sculpt *sd, struct Object *ob, struct PBVHNode **nodes, int totnode)
void SCULPT_do_mask_brush_draw(struct Sculpt *sd, struct Object *ob, struct PBVHNode **nodes, int totnode)
const float * SCULPT_vertex_co_get(struct SculptSession *ss, int index)
Definition: sculpt.c:125
void SCULPT_vertex_face_set_set(SculptSession *ss, int index, int face_set)
Definition: sculpt.c:483
enum eDynTopoWarnFlag SCULPT_dynamic_topology_check(Scene *scene, Object *ob)
eSculptExpandRecursionType
@ SCULPT_EXPAND_RECURSION_GEODESICS
@ SCULPT_EXPAND_RECURSION_TOPOLOGY
bool SCULPT_brush_test_circle_sq(SculptBrushTest *test, const float co[3])
Definition: sculpt.c:1621
struct SculptThreadedTaskData SculptThreadedTaskData
BLI_INLINE bool SCULPT_is_cloth_deform_brush(const Brush *brush)
void SCULPT_floodfill_add_initial(SculptFloodFill *flood, int index)
Definition: sculpt.c:1081
void SCULPT_OT_mesh_filter(struct wmOperatorType *ot)
struct AutomaskingCache AutomaskingCache
void SCULPT_dynamic_topology_disable(bContext *C, struct SculptUndoNode *unode)
void SCULPT_calc_area_normal_and_center(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode, float r_area_no[3], float r_area_co[3])
Definition: sculpt.c:2151
bool SCULPT_is_symmetry_iteration_valid(char i, char symm)
Definition: sculpt.c:1025
void SCULPT_pbvh_clear(Object *ob)
void SCULPT_OT_set_pivot_position(struct wmOperatorType *ot)
void SCULPT_connected_components_ensure(Object *ob)
Definition: sculpt.c:5815
SculptFilterOrientation
@ SCULPT_FILTER_ORIENTATION_WORLD
@ SCULPT_FILTER_ORIENTATION_VIEW
@ SCULPT_FILTER_ORIENTATION_LOCAL
const float * SCULPT_active_vertex_co_get(SculptSession *ss)
Definition: sculpt.c:279
BLI_INLINE bool SCULPT_tool_needs_all_pbvh_nodes(const Brush *brush)
SculptTransformDisplacementMode
@ SCULPT_TRANSFORM_DISPLACEMENT_ORIGINAL
@ SCULPT_TRANSFORM_DISPLACEMENT_INCREMENTAL
void SCULPT_flush_update_done(const bContext *C, Object *ob, SculptUpdateType update_flags)
Definition: sculpt.c:5212
struct AutomaskingCache * SCULPT_automasking_cache_init(Sculpt *sd, Brush *brush, Object *ob)
void SCULPT_OT_dynamic_topology_toggle(struct wmOperatorType *ot)
bool SCULPT_search_sphere_cb(PBVHNode *node, void *data_v)
Definition: sculpt.c:2467
void SCULPT_do_displacement_eraser_brush(struct Sculpt *sd, struct Object *ob, struct PBVHNode **nodes, int totnode)
void SCULPT_stroke_modifiers_check(const bContext *C, Object *ob, const Brush *brush)
Definition: sculpt.c:4712
void SCULPT_vertex_visible_set(SculptSession *ss, int index, bool visible)
Definition: sculpt.c:341
void SCULPT_filter_to_object_space(float r_v[3], struct FilterCache *filter_cache)
void SCULPT_do_flatten_brush(struct Sculpt *sd, struct Object *ob, struct PBVHNode **nodes, int totnode)
bool SCULPT_vertex_visible_get(SculptSession *ss, int index)
Definition: sculpt.c:356
void SCULPT_vertex_color_set(SculptSession *ss, int index, const float color[4])
Definition: sculpt.c:166
void SCULPT_combine_transform_proxies(Sculpt *sd, Object *ob)
Definition: sculpt.c:3646
void SCULPT_face_sets_visibility_all_set(SculptSession *ss, bool visible)
Definition: sculpt.c:412
void SCULPT_do_clay_thumb_brush(struct Sculpt *sd, struct Object *ob, struct PBVHNode **nodes, int totnode)
void sculpt_expand_modal_keymap(struct wmKeyConfig *keyconf)
void SCULPT_surface_smooth_laplacian_step(SculptSession *ss, float *disp, const float co[3], float(*laplacian_disp)[3], int v_index, const float origco[3], float alpha)
void SCULPT_relax_vertex(struct SculptSession *ss, struct PBVHVertexIter *vd, float factor, bool filter_boundary_face_sets, float *r_final_pos)
void SCULPT_face_sets_visibility_invert(SculptSession *ss)
Definition: sculpt.c:398
int SCULPT_plane_trim(const struct StrokeCache *cache, const struct Brush *brush, const float val[3])
void SCULPT_do_smooth_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode)
void SCULPT_do_slide_relax_brush(struct Sculpt *sd, struct Object *ob, struct PBVHNode **nodes, int totnode)
void SCULPT_flush_update_step(bContext *C, SculptUpdateType update_flags)
Definition: sculpt.c:5144
void SCULPT_orig_vert_data_unode_init(SculptOrigVertData *data, Object *ob, struct SculptUndoNode *unode)
Definition: sculpt.c:1271
void SCULPT_vertex_color_get(const SculptSession *ss, int index, float r_color[4])
Definition: sculpt.c:161
void SCULPT_OT_expand(struct wmOperatorType *ot)
bool SCULPT_mode_poll(struct bContext *C)
Definition: sculpt.c:3957
void SCULPT_vertex_normal_get(SculptSession *ss, int index, float no[3])
Definition: sculpt.c:171
void SCULPT_neighbor_coords_average(SculptSession *ss, float result[3], int index)
bool SCULPT_stroke_is_first_brush_step(struct StrokeCache *cache)
Definition: sculpt.c:912
void SCULPT_bmesh_topology_rake(struct Sculpt *sd, struct Object *ob, struct PBVHNode **nodes, int totnode, float bstrength)
void SCULPT_visibility_sync_all_vertex_to_face_sets(struct SculptSession *ss)
Definition: sculpt.c:591
void SCULPT_vertex_limit_surface_get(SculptSession *ss, int index, float r_co[3])
Definition: sculpt.c:218
float SCULPT_neighbor_mask_average(SculptSession *ss, int index)
bool SCULPT_stroke_is_dynamic_topology(const SculptSession *ss, const Brush *brush)
Definition: sculpt.c:1338
bool SCULPT_check_vertex_pivot_symmetry(const float vco[3], const float pco[3], char symm)
Definition: sculpt.c:923
bool SCULPT_pbvh_calc_area_normal(const struct Brush *brush, Object *ob, PBVHNode **nodes, int totnode, bool use_threading, float r_area_no[3])
void SCULPT_undo_push_end_ex(struct Object *ob, const bool use_nested_undo)
Definition: sculpt_undo.c:1580
void SCULPT_automasking_cache_free(struct AutomaskingCache *automasking)
void SCULPT_do_multiplane_scrape_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode)
void SCULPT_do_crease_brush(struct Sculpt *sd, struct Object *ob, struct PBVHNode **nodes, int totnode)
bool SCULPT_poll_view3d(struct bContext *C)
Definition: sculpt.c:3968
bool(* SculptBrushTestFn)(SculptBrushTest *test, const float co[3])
float SCULPT_brush_plane_offset_get(Sculpt *sd, SculptSession *ss)
Definition: sculpt.c:3002
void SCULPT_floodfill_free(SculptFloodFill *flood)
Definition: sculpt.c:1174
void SCULPT_OT_set_detail_size(struct wmOperatorType *ot)
SculptUndoNode * SCULPT_undo_get_first_node(void)
Definition: sculpt_undo.c:1037
float * SCULPT_brush_deform_target_vertex_co_get(SculptSession *ss, int deform_target, PBVHVertexIter *iter)
Definition: sculpt.c:304
#define SCULPT_CLAY_STABILIZER_LEN
void SCULPT_bmesh_four_neighbor_average(float avg[3], float direction[3], struct BMVert *v)
Definition: sculpt_smooth.c:89
void SCULPT_fake_neighbors_enable(Object *ob)
Definition: sculpt.c:5909
void SCULPT_vertex_random_access_ensure(struct SculptSession *ss)
Definition: sculpt.c:103
void SCULPT_OT_face_sets_edit(struct wmOperatorType *ot)
void SCULPT_do_cloth_brush(struct Sculpt *sd, struct Object *ob, struct PBVHNode **nodes, int totnode)
SculptUpdateType
Definition: sculpt_intern.h:44
@ SCULPT_UPDATE_COLOR
Definition: sculpt_intern.h:48
@ SCULPT_UPDATE_IMAGE
Definition: sculpt_intern.h:49
@ SCULPT_UPDATE_MASK
Definition: sculpt_intern.h:46
@ SCULPT_UPDATE_VISIBILITY
Definition: sculpt_intern.h:47
@ SCULPT_UPDATE_COORDS
Definition: sculpt_intern.h:45
void SCULPT_OT_brush_stroke(struct wmOperatorType *ot)
Definition: sculpt.c:5624
#define SCULPT_VERTEX_NEIGHBOR_FIXED_CAPACITY
Definition: sculpt_intern.h:58
void SCULPT_active_vertex_normal_get(SculptSession *ss, float normal[3])
Definition: sculpt.c:284
void SCULPT_update_object_bounding_box(struct Object *ob)
Definition: sculpt.c:5134
void SCULPT_do_pose_brush(struct Sculpt *sd, struct Object *ob, struct PBVHNode **nodes, int totnode)
Definition: sculpt_pose.c:1112
bool SCULPT_vertex_all_face_sets_visible_get(const SculptSession *ss, int index)
Definition: sculpt.c:459
void SCULPT_do_layer_brush(struct Sculpt *sd, struct Object *ob, struct PBVHNode **nodes, int totnode)
void SCULPT_dynamic_topology_enable_ex(struct Main *bmain, struct Depsgraph *depsgraph, Scene *scene, Object *ob)
void SCULPT_do_nudge_brush(struct Sculpt *sd, struct Object *ob, struct PBVHNode **nodes, int totnode)
void SCULPT_floodfill_add_initial_with_symmetry(struct Sculpt *sd, struct Object *ob, struct SculptSession *ss, SculptFloodFill *flood, int index, float radius)
Definition: sculpt.c:1092
void SCULPT_fake_neighbors_ensure(struct Sculpt *sd, Object *ob, float max_dist)
Definition: sculpt.c:5879
void SCULPT_multiplane_scrape_preview_draw(uint gpuattr, Brush *brush, SculptSession *ss, const float outline_col[3], float outline_alpha)
void SCULPT_do_fill_brush(struct Sculpt *sd, struct Object *ob, struct PBVHNode **nodes, int totnode)
void SCULPT_do_elastic_deform_brush(struct Sculpt *sd, struct Object *ob, struct PBVHNode **nodes, int totnode)
void SCULPT_cloth_simulation_free(struct SculptClothSimulation *cloth_sim)
struct SculptBrushTest SculptBrushTest
eDynTopoWarnFlag
@ DYNTOPO_WARN_LDATA
@ DYNTOPO_WARN_MODIFIER
@ DYNTOPO_WARN_VDATA
@ DYNTOPO_WARN_EDATA
void SCULPT_do_surface_smooth_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode)
bool SCULPT_brush_test_sphere_sq(SculptBrushTest *test, const float co[3])
Definition: sculpt.c:1599
int SCULPT_vertex_face_set_get(SculptSession *ss, int index)
Definition: sculpt.c:508
void SCULPT_do_grab_brush(struct Sculpt *sd, struct Object *ob, struct PBVHNode **nodes, int totnode)
struct SculptBoundary * SCULPT_boundary_data_init(Object *object, Brush *brush, int initial_vertex, float radius)
void SCULPT_do_rotate_brush(struct Sculpt *sd, struct Object *ob, struct PBVHNode **nodes, int totnode)
void SCULPT_OT_face_set_box_gesture(struct wmOperatorType *ot)
Definition: paint_mask.c:1733
struct FilterCache FilterCache
struct AutomaskingCache * SCULPT_automasking_active_cache_get(SculptSession *ss)
void SCULPT_do_clay_brush(struct Sculpt *sd, struct Object *ob, struct PBVHNode **nodes, int totnode)
void SCULPT_do_draw_brush(struct Sculpt *sd, struct Object *ob, struct PBVHNode **nodes, int totnode)
SculptUndoNode * SCULPT_undo_push_node(Object *ob, PBVHNode *node, SculptUndoType type)
Definition: sculpt_undo.c:1419
void SCULPT_fake_neighbors_disable(Object *ob)
Definition: sculpt.c:5916
SculptUndoNode * SCULPT_undo_get_node(PBVHNode *node, SculptUndoType type)
Definition: sculpt_undo.c:1020
struct AutomaskingSettings AutomaskingSettings
void SCULPT_do_thumb_brush(struct Sculpt *sd, struct Object *ob, struct PBVHNode **nodes, int totnode)
void SCULPT_boundary_edges_preview_draw(uint gpuattr, struct SculptSession *ss, const float outline_col[3], float outline_alpha)
void SCULPT_OT_detail_flood_fill(struct wmOperatorType *ot)
struct SculptCursorGeometryInfo SculptCursorGeometryInfo
int SCULPT_face_set_next_available_get(SculptSession *ss)
Definition: sculpt.c:693
void SCULPT_neighbor_coords_average_interior(SculptSession *ss, float result[3], int index)
Definition: sculpt_smooth.c:49
void SCULPT_flip_v3_by_symm_area(float v[3], ePaintSymmetryFlags symm, ePaintSymmetryAreas symmarea, const float pivot[3])
Definition: sculpt.c:2863
bool SCULPT_has_loop_colors(const struct Object *ob)
int SCULPT_nearest_vertex_get(struct Sculpt *sd, struct Object *ob, const float co[3], float max_distance, bool use_original)
Definition: sculpt.c:983
void SCULPT_cloth_brush_simulation_init(struct SculptSession *ss, struct SculptClothSimulation *cloth_sim)
void SCULPT_dyntopo_node_layers_add(struct SculptSession *ss)
void SCULPT_do_boundary_brush(struct Sculpt *sd, struct Object *ob, struct PBVHNode **nodes, int totnode)
char SCULPT_mesh_symmetry_xyz_get(Object *object)
Definition: sculpt.c:317
void SCULPT_neighbor_color_average(SculptSession *ss, float result[4], int index)
bool SCULPT_is_vertex_inside_brush_radius_symm(const float vertex[3], const float br_co[3], float radius, char symm)
Definition: sculpt.c:1030
void SCULPT_OT_face_sets_create(struct wmOperatorType *ot)
void SCULPT_floodfill_add_active(struct Sculpt *sd, struct Object *ob, struct SculptSession *ss, SculptFloodFill *flood, float radius)
Definition: sculpt.c:1118
void SCULPT_filter_cache_init(struct bContext *C, Object *ob, Sculpt *sd, int undo_type)
void SCULPT_filter_cache_free(SculptSession *ss)
bool SCULPT_stroke_is_first_brush_step_of_symmetry_pass(struct StrokeCache *cache)
Definition: sculpt.c:918
void SCULPT_geometry_preview_lines_update(bContext *C, struct SculptSession *ss, float radius)
Definition: sculpt_ops.c:541
void SCULPT_cache_calc_brushdata_symm(StrokeCache *cache, char symm, char axis, float angle)
Definition: sculpt.c:3767
bool SCULPT_search_circle_cb(PBVHNode *node, void *data_v)
Definition: sculpt.c:2513
eBoundaryAutomaskMode
Definition: sculpt_intern.h:99
@ AUTOMASK_INIT_BOUNDARY_EDGES
@ AUTOMASK_INIT_BOUNDARY_FACE_SETS
void SCULPT_do_snake_hook_brush(struct Sculpt *sd, struct Object *ob, struct PBVHNode **nodes, int totnode)
void SCULPT_cache_free(StrokeCache *cache)
Definition: sculpt.c:4055
void SCULPT_fake_neighbors_free(struct Object *ob)
Definition: sculpt.c:5923
float SCULPT_vertex_mask_get(struct SculptSession *ss, int index)
Definition: sculpt.c:248
bool SCULPT_is_automasking_mode_enabled(const Sculpt *sd, const Brush *br, eAutomasking_flag mode)
void SCULPT_do_draw_sharp_brush(struct Sculpt *sd, struct Object *ob, struct PBVHNode **nodes, int totnode)
void SCULPT_do_paint_brush_image(struct PaintModeSettings *paint_mode_settings, Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode) ATTR_NONNULL()
void SCULPT_OT_face_sets_randomize_colors(struct wmOperatorType *ot)
void SCULPT_calc_area_normal(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode, float r_area_no[3])
Definition: sculpt.c:2103
struct StrokeCache StrokeCache
void SCULPT_OT_cloth_filter(struct wmOperatorType *ot)
bool SCULPT_brush_test_cube(SculptBrushTest *test, const float co[3], const float local[4][4], float roundness)
Definition: sculpt.c:1639
float SCULPT_automasking_factor_get(struct AutomaskingCache *automasking, SculptSession *ss, int vert)
void SCULPT_OT_sample_detail_size(struct wmOperatorType *ot)
const float * SCULPT_vertex_persistent_co_get(SculptSession *ss, int index)
Definition: sculpt.c:193
void SCULPT_OT_color_filter(struct wmOperatorType *ot)
void SCULPT_surface_smooth_displace_step(SculptSession *ss, float *co, float(*laplacian_disp)[3], int v_index, float beta, float fade)
void SCULPT_brush_test_init(struct SculptSession *ss, SculptBrushTest *test)
Definition: sculpt.c:1532
float SCULPT_brush_strength_factor(struct SculptSession *ss, const struct Brush *br, const float point[3], float len, const float vno[3], const float fno[3], float mask, int vertex_index, int thread_id)
void SCULPT_OT_trim_box_gesture(struct wmOperatorType *ot)
Definition: paint_mask.c:1773
bool SCULPT_stroke_is_main_symmetry_pass(struct StrokeCache *cache)
Definition: sculpt.c:906
ePaintSymmetryAreas SCULPT_get_vertex_symm_area(const float co[3])
Definition: sculpt.c:2848
struct MVert * SCULPT_mesh_deformed_mverts_get(SculptSession *ss)
Definition: sculpt.c:289
void SCULPT_cloth_brush_do_simulation_step(struct Sculpt *sd, struct Object *ob, struct SculptClothSimulation *cloth_sim, struct PBVHNode **nodes, int totnode)
Definition: sculpt_cloth.c:908
bool SCULPT_is_automasking_enabled(const Sculpt *sd, const SculptSession *ss, const Brush *br)
#define EXPAND_SYMM_AREAS
void SCULPT_cloth_simulation_limits_draw(uint gpuattr, const struct Brush *brush, const float location[3], const float normal[3], float rds, float line_width, const float outline_col[3], float alpha)
int SCULPT_active_face_set_get(SculptSession *ss)
Definition: sculpt.c:325
void SCULPT_boundary_data_free(struct SculptBoundary *boundary)
eSculptExpandTargetType
@ SCULPT_EXPAND_TARGET_COLORS
@ SCULPT_EXPAND_TARGET_FACE_SETS
@ SCULPT_EXPAND_TARGET_MASK
void SCULPT_mask_filter_smooth_apply(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode, int smooth_iterations)
void SCULPT_OT_mask_init(struct wmOperatorType *ot)
void SCULPT_OT_dirty_mask(struct wmOperatorType *ot)
void SCULPT_do_draw_face_sets_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode)
int SCULPT_vertex_count_get(struct SculptSession *ss)
Definition: sculpt.c:111
void SCULPT_smooth(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode, float bstrength, bool smooth_mask)
void SCULPT_boundary_pivot_line_preview_draw(uint gpuattr, struct SculptSession *ss)
struct ExpandCache ExpandCache
void SCULPT_clip(Sculpt *sd, SculptSession *ss, float co[3], const float val[3])
Definition: sculpt.c:2540
void SCULPT_OT_face_sets_change_visibility(struct wmOperatorType *ot)
bool SCULPT_has_colors(const SculptSession *ss)
Definition: sculpt.c:156
void SCULPT_pose_ik_chain_free(struct SculptPoseIKChain *ik_chain)
Definition: sculpt_pose.c:1209
void SCULPT_cloth_brush_ensure_nodes_constraints(struct Sculpt *sd, struct Object *ob, struct PBVHNode **nodes, int totnode, struct SculptClothSimulation *cloth_sim, float initial_location[3], float radius)
SculptUndoType
@ SCULPT_UNDO_GEOMETRY
@ SCULPT_UNDO_FACE_SETS
@ SCULPT_UNDO_COORDS
@ SCULPT_UNDO_HIDDEN
@ SCULPT_UNDO_DYNTOPO_SYMMETRIZE
@ SCULPT_UNDO_COLOR
@ SCULPT_UNDO_DYNTOPO_END
@ SCULPT_UNDO_DYNTOPO_BEGIN
@ SCULPT_UNDO_MASK
void SCULPT_calc_area_center(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode, float r_area_co[3])
Definition: sculpt.c:2054
void SCULPT_cloth_sim_activate_nodes(struct SculptClothSimulation *cloth_sim, PBVHNode **nodes, int totnode)
void SCULPT_tag_update_overlays(bContext *C)
Definition: sculpt.c:1048
bool SCULPT_brush_test_sphere_fast(const SculptBrushTest *test, const float co[3])
Definition: sculpt.c:1613
void SCULPT_vertex_neighbors_get(struct SculptSession *ss, int index, bool include_duplicates, SculptVertexNeighborIter *iter)
Definition: sculpt.c:841
void SCULPT_OT_mask_expand(struct wmOperatorType *ot)
bool SCULPT_paint_image_canvas_get(struct PaintModeSettings *paint_mode_settings, struct Object *ob, struct Image **r_image, struct ImageUser **r_image_user) ATTR_NONNULL()
Get the image canvas for painting on the given object.
void SCULPT_pose_calc_pose_data(struct Sculpt *sd, struct Object *ob, struct SculptSession *ss, float initial_location[3], float radius, float pose_offset, float *r_pose_origin, float *r_pose_factor)
Definition: sculpt_pose.c:527
AutomaskingSettings settings
int cloth_deform_type
int snake_hook_deform_type
char sculpt_tool
int deform_target
bool brush_gradient
eSculptExpandFalloffType falloff_type
float active_falloff
int * initial_face_sets
int * original_face_sets
float * vert_falloff
eSculptExpandFalloffType move_original_falloff_type
int max_geodesic_move_preview
float initial_mouse[2]
int initial_active_vertex
Brush * brush
float texture_distortion_strength
int initial_active_face_set
bool reposition_pivot
eSculptExpandTargetType target
short blend_mode
float max_vert_falloff
GSet * snap_enabled_face_sets
float * face_falloff
float * original_mask
bool falloff_gradient
float initial_mouse_move[2]
eSculptExpandFalloffType move_preview_falloff_type
bool modify_active_face_set
struct Scene * scene
float(* original_colors)[4]
struct MTex * mtex
int active_connected_components[EXPAND_SYMM_AREAS]
float max_face_falloff
float fill_color[4]
PBVHNode ** nodes
float original_mouse_move[2]
float surface_smooth_current_vertex
float(* detail_directions)[3]
float * edge_factor
float * prev_mask
int * mask_update_it
SculptTransformDisplacementMode transform_displacement_mode
AutomaskingCache * automasking
SculptFilterOrientation orientation
float * normal_factor
int * prev_face_set
float viewmat_inv[4][4]
float * sharpen_factor
float viewmat[4][4]
float cloth_sim_pinch_point[3]
int sharpen_curvature_smooth_iterations
float obmat[4][4]
int mask_update_last_it
float(* surface_smooth_laplacian_disp)[3]
bool enabled_axis[3]
float sharpen_smooth_ratio
PBVHNode ** nodes
float(* limit_surface_co)[3]
float mask_expand_initial_co[3]
float sharpen_intensify_detail_strength
float(* pre_smoothed_color)[4]
SculptClothSimulation * cloth_sim
float surface_smooth_shape_preservation
float obmat_inv[4][4]
int mask_update_current_it
bool enabled_force_axis[3]
float co[3]
Definition: BKE_main.h:121
int initial_vertex
Definition: BKE_paint.h:435
struct RegionView3D * clip_rv3d
float plane_view[4]
float plane_tool[4]
float symm_rot_mat_inv[4][4]
GSQueue * queue
Definition: sculpt_intern.h:95
BLI_bitmap * visited_vertices
Definition: sculpt_intern.h:96
const float * co
Definition: sculpt_intern.h:87
struct SculptUndoNode * unode
Definition: sculpt_intern.h:80
struct BMLog * bm_log
Definition: sculpt_intern.h:78
const float * vmasks
Definition: sculpt_intern.h:83
const float * col
Definition: sculpt_intern.h:90
const float * no
Definition: sculpt_intern.h:88
float follow_co[3]
struct Sculpt * sd
struct SculptSession * ss
struct DistRayAABB_Precalc * dist_ray_to_aabb_precalc
struct Sculpt * sd
struct SculptSession * ss
const struct Brush * brush
float elastic_transform_pivot_init[3]
SculptClothSimulation * cloth_sim
struct Sculpt * sd
struct WPaintData * wpd
struct Object * ob
float nearest_vertex_search_co[3]
struct SculptProjectVector * spvc
struct PBVHNode ** nodes
float * cloth_sim_initial_location
struct VPaint * vp
struct WeightPaintInfo * wpi
float multiplane_scrape_planes[2][4]
float elastic_transform_mat[4][4]
float transform_mats[8][4][4]
struct bContext * C
float elastic_transform_pivot[3]
float(* col)[4]
struct BMLogEntry * bm_entry
struct SculptUndoNode * prev
float(* orig_loop_col)[4]
bool geometry_clear_pbvh
float(* no)[3]
BLI_bitmap * vert_hidden
float(* co)[3]
BLI_bitmap ** grid_hidden
char idname[MAX_ID_NAME]
float(* loop_col)[4]
SculptUndoNodeGeometry geometry_modified
SculptUndoNodeGeometry geometry_bmesh_enter
char shapeName[sizeof(((KeyBlock *) 0)) ->name]
float(* orig_co)[3]
SculptUndoNodeGeometry geometry_original
SculptUndoType type
struct SculptUndoNode * next
float pivot_rot[4]
float pivot_pos[3]
int neighbors_fixed[SCULPT_VERTEX_NEIGHBOR_FIXED_CAPACITY]
Definition: sculpt_intern.h:65
float wet_mix_prev_color[4]
float orig_grab_location[3]
float old_grab_location[3]
float true_location[3]
float initial_radius
float initial_mouse[2]
const struct Brush * brush
float sculpt_normal[3]
float brush_local_mat[4][4]
float special_rotation
float mouse[2]
float symm_rot_mat_inv[4][4]
float scale[3]
float plane_offset[3]
float initial_location[3]
float clip_mirror_mtx[4][4]
float true_view_normal[3]
float radius_squared
float projection_mat[4][4]
void * prev_colors_vpaint
float last_location[3]
float anchored_location[3]
float clip_tolerance[3]
float initial_normal[3]
char saved_active_brush_name[MAX_ID_NAME]
int mirror_symmetry_pass
float density_seed
struct SculptPoseIKChain * pose_ik_chain
float view_normal[3]
struct SculptBoundary * boundaries[PAINT_SYMM_AREAS]
float rake_rotation[4]
struct ViewContext * vc
struct StrokeCache::@514 paint_brush
float sculpt_normal_symm[3]
float(* limit_surface_co)[3]
struct SculptRakeData rake_data
float(* surface_smooth_laplacian_disp)[3]
float true_initial_location[3]
float last_center[3]
float multiplane_scrape_angle
float grab_delta_symmetry[3]
float location[3]
AutomaskingCache * automasking
float stroke_local_mat[4][4]
struct SculptClothSimulation * cloth_sim
int radial_symmetry_pass
float true_last_location[3]
float true_initial_normal[3]
struct Dial * dial
float(* prev_displacement)[3]
int saved_smooth_size
bool is_rake_rotation_valid
float gravity_direction[3]
float plane_trim_squared
float stroke_distance
float normal_weight
float vertex_rotation
float(* detail_directions)[3]
float true_gravity_direction[3]
float mouse_event[2]
float * layer_displacement_factor
char saved_mask_brush_tool
float clay_pressure_stabilizer[SCULPT_CLAY_STABILIZER_LEN]
float(* prev_colors)[4]
int clay_pressure_stabilizer_index
float wet_persistence
float clay_thumb_front_angle
bool supports_gravity
bool is_last_valid
float rake_rotation_symmetry[4]
float grab_delta[3]
float symm_rot_mat[4][4]
float dyntopo_pixel_radius
ccl_device_inline float beta(float x, float y)
Definition: util/math.h:775
wmOperatorType * ot
Definition: wm_files.c:3479