Blender  V3.3
BKE_paint.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2009 by Nicholas Bishop. All rights reserved. */
3 
4 #pragma once
5 
10 #include "BLI_bitmap.h"
11 #include "BLI_utildefines.h"
12 #include "DNA_brush_enums.h"
13 #include "DNA_object_enums.h"
14 
15 #include "BKE_attribute.h"
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
21 struct BMFace;
22 struct BMesh;
23 struct BlendDataReader;
24 struct BlendLibReader;
25 struct BlendWriter;
26 struct Brush;
27 struct CurveMapping;
28 struct Depsgraph;
29 struct EdgeSet;
30 struct EnumPropertyItem;
31 struct GHash;
32 struct GridPaintMask;
33 struct Image;
34 struct ImagePool;
35 struct ImageUser;
36 struct ListBase;
37 struct MLoop;
38 struct MLoopTri;
39 struct MVert;
40 struct Main;
41 struct Mesh;
42 struct MeshElemMap;
43 struct Object;
44 struct PBVH;
45 struct Paint;
46 struct PaintCurve;
47 struct PaintModeSettings;
48 struct Palette;
49 struct PaletteColor;
50 struct Scene;
51 struct StrokeCache;
52 struct SubdivCCG;
53 struct Tex;
54 struct ToolSettings;
56 struct View3D;
57 struct ViewLayer;
58 struct bContext;
59 struct bToolRef;
60 struct tPaletteColorHSV;
61 
62 extern const char PAINT_CURSOR_SCULPT[3];
63 extern const char PAINT_CURSOR_VERTEX_PAINT[3];
64 extern const char PAINT_CURSOR_WEIGHT_PAINT[3];
65 extern const char PAINT_CURSOR_TEXTURE_PAINT[3];
66 
67 typedef enum ePaintMode {
78  /* Grease Pencil Vertex Paint */
84 
88 
89 #define PAINT_MODE_HAS_BRUSH(mode) !ELEM(mode, PAINT_MODE_SCULPT_UV)
90 
91 /* overlay invalidation */
100 
101 #define PAINT_OVERRIDE_MASK \
102  (PAINT_OVERLAY_OVERRIDE_SECONDARY | PAINT_OVERLAY_OVERRIDE_PRIMARY | \
103  PAINT_OVERLAY_OVERRIDE_CURSOR)
104 
110 #define PAINT_SYMM_AREA_DEFAULT 0
111 
112 typedef enum ePaintSymmetryAreas {
113  PAINT_SYMM_AREA_X = (1 << 0),
114  PAINT_SYMM_AREA_Y = (1 << 1),
115  PAINT_SYMM_AREA_Z = (1 << 2),
117 
118 #define PAINT_SYMM_AREAS 8
119 
121  struct ViewLayer *view_layer,
122  const struct Tex *tex);
124  struct ViewLayer *view_layer,
125  struct CurveMapping *curve);
130 
131 /* Palettes. */
132 
133 struct Palette *BKE_palette_add(struct Main *bmain, const char *name);
134 struct PaletteColor *BKE_palette_color_add(struct Palette *palette);
135 bool BKE_palette_is_empty(const struct Palette *palette);
139 void BKE_palette_color_remove(struct Palette *palette, struct PaletteColor *color);
140 void BKE_palette_clear(struct Palette *palette);
141 
142 void BKE_palette_sort_hsv(struct tPaletteColorHSV *color_array, int totcol);
143 void BKE_palette_sort_svh(struct tPaletteColorHSV *color_array, int totcol);
144 void BKE_palette_sort_vhs(struct tPaletteColorHSV *color_array, int totcol);
145 void BKE_palette_sort_luminance(struct tPaletteColorHSV *color_array, int totcol);
146 bool BKE_palette_from_hash(struct Main *bmain,
147  struct GHash *color_table,
148  const char *name,
149  bool linear);
150 
151 /* Paint curves. */
152 
153 struct PaintCurve *BKE_paint_curve_add(struct Main *bmain, const char *name);
154 
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);
166 void BKE_paint_copy(struct Paint *src, struct Paint *tar, int flag);
167 
168 void BKE_paint_runtime_init(const struct ToolSettings *ts, struct Paint *paint);
169 
170 void BKE_paint_cavity_curve_preset(struct Paint *p, int preset);
171 
173 bool BKE_paint_ensure_from_paintmode(struct Scene *sce, ePaintMode mode);
174 struct Paint *BKE_paint_get_active_from_paintmode(struct Scene *sce, ePaintMode mode);
178 struct Paint *BKE_paint_get_active(struct Scene *sce, struct ViewLayer *view_layer);
182 struct Brush *BKE_paint_brush(struct Paint *paint);
183 const struct Brush *BKE_paint_brush_for_read(const struct Paint *p);
184 void BKE_paint_brush_set(struct Paint *paint, struct Brush *br);
185 struct Palette *BKE_paint_palette(struct Paint *paint);
186 void BKE_paint_palette_set(struct Paint *p, struct Palette *palette);
187 void BKE_paint_curve_set(struct Brush *br, struct PaintCurve *pc);
188 void BKE_paint_curve_clamp_endpoint_add_index(struct PaintCurve *pc, int add_index);
189 
193 bool BKE_paint_select_face_test(struct Object *ob);
197 bool BKE_paint_select_vert_test(struct Object *ob);
202 bool BKE_paint_select_elem_test(struct Object *ob);
207 bool BKE_paint_always_hide_test(struct Object *ob);
208 
209 /* Partial visibility. */
210 
214 bool paint_is_face_hidden(const struct MLoopTri *lt,
215  const struct MVert *mvert,
216  const struct MLoop *mloop);
221 bool paint_is_grid_face_hidden(const unsigned int *grid_hidden, int gridsize, int x, int y);
225 bool paint_is_bmesh_face_hidden(struct BMFace *f);
226 
227 /* Paint masks. */
228 
229 float paint_grid_paint_mask(const struct GridPaintMask *gpm, uint level, uint x, uint y);
230 
231 void BKE_paint_face_set_overlay_color_get(int face_set, int seed, uchar r_color[4]);
232 
233 /* Stroke related. */
234 
236  struct Brush *brush,
237  const float mouse_pos[2]);
239  struct Brush *brush,
240  float rotation);
241 
242 void BKE_paint_stroke_get_average(struct Scene *scene, struct Object *ob, float stroke[3]);
243 
244 /* Tool slot API. */
245 
246 void BKE_paint_toolslots_init_from_main(struct Main *bmain);
247 void BKE_paint_toolslots_len_ensure(struct Paint *paint, int len);
248 void BKE_paint_toolslots_brush_update_ex(struct Paint *paint, struct Brush *brush);
249 void BKE_paint_toolslots_brush_update(struct Paint *paint);
254 void BKE_paint_toolslots_brush_validate(struct Main *bmain, struct Paint *paint);
255 struct Brush *BKE_paint_toolslots_brush_get(struct Paint *paint, int slot_index);
256 
257 /* .blend I/O */
258 
259 void BKE_paint_blend_write(struct BlendWriter *writer, struct Paint *paint);
261  const struct Scene *scene,
262  struct Paint *paint);
263 void BKE_paint_blend_read_lib(struct BlendLibReader *reader,
264  struct Scene *scene,
265  struct Paint *paint);
266 
267 #define SCULPT_FACE_SET_NONE 0
268 
275 };
276 
278 typedef struct SculptPoseIKChainSegment {
279  float orig[3];
280  float head[3];
281 
282  float initial_orig[3];
283  float initial_head[3];
284  float len;
285  float scale[3];
286  float rot[4];
287  float *weights;
288 
289  /* Store a 4x4 transform matrix for each of the possible combinations of enabled XYZ symmetry
290  * axis. */
295 
296 typedef struct SculptPoseIKChain {
301 
302 /* Cloth Brush */
303 
304 /* Cloth Simulation. */
306  /* Constraints were not built for this node, so it can't be simulated. */
308 
309  /* There are constraints for the geometry in this node, but it should not be simulated. */
311 
312  /* There are constraints for this node and they should be used by the solver. */
315 
317  /* Constraint that creates the structure of the cloth. */
319  /* Constraint that references the position of a vertex and a position in deformation_pos which
320  * can be deformed by the tools. */
322  /* Constraint that references the vertex position and a editable soft-body position for
323  * plasticity. */
325  /* Constraint that references the vertex position and its initial position. */
328 
330  /* Elements that are affected by the constraint. */
331  /* Element a should always be a mesh vertex with the index stored in elem_index_a as it is always
332  * deformed. Element b could be another vertex of the same mesh or any other position (arbitrary
333  * point, position for a previous state). In that case, elem_index_a and elem_index_b should be
334  * the same to avoid affecting two different vertices when solving the constraints.
335  * *elem_position points to the position which is owned by the element. */
338 
341 
342  float length;
343  float strength;
344 
345  /* Index in #SculptClothSimulation.node_state of the node from where this constraint was created.
346  * This constraints will only be used by the solver if the state is active. */
347  int node;
348 
351 
352 typedef struct SculptClothSimulation {
358 
359  /* Position anchors for deformation brushes. These positions are modified by the brush and the
360  * final positions of the simulated vertices are updated with constraints that use these points
361  * as targets. */
364 
365  float mass;
366  float damping;
368 
370  float (*pos)[3];
375 
377 
378  int totnode;
383 
384 typedef struct SculptPersistentBase {
385  float co[3];
386  float no[3];
387  float disp;
389 
390 typedef struct SculptVertexInfo {
391  /* Indexed by vertex, stores and ID of its topologically connected component. */
393 
394  /* Indexed by base mesh vertex index, stores if that vertex is a boundary. */
397 
398 typedef struct SculptBoundaryEditInfo {
399  /* Vertex index from where the topology propagation reached this vertex. */
401 
402  /* How many steps were needed to reach this vertex from the boundary. */
404 
405  /* Strength that is used to deform this vertex. */
408 
409 /* Edge for drawing the boundary preview in the cursor. */
411  int v1;
412  int v2;
414 
415 typedef struct SculptBoundary {
416  /* Vertex indices of the active boundary. */
417  int *vertices;
420 
421  /* Distance from a vertex in the boundary to initial vertex indexed by vertex index, taking into
422  * account the length of all edges between them. Any vertex that is not in the boundary will have
423  * a distance of 0. */
424  float *distance;
425 
426  /* Data for drawing the preview. */
430 
431  /* True if the boundary loops into itself. */
433 
434  /* Initial vertex in the boundary which is closest to the current sculpt active vertex. */
436 
437  /* Vertex that at max_propagation_steps from the boundary and closest to the original active
438  * vertex that was used to initialize the boundary. This is used as a reference to check how much
439  * the deformation will go into the mesh and to calculate the strength of the brushes. */
441 
442  /* Stores the initial positions of the pivot and boundary initial vertex as they may be deformed
443  * during the brush action. This allows to use them as a reference positions and vectors for some
444  * brush effects. */
447 
448  /* Maximum number of topology steps that were calculated from the boundary. */
450 
451  /* Indexed by vertex index, contains the topology information needed for boundary deformations.
452  */
454 
455  /* Bend Deform type. */
456  struct {
459  } bend;
460 
461  /* Slide Deform type. */
462  struct {
464  } slide;
465 
466  /* Twist Deform type. */
467  struct {
468  float rotation_axis[3];
469  float pivot_position[3];
470  } twist;
472 
473 typedef struct SculptFakeNeighbors {
475 
476  /* Max distance used to calculate neighborhood information. */
478 
479  /* Indexed by vertex, stores the vertex index of its fake neighbor if available. */
481 
483 
484 /* Session data (mode-specific) */
485 
486 typedef struct SculptSession {
487  /* Mesh data (not copied) can come either directly from a Mesh, or from a MultiresDM */
488  struct { /* Special handling for multires meshes */
489  bool active;
491  int level;
493 
494  /* Depsgraph for the Cloth Brush solver to get the colliders. */
496 
497  /* These are always assigned to base mesh data when using PBVH_FACES and PBVH_GRIDS. */
498  struct MVert *mvert;
499  struct MPoly *mpoly;
500  struct MLoop *mloop;
501 
502  /* These contain the vertex and poly counts of the final mesh. */
504 
506  struct MPropCol *vcol;
507  struct MLoopCol *mcol;
508 
511 
512  float *vmask;
513 
514  /* Mesh connectivity maps. */
515  /* Vertices to adjacent polys. */
516  struct MeshElemMap *pmap;
517  int *pmap_mem;
518 
519  /* Edges to adjacent polys. */
521  int *epmap_mem;
522 
523  /* Vertices to adjacent edges. */
525  int *vemap_mem;
526 
527  /* Mesh Face Sets */
528  /* Total number of polys of the base mesh. */
529  int totfaces;
530  /* Face sets store its visibility in the sign of the integer, using the absolute value as the
531  * Face Set ID. Positive IDs are visible, negative IDs are hidden.
532  * The 0 ID is not used by the tools or the visibility system, it is just used when creating new
533  * geometry (the trim tool, for example) to detect which geometry was just added, so it can be
534  * assigned a valid Face Set after creation. Tools are not intended to run with Face Sets IDs set
535  * to 0. */
536  int *face_sets;
537 
538  /* BMesh for dynamic topology sculpting */
539  struct BMesh *bm;
543  /* Undo/redo log for dynamic topology sculpting */
544  struct BMLog *bm_log;
545 
546  /* Limit surface/grids. */
548 
549  /* PBVH acceleration structure */
550  struct PBVH *pbvh;
551  bool show_mask;
553 
554  /* Painting on deformed mesh */
555  bool deform_modifiers_active; /* Object is deformed with some modifiers. */
556  float (*orig_cos)[3]; /* Coords of un-deformed mesh. */
557  float (*deform_cos)[3]; /* Coords of deformed mesh but without stroke displacement. */
558  float (*deform_imats)[3][3]; /* Crazy-space deformation matrices. */
559 
560  /* Pool for texture evaluations. */
562 
566 
567  /* Cursor data and active vertex for tools */
569 
572 
573  /* When active, the cursor draws with faded colors, indicating that there is an action enabled.
574  */
577  float cursor_location[3];
578  float cursor_normal[3];
581 
582  /* For Sculpt trimming gesture tools, initial ray-cast data from the position of the mouse when
583  * the gesture starts (intersection with the surface and if they ray hit the surface or not). */
587 
588  /* TODO(jbakker): Replace rv3d and v3d with ViewContext */
590  struct View3D *v3d;
591  struct Scene *scene;
592 
593  /* Dynamic mesh preview */
596 
597  /* Pose Brush Preview */
598  float pose_origin[3];
600 
601  /* Boundary Brush Preview */
603 
604  /* Mesh State Persistence */
605  /* This is freed with the PBVH, so it is always in sync with the mesh. */
607 
610 
611  /* Transform operator */
612  float pivot_pos[3];
613  float pivot_rot[4];
614  float pivot_scale[3];
615 
616  float init_pivot_pos[3];
617  float init_pivot_rot[4];
619 
620  float prev_pivot_pos[3];
621  float prev_pivot_rot[4];
623 
624  union {
625  struct {
628 
629  struct {
631  /* Keep track of how much each vertex has been painted (non-airbrush only). */
632  float *alpha_weight;
633 
634  /* Needed to continuously re-apply over the same weights (BRUSH_ACCUMULATE disabled).
635  * Lazy initialize as needed (flag is set to 1 to tag it as uninitialized). */
638 
639  /* TODO: identify sculpt-only fields */
640  // struct { ... } sculpt;
641  } mode;
643 
644  /* This flag prevents PBVH from being freed when creating the vp_handle for texture paint. */
646 
652 
660 
665 
667 
668 void BKE_sculptsession_free(struct Object *ob);
671 void BKE_sculptsession_bm_to_me(struct Object *ob, bool reorder);
672 void BKE_sculptsession_bm_to_me_for_render(struct Object *object);
673 
679 
684  struct Object *ob_orig,
685  bool need_pmap,
686  bool need_mask,
687  bool is_paint_tool);
688 void BKE_sculpt_update_object_before_eval(const struct Scene *scene, struct Object *ob_eval);
689 void BKE_sculpt_update_object_after_eval(struct Depsgraph *depsgraph, struct Object *ob_eval);
690 
696  struct Object *ob);
697 int BKE_sculpt_mask_layers_ensure(struct Object *ob, struct MultiresModifierData *mmd);
699 
700 struct PBVH *BKE_sculpt_object_pbvh_ensure(struct Depsgraph *depsgraph, struct Object *ob);
701 
702 void BKE_sculpt_bvh_update_from_ccg(struct PBVH *pbvh, struct SubdivCCG *subdiv_ccg);
703 
709 
715  struct SubdivCCG *subdiv_ccg);
716 
722 
729 void BKE_sculpt_ensure_orig_mesh_data(struct Scene *scene, struct Object *object);
730 
735 bool BKE_sculptsession_use_pbvh_draw(const struct Object *ob, const struct RegionView3D *rv3d);
736 
737 enum {
740 };
741 
742 /* paint_vertex.cc */
743 
754  const float fill_color[4],
755  bool only_selected);
756 
757 /* paint_canvas.cc */
758 
763 char *BKE_paint_canvas_key_get(struct PaintModeSettings *settings, struct Object *ob);
764 
765 bool BKE_paint_canvas_image_get(struct PaintModeSettings *settings,
766  struct Object *ob,
767  struct Image **r_image,
768  struct ImageUser **r_image_user);
770  struct Object *ob);
771 
772 #ifdef __cplusplus
773 }
774 #endif
typedef float(TangentPoint)[2]
Generic geometry attributes built on CustomData.
eAttrDomain
Definition: BKE_attribute.h:25
char * BKE_paint_canvas_key_get(struct PaintModeSettings *settings, struct Object *ob)
uint BKE_paint_get_brush_tool_offset_from_paintmode(ePaintMode mode)
Definition: paint.c:675
bool BKE_object_attributes_active_color_fill(struct Object *ob, const float fill_color[4], bool only_selected)
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:444
void BKE_sculptsession_free_vwpaint_data(struct SculptSession *ss)
Definition: paint.c:1349
void BKE_palette_sort_vhs(struct tPaletteColorHSV *color_array, int totcol)
Definition: paint.c:906
eObjectMode BKE_paint_object_mode_from_paintmode(ePaintMode mode)
Definition: paint.c:1022
void BKE_sculptsession_bm_to_me_for_render(struct Object *object)
Definition: paint.c:1447
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:1196
void BKE_paint_copy(struct Paint *src, struct Paint *tar, int flag)
Definition: paint.c:1167
struct Palette * BKE_paint_palette(struct Paint *paint)
Definition: paint.c:714
bool BKE_paint_canvas_image_get(struct PaintModeSettings *settings, struct Object *ob, struct Image **r_image, struct ImageUser **r_image_user)
#define PAINT_SYMM_AREAS
Definition: BKE_paint.h:118
void BKE_paint_brush_set(struct Paint *paint, struct Brush *br)
Definition: paint.c:617
struct SculptPoseIKChainSegment SculptPoseIKChainSegment
struct Palette * BKE_palette_add(struct Main *bmain, const char *name)
Definition: paint.c:764
struct SculptBoundaryPreviewEdge SculptBoundaryPreviewEdge
void BKE_sculpt_sync_face_set_visibility(struct Mesh *mesh, struct SubdivCCG *subdiv_ccg)
Definition: paint.c:2137
bool paint_calculate_rake_rotation(struct UnifiedPaintSettings *ups, struct Brush *brush, const float mouse_pos[2])
Definition: paint.c:1305
void BKE_sculpt_update_object_before_eval(const struct Scene *scene, struct Object *ob_eval)
void BKE_palette_sort_svh(struct tPaletteColorHSV *color_array, int totcol)
Definition: paint.c:900
void BKE_sculpt_sync_face_sets_visibility_to_base_mesh(struct Mesh *mesh)
Definition: paint.c:2091
void BKE_paint_invalidate_cursor_overlay(struct Scene *scene, struct ViewLayer *view_layer, struct CurveMapping *curve)
Definition: paint.c:247
void BKE_paint_toolslots_len_ensure(struct Paint *paint, int len)
bool BKE_paint_select_elem_test(struct Object *ob)
Definition: paint.c:994
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:345
void BKE_sculpt_sync_face_sets_visibility_to_grids(struct Mesh *mesh, struct SubdivCCG *subdiv_ccg)
Definition: paint.c:2106
void BKE_sculpt_toolsettings_data_ensure(struct Scene *scene)
Definition: paint.c:1992
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:728
struct SculptSession SculptSession
struct MultiresModifierData * BKE_sculpt_multires_active(const struct Scene *scene, struct Object *ob)
const char PAINT_CURSOR_VERTEX_PAINT[3]
Definition: paint.c:221
ePaintSymmetryAreas
Definition: BKE_paint.h:112
@ PAINT_SYMM_AREA_Z
Definition: BKE_paint.h:115
@ PAINT_SYMM_AREA_X
Definition: BKE_paint.h:113
@ PAINT_SYMM_AREA_Y
Definition: BKE_paint.h:114
void BKE_paint_runtime_init(const struct ToolSettings *ts, struct Paint *paint)
struct SculptClothSimulation SculptClothSimulation
void BKE_sculpt_update_object_for_edit(struct Depsgraph *depsgraph, struct Object *ob_orig, bool need_pmap, bool need_mask, bool is_paint_tool)
Definition: paint.c:1914
const char PAINT_CURSOR_SCULPT[3]
Definition: paint.c:220
bool paint_is_bmesh_face_hidden(struct BMFace *f)
Definition: paint.c:1262
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:305
@ SCULPT_CLOTH_NODE_UNINITIALIZED
Definition: BKE_paint.h:307
@ SCULPT_CLOTH_NODE_ACTIVE
Definition: BKE_paint.h:313
@ SCULPT_CLOTH_NODE_INACTIVE
Definition: BKE_paint.h:310
void BKE_paint_face_set_overlay_color_get(int face_set, int seed, uchar r_color[4])
Definition: paint.c:2336
struct SculptPersistentBase SculptPersistentBase
struct Brush * BKE_paint_brush(struct Paint *paint)
Definition: paint.c:607
struct SculptBoundaryEditInfo SculptBoundaryEditInfo
void BKE_paint_init(struct Main *bmain, struct Scene *sce, ePaintMode mode, const char col[3])
Definition: paint.c:1130
bool BKE_paint_ensure(struct ToolSettings *ts, struct Paint **r_paint)
Definition: paint.c:1042
void BKE_paint_set_overlay_override(enum eOverlayFlags flag)
Definition: paint.c:271
ePaintOverlayControlFlags
Definition: BKE_paint.h:92
@ PAINT_OVERLAY_INVALID_CURVE
Definition: BKE_paint.h:95
@ PAINT_OVERLAY_INVALID_TEXTURE_SECONDARY
Definition: BKE_paint.h:94
@ PAINT_OVERLAY_OVERRIDE_CURSOR
Definition: BKE_paint.h:96
@ PAINT_OVERLAY_INVALID_TEXTURE_PRIMARY
Definition: BKE_paint.h:93
@ PAINT_OVERLAY_OVERRIDE_SECONDARY
Definition: BKE_paint.h:98
@ PAINT_OVERLAY_OVERRIDE_PRIMARY
Definition: BKE_paint.h:97
void BKE_paint_reset_overlay_invalid(ePaintOverlayControlFlags flag)
Definition: paint.c:289
void BKE_paint_palette_set(struct Paint *p, struct Palette *palette)
Definition: paint.c:719
int BKE_sculpt_mask_layers_ensure(struct Object *ob, struct MultiresModifierData *mmd)
Definition: paint.c:1926
void BKE_paint_curve_clamp_endpoint_add_index(struct PaintCurve *pc, int add_index)
Definition: paint.c:737
void BKE_paint_free(struct Paint *p)
Definition: paint.c:1161
void BKE_palette_color_remove(struct Palette *palette, struct PaletteColor *color)
Definition: paint.c:742
struct SculptPoseIKChain SculptPoseIKChain
void BKE_palette_sort_hsv(struct tPaletteColorHSV *color_array, int totcol)
Definition: paint.c:894
void BKE_sculptsession_free(struct Object *ob)
Definition: paint.c:1469
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:1230
bool paint_is_grid_face_hidden(const unsigned int *grid_hidden, int gridsize, int x, int y)
Definition: paint.c:1253
const char PAINT_CURSOR_WEIGHT_PAINT[3]
Definition: paint.c:222
struct SculptBoundary SculptBoundary
const struct EnumPropertyItem * BKE_paint_get_tool_enum_from_paintmode(ePaintMode mode)
Definition: paint.c:382
struct SculptFakeNeighbors SculptFakeNeighbors
bool BKE_paint_select_vert_test(struct Object *ob)
Definition: paint.c:987
const char PAINT_CURSOR_TEXTURE_PAINT[3]
Definition: paint.c:223
bool BKE_paint_select_face_test(struct Object *ob)
Definition: paint.c:980
void BKE_paint_toolslots_brush_update_ex(struct Paint *paint, struct Brush *brush)
void BKE_palette_clear(struct Palette *palette)
Definition: paint.c:758
bool BKE_sculptsession_use_pbvh_draw(const struct Object *ob, const struct RegionView3D *rv3d)
bool BKE_paint_ensure_from_paintmode(struct Scene *sce, ePaintMode mode)
Definition: paint.c:294
void BKE_paint_toolslots_brush_validate(struct Main *bmain, struct Paint *paint)
int BKE_paint_canvas_uvmap_layer_index_get(const struct PaintModeSettings *settings, struct Object *ob)
void BKE_paint_stroke_get_average(struct Scene *scene, struct Object *ob, float stroke[3])
Definition: paint.c:1184
void BKE_paint_cavity_curve_preset(struct Paint *p, int preset)
Definition: paint.c:1005
void BKE_sculptsession_free_deformMats(struct SculptSession *ss)
Definition: paint.c:1342
void BKE_paint_invalidate_overlay_all(void)
Definition: paint.c:260
struct PaintCurve * BKE_paint_curve_add(struct Main *bmain, const char *name)
Definition: paint.c:705
ePaintMode
Definition: BKE_paint.h:67
@ PAINT_MODE_INVALID
Definition: BKE_paint.h:86
@ PAINT_MODE_SCULPT_CURVES
Definition: BKE_paint.h:83
@ PAINT_MODE_GPENCIL
Definition: BKE_paint.h:77
@ PAINT_MODE_SCULPT_UV
Definition: BKE_paint.h:76
@ PAINT_MODE_VERTEX_GPENCIL
Definition: BKE_paint.h:79
@ PAINT_MODE_TEXTURE_3D
Definition: BKE_paint.h:73
@ PAINT_MODE_WEIGHT_GPENCIL
Definition: BKE_paint.h:81
@ PAINT_MODE_SCULPT
Definition: BKE_paint.h:68
@ PAINT_MODE_SCULPT_GPENCIL
Definition: BKE_paint.h:80
@ PAINT_MODE_WEIGHT
Definition: BKE_paint.h:71
@ PAINT_MODE_TEXTURE_2D
Definition: BKE_paint.h:75
@ PAINT_MODE_VERTEX
Definition: BKE_paint.h:70
void BKE_sculptsession_bm_to_me(struct Object *ob, bool reorder)
Definition: paint.c:1401
const char * BKE_paint_get_tool_prop_id_from_paintmode(ePaintMode mode)
Definition: paint.c:412
void BKE_sculpt_bvh_update_from_ccg(struct PBVH *pbvh, struct SubdivCCG *subdiv_ccg)
Definition: paint.c:2307
struct PaletteColor * BKE_palette_color_add(struct Palette *palette)
Definition: paint.c:770
eSculptClothConstraintType
Definition: BKE_paint.h:316
@ SCULPT_CLOTH_CONSTRAINT_DEFORMATION
Definition: BKE_paint.h:321
@ SCULPT_CLOTH_CONSTRAINT_PIN
Definition: BKE_paint.h:326
@ SCULPT_CLOTH_CONSTRAINT_SOFTBODY
Definition: BKE_paint.h:324
@ SCULPT_CLOTH_CONSTRAINT_STRUCTURAL
Definition: BKE_paint.h:318
void BKE_sculpt_update_object_after_eval(struct Depsgraph *depsgraph, struct Object *ob_eval)
Definition: paint.c:1869
struct PBVH * BKE_sculpt_object_pbvh_ensure(struct Depsgraph *depsgraph, struct Object *ob)
Definition: paint.c:2258
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:266
void BKE_sculpt_color_layer_create_if_needed(struct Object *object)
Definition: paint.c:1880
void BKE_paint_toolslots_init_from_main(struct Main *bmain)
const struct Brush * BKE_paint_brush_for_read(const struct Paint *p)
bool BKE_paint_always_hide_test(struct Object *ob)
Definition: paint.c:999
@ SCULPT_MASK_LAYER_CALC_VERT
Definition: BKE_paint.h:738
@ SCULPT_MASK_LAYER_CALC_LOOP
Definition: BKE_paint.h:739
void BKE_palette_sort_luminance(struct tPaletteColorHSV *color_array, int totcol)
Definition: paint.c:912
void paint_update_brush_rake_rotation(struct UnifiedPaintSettings *ups, struct Brush *brush, float rotation)
Definition: paint.c:1288
bool BKE_palette_from_hash(struct Main *bmain, struct GHash *color_table, const char *name, bool linear)
Definition: paint.c:918
void BKE_sculpt_face_sets_ensure_from_base_mesh_visibility(struct Mesh *mesh)
Definition: paint.c:2043
ePaintMode BKE_paintmode_get_from_tool(const struct bToolRef *tref)
Definition: paint.c:571
void BKE_sculpt_ensure_orig_mesh_data(struct Scene *scene, struct Object *object)
Definition: paint.c:2144
bool BKE_palette_is_empty(const struct Palette *palette)
Definition: paint.c:777
unsigned int BLI_bitmap
Definition: BLI_bitmap.h:16
unsigned char uchar
Definition: BLI_sys_types.h:70
unsigned int uint
Definition: BLI_sys_types.h:67
struct Depsgraph Depsgraph
Definition: DEG_depsgraph.h:35
eOverlayFlags
eCustomDataType
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
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
static unsigned long seed
Definition: btSoftBody.h:39
Scene scene
Curve curve
const Depsgraph * depsgraph
SyclQueue void void * src
int len
Definition: draw_manager.c:108
uint col
Definition: BKE_main.h:121
struct SubdivCCG * subdiv_ccg
Definition: pbvh_intern.h:196
float rotation_axis[3]
Definition: BKE_paint.h:468
int vertices_capacity
Definition: BKE_paint.h:418
int initial_vertex
Definition: BKE_paint.h:435
struct SculptBoundary::@51 twist
int max_propagation_steps
Definition: BKE_paint.h:449
struct SculptBoundaryEditInfo * edit_info
Definition: BKE_paint.h:453
float pivot_position[3]
Definition: BKE_paint.h:469
float initial_vertex_position[3]
Definition: BKE_paint.h:445
float(* pivot_rotation_axis)[3]
Definition: BKE_paint.h:457
float initial_pivot_position[3]
Definition: BKE_paint.h:446
int * vertices
Definition: BKE_paint.h:417
struct SculptBoundary::@50 slide
struct SculptBoundary::@49 bend
int edges_capacity
Definition: BKE_paint.h:428
float * distance
Definition: BKE_paint.h:424
SculptBoundaryPreviewEdge * edges
Definition: BKE_paint.h:427
float(* directions)[3]
Definition: BKE_paint.h:463
float(* pivot_positions)[3]
Definition: BKE_paint.h:458
eSculptClothConstraintType type
Definition: BKE_paint.h:349
float * deformation_strength
Definition: BKE_paint.h:363
struct EdgeSet * created_length_constraints
Definition: BKE_paint.h:355
float(* init_pos)[3]
Definition: BKE_paint.h:371
float(* prev_pos)[3]
Definition: BKE_paint.h:373
float(* softbody_pos)[3]
Definition: BKE_paint.h:372
float(* acceleration)[3]
Definition: BKE_paint.h:369
struct ListBase * collider_list
Definition: BKE_paint.h:376
struct GHash * node_state_index
Definition: BKE_paint.h:380
float(* deformation_pos)[3]
Definition: BKE_paint.h:362
eSculptClothNodeSimState * node_state
Definition: BKE_paint.h:381
SculptClothLengthConstraint * length_constraints
Definition: BKE_paint.h:353
float(* last_iteration_pos)[3]
Definition: BKE_paint.h:374
float * length_constraint_tweak
Definition: BKE_paint.h:357
int * fake_neighbor_index
Definition: BKE_paint.h:480
float current_max_distance
Definition: BKE_paint.h:477
float pivot_mat[PAINT_SYMM_AREAS][4][4]
Definition: BKE_paint.h:292
float trans_mat[PAINT_SYMM_AREAS][4][4]
Definition: BKE_paint.h:291
float pivot_mat_inv[PAINT_SYMM_AREAS][4][4]
Definition: BKE_paint.h:293
SculptPoseIKChainSegment * segments
Definition: BKE_paint.h:297
float grab_delta_offset[3]
Definition: BKE_paint.h:299
float cursor_normal[3]
Definition: BKE_paint.h:578
struct SubdivCCG * subdiv_ccg
Definition: BKE_paint.h:547
struct ImagePool * tex_pool
Definition: BKE_paint.h:561
int cd_face_node_offset
Definition: BKE_paint.h:541
SculptPoseIKChain * pose_ik_chain_preview
Definition: BKE_paint.h:599
struct MeshElemMap * epmap
Definition: BKE_paint.h:520
float cursor_view_normal[3]
Definition: BKE_paint.h:580
bool bm_smooth_shading
Definition: BKE_paint.h:542
int cd_vert_node_offset
Definition: BKE_paint.h:540
float pose_origin[3]
Definition: BKE_paint.h:598
struct MDeformVert * dvert_prev
Definition: BKE_paint.h:636
int preview_vert_index_count
Definition: BKE_paint.h:595
struct Depsgraph * depsgraph
Definition: BKE_paint.h:495
float pivot_scale[3]
Definition: BKE_paint.h:614
struct SculptSession::@53::@54 vpaint
SculptVertexInfo vertex_info
Definition: BKE_paint.h:608
bool show_mask
Definition: BKE_paint.h:551
float cursor_location[3]
Definition: BKE_paint.h:577
struct RegionView3D * rv3d
Definition: BKE_paint.h:589
float(* orig_cos)[3]
Definition: BKE_paint.h:556
int * face_sets
Definition: BKE_paint.h:536
float pivot_pos[3]
Definition: BKE_paint.h:612
int * pmap_mem
Definition: BKE_paint.h:517
bool draw_faded_cursor
Definition: BKE_paint.h:575
float cursor_radius
Definition: BKE_paint.h:576
struct MVert * mvert
Definition: BKE_paint.h:498
eCustomDataType vcol_type
Definition: BKE_paint.h:510
struct MPropCol * vcol
Definition: BKE_paint.h:506
struct KeyBlock * shapekey_active
Definition: BKE_paint.h:505
float init_pivot_scale[3]
Definition: BKE_paint.h:618
bool show_face_sets
Definition: BKE_paint.h:552
struct BMesh * bm
Definition: BKE_paint.h:539
int * preview_vert_index_list
Definition: BKE_paint.h:594
SculptBoundary * boundary_preview
Definition: BKE_paint.h:602
float * alpha_weight
Definition: BKE_paint.h:632
int active_face_index
Definition: BKE_paint.h:570
struct MeshElemMap * vemap
Definition: BKE_paint.h:524
float gesture_initial_location[3]
Definition: BKE_paint.h:584
struct BMLog * bm_log
Definition: BKE_paint.h:544
int active_vertex_index
Definition: BKE_paint.h:568
struct SculptSession::@53::@55 wpaint
float pivot_rot[4]
Definition: BKE_paint.h:613
float init_pivot_rot[4]
Definition: BKE_paint.h:617
union SculptSession::@53 mode
char * last_paint_canvas_key
Definition: BKE_paint.h:664
float gesture_initial_normal[3]
Definition: BKE_paint.h:585
struct SculptVertexPaintGeomMap gmap
Definition: BKE_paint.h:626
struct Scene * scene
Definition: BKE_paint.h:591
int * epmap_mem
Definition: BKE_paint.h:521
float prev_pivot_scale[3]
Definition: BKE_paint.h:622
float * vmask
Definition: BKE_paint.h:512
bool gesture_initial_hit
Definition: BKE_paint.h:586
struct MeshElemMap * pmap
Definition: BKE_paint.h:516
bool sticky_shading_color
Definition: BKE_paint.h:659
struct MLoop * mloop
Definition: BKE_paint.h:500
struct SculptSession::@52 multires
struct MPoly * mpoly
Definition: BKE_paint.h:499
char needs_flush_to_id
Definition: BKE_paint.h:651
eObjectMode mode_type
Definition: BKE_paint.h:642
struct MultiresModifierData * modifier
Definition: BKE_paint.h:490
float(* deform_imats)[3][3]
Definition: BKE_paint.h:558
float cursor_sampled_normal[3]
Definition: BKE_paint.h:579
struct StrokeCache * cache
Definition: BKE_paint.h:563
float prev_pivot_pos[3]
Definition: BKE_paint.h:620
struct View3D * v3d
Definition: BKE_paint.h:590
eAttrDomain vcol_domain
Definition: BKE_paint.h:509
float init_pivot_pos[3]
Definition: BKE_paint.h:616
float(* deform_cos)[3]
Definition: BKE_paint.h:557
struct ExpandCache * expand_cache
Definition: BKE_paint.h:565
struct MLoopCol * mcol
Definition: BKE_paint.h:507
float prev_pivot_rot[4]
Definition: BKE_paint.h:621
int active_grid_index
Definition: BKE_paint.h:571
SculptFakeNeighbors fake_neighbors
Definition: BKE_paint.h:609
SculptPersistentBase * persistent_base
Definition: BKE_paint.h:606
struct FilterCache * filter_cache
Definition: BKE_paint.h:564
bool building_vp_handle
Definition: BKE_paint.h:645
struct PBVH * pbvh
Definition: BKE_paint.h:550
int * vemap_mem
Definition: BKE_paint.h:525
bool deform_modifiers_active
Definition: BKE_paint.h:555
int * connected_component
Definition: BKE_paint.h:392
BLI_bitmap * boundary
Definition: BKE_paint.h:395
struct MeshElemMap * vert_to_loop
Definition: BKE_paint.h:272
struct MeshElemMap * vert_to_poly
Definition: BKE_paint.h:274