Blender  V2.93
BKE_paint.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2009 by Nicholas Bishop
17  * All rights reserved.
18  */
19 
20 #pragma once
21 
26 #include "BLI_bitmap.h"
27 #include "BLI_utildefines.h"
28 #include "DNA_brush_enums.h"
29 #include "DNA_object_enums.h"
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
35 struct BMFace;
36 struct BMesh;
37 struct BlendDataReader;
38 struct BlendLibReader;
39 struct BlendWriter;
40 struct Brush;
41 struct CurveMapping;
42 struct Depsgraph;
43 struct EdgeSet;
44 struct EnumPropertyItem;
45 struct GHash;
46 struct GridPaintMask;
47 struct ImagePool;
48 struct ListBase;
49 struct MLoop;
50 struct MLoopTri;
51 struct MVert;
52 struct Main;
53 struct Mesh;
54 struct MeshElemMap;
55 struct Object;
56 struct PBVH;
57 struct Paint;
58 struct PaintCurve;
59 struct Palette;
60 struct PaletteColor;
61 struct Scene;
62 struct StrokeCache;
63 struct SubdivCCG;
64 struct Tex;
65 struct ToolSettings;
67 struct View3D;
68 struct ViewLayer;
69 struct bContext;
70 struct bToolRef;
71 struct tPaletteColorHSV;
72 
73 extern const char PAINT_CURSOR_SCULPT[3];
74 extern const char PAINT_CURSOR_VERTEX_PAINT[3];
75 extern const char PAINT_CURSOR_WEIGHT_PAINT[3];
76 extern const char PAINT_CURSOR_TEXTURE_PAINT[3];
77 
78 typedef enum ePaintMode {
89  /* Grease Pencil Vertex Paint */
93 
97 
98 #define PAINT_MODE_HAS_BRUSH(mode) !ELEM(mode, PAINT_MODE_SCULPT_UV)
99 
100 /* overlay invalidation */
109 
110 #define PAINT_OVERRIDE_MASK \
111  (PAINT_OVERLAY_OVERRIDE_SECONDARY | PAINT_OVERLAY_OVERRIDE_PRIMARY | \
112  PAINT_OVERLAY_OVERRIDE_CURSOR)
113 
114 /* Defines 8 areas resulting of splitting the object space by the XYZ axis planes. This is used to
115  * flip or mirror transform values depending on where the vertex is and where the transform
116  * operation started to support XYZ symmetry on those operations in a predictable way. */
117 
118 #define PAINT_SYMM_AREA_DEFAULT 0
119 
120 typedef enum ePaintSymmetryAreas {
121  PAINT_SYMM_AREA_X = (1 << 0),
122  PAINT_SYMM_AREA_Y = (1 << 1),
123  PAINT_SYMM_AREA_Z = (1 << 2),
125 
126 #define PAINT_SYMM_AREAS 8
127 
129  struct ViewLayer *view_layer,
130  const struct Tex *tex);
132  struct ViewLayer *view_layer,
133  struct CurveMapping *curve);
138 
139 /* palettes */
140 struct Palette *BKE_palette_add(struct Main *bmain, const char *name);
141 struct PaletteColor *BKE_palette_color_add(struct Palette *palette);
142 bool BKE_palette_is_empty(const struct Palette *palette);
143 void BKE_palette_color_remove(struct Palette *palette, struct PaletteColor *color);
144 void BKE_palette_clear(struct Palette *palette);
145 
146 void BKE_palette_sort_hsv(struct tPaletteColorHSV *color_array, const int totcol);
147 void BKE_palette_sort_svh(struct tPaletteColorHSV *color_array, const int totcol);
148 void BKE_palette_sort_vhs(struct tPaletteColorHSV *color_array, const int totcol);
149 void BKE_palette_sort_luminance(struct tPaletteColorHSV *color_array, const int totcol);
150 bool BKE_palette_from_hash(struct Main *bmain,
151  struct GHash *color_table,
152  const char *name,
153  const bool linear);
154 
155 /* paint curves */
156 struct PaintCurve *BKE_paint_curve_add(struct Main *bmain, const char *name);
157 
158 bool BKE_paint_ensure(struct ToolSettings *ts, struct Paint **r_paint);
159 void BKE_paint_init(struct Main *bmain, struct Scene *sce, ePaintMode mode, const char col[3]);
160 void BKE_paint_free(struct Paint *p);
161 void BKE_paint_copy(struct Paint *src, struct Paint *tar, const int flag);
162 
163 void BKE_paint_runtime_init(const struct ToolSettings *ts, struct Paint *paint);
164 
165 void BKE_paint_cavity_curve_preset(struct Paint *p, int preset);
166 
168 bool BKE_paint_ensure_from_paintmode(struct Scene *sce, ePaintMode mode);
169 struct Paint *BKE_paint_get_active_from_paintmode(struct Scene *sce, ePaintMode mode);
173 struct Paint *BKE_paint_get_active(struct Scene *sce, struct ViewLayer *view_layer);
177 struct Brush *BKE_paint_brush(struct Paint *paint);
178 void BKE_paint_brush_set(struct Paint *paint, struct Brush *br);
179 struct Palette *BKE_paint_palette(struct Paint *paint);
180 void BKE_paint_palette_set(struct Paint *p, struct Palette *palette);
181 void BKE_paint_curve_set(struct Brush *br, struct PaintCurve *pc);
182 void BKE_paint_curve_clamp_endpoint_add_index(struct PaintCurve *pc, const int add_index);
183 
184 /* testing face select mode
185  * Texture paint could be removed since selected faces are not used
186  * however hiding faces is useful */
187 bool BKE_paint_select_face_test(struct Object *ob);
188 bool BKE_paint_select_vert_test(struct Object *ob);
189 bool BKE_paint_select_elem_test(struct Object *ob);
190 
191 /* partial visibility */
192 bool paint_is_face_hidden(const struct MLoopTri *lt,
193  const struct MVert *mvert,
194  const struct MLoop *mloop);
195 bool paint_is_grid_face_hidden(const unsigned int *grid_hidden, int gridsize, int x, int y);
196 bool paint_is_bmesh_face_hidden(struct BMFace *f);
197 
198 /* paint masks */
199 float paint_grid_paint_mask(const struct GridPaintMask *gpm, uint level, uint x, uint y);
200 
201 void BKE_paint_face_set_overlay_color_get(const int face_set, const int seed, uchar r_color[4]);
202 
203 /* stroke related */
205  struct Brush *brush,
206  const float mouse_pos[2]);
208  struct Brush *brush,
209  float rotation);
210 
211 void BKE_paint_stroke_get_average(struct Scene *scene, struct Object *ob, float stroke[3]);
212 
213 /* Tool slot API. */
214 void BKE_paint_toolslots_init_from_main(struct Main *bmain);
215 void BKE_paint_toolslots_len_ensure(struct Paint *paint, int len);
216 void BKE_paint_toolslots_brush_update_ex(struct Paint *paint, struct Brush *brush);
217 void BKE_paint_toolslots_brush_update(struct Paint *paint);
218 void BKE_paint_toolslots_brush_validate(struct Main *bmain, struct Paint *paint);
219 struct Brush *BKE_paint_toolslots_brush_get(struct Paint *paint, int slot_index);
220 
221 /* .blend I/O */
222 void BKE_paint_blend_write(struct BlendWriter *writer, struct Paint *paint);
224  const struct Scene *scene,
225  struct Paint *paint);
226 void BKE_paint_blend_read_lib(struct BlendLibReader *reader,
227  struct Scene *scene,
228  struct Paint *paint);
229 
230 #define SCULPT_FACE_SET_NONE 0
231 
232 /* Used for both vertex color and weight paint */
238 };
239 
240 /* Pose Brush IK Chain */
241 typedef struct SculptPoseIKChainSegment {
242  float orig[3];
243  float head[3];
244 
245  float initial_orig[3];
246  float initial_head[3];
247  float len;
248  float scale[3];
249  float rot[4];
250  float *weights;
251 
252  /* Store a 4x4 transform matrix for each of the possible combinations of enabled XYZ symmetry
253  * axis. */
258 
259 typedef struct SculptPoseIKChain {
264 
265 /* Cloth Brush */
266 
267 /* Cloth Simulation. */
269  /* Constraints were not built for this node, so it can't be simulated. */
271 
272  /* There are constraints for the geometry in this node, but it should not be simulated. */
274 
275  /* There are constraints for this node and they should be used by the solver. */
278 
280  /* Constraint that creates the structure of the cloth. */
282  /* Constraint that references the position of a vertex and a position in deformation_pos which
283  * can be deformed by the tools. */
285  /* Constraint that references the vertex position and a editable soft-body position for
286  * plasticity. */
288  /* Constraint that references the vertex position and its initial position. */
291 
293  /* Elements that are affected by the constraint. */
294  /* Element a should always be a mesh vertex with the index stored in elem_index_a as it is always
295  * deformed. Element b could be another vertex of the same mesh or any other position (arbitrary
296  * point, position for a previous state). In that case, elem_index_a and elem_index_b should be
297  * the same to avoid affecting two different vertices when solving the constraints.
298  * *elem_position points to the position which is owned by the element. */
301 
304 
305  float length;
306  float strength;
307 
308  /* Index in #SculptClothSimulation.node_state of the node from where this constraint was created.
309  * This constraints will only be used by the solver if the state is active. */
310  int node;
311 
314 
315 typedef struct SculptClothSimulation {
321 
322  /* Position anchors for deformation brushes. These positions are modified by the brush and the
323  * final positions of the simulated vertices are updated with constraints that use these points
324  * as targets. */
327 
328  float mass;
329  float damping;
331 
333  float (*pos)[3];
338 
340 
341  int totnode;
346 
347 typedef struct SculptPersistentBase {
348  float co[3];
349  float no[3];
350  float disp;
352 
353 typedef struct SculptVertexInfo {
354  /* Indexed by vertex, stores and ID of its topologically connected component. */
356 
357  /* Indexed by base mesh vertex index, stores if that vertex is a boundary. */
360 
361 typedef struct SculptBoundaryEditInfo {
362  /* Vertex index from where the topology propagation reached this vertex. */
364 
365  /* How many steps were needed to reach this vertex from the boundary. */
367 
368  /* Strength that is used to deform this vertex. */
371 
372 /* Edge for drawing the boundary preview in the cursor. */
374  int v1;
375  int v2;
377 
378 typedef struct SculptBoundary {
379  /* Vertex indices of the active boundary. */
380  int *vertices;
383 
384  /* Distance from a vertex in the boundary to initial vertex indexed by vertex index, taking into
385  * account the length of all edges between them. Any vertex that is not in the boundary will have
386  * a distance of 0. */
387  float *distance;
388 
389  /* Data for drawing the preview. */
393 
394  /* True if the boundary loops into itself. */
396 
397  /* Initial vertex in the boundary which is closest to the current sculpt active vertex. */
399 
400  /* Vertex that at max_propagation_steps from the boundary and closest to the original active
401  * vertex that was used to initialize the boundary. This is used as a reference to check how much
402  * the deformation will go into the mesh and to calculate the strength of the brushes. */
404 
405  /* Stores the initial positions of the pivot and boundary initial vertex as they may be deformed
406  * during the brush action. This allows to use them as a reference positions and vectors for some
407  * brush effects. */
410 
411  /* Maximum number of topology steps that were calculated from the boundary. */
413 
414  /* Indexed by vertex index, contains the topology information needed for boundary deformations.
415  */
417 
418  /* Bend Deform type. */
419  struct {
422  } bend;
423 
424  /* Slide Deform type. */
425  struct {
427  } slide;
428 
429  /* Twist Deform type. */
430  struct {
431  float rotation_axis[3];
432  float pivot_position[3];
433  } twist;
435 
436 typedef struct SculptFakeNeighbors {
438 
439  /* Max distance used to calculate neighborhood information. */
441 
442  /* Indexed by vertex, stores the vertex index of its fake neighbor if available. */
444 
446 
447 /* Session data (mode-specific) */
448 
449 typedef struct SculptSession {
450  /* Mesh data (not copied) can come either directly from a Mesh, or from a MultiresDM */
451  struct { /* Special handling for multires meshes */
452  bool active;
454  int level;
456 
457  /* Depsgraph for the Cloth Brush solver to get the colliders. */
459 
460  /* These are always assigned to base mesh data when using PBVH_FACES and PBVH_GRIDS. */
461  struct MVert *mvert;
462  struct MPoly *mpoly;
463  struct MLoop *mloop;
464 
465  /* These contain the vertex and poly counts of the final mesh. */
467 
469  struct MPropCol *vcol;
470  float *vmask;
471 
472  /* Mesh connectivity maps. */
473  /* Vertices to adjacent polys. */
474  struct MeshElemMap *pmap;
475  int *pmap_mem;
476 
477  /* Edges to adjacent polys. */
479  int *epmap_mem;
480 
481  /* Vertices to adjacent edges. */
483  int *vemap_mem;
484 
485  /* Mesh Face Sets */
486  /* Total number of polys of the base mesh. */
487  int totfaces;
488  /* Face sets store its visibility in the sign of the integer, using the absolute value as the
489  * Face Set ID. Positive IDs are visible, negative IDs are hidden. */
490  int *face_sets;
491 
492  /* BMesh for dynamic topology sculpting */
493  struct BMesh *bm;
497  /* Undo/redo log for dynamic topology sculpting */
498  struct BMLog *bm_log;
499 
500  /* Limit surface/grids. */
502 
503  /* PBVH acceleration structure */
504  struct PBVH *pbvh;
505  bool show_mask;
507 
508  /* Painting on deformed mesh */
509  bool deform_modifiers_active; /* Object is deformed with some modifiers. */
510  float (*orig_cos)[3]; /* Coords of un-deformed mesh. */
511  float (*deform_cos)[3]; /* Coords of deformed mesh but without stroke displacement. */
512  float (*deform_imats)[3][3]; /* Crazy-space deformation matrices. */
513 
514  /* Used to cache the render of the active texture */
517 
521 
522  /* Cursor data and active vertex for tools */
524 
527 
528  /* When active, the cursor draws with faded colors, indicating that there is an action enabled.
529  */
532  float cursor_location[3];
533  float cursor_normal[3];
536 
537  /* For Sculpt trimming gesture tools, initial raycast data from the position of the mouse when
538  * the gesture starts (intersection with the surface and if they ray hit the surface or not). */
542 
543  /* TODO(jbakker): Replace rv3d and v3d with ViewContext */
545  struct View3D *v3d;
546  struct Scene *scene;
547 
548  /* Dynamic mesh preview */
551 
552  /* Pose Brush Preview */
553  float pose_origin[3];
555 
556  /* Boundary Brush Preview */
558 
559  /* Mesh State Persistence */
560  /* This is freed with the PBVH, so it is always in sync with the mesh. */
562 
565 
566  /* Transform operator */
567  float pivot_pos[3];
568  float pivot_rot[4];
569  float pivot_scale[3];
570 
571  float init_pivot_pos[3];
572  float init_pivot_rot[4];
574 
575  float prev_pivot_pos[3];
576  float prev_pivot_rot[4];
578 
579  union {
580  struct {
582 
583  /* For non-airbrush painting to re-apply from the original (MLoop aligned). */
584  unsigned int *previous_color;
586 
587  struct {
589  /* Keep track of how much each vertex has been painted (non-airbrush only). */
590  float *alpha_weight;
591 
592  /* Needed to continuously re-apply over the same weights (BRUSH_ACCUMULATE disabled).
593  * Lazy initialize as needed (flag is set to 1 to tag it as uninitialized). */
596 
597  /* TODO: identify sculpt-only fields */
598  // struct { ... } sculpt;
599  } mode;
601 
602  /* This flag prevents PBVH from being freed when creating the vp_handle for texture paint. */
604 
610 
612 
613 void BKE_sculptsession_free(struct Object *ob);
616 void BKE_sculptsession_bm_to_me(struct Object *ob, bool reorder);
617 void BKE_sculptsession_bm_to_me_for_render(struct Object *object);
618 
619 /* Create new color layer on object if it doesn't have one and if experimental feature set has
620  * sculpt vertex color enabled. Returns truth if new layer has been added, false otherwise. */
622 
624  struct Object *ob_orig,
625  bool need_pmap,
626  bool need_mask,
627  bool need_colors);
628 void BKE_sculpt_update_object_before_eval(struct Object *ob_eval);
629 void BKE_sculpt_update_object_after_eval(struct Depsgraph *depsgraph, struct Object *ob_eval);
630 
632 int BKE_sculpt_mask_layers_ensure(struct Object *ob, struct MultiresModifierData *mmd);
634 
635 struct PBVH *BKE_sculpt_object_pbvh_ensure(struct Depsgraph *depsgraph, struct Object *ob);
636 
637 void BKE_sculpt_bvh_update_from_ccg(struct PBVH *pbvh, struct SubdivCCG *subdiv_ccg);
638 
639 /* This ensure that all elements in the mesh (both vertices and grids) have their visibility
640  * updated according to the face sets. */
642 
643 /* Individual function to sync the Face Set visibility to mesh and grids. */
646  struct SubdivCCG *subdiv_ccg);
647 
649 
650 void BKE_sculpt_ensure_orig_mesh_data(struct Scene *scene, struct Object *object);
651 
652 bool BKE_sculptsession_use_pbvh_draw(const struct Object *ob, const struct View3D *v3d);
653 
654 enum {
657 };
658 
659 #ifdef __cplusplus
660 }
661 #endif
typedef float(TangentPoint)[2]
bool paint_is_face_hidden(const struct MLoopTri *lt, const struct MVert *mvert, const struct MLoop *mloop)
struct Paint * BKE_paint_get_active(struct Scene *sce, struct ViewLayer *view_layer)
Definition: paint.c:447
void BKE_sculptsession_free_vwpaint_data(struct SculptSession *ss)
Definition: paint.c:1344
eObjectMode BKE_paint_object_mode_from_paintmode(ePaintMode mode)
Definition: paint.c:1009
void BKE_sculptsession_bm_to_me_for_render(struct Object *object)
Definition: paint.c:1444
void BKE_paint_invalidate_overlay_tex(struct Scene *scene, struct ViewLayer *view_layer, const struct Tex *tex)
void BKE_paint_blend_write(struct BlendWriter *writer, struct Paint *paint)
Definition: paint.c:1185
struct Palette * BKE_paint_palette(struct Paint *paint)
Definition: paint.c:700
#define PAINT_SYMM_AREAS
Definition: BKE_paint.h:126
void BKE_paint_brush_set(struct Paint *paint, struct Brush *br)
Definition: paint.c:609
struct SculptPoseIKChainSegment SculptPoseIKChainSegment
struct Palette * BKE_palette_add(struct Main *bmain, const char *name)
Definition: paint.c:751
struct SculptBoundaryPreviewEdge SculptBoundaryPreviewEdge
void BKE_sculpt_sync_face_set_visibility(struct Mesh *mesh, struct SubdivCCG *subdiv_ccg)
Definition: paint.c:2044
bool paint_calculate_rake_rotation(struct UnifiedPaintSettings *ups, struct Brush *brush, const float mouse_pos[2])
Definition: paint.c:1300
void BKE_sculpt_sync_face_sets_visibility_to_base_mesh(struct Mesh *mesh)
Definition: paint.c:1998
void BKE_paint_invalidate_cursor_overlay(struct Scene *scene, struct ViewLayer *view_layer, struct CurveMapping *curve)
Definition: paint.c:259
void BKE_paint_toolslots_len_ensure(struct Paint *paint, int len)
void BKE_palette_sort_svh(struct tPaletteColorHSV *color_array, const int totcol)
Definition: paint.c:887
bool BKE_paint_select_elem_test(struct Object *ob)
Definition: paint.c:987
struct SculptClothLengthConstraint SculptClothLengthConstraint
float paint_grid_paint_mask(const struct GridPaintMask *gpm, uint level, uint x, uint y)
struct Paint * BKE_paint_get_active_from_paintmode(struct Scene *sce, ePaintMode mode)
Definition: paint.c:354
void BKE_sculpt_sync_face_sets_visibility_to_grids(struct Mesh *mesh, struct SubdivCCG *subdiv_ccg)
Definition: paint.c:2013
void BKE_sculpt_toolsettings_data_ensure(struct Scene *scene)
Definition: paint.c:1895
ePaintMode BKE_paintmode_get_active_from_context(const struct bContext *C)
void BKE_paint_curve_set(struct Brush *br, struct PaintCurve *pc)
Definition: paint.c:714
struct SculptSession SculptSession
void BKE_palette_sort_luminance(struct tPaletteColorHSV *color_array, const int totcol)
Definition: paint.c:899
const char PAINT_CURSOR_VERTEX_PAINT[3]
Definition: paint.c:233
ePaintSymmetryAreas
Definition: BKE_paint.h:120
@ PAINT_SYMM_AREA_Z
Definition: BKE_paint.h:123
@ PAINT_SYMM_AREA_X
Definition: BKE_paint.h:121
@ PAINT_SYMM_AREA_Y
Definition: BKE_paint.h:122
void BKE_paint_copy(struct Paint *src, struct Paint *tar, const int flag)
Definition: paint.c:1156
void BKE_paint_runtime_init(const struct ToolSettings *ts, struct Paint *paint)
void BKE_sculpt_update_object_before_eval(struct Object *ob_eval)
Definition: paint.c:1757
struct SculptClothSimulation SculptClothSimulation
void BKE_sculpt_update_object_for_edit(struct Depsgraph *depsgraph, struct Object *ob_orig, bool need_pmap, bool need_mask, bool need_colors)
Definition: paint.c:1817
const char PAINT_CURSOR_SCULPT[3]
Definition: paint.c:232
bool paint_is_bmesh_face_hidden(struct BMFace *f)
Definition: paint.c:1257
uint BKE_paint_get_brush_tool_offset_from_paintmode(const ePaintMode mode)
Definition: paint.c:663
struct Brush * BKE_paint_toolslots_brush_get(struct Paint *paint, int slot_index)
void BKE_paint_toolslots_brush_update(struct Paint *paint)
eSculptClothNodeSimState
Definition: BKE_paint.h:268
@ SCULPT_CLOTH_NODE_UNINITIALIZED
Definition: BKE_paint.h:270
@ SCULPT_CLOTH_NODE_ACTIVE
Definition: BKE_paint.h:276
@ SCULPT_CLOTH_NODE_INACTIVE
Definition: BKE_paint.h:273
struct SculptPersistentBase SculptPersistentBase
struct Brush * BKE_paint_brush(struct Paint *paint)
Definition: paint.c:604
struct SculptBoundaryEditInfo SculptBoundaryEditInfo
void BKE_paint_init(struct Main *bmain, struct Scene *sce, ePaintMode mode, const char col[3])
Definition: paint.c:1115
bool BKE_paint_ensure(struct ToolSettings *ts, struct Paint **r_paint)
Definition: paint.c:1032
void BKE_paint_set_overlay_override(enum eOverlayFlags flag)
Definition: paint.c:283
bool BKE_palette_from_hash(struct Main *bmain, struct GHash *color_table, const char *name, const bool linear)
Definition: paint.c:905
ePaintOverlayControlFlags
Definition: BKE_paint.h:101
@ PAINT_OVERLAY_INVALID_CURVE
Definition: BKE_paint.h:104
@ PAINT_OVERLAY_INVALID_TEXTURE_SECONDARY
Definition: BKE_paint.h:103
@ PAINT_OVERLAY_OVERRIDE_CURSOR
Definition: BKE_paint.h:105
@ PAINT_OVERLAY_INVALID_TEXTURE_PRIMARY
Definition: BKE_paint.h:102
@ PAINT_OVERLAY_OVERRIDE_SECONDARY
Definition: BKE_paint.h:107
@ PAINT_OVERLAY_OVERRIDE_PRIMARY
Definition: BKE_paint.h:106
void BKE_paint_reset_overlay_invalid(ePaintOverlayControlFlags flag)
Definition: paint.c:301
void BKE_paint_palette_set(struct Paint *p, struct Palette *palette)
Definition: paint.c:705
int BKE_sculpt_mask_layers_ensure(struct Object *ob, struct MultiresModifierData *mmd)
Definition: paint.c:1829
void BKE_paint_free(struct Paint *p)
Definition: paint.c:1146
void BKE_palette_color_remove(struct Palette *palette, struct PaletteColor *color)
Definition: paint.c:729
struct SculptPoseIKChain SculptPoseIKChain
void BKE_sculptsession_free(struct Object *ob)
Definition: paint.c:1466
struct SculptVertexInfo SculptVertexInfo
struct Paint * BKE_paint_get_active_from_context(const struct bContext *C)
void BKE_paint_blend_read_lib(struct BlendLibReader *reader, struct Scene *scene, struct Paint *paint)
Definition: paint.c:1219
bool paint_is_grid_face_hidden(const unsigned int *grid_hidden, int gridsize, int x, int y)
Definition: paint.c:1247
const char PAINT_CURSOR_WEIGHT_PAINT[3]
Definition: paint.c:234
struct SculptBoundary SculptBoundary
const struct EnumPropertyItem * BKE_paint_get_tool_enum_from_paintmode(ePaintMode mode)
Definition: paint.c:389
void BKE_palette_sort_vhs(struct tPaletteColorHSV *color_array, const int totcol)
Definition: paint.c:893
struct SculptFakeNeighbors SculptFakeNeighbors
bool BKE_paint_select_vert_test(struct Object *ob)
Definition: paint.c:976
const char PAINT_CURSOR_TEXTURE_PAINT[3]
Definition: paint.c:235
bool BKE_paint_select_face_test(struct Object *ob)
Definition: paint.c:968
void BKE_paint_curve_clamp_endpoint_add_index(struct PaintCurve *pc, const int add_index)
Definition: paint.c:723
void BKE_paint_toolslots_brush_update_ex(struct Paint *paint, struct Brush *brush)
void BKE_palette_clear(struct Palette *palette)
Definition: paint.c:745
bool BKE_paint_ensure_from_paintmode(struct Scene *sce, ePaintMode mode)
Definition: paint.c:306
void BKE_paint_toolslots_brush_validate(struct Main *bmain, struct Paint *paint)
void BKE_paint_stroke_get_average(struct Scene *scene, struct Object *ob, float stroke[3])
Definition: paint.c:1173
void BKE_paint_cavity_curve_preset(struct Paint *p, int preset)
Definition: paint.c:992
void BKE_palette_sort_hsv(struct tPaletteColorHSV *color_array, const int totcol)
Definition: paint.c:881
void BKE_sculptsession_free_deformMats(struct SculptSession *ss)
Definition: paint.c:1337
void BKE_paint_invalidate_overlay_all(void)
Definition: paint.c:272
struct PaintCurve * BKE_paint_curve_add(struct Main *bmain, const char *name)
Definition: paint.c:691
ePaintMode
Definition: BKE_paint.h:78
@ PAINT_MODE_INVALID
Definition: BKE_paint.h:95
@ PAINT_MODE_GPENCIL
Definition: BKE_paint.h:88
@ PAINT_MODE_SCULPT_UV
Definition: BKE_paint.h:87
@ PAINT_MODE_VERTEX_GPENCIL
Definition: BKE_paint.h:90
@ PAINT_MODE_TEXTURE_3D
Definition: BKE_paint.h:84
@ PAINT_MODE_WEIGHT_GPENCIL
Definition: BKE_paint.h:92
@ PAINT_MODE_SCULPT
Definition: BKE_paint.h:79
@ PAINT_MODE_SCULPT_GPENCIL
Definition: BKE_paint.h:91
@ PAINT_MODE_WEIGHT
Definition: BKE_paint.h:82
@ PAINT_MODE_TEXTURE_2D
Definition: BKE_paint.h:86
@ PAINT_MODE_VERTEX
Definition: BKE_paint.h:81
void BKE_sculptsession_bm_to_me(struct Object *ob, bool reorder)
Definition: paint.c:1398
const char * BKE_paint_get_tool_prop_id_from_paintmode(ePaintMode mode)
Definition: paint.c:417
void BKE_sculpt_bvh_update_from_ccg(struct PBVH *pbvh, struct SubdivCCG *subdiv_ccg)
Definition: paint.c:2219
struct PaletteColor * BKE_palette_color_add(struct Palette *palette)
Definition: paint.c:757
void BKE_paint_face_set_overlay_color_get(const int face_set, const int seed, uchar r_color[4])
Definition: paint.c:2249
eSculptClothConstraintType
Definition: BKE_paint.h:279
@ SCULPT_CLOTH_CONSTRAINT_DEFORMATION
Definition: BKE_paint.h:284
@ SCULPT_CLOTH_CONSTRAINT_PIN
Definition: BKE_paint.h:289
@ SCULPT_CLOTH_CONSTRAINT_SOFTBODY
Definition: BKE_paint.h:287
@ SCULPT_CLOTH_CONSTRAINT_STRUCTURAL
Definition: BKE_paint.h:281
void BKE_sculpt_update_object_after_eval(struct Depsgraph *depsgraph, struct Object *ob_eval)
Definition: paint.c:1789
struct PBVH * BKE_sculpt_object_pbvh_ensure(struct Depsgraph *depsgraph, struct Object *ob)
Definition: paint.c:2171
void BKE_paint_blend_read_data(struct BlendDataReader *reader, const struct Scene *scene, struct Paint *paint)
ePaintOverlayControlFlags BKE_paint_get_overlay_flags(void)
Definition: paint.c:278
void BKE_sculpt_color_layer_create_if_needed(struct Object *object)
Definition: paint.c:1800
void BKE_paint_toolslots_init_from_main(struct Main *bmain)
struct MultiresModifierData * BKE_sculpt_multires_active(struct Scene *scene, struct Object *ob)
Definition: paint.c:1527
void paint_update_brush_rake_rotation(struct UnifiedPaintSettings *ups, struct Brush *brush, float rotation)
Definition: paint.c:1283
void BKE_sculpt_face_sets_ensure_from_base_mesh_visibility(struct Mesh *mesh)
Definition: paint.c:1950
ePaintMode BKE_paintmode_get_from_tool(const struct bToolRef *tref)
Definition: paint.c:570
bool BKE_sculptsession_use_pbvh_draw(const struct Object *ob, const struct View3D *v3d)
@ SCULPT_MASK_LAYER_CALC_VERT
Definition: BKE_paint.h:655
@ SCULPT_MASK_LAYER_CALC_LOOP
Definition: BKE_paint.h:656
void BKE_sculpt_ensure_orig_mesh_data(struct Scene *scene, struct Object *object)
Definition: paint.c:2057
bool BKE_palette_is_empty(const struct Palette *palette)
Definition: paint.c:764
unsigned int BLI_bitmap
Definition: BLI_bitmap.h:32
unsigned char uchar
Definition: BLI_sys_types.h:86
unsigned int uint
Definition: BLI_sys_types.h:83
struct Depsgraph Depsgraph
Definition: DEG_depsgraph.h:51
eOverlayFlags
eObjectMode
_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 const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
#define C
Definition: RandGen.cpp:39
static unsigned long seed
Definition: btSoftBody.h:39
Scene scene
Curve curve
const Depsgraph * depsgraph
uint col
Definition: BKE_main.h:116
struct SubdivCCG * subdiv_ccg
Definition: pbvh_intern.h:178
struct SculptBoundary::@52 twist
float rotation_axis[3]
Definition: BKE_paint.h:431
int vertices_capacity
Definition: BKE_paint.h:381
int initial_vertex
Definition: BKE_paint.h:398
int max_propagation_steps
Definition: BKE_paint.h:412
struct SculptBoundaryEditInfo * edit_info
Definition: BKE_paint.h:416
float pivot_position[3]
Definition: BKE_paint.h:432
float initial_vertex_position[3]
Definition: BKE_paint.h:408
float(* pivot_rotation_axis)[3]
Definition: BKE_paint.h:420
float initial_pivot_position[3]
Definition: BKE_paint.h:409
struct SculptBoundary::@50 bend
struct SculptBoundary::@51 slide
int * vertices
Definition: BKE_paint.h:380
int edges_capacity
Definition: BKE_paint.h:391
float * distance
Definition: BKE_paint.h:387
SculptBoundaryPreviewEdge * edges
Definition: BKE_paint.h:390
float(* directions)[3]
Definition: BKE_paint.h:426
float(* pivot_positions)[3]
Definition: BKE_paint.h:421
eSculptClothConstraintType type
Definition: BKE_paint.h:312
float * deformation_strength
Definition: BKE_paint.h:326
struct EdgeSet * created_length_constraints
Definition: BKE_paint.h:318
float(* init_pos)[3]
Definition: BKE_paint.h:334
float(* prev_pos)[3]
Definition: BKE_paint.h:336
float(* softbody_pos)[3]
Definition: BKE_paint.h:335
float(* acceleration)[3]
Definition: BKE_paint.h:332
struct ListBase * collider_list
Definition: BKE_paint.h:339
struct GHash * node_state_index
Definition: BKE_paint.h:343
float(* deformation_pos)[3]
Definition: BKE_paint.h:325
eSculptClothNodeSimState * node_state
Definition: BKE_paint.h:344
SculptClothLengthConstraint * length_constraints
Definition: BKE_paint.h:316
float(* last_iteration_pos)[3]
Definition: BKE_paint.h:337
float * length_constraint_tweak
Definition: BKE_paint.h:320
int * fake_neighbor_index
Definition: BKE_paint.h:443
float current_max_distance
Definition: BKE_paint.h:440
float pivot_mat[PAINT_SYMM_AREAS][4][4]
Definition: BKE_paint.h:255
float trans_mat[PAINT_SYMM_AREAS][4][4]
Definition: BKE_paint.h:254
float pivot_mat_inv[PAINT_SYMM_AREAS][4][4]
Definition: BKE_paint.h:256
SculptPoseIKChainSegment * segments
Definition: BKE_paint.h:260
float grab_delta_offset[3]
Definition: BKE_paint.h:262
float cursor_normal[3]
Definition: BKE_paint.h:533
unsigned int texcache_side
Definition: BKE_paint.h:515
struct SubdivCCG * subdiv_ccg
Definition: BKE_paint.h:501
struct ImagePool * tex_pool
Definition: BKE_paint.h:516
int cd_face_node_offset
Definition: BKE_paint.h:495
SculptPoseIKChain * pose_ik_chain_preview
Definition: BKE_paint.h:554
struct MeshElemMap * epmap
Definition: BKE_paint.h:478
float cursor_view_normal[3]
Definition: BKE_paint.h:535
bool bm_smooth_shading
Definition: BKE_paint.h:496
int cd_vert_node_offset
Definition: BKE_paint.h:494
float pose_origin[3]
Definition: BKE_paint.h:553
struct MDeformVert * dvert_prev
Definition: BKE_paint.h:594
int preview_vert_index_count
Definition: BKE_paint.h:550
struct Depsgraph * depsgraph
Definition: BKE_paint.h:458
float pivot_scale[3]
Definition: BKE_paint.h:569
SculptVertexInfo vertex_info
Definition: BKE_paint.h:563
bool show_mask
Definition: BKE_paint.h:505
float cursor_location[3]
Definition: BKE_paint.h:532
struct RegionView3D * rv3d
Definition: BKE_paint.h:544
float(* orig_cos)[3]
Definition: BKE_paint.h:510
int * face_sets
Definition: BKE_paint.h:490
float pivot_pos[3]
Definition: BKE_paint.h:567
int * pmap_mem
Definition: BKE_paint.h:475
bool draw_faded_cursor
Definition: BKE_paint.h:530
float cursor_radius
Definition: BKE_paint.h:531
struct MVert * mvert
Definition: BKE_paint.h:461
struct MPropCol * vcol
Definition: BKE_paint.h:469
struct KeyBlock * shapekey_active
Definition: BKE_paint.h:468
float init_pivot_scale[3]
Definition: BKE_paint.h:573
struct SculptSession::@54::@55 vpaint
bool show_face_sets
Definition: BKE_paint.h:506
union SculptSession::@54 mode
struct BMesh * bm
Definition: BKE_paint.h:493
int * preview_vert_index_list
Definition: BKE_paint.h:549
SculptBoundary * boundary_preview
Definition: BKE_paint.h:557
float * alpha_weight
Definition: BKE_paint.h:590
int active_face_index
Definition: BKE_paint.h:525
struct MeshElemMap * vemap
Definition: BKE_paint.h:482
float gesture_initial_location[3]
Definition: BKE_paint.h:539
struct BMLog * bm_log
Definition: BKE_paint.h:498
int active_vertex_index
Definition: BKE_paint.h:523
float pivot_rot[4]
Definition: BKE_paint.h:568
float init_pivot_rot[4]
Definition: BKE_paint.h:572
float gesture_initial_normal[3]
Definition: BKE_paint.h:540
struct SculptVertexPaintGeomMap gmap
Definition: BKE_paint.h:581
struct Scene * scene
Definition: BKE_paint.h:546
int * epmap_mem
Definition: BKE_paint.h:479
float prev_pivot_scale[3]
Definition: BKE_paint.h:577
float * vmask
Definition: BKE_paint.h:470
bool gesture_initial_hit
Definition: BKE_paint.h:541
struct MeshElemMap * pmap
Definition: BKE_paint.h:474
struct MLoop * mloop
Definition: BKE_paint.h:463
struct MPoly * mpoly
Definition: BKE_paint.h:462
char needs_flush_to_id
Definition: BKE_paint.h:609
eObjectMode mode_type
Definition: BKE_paint.h:600
struct MultiresModifierData * modifier
Definition: BKE_paint.h:453
float(* deform_imats)[3][3]
Definition: BKE_paint.h:512
float cursor_sampled_normal[3]
Definition: BKE_paint.h:534
struct StrokeCache * cache
Definition: BKE_paint.h:518
float prev_pivot_pos[3]
Definition: BKE_paint.h:575
struct SculptSession::@53 multires
struct View3D * v3d
Definition: BKE_paint.h:545
float init_pivot_pos[3]
Definition: BKE_paint.h:571
float(* deform_cos)[3]
Definition: BKE_paint.h:511
unsigned int texcache_actual
Definition: BKE_paint.h:515
unsigned int * previous_color
Definition: BKE_paint.h:584
struct ExpandCache * expand_cache
Definition: BKE_paint.h:520
float prev_pivot_rot[4]
Definition: BKE_paint.h:576
int active_grid_index
Definition: BKE_paint.h:526
struct SculptSession::@54::@56 wpaint
SculptFakeNeighbors fake_neighbors
Definition: BKE_paint.h:564
unsigned int * texcache
Definition: BKE_paint.h:515
SculptPersistentBase * persistent_base
Definition: BKE_paint.h:561
struct FilterCache * filter_cache
Definition: BKE_paint.h:519
bool building_vp_handle
Definition: BKE_paint.h:603
struct PBVH * pbvh
Definition: BKE_paint.h:504
int * vemap_mem
Definition: BKE_paint.h:483
bool deform_modifiers_active
Definition: BKE_paint.h:509
int * connected_component
Definition: BKE_paint.h:355
BLI_bitmap * boundary
Definition: BKE_paint.h:358
struct MeshElemMap * vert_to_loop
Definition: BKE_paint.h:235
struct MeshElemMap * vert_to_poly
Definition: BKE_paint.h:237
uint len