Blender  V2.93
rna_brush.c
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 
21 #include <stdlib.h>
22 
23 #include "DNA_brush_types.h"
24 #include "DNA_gpencil_types.h"
25 #include "DNA_material_types.h"
26 #include "DNA_object_types.h"
27 #include "DNA_scene_types.h"
28 #include "DNA_texture_types.h"
29 #include "DNA_workspace_types.h"
30 
31 #include "BLI_math.h"
32 
33 #include "RNA_define.h"
34 #include "RNA_enum_types.h"
35 
36 #include "rna_internal.h"
37 
38 #include "IMB_imbuf.h"
39 
40 #include "WM_types.h"
41 
43  {0, "ADD", ICON_ADD, "Add", "Add effect of brush"},
44  {BRUSH_DIR_IN, "SUBTRACT", ICON_REMOVE, "Subtract", "Subtract effect of brush"},
45  {0, NULL, 0, NULL, NULL},
46 };
47 
48 #ifdef RNA_RUNTIME
49 static const EnumPropertyItem prop_smooth_direction_items[] = {
50  {0, "SMOOTH", ICON_ADD, "Smooth", "Smooth the surfae"},
51  {BRUSH_DIR_IN,
52  "ENHANCE_DETAILS",
53  ICON_REMOVE,
54  "Enhance Details",
55  "Enhance the surface detail"},
56  {0, NULL, 0, NULL, NULL},
57 };
58 #endif
59 
61  {0, "DOTS", 0, "Dots", "Apply paint on each mouse move step"},
62  {BRUSH_DRAG_DOT, "DRAG_DOT", 0, "Drag Dot", "Allows a single dot to be carefully positioned"},
63  {BRUSH_SPACE,
64  "SPACE",
65  0,
66  "Space",
67  "Limit brush application to the distance specified by spacing"},
69  "AIRBRUSH",
70  0,
71  "Airbrush",
72  "Keep applying paint effect while holding mouse (spray)"},
73  {BRUSH_ANCHORED, "ANCHORED", 0, "Anchored", "Keep the brush anchored to the initial location"},
74  {BRUSH_LINE, "LINE", 0, "Line", "Draw a line with dabs separated according to spacing"},
75  {BRUSH_CURVE,
76  "CURVE",
77  0,
78  "Curve",
79  "Define the stroke curve with a bezier curve (dabs are separated according to spacing)"},
80  {0, NULL, 0, NULL, NULL},
81 };
82 
84  {MTEX_MAP_MODE_VIEW, "VIEW_PLANE", 0, "View Plane", ""},
85  {MTEX_MAP_MODE_AREA, "AREA_PLANE", 0, "Area Plane", ""},
86  {MTEX_MAP_MODE_TILED, "TILED", 0, "Tiled", ""},
87  {MTEX_MAP_MODE_3D, "3D", 0, "3D", ""},
88  {MTEX_MAP_MODE_RANDOM, "RANDOM", 0, "Random", ""},
89  {MTEX_MAP_MODE_STENCIL, "STENCIL", 0, "Stencil", ""},
90  {0, NULL, 0, NULL, NULL},
91 };
92 
93 #ifdef RNA_RUNTIME
94 static const EnumPropertyItem rna_enum_brush_texture_slot_map_texture_mode_items[] = {
95  {MTEX_MAP_MODE_VIEW, "VIEW_PLANE", 0, "View Plane", ""},
96  {MTEX_MAP_MODE_TILED, "TILED", 0, "Tiled", ""},
97  {MTEX_MAP_MODE_3D, "3D", 0, "3D", ""},
98  {MTEX_MAP_MODE_RANDOM, "RANDOM", 0, "Random", ""},
99  {MTEX_MAP_MODE_STENCIL, "STENCIL", 0, "Stencil", ""},
100  {0, NULL, 0, NULL, NULL},
101 };
102 #endif
103 
104 /* clang-format off */
106  {SCULPT_TOOL_DRAW, "DRAW", ICON_BRUSH_SCULPT_DRAW, "Draw", ""},
107  {SCULPT_TOOL_DRAW_SHARP, "DRAW_SHARP", ICON_BRUSH_SCULPT_DRAW, "Draw Sharp", ""},
108  {SCULPT_TOOL_CLAY, "CLAY", ICON_BRUSH_CLAY, "Clay", ""},
109  {SCULPT_TOOL_CLAY_STRIPS, "CLAY_STRIPS", ICON_BRUSH_CLAY_STRIPS, "Clay Strips", ""},
110  {SCULPT_TOOL_CLAY_THUMB, "CLAY_THUMB", ICON_BRUSH_CLAY_STRIPS, "Clay Thumb", ""},
111  {SCULPT_TOOL_LAYER, "LAYER", ICON_BRUSH_LAYER, "Layer", ""},
112  {SCULPT_TOOL_INFLATE, "INFLATE", ICON_BRUSH_INFLATE, "Inflate", ""},
113  {SCULPT_TOOL_BLOB, "BLOB", ICON_BRUSH_BLOB, "Blob", ""},
114  {SCULPT_TOOL_CREASE, "CREASE", ICON_BRUSH_CREASE, "Crease", ""},
115  {0, "", 0, NULL, NULL},
116  {SCULPT_TOOL_SMOOTH, "SMOOTH", ICON_BRUSH_SMOOTH, "Smooth", ""},
117  {SCULPT_TOOL_FLATTEN, "FLATTEN", ICON_BRUSH_FLATTEN, "Flatten", ""},
118  {SCULPT_TOOL_FILL, "FILL", ICON_BRUSH_FILL, "Fill", ""},
119  {SCULPT_TOOL_SCRAPE, "SCRAPE", ICON_BRUSH_SCRAPE, "Scrape", ""},
120  {SCULPT_TOOL_MULTIPLANE_SCRAPE, "MULTIPLANE_SCRAPE", ICON_BRUSH_SCRAPE, "Multi-plane Scrape", ""},
121  {SCULPT_TOOL_PINCH, "PINCH", ICON_BRUSH_PINCH, "Pinch", ""},
122  {0, "", 0, NULL, NULL},
123  {SCULPT_TOOL_GRAB, "GRAB", ICON_BRUSH_GRAB, "Grab", ""},
124  {SCULPT_TOOL_ELASTIC_DEFORM, "ELASTIC_DEFORM", ICON_BRUSH_GRAB, "Elastic Deform", ""},
125  {SCULPT_TOOL_SNAKE_HOOK, "SNAKE_HOOK", ICON_BRUSH_SNAKE_HOOK, "Snake Hook", ""},
126  {SCULPT_TOOL_THUMB, "THUMB", ICON_BRUSH_THUMB, "Thumb", ""},
127  {SCULPT_TOOL_POSE, "POSE", ICON_BRUSH_GRAB, "Pose", ""},
128  {SCULPT_TOOL_NUDGE, "NUDGE", ICON_BRUSH_NUDGE, "Nudge", ""},
129  {SCULPT_TOOL_ROTATE, "ROTATE", ICON_BRUSH_ROTATE, "Rotate", ""},
130  {SCULPT_TOOL_SLIDE_RELAX, "TOPOLOGY", ICON_BRUSH_GRAB, "Slide Relax", ""},
131  {SCULPT_TOOL_BOUNDARY, "BOUNDARY", ICON_BRUSH_GRAB, "Boundary", ""},
132  {0, "", 0, NULL, NULL},
133  {SCULPT_TOOL_CLOTH, "CLOTH", ICON_BRUSH_SCULPT_DRAW, "Cloth", ""},
134  {SCULPT_TOOL_SIMPLIFY, "SIMPLIFY", ICON_BRUSH_DATA, "Simplify", ""},
135  {SCULPT_TOOL_MASK, "MASK", ICON_BRUSH_MASK, "Mask", ""},
136  {SCULPT_TOOL_DISPLACEMENT_ERASER, "DISPLACEMENT_ERASER", ICON_BRUSH_SCULPT_DRAW, "Multires Displacement Eraser", ""},
137  {SCULPT_TOOL_DISPLACEMENT_SMEAR, "DISPLACEMENT_SMEAR", ICON_BRUSH_SCULPT_DRAW, "Multires Displacement Smear", ""},
138  {SCULPT_TOOL_PAINT, "PAINT", ICON_BRUSH_SCULPT_DRAW, "Paint", ""},
139  {SCULPT_TOOL_SMEAR, "SMEAR", ICON_BRUSH_SCULPT_DRAW, "Smear", ""},
140  {SCULPT_TOOL_DRAW_FACE_SETS, "DRAW_FACE_SETS", ICON_BRUSH_MASK, "Draw Face Sets", ""},
141  {0, NULL, 0, NULL, NULL},
142 };
143 /* clang-format on */
144 
146  {UV_SCULPT_TOOL_GRAB, "GRAB", 0, "Grab", "Grab UVs"},
147  {UV_SCULPT_TOOL_RELAX, "RELAX", 0, "Relax", "Relax UVs"},
148  {UV_SCULPT_TOOL_PINCH, "PINCH", 0, "Pinch", "Pinch UVs"},
149  {0, NULL, 0, NULL, NULL},
150 };
151 
153  {VPAINT_TOOL_DRAW, "DRAW", ICON_BRUSH_MIX, "Draw", ""},
154  {VPAINT_TOOL_BLUR, "BLUR", ICON_BRUSH_BLUR, "Blur", ""},
155  {VPAINT_TOOL_AVERAGE, "AVERAGE", ICON_BRUSH_BLUR, "Average", ""},
156  {VPAINT_TOOL_SMEAR, "SMEAR", ICON_BRUSH_BLUR, "Smear", ""},
157  {0, NULL, 0, NULL, NULL},
158 };
159 
161  {WPAINT_TOOL_DRAW, "DRAW", ICON_BRUSH_MIX, "Draw", ""},
162  {WPAINT_TOOL_BLUR, "BLUR", ICON_BRUSH_BLUR, "Blur", ""},
163  {WPAINT_TOOL_AVERAGE, "AVERAGE", ICON_BRUSH_BLUR, "Average", ""},
164  {WPAINT_TOOL_SMEAR, "SMEAR", ICON_BRUSH_BLUR, "Smear", ""},
165  {0, NULL, 0, NULL, NULL},
166 };
167 
169  {PAINT_TOOL_DRAW, "DRAW", ICON_BRUSH_TEXDRAW, "Draw", ""},
170  {PAINT_TOOL_SOFTEN, "SOFTEN", ICON_BRUSH_SOFTEN, "Soften", ""},
171  {PAINT_TOOL_SMEAR, "SMEAR", ICON_BRUSH_SMEAR, "Smear", ""},
172  {PAINT_TOOL_CLONE, "CLONE", ICON_BRUSH_CLONE, "Clone", ""},
173  {PAINT_TOOL_FILL, "FILL", ICON_BRUSH_TEXFILL, "Fill", ""},
174  {PAINT_TOOL_MASK, "MASK", ICON_BRUSH_TEXMASK, "Mask", ""},
175  {0, NULL, 0, NULL, NULL},
176 };
177 
180  "DRAW",
181  ICON_STROKE,
182  "Draw",
183  "The brush is of type used for drawing strokes"},
184  {GPAINT_TOOL_FILL, "FILL", ICON_COLOR, "Fill", "The brush is of type used for filling areas"},
186  "ERASE",
187  ICON_PANEL_CLOSE,
188  "Erase",
189  "The brush is used for erasing strokes"},
191  "TINT",
192  ICON_BRUSH_TEXDRAW,
193  "Tint",
194  "The brush is of type used for tinting strokes"},
195  {0, NULL, 0, NULL, NULL},
196 };
197 
199  {GPVERTEX_TOOL_DRAW, "DRAW", ICON_BRUSH_MIX, "Draw", ""},
200  {GPVERTEX_TOOL_BLUR, "BLUR", ICON_BRUSH_BLUR, "Blur", ""},
201  {GPVERTEX_TOOL_AVERAGE, "AVERAGE", ICON_BRUSH_BLUR, "Average", ""},
202  {GPVERTEX_TOOL_SMEAR, "SMEAR", ICON_BRUSH_BLUR, "Smear", ""},
203  {GPVERTEX_TOOL_REPLACE, "REPLACE", ICON_BRUSH_BLUR, "Replace", ""},
204  {0, NULL, 0, NULL, NULL},
205 };
206 
208  {GPSCULPT_TOOL_SMOOTH, "SMOOTH", ICON_GPBRUSH_SMOOTH, "Smooth", "Smooth stroke points"},
210  "THICKNESS",
211  ICON_GPBRUSH_THICKNESS,
212  "Thickness",
213  "Adjust thickness of strokes"},
215  "STRENGTH",
216  ICON_GPBRUSH_STRENGTH,
217  "Strength",
218  "Adjust color strength of strokes"},
220  "RANDOMIZE",
221  ICON_GPBRUSH_RANDOMIZE,
222  "Randomize",
223  "Introduce jitter/randomness into strokes"},
225  "GRAB",
226  ICON_GPBRUSH_GRAB,
227  "Grab",
228  "Translate the set of points initially within the brush circle"},
230  "PUSH",
231  ICON_GPBRUSH_PUSH,
232  "Push",
233  "Move points out of the way, as if combing them"},
235  "TWIST",
236  ICON_GPBRUSH_TWIST,
237  "Twist",
238  "Rotate points around the midpoint of the brush"},
240  "PINCH",
241  ICON_GPBRUSH_PINCH,
242  "Pinch",
243  "Pull points towards the midpoint of the brush"},
245  "CLONE",
246  ICON_GPBRUSH_CLONE,
247  "Clone",
248  "Paste copies of the strokes stored on the clipboard"},
249  {0, NULL, 0, NULL, NULL}};
250 
253  "WEIGHT",
254  ICON_GPBRUSH_WEIGHT,
255  "Weight",
256  "Weight Paint for Vertex Groups"},
257  {0, NULL, 0, NULL, NULL},
258 };
259 
260 #ifndef RNA_RUNTIME
263  "SOFT",
264  0,
265  "Dissolve",
266  "Erase strokes, fading their points strength and thickness"},
267  {GP_BRUSH_ERASER_HARD, "HARD", 0, "Point", "Erase stroke points"},
268  {GP_BRUSH_ERASER_STROKE, "STROKE", 0, "Stroke", "Erase entire strokes"},
269  {0, NULL, 0, NULL, NULL},
270 };
271 
274  "BOTH",
275  0,
276  "All",
277  "Use both visible strokes and edit lines as fill boundary limits"},
278  {GP_FILL_DMODE_STROKE, "STROKE", 0, "Strokes", "Use visible strokes as fill boundary limits"},
279  {GP_FILL_DMODE_CONTROL, "CONTROL", 0, "Edit Lines", "Use edit lines as fill boundary limits"},
280  {0, NULL, 0, NULL, NULL}};
281 
283  {GP_FILL_GPLMODE_VISIBLE, "VISIBLE", 0, "Visible", "Visible layers"},
284  {GP_FILL_GPLMODE_ACTIVE, "ACTIVE", 0, "Active", "Only active layer"},
285  {GP_FILL_GPLMODE_ABOVE, "ABOVE", 0, "Layer Above", "Layer above active"},
286  {GP_FILL_GPLMODE_BELOW, "BELOW", 0, "Layer Below", "Layer below active"},
287  {GP_FILL_GPLMODE_ALL_ABOVE, "ALL_ABOVE", 0, "All Above", "All layers above active"},
288  {GP_FILL_GPLMODE_ALL_BELOW, "ALL_BELOW", 0, "All Below", "All layers below active"},
289  {0, NULL, 0, NULL, NULL}};
290 
292  {0, "NORMAL", ICON_ADD, "Normal", "Fill internal area"},
293  {BRUSH_DIR_IN, "INVERT", ICON_REMOVE, "Inverted", "Fill inverted area"},
294  {0, NULL, 0, NULL, NULL},
295 };
296 
298  {GP_BRUSH_MODE_ACTIVE, "ACTIVE", 0, "Active", "Use current mode"},
299  {GP_BRUSH_MODE_MATERIAL, "MATERIAL", 0, "Material", "Use always material mode"},
300  {GP_BRUSH_MODE_VERTEXCOLOR, "VERTEXCOLOR", 0, "Vertex Color", "Use always Vertex Color mode"},
301  {0, NULL, 0, NULL, NULL}};
302 
304  {GP_BRUSH_ICON_PENCIL, "PENCIL", ICON_GPBRUSH_PENCIL, "Pencil", ""},
305  {GP_BRUSH_ICON_PEN, "PEN", ICON_GPBRUSH_PEN, "Pen", ""},
306  {GP_BRUSH_ICON_INK, "INK", ICON_GPBRUSH_INK, "Ink", ""},
307  {GP_BRUSH_ICON_INKNOISE, "INKNOISE", ICON_GPBRUSH_INKNOISE, "Ink Noise", ""},
308  {GP_BRUSH_ICON_BLOCK, "BLOCK", ICON_GPBRUSH_BLOCK, "Block", ""},
309  {GP_BRUSH_ICON_MARKER, "MARKER", ICON_GPBRUSH_MARKER, "Marker", ""},
310  {GP_BRUSH_ICON_AIRBRUSH, "AIRBRUSH", ICON_GPBRUSH_AIRBRUSH, "Airbrush", ""},
311  {GP_BRUSH_ICON_CHISEL, "CHISEL", ICON_GPBRUSH_CHISEL, "Chisel", ""},
312  {GP_BRUSH_ICON_FILL, "FILL", ICON_GPBRUSH_FILL, "Fill", ""},
313  {GP_BRUSH_ICON_ERASE_SOFT, "SOFT", ICON_GPBRUSH_ERASE_SOFT, "Eraser Soft", ""},
314  {GP_BRUSH_ICON_ERASE_HARD, "HARD", ICON_GPBRUSH_ERASE_HARD, "Eraser Hard", ""},
315  {GP_BRUSH_ICON_ERASE_STROKE, "STROKE", ICON_GPBRUSH_ERASE_STROKE, "Eraser Stroke", ""},
316  {0, NULL, 0, NULL, NULL},
317 };
318 
320  {GP_BRUSH_ICON_GPBRUSH_SMOOTH, "SMOOTH", ICON_GPBRUSH_SMOOTH, "Smooth", ""},
321  {GP_BRUSH_ICON_GPBRUSH_THICKNESS, "THICKNESS", ICON_GPBRUSH_THICKNESS, "Thickness", ""},
322  {GP_BRUSH_ICON_GPBRUSH_STRENGTH, "STRENGTH", ICON_GPBRUSH_STRENGTH, "Strength", ""},
323  {GP_BRUSH_ICON_GPBRUSH_RANDOMIZE, "RANDOMIZE", ICON_GPBRUSH_RANDOMIZE, "Randomize", ""},
324  {GP_BRUSH_ICON_GPBRUSH_GRAB, "GRAB", ICON_GPBRUSH_GRAB, "Grab", ""},
325  {GP_BRUSH_ICON_GPBRUSH_PUSH, "PUSH", ICON_GPBRUSH_PUSH, "Push", ""},
326  {GP_BRUSH_ICON_GPBRUSH_TWIST, "TWIST", ICON_GPBRUSH_TWIST, "Twist", ""},
327  {GP_BRUSH_ICON_GPBRUSH_PINCH, "PINCH", ICON_GPBRUSH_PINCH, "Pinch", ""},
328  {GP_BRUSH_ICON_GPBRUSH_CLONE, "CLONE", ICON_GPBRUSH_CLONE, "Clone", ""},
329  {0, NULL, 0, NULL, NULL},
330 };
331 
333  {GP_BRUSH_ICON_GPBRUSH_WEIGHT, "DRAW", ICON_GPBRUSH_WEIGHT, "Draw", ""},
334  {0, NULL, 0, NULL, NULL},
335 };
337  {GP_BRUSH_ICON_VERTEX_DRAW, "DRAW", ICON_BRUSH_MIX, "Draw", ""},
338  {GP_BRUSH_ICON_VERTEX_BLUR, "BLUR", ICON_BRUSH_BLUR, "Blur", ""},
339  {GP_BRUSH_ICON_VERTEX_AVERAGE, "AVERAGE", ICON_BRUSH_BLUR, "Average", ""},
340  {GP_BRUSH_ICON_VERTEX_SMEAR, "SMEAR", ICON_BRUSH_BLUR, "Smear", ""},
341  {GP_BRUSH_ICON_VERTEX_REPLACE, "REPLACE", ICON_BRUSH_MIX, "Replace", ""},
342  {0, NULL, 0, NULL, NULL},
343 };
344 #endif
345 
346 #ifdef RNA_RUNTIME
347 
348 # include "MEM_guardedalloc.h"
349 
350 # include "RNA_access.h"
351 
352 # include "BKE_brush.h"
353 # include "BKE_colorband.h"
354 # include "BKE_gpencil.h"
355 # include "BKE_icons.h"
356 # include "BKE_material.h"
357 # include "BKE_paint.h"
358 
359 # include "WM_api.h"
360 
361 static bool rna_BrushCapabilitiesSculpt_has_accumulate_get(PointerRNA *ptr)
362 {
363  Brush *br = (Brush *)ptr->data;
365 }
366 
367 static bool rna_BrushCapabilitiesSculpt_has_topology_rake_get(PointerRNA *ptr)
368 {
369  Brush *br = (Brush *)ptr->data;
371 }
372 
373 static bool rna_BrushCapabilitiesSculpt_has_auto_smooth_get(PointerRNA *ptr)
374 {
375  Brush *br = (Brush *)ptr->data;
376  return !ELEM(
378 }
379 
380 static bool rna_BrushCapabilitiesSculpt_has_height_get(PointerRNA *ptr)
381 {
382  Brush *br = (Brush *)ptr->data;
383  return br->sculpt_tool == SCULPT_TOOL_LAYER;
384 }
385 
386 static bool rna_BrushCapabilitiesSculpt_has_jitter_get(PointerRNA *ptr)
387 {
388  Brush *br = (Brush *)ptr->data;
389  return (!(br->flag & BRUSH_ANCHORED) && !(br->flag & BRUSH_DRAG_DOT) &&
390  !ELEM(br->sculpt_tool,
395 }
396 
397 static bool rna_BrushCapabilitiesSculpt_has_normal_weight_get(PointerRNA *ptr)
398 {
399  Brush *br = (Brush *)ptr->data;
401 }
402 
403 static bool rna_BrushCapabilitiesSculpt_has_rake_factor_get(PointerRNA *ptr)
404 {
405  Brush *br = (Brush *)ptr->data;
406  return SCULPT_TOOL_HAS_RAKE(br->sculpt_tool);
407 }
408 
409 static bool rna_BrushCapabilities_has_overlay_get(PointerRNA *ptr)
410 {
411  Brush *br = (Brush *)ptr->data;
412  return ELEM(
414 }
415 
416 static bool rna_BrushCapabilitiesSculpt_has_persistence_get(PointerRNA *ptr)
417 {
418  Brush *br = (Brush *)ptr->data;
420 }
421 
422 static bool rna_BrushCapabilitiesSculpt_has_pinch_factor_get(PointerRNA *ptr)
423 {
424  Brush *br = (Brush *)ptr->data;
426 }
427 
428 static bool rna_BrushCapabilitiesSculpt_has_plane_offset_get(PointerRNA *ptr)
429 {
430  Brush *br = (Brush *)ptr->data;
431  return ELEM(br->sculpt_tool,
438 }
439 
440 static bool rna_BrushCapabilitiesSculpt_has_random_texture_angle_get(PointerRNA *ptr)
441 {
442  Brush *br = (Brush *)ptr->data;
443  return (!ELEM(br->sculpt_tool,
448 }
449 
450 static bool rna_TextureCapabilities_has_random_texture_angle_get(PointerRNA *ptr)
451 {
452  MTex *mtex = (MTex *)ptr->data;
454 }
455 
456 static bool rna_BrushCapabilities_has_random_texture_angle_get(PointerRNA *ptr)
457 {
458  Brush *br = (Brush *)ptr->data;
459  return !(br->flag & BRUSH_ANCHORED);
460 }
461 
462 static bool rna_BrushCapabilitiesSculpt_has_sculpt_plane_get(PointerRNA *ptr)
463 {
464  Brush *br = (Brush *)ptr->data;
465  return !ELEM(br->sculpt_tool,
470 }
471 
472 static bool rna_BrushCapabilitiesSculpt_has_color_get(PointerRNA *ptr)
473 {
474  Brush *br = (Brush *)ptr->data;
475  return ELEM(br->sculpt_tool, SCULPT_TOOL_PAINT);
476 }
477 
478 static bool rna_BrushCapabilitiesSculpt_has_secondary_color_get(PointerRNA *ptr)
479 {
480  Brush *br = (Brush *)ptr->data;
482 }
483 
484 static bool rna_BrushCapabilitiesSculpt_has_smooth_stroke_get(PointerRNA *ptr)
485 {
486  Brush *br = (Brush *)ptr->data;
487  return (!(br->flag & BRUSH_ANCHORED) && !(br->flag & BRUSH_DRAG_DOT) &&
488  !(br->flag & BRUSH_LINE) && !(br->flag & BRUSH_CURVE) &&
489  !ELEM(br->sculpt_tool,
494 }
495 
496 static bool rna_BrushCapabilities_has_smooth_stroke_get(PointerRNA *ptr)
497 {
498  Brush *br = (Brush *)ptr->data;
499  return (!(br->flag & BRUSH_ANCHORED) && !(br->flag & BRUSH_DRAG_DOT) &&
500  !(br->flag & BRUSH_LINE) && !(br->flag & BRUSH_CURVE));
501 }
502 
503 static bool rna_BrushCapabilitiesSculpt_has_space_attenuation_get(PointerRNA *ptr)
504 {
505  Brush *br = (Brush *)ptr->data;
511 }
512 
513 static bool rna_BrushCapabilitiesImagePaint_has_space_attenuation_get(PointerRNA *ptr)
514 {
515  Brush *br = (Brush *)ptr->data;
516  return (br->flag & (BRUSH_SPACE | BRUSH_LINE | BRUSH_CURVE)) &&
518 }
519 
520 static bool rna_BrushCapabilitiesImagePaint_has_color_get(PointerRNA *ptr)
521 {
522  Brush *br = (Brush *)ptr->data;
524 }
525 
526 static bool rna_BrushCapabilitiesVertexPaint_has_color_get(PointerRNA *ptr)
527 {
528  Brush *br = (Brush *)ptr->data;
530 }
531 
532 static bool rna_BrushCapabilitiesWeightPaint_has_weight_get(PointerRNA *ptr)
533 {
534  Brush *br = (Brush *)ptr->data;
536 }
537 
538 static bool rna_BrushCapabilities_has_spacing_get(PointerRNA *ptr)
539 {
540  Brush *br = (Brush *)ptr->data;
541  return (!(br->flag & BRUSH_ANCHORED));
542 }
543 
544 static bool rna_BrushCapabilitiesSculpt_has_strength_pressure_get(PointerRNA *ptr)
545 {
546  Brush *br = (Brush *)ptr->data;
548 }
549 
550 static bool rna_TextureCapabilities_has_texture_angle_get(PointerRNA *ptr)
551 {
552  MTex *mtex = (MTex *)ptr->data;
553  return mtex->brush_map_mode != MTEX_MAP_MODE_3D;
554 }
555 
556 static bool rna_BrushCapabilitiesSculpt_has_direction_get(PointerRNA *ptr)
557 {
558  Brush *br = (Brush *)ptr->data;
559  return !ELEM(br->sculpt_tool,
575 }
576 
577 static bool rna_BrushCapabilitiesSculpt_has_gravity_get(PointerRNA *ptr)
578 {
579  Brush *br = (Brush *)ptr->data;
581 }
582 
583 static bool rna_BrushCapabilitiesSculpt_has_tilt_get(PointerRNA *ptr)
584 {
585  Brush *br = (Brush *)ptr->data;
586  return ELEM(br->sculpt_tool,
594 }
595 
596 static bool rna_TextureCapabilities_has_texture_angle_source_get(PointerRNA *ptr)
597 {
598  MTex *mtex = (MTex *)ptr->data;
600 }
601 
602 static bool rna_BrushCapabilitiesImagePaint_has_accumulate_get(PointerRNA *ptr)
603 {
604  /* only support for draw tool */
605  Brush *br = (Brush *)ptr->data;
606 
607  return ((br->flag & BRUSH_AIRBRUSH) || (br->flag & BRUSH_DRAG_DOT) ||
610  (br->mtex.tex && !ELEM(br->mtex.brush_map_mode,
613  MTEX_MAP_MODE_3D))) ?
614  false :
615  true;
616 }
617 
618 static bool rna_BrushCapabilitiesImagePaint_has_radius_get(PointerRNA *ptr)
619 {
620  /* only support for draw tool */
621  Brush *br = (Brush *)ptr->data;
622 
624 }
625 
626 static PointerRNA rna_Sculpt_tool_capabilities_get(PointerRNA *ptr)
627 {
628  return rna_pointer_inherit_refine(ptr, &RNA_BrushCapabilitiesSculpt, ptr->owner_id);
629 }
630 
631 static PointerRNA rna_Imapaint_tool_capabilities_get(PointerRNA *ptr)
632 {
634 }
635 
636 static PointerRNA rna_Vertexpaint_tool_capabilities_get(PointerRNA *ptr)
637 {
639 }
640 
641 static PointerRNA rna_Weightpaint_tool_capabilities_get(PointerRNA *ptr)
642 {
643  return rna_pointer_inherit_refine(ptr, &RNA_BrushCapabilitiesWeightPaint, ptr->owner_id);
644 }
645 
646 static PointerRNA rna_Brush_capabilities_get(PointerRNA *ptr)
647 {
648  return rna_pointer_inherit_refine(ptr, &RNA_BrushCapabilities, ptr->owner_id);
649 }
650 
651 static void rna_Brush_reset_icon(Brush *br)
652 {
653  ID *id = &br->id;
654 
655  if (br->flag & BRUSH_CUSTOM_ICON) {
656  return;
657  }
658 
659  if (id->icon_id >= BIFICONID_LAST) {
660  BKE_icon_id_delete(id);
662  }
663 
664  id->icon_id = 0;
665 }
666 
667 static void rna_Brush_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
668 {
669  Brush *br = (Brush *)ptr->data;
671  /*WM_main_add_notifier(NC_SPACE|ND_SPACE_VIEW3D, NULL); */
672 }
673 
674 static void rna_Brush_material_update(bContext *UNUSED(C), PointerRNA *UNUSED(ptr))
675 {
676  /* number of material users changed */
678 }
679 
680 static void rna_Brush_main_tex_update(bContext *C, PointerRNA *ptr)
681 {
682  Main *bmain = CTX_data_main(C);
684  ViewLayer *view_layer = CTX_data_view_layer(C);
685  Brush *br = (Brush *)ptr->data;
687  rna_Brush_update(bmain, scene, ptr);
688 }
689 
690 static void rna_Brush_secondary_tex_update(bContext *C, PointerRNA *ptr)
691 {
692  Main *bmain = CTX_data_main(C);
694  ViewLayer *view_layer = CTX_data_view_layer(C);
695  Brush *br = (Brush *)ptr->data;
697  rna_Brush_update(bmain, scene, ptr);
698 }
699 
700 static void rna_Brush_size_update(Main *bmain, Scene *scene, PointerRNA *ptr)
701 {
703  rna_Brush_update(bmain, scene, ptr);
704 }
705 
706 static void rna_Brush_update_and_reset_icon(Main *bmain, Scene *scene, PointerRNA *ptr)
707 {
708  Brush *br = ptr->data;
709  rna_Brush_reset_icon(br);
710  rna_Brush_update(bmain, scene, ptr);
711 }
712 
713 static void rna_Brush_stroke_update(Main *bmain, Scene *scene, PointerRNA *ptr)
714 {
716  rna_Brush_update(bmain, scene, ptr);
717 }
718 
719 static void rna_Brush_icon_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
720 {
721  Brush *br = (Brush *)ptr->data;
722 
723  if (br->icon_imbuf) {
725  br->icon_imbuf = NULL;
726  }
727 
728  br->id.icon_id = 0;
729 
730  if (br->flag & BRUSH_CUSTOM_ICON) {
732  }
733 
735 }
736 
737 static void rna_TextureSlot_brush_angle_update(bContext *C, PointerRNA *ptr)
738 {
740  MTex *mtex = ptr->data;
741  /* skip invalidation of overlay for stencil mode */
742  if (mtex->mapping != MTEX_MAP_MODE_STENCIL) {
743  ViewLayer *view_layer = CTX_data_view_layer(C);
744  BKE_paint_invalidate_overlay_tex(scene, view_layer, mtex->tex);
745  }
746 
748 }
749 
750 static void rna_Brush_set_size(PointerRNA *ptr, int value)
751 {
752  Brush *brush = ptr->data;
753 
754  /* scale unprojected radius so it stays consistent with brush size */
756  brush->size = value;
757 }
758 
759 static void rna_Brush_use_gradient_set(PointerRNA *ptr, bool value)
760 {
761  Brush *br = (Brush *)ptr->data;
762 
763  if (value) {
764  br->flag |= BRUSH_USE_GRADIENT;
765  }
766  else {
767  br->flag &= ~BRUSH_USE_GRADIENT;
768  }
769 
770  if ((br->flag & BRUSH_USE_GRADIENT) && br->gradient == NULL) {
771  br->gradient = BKE_colorband_add(true);
772  }
773 }
774 
775 static void rna_Brush_set_unprojected_radius(PointerRNA *ptr, float value)
776 {
777  Brush *brush = ptr->data;
778 
779  /* scale brush size so it stays consistent with unprojected_radius */
780  BKE_brush_scale_size(&brush->size, value, brush->unprojected_radius);
781  brush->unprojected_radius = value;
782 }
783 
784 static const EnumPropertyItem *rna_Brush_direction_itemf(bContext *C,
785  PointerRNA *ptr,
786  PropertyRNA *UNUSED(prop),
787  bool *UNUSED(r_free))
788 {
790 
791  /* sculpt mode */
792  static const EnumPropertyItem prop_flatten_contrast_items[] = {
793  {BRUSH_DIR_IN, "CONTRAST", ICON_ADD, "Contrast", "Subtract effect of brush"},
794  {0, "FLATTEN", ICON_REMOVE, "Flatten", "Add effect of brush"},
795  {0, NULL, 0, NULL, NULL},
796  };
797 
798  static const EnumPropertyItem prop_fill_deepen_items[] = {
799  {0, "FILL", ICON_ADD, "Fill", "Add effect of brush"},
800  {BRUSH_DIR_IN, "DEEPEN", ICON_REMOVE, "Deepen", "Subtract effect of brush"},
801  {0, NULL, 0, NULL, NULL},
802  };
803 
804  static const EnumPropertyItem prop_scrape_peaks_items[] = {
805  {0, "SCRAPE", ICON_ADD, "Scrape", "Add effect of brush"},
806  {BRUSH_DIR_IN, "PEAKS", ICON_REMOVE, "Peaks", "Subtract effect of brush"},
807  {0, NULL, 0, NULL, NULL},
808  };
809 
810  static const EnumPropertyItem prop_pinch_magnify_items[] = {
811  {BRUSH_DIR_IN, "MAGNIFY", ICON_ADD, "Magnify", "Subtract effect of brush"},
812  {0, "PINCH", ICON_REMOVE, "Pinch", "Add effect of brush"},
813  {0, NULL, 0, NULL, NULL},
814  };
815 
816  static const EnumPropertyItem prop_inflate_deflate_items[] = {
817  {0, "INFLATE", ICON_ADD, "Inflate", "Add effect of brush"},
818  {BRUSH_DIR_IN, "DEFLATE", ICON_REMOVE, "Deflate", "Subtract effect of brush"},
819  {0, NULL, 0, NULL, NULL},
820  };
821 
822  /* texture paint mode */
823  static const EnumPropertyItem prop_soften_sharpen_items[] = {
824  {BRUSH_DIR_IN, "SHARPEN", ICON_ADD, "Sharpen", "Sharpen effect of brush"},
825  {0, "SOFTEN", ICON_REMOVE, "Soften", "Blur effect of brush"},
826  {0, NULL, 0, NULL, NULL},
827  };
828 
829  Brush *me = (Brush *)(ptr->data);
830 
831  switch (mode) {
832  case PAINT_MODE_SCULPT:
833  switch (me->sculpt_tool) {
834  case SCULPT_TOOL_DRAW:
836  case SCULPT_TOOL_CREASE:
837  case SCULPT_TOOL_BLOB:
838  case SCULPT_TOOL_LAYER:
839  case SCULPT_TOOL_CLAY:
841  return prop_direction_items;
842  case SCULPT_TOOL_SMOOTH:
843  return prop_smooth_direction_items;
844  case SCULPT_TOOL_MASK:
845  switch ((BrushMaskTool)me->mask_tool) {
846  case BRUSH_MASK_DRAW:
847  return prop_direction_items;
848 
849  case BRUSH_MASK_SMOOTH:
850  return DummyRNA_DEFAULT_items;
851 
852  default:
853  return DummyRNA_DEFAULT_items;
854  }
855 
856  case SCULPT_TOOL_FLATTEN:
857  return prop_flatten_contrast_items;
858 
859  case SCULPT_TOOL_FILL:
860  return prop_fill_deepen_items;
861 
862  case SCULPT_TOOL_SCRAPE:
863  return prop_scrape_peaks_items;
864 
865  case SCULPT_TOOL_PINCH:
866  return prop_pinch_magnify_items;
867 
868  case SCULPT_TOOL_INFLATE:
869  return prop_inflate_deflate_items;
870 
871  default:
872  return DummyRNA_DEFAULT_items;
873  }
874 
877  switch (me->imagepaint_tool) {
878  case PAINT_TOOL_SOFTEN:
879  return prop_soften_sharpen_items;
880 
881  default:
882  return DummyRNA_DEFAULT_items;
883  }
884 
885  default:
886  return DummyRNA_DEFAULT_items;
887  }
888 }
889 
890 static const EnumPropertyItem *rna_Brush_stroke_itemf(bContext *C,
892  PropertyRNA *UNUSED(prop),
893  bool *UNUSED(r_free))
894 {
896 
897  static const EnumPropertyItem brush_stroke_method_items[] = {
898  {0, "DOTS", 0, "Dots", "Apply paint on each mouse move step"},
899  {BRUSH_SPACE,
900  "SPACE",
901  0,
902  "Space",
903  "Limit brush application to the distance specified by spacing"},
905  "AIRBRUSH",
906  0,
907  "Airbrush",
908  "Keep applying paint effect while holding mouse (spray)"},
909  {BRUSH_LINE, "LINE", 0, "Line", "Drag a line with dabs separated according to spacing"},
910  {BRUSH_CURVE,
911  "CURVE",
912  0,
913  "Curve",
914  "Define the stroke curve with a bezier curve. Dabs are separated according to spacing"},
915  {0, NULL, 0, NULL, NULL},
916  };
917 
918  switch (mode) {
919  case PAINT_MODE_SCULPT:
923 
924  default:
925  return brush_stroke_method_items;
926  }
927 }
928 
929 /* Grease Pencil Drawing Brushes Settings */
930 static char *rna_BrushGpencilSettings_path(PointerRNA *UNUSED(ptr))
931 {
932  return BLI_strdup("tool_settings.gpencil_paint.brush.gpencil_settings");
933 }
934 
935 static void rna_BrushGpencilSettings_default_eraser_update(Main *bmain,
936  Scene *scene,
938 {
940  Paint *paint = &ts->gp_paint->paint;
941  Brush *brush_cur = paint->brush;
942 
943  /* disable default eraser in all brushes */
944  for (Brush *brush = bmain->brushes.first; brush; brush = brush->id.next) {
945  if ((brush != brush_cur) && (brush->ob_mode == OB_MODE_PAINT_GPENCIL) &&
946  (brush->gpencil_tool == GPAINT_TOOL_ERASE)) {
948  }
949  }
950 }
951 
952 static void rna_BrushGpencilSettings_use_material_pin_update(bContext *C, PointerRNA *ptr)
953 {
954  ViewLayer *view_layer = CTX_data_view_layer(C);
955  Object *ob = OBACT(view_layer);
956  Brush *brush = (Brush *)ptr->owner_id;
957 
961  }
962  else {
964  }
965 
966  /* number of material users changed */
968 }
969 
970 static void rna_BrushGpencilSettings_eraser_mode_update(Main *UNUSED(bmain),
971  Scene *scene,
973 {
975  Paint *paint = &ts->gp_paint->paint;
976  Brush *brush = paint->brush;
977 
978  /* set eraser icon */
979  if ((brush) && (brush->gpencil_tool == GPAINT_TOOL_ERASE)) {
980  switch (brush->gpencil_settings->eraser_mode) {
983  break;
986  break;
989  break;
990  default:
992  break;
993  }
994  }
995 }
996 
997 static bool rna_BrushGpencilSettings_material_poll(PointerRNA *UNUSED(ptr), PointerRNA value)
998 {
999  Material *ma = (Material *)value.data;
1000 
1001  /* GP materials only */
1002  return (ma->gp_style != NULL);
1003 }
1004 
1005 static bool rna_GPencilBrush_pin_mode_get(PointerRNA *ptr)
1006 {
1007  Brush *brush = (Brush *)ptr->owner_id;
1008  if ((brush != NULL) && (brush->gpencil_settings != NULL)) {
1010  }
1011  return false;
1012 }
1013 
1014 static void rna_GPencilBrush_pin_mode_set(PointerRNA *UNUSED(ptr), bool UNUSED(value))
1015 {
1016  /* All data is set in update. Keep this function only to avoid RNA compilation errors. */
1017  return;
1018 }
1019 
1020 static void rna_GPencilBrush_pin_mode_update(bContext *C, PointerRNA *ptr)
1021 {
1022  Brush *brush = (Brush *)ptr->owner_id;
1023  if ((brush != NULL) && (brush->gpencil_settings != NULL)) {
1025  /* If not active, means that must be set to off. */
1027  }
1028  else {
1033  }
1034  }
1035 }
1036 
1037 static const EnumPropertyItem *rna_BrushTextureSlot_map_mode_itemf(bContext *C,
1038  PointerRNA *UNUSED(ptr),
1039  PropertyRNA *UNUSED(prop),
1040  bool *UNUSED(r_free))
1041 {
1042 
1043  if (C == NULL) {
1045  }
1046 
1047 # define rna_enum_brush_texture_slot_map_sculpt_mode_items \
1048  rna_enum_brush_texture_slot_map_all_mode_items;
1049 
1051  if (mode == PAINT_MODE_SCULPT) {
1052  return rna_enum_brush_texture_slot_map_sculpt_mode_items;
1053  }
1054  return rna_enum_brush_texture_slot_map_texture_mode_items;
1055 
1056 # undef rna_enum_brush_texture_slot_map_sculpt_mode_items
1057 }
1058 
1059 #else
1060 
1062 {
1063  StructRNA *srna;
1064  PropertyRNA *prop;
1065 
1066  static const EnumPropertyItem prop_mask_paint_map_mode_items[] = {
1067  {MTEX_MAP_MODE_VIEW, "VIEW_PLANE", 0, "View Plane", ""},
1068  {MTEX_MAP_MODE_TILED, "TILED", 0, "Tiled", ""},
1069  {MTEX_MAP_MODE_RANDOM, "RANDOM", 0, "Random", ""},
1070  {MTEX_MAP_MODE_STENCIL, "STENCIL", 0, "Stencil", ""},
1071  {0, NULL, 0, NULL, NULL},
1072  };
1073 
1074 # define TEXTURE_CAPABILITY(prop_name_, ui_name_) \
1075  prop = RNA_def_property(srna, #prop_name_, PROP_BOOLEAN, PROP_NONE); \
1076  RNA_def_property_clear_flag(prop, PROP_EDITABLE); \
1077  RNA_def_property_boolean_funcs(prop, "rna_TextureCapabilities_" #prop_name_ "_get", NULL); \
1078  RNA_def_property_ui_text(prop, ui_name_, NULL)
1079 
1080  srna = RNA_def_struct(brna, "BrushTextureSlot", "TextureSlot");
1081  RNA_def_struct_sdna(srna, "MTex");
1083  srna, "Brush Texture Slot", "Texture slot for textures in a Brush data-block");
1084 
1085  prop = RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE);
1086  RNA_def_property_float_sdna(prop, NULL, "rot");
1087  RNA_def_property_range(prop, 0, M_PI * 2);
1088  RNA_def_property_ui_text(prop, "Angle", "Brush texture rotation");
1090  RNA_def_property_update(prop, 0, "rna_TextureSlot_brush_angle_update");
1091 
1092  prop = RNA_def_property(srna, "map_mode", PROP_ENUM, PROP_NONE);
1093  RNA_def_property_enum_sdna(prop, NULL, "brush_map_mode");
1095  RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_BrushTextureSlot_map_mode_itemf");
1096  RNA_def_property_ui_text(prop, "Mode", "");
1098  RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
1099 
1100  prop = RNA_def_property(srna, "mask_map_mode", PROP_ENUM, PROP_NONE);
1101  RNA_def_property_enum_sdna(prop, NULL, "brush_map_mode");
1102  RNA_def_property_enum_items(prop, prop_mask_paint_map_mode_items);
1103  RNA_def_property_ui_text(prop, "Mode", "");
1105  RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
1106 
1107  prop = RNA_def_property(srna, "use_rake", PROP_BOOLEAN, PROP_NONE);
1108  RNA_def_property_boolean_sdna(prop, NULL, "brush_angle_mode", MTEX_ANGLE_RAKE);
1109  RNA_def_property_ui_text(prop, "Rake", "");
1111  RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
1112 
1113  prop = RNA_def_property(srna, "use_random", PROP_BOOLEAN, PROP_NONE);
1114  RNA_def_property_boolean_sdna(prop, NULL, "brush_angle_mode", MTEX_ANGLE_RANDOM);
1115  RNA_def_property_ui_text(prop, "Random", "");
1117  RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
1118 
1119  prop = RNA_def_property(srna, "random_angle", PROP_FLOAT, PROP_ANGLE);
1120  RNA_def_property_range(prop, 0, M_PI * 2);
1121  RNA_def_property_ui_text(prop, "Random Angle", "Brush texture random angle");
1123  RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
1124 
1125  TEXTURE_CAPABILITY(has_texture_angle_source, "Has Texture Angle Source");
1126  TEXTURE_CAPABILITY(has_random_texture_angle, "Has Random Texture Angle");
1127  TEXTURE_CAPABILITY(has_texture_angle, "Has Texture Angle Source");
1128 }
1129 
1131 {
1132  StructRNA *srna;
1133  PropertyRNA *prop;
1134 
1135  srna = RNA_def_struct(brna, "BrushCapabilitiesSculpt", NULL);
1136  RNA_def_struct_sdna(srna, "Brush");
1137  RNA_def_struct_nested(brna, srna, "Brush");
1139  "Sculpt Capabilities",
1140  "Read-only indications of which brush operations "
1141  "are supported by the current sculpt tool");
1142 
1143 # define SCULPT_TOOL_CAPABILITY(prop_name_, ui_name_) \
1144  prop = RNA_def_property(srna, #prop_name_, PROP_BOOLEAN, PROP_NONE); \
1145  RNA_def_property_clear_flag(prop, PROP_EDITABLE); \
1146  RNA_def_property_boolean_funcs( \
1147  prop, "rna_BrushCapabilitiesSculpt_" #prop_name_ "_get", NULL); \
1148  RNA_def_property_ui_text(prop, ui_name_, NULL)
1149 
1150  SCULPT_TOOL_CAPABILITY(has_accumulate, "Has Accumulate");
1151  SCULPT_TOOL_CAPABILITY(has_auto_smooth, "Has Auto Smooth");
1152  SCULPT_TOOL_CAPABILITY(has_topology_rake, "Has Topology Rake");
1153  SCULPT_TOOL_CAPABILITY(has_height, "Has Height");
1154  SCULPT_TOOL_CAPABILITY(has_jitter, "Has Jitter");
1155  SCULPT_TOOL_CAPABILITY(has_normal_weight, "Has Crease/Pinch Factor");
1156  SCULPT_TOOL_CAPABILITY(has_rake_factor, "Has Rake Factor");
1157  SCULPT_TOOL_CAPABILITY(has_persistence, "Has Persistence");
1158  SCULPT_TOOL_CAPABILITY(has_pinch_factor, "Has Pinch Factor");
1159  SCULPT_TOOL_CAPABILITY(has_plane_offset, "Has Plane Offset");
1160  SCULPT_TOOL_CAPABILITY(has_random_texture_angle, "Has Random Texture Angle");
1161  SCULPT_TOOL_CAPABILITY(has_sculpt_plane, "Has Sculpt Plane");
1162  SCULPT_TOOL_CAPABILITY(has_color, "Has Color");
1163  SCULPT_TOOL_CAPABILITY(has_secondary_color, "Has Secondary Color");
1164  SCULPT_TOOL_CAPABILITY(has_smooth_stroke, "Has Smooth Stroke");
1165  SCULPT_TOOL_CAPABILITY(has_space_attenuation, "Has Space Attenuation");
1166  SCULPT_TOOL_CAPABILITY(has_strength_pressure, "Has Strength Pressure");
1167  SCULPT_TOOL_CAPABILITY(has_direction, "Has Direction");
1168  SCULPT_TOOL_CAPABILITY(has_gravity, "Has Gravity");
1169  SCULPT_TOOL_CAPABILITY(has_tilt, "Has Tilt");
1170 
1171 # undef SCULPT_CAPABILITY
1172 }
1173 
1175 {
1176  StructRNA *srna;
1177  PropertyRNA *prop;
1178 
1179  srna = RNA_def_struct(brna, "BrushCapabilities", NULL);
1180  RNA_def_struct_sdna(srna, "Brush");
1181  RNA_def_struct_nested(brna, srna, "Brush");
1183  srna, "Brush Capabilities", "Read-only indications of supported operations");
1184 
1185 # define BRUSH_CAPABILITY(prop_name_, ui_name_) \
1186  prop = RNA_def_property(srna, #prop_name_, PROP_BOOLEAN, PROP_NONE); \
1187  RNA_def_property_clear_flag(prop, PROP_EDITABLE); \
1188  RNA_def_property_boolean_funcs(prop, "rna_BrushCapabilities_" #prop_name_ "_get", NULL); \
1189  RNA_def_property_ui_text(prop, ui_name_, NULL)
1190 
1191  BRUSH_CAPABILITY(has_overlay, "Has Overlay");
1192  BRUSH_CAPABILITY(has_random_texture_angle, "Has Random Texture Angle");
1193  BRUSH_CAPABILITY(has_spacing, "Has Spacing");
1194  BRUSH_CAPABILITY(has_smooth_stroke, "Has Smooth Stroke");
1195 
1196 # undef BRUSH_CAPABILITY
1197 }
1198 
1200 {
1201  StructRNA *srna;
1202  PropertyRNA *prop;
1203 
1204  srna = RNA_def_struct(brna, "BrushCapabilitiesImagePaint", NULL);
1205  RNA_def_struct_sdna(srna, "Brush");
1206  RNA_def_struct_nested(brna, srna, "Brush");
1208  srna, "Image Paint Capabilities", "Read-only indications of supported operations");
1209 
1210 # define IMAPAINT_TOOL_CAPABILITY(prop_name_, ui_name_) \
1211  prop = RNA_def_property(srna, #prop_name_, PROP_BOOLEAN, PROP_NONE); \
1212  RNA_def_property_clear_flag(prop, PROP_EDITABLE); \
1213  RNA_def_property_boolean_funcs( \
1214  prop, "rna_BrushCapabilitiesImagePaint_" #prop_name_ "_get", NULL); \
1215  RNA_def_property_ui_text(prop, ui_name_, NULL)
1216 
1217  IMAPAINT_TOOL_CAPABILITY(has_accumulate, "Has Accumulate");
1218  IMAPAINT_TOOL_CAPABILITY(has_space_attenuation, "Has Space Attenuation");
1219  IMAPAINT_TOOL_CAPABILITY(has_radius, "Has Radius");
1220  IMAPAINT_TOOL_CAPABILITY(has_color, "Has Color");
1221 
1222 # undef IMAPAINT_TOOL_CAPABILITY
1223 }
1224 
1226 {
1227  StructRNA *srna;
1228  PropertyRNA *prop;
1229 
1230  srna = RNA_def_struct(brna, "BrushCapabilitiesVertexPaint", NULL);
1231  RNA_def_struct_sdna(srna, "Brush");
1232  RNA_def_struct_nested(brna, srna, "Brush");
1234  srna, "Vertex Paint Capabilities", "Read-only indications of supported operations");
1235 
1236 # define VPAINT_TOOL_CAPABILITY(prop_name_, ui_name_) \
1237  prop = RNA_def_property(srna, #prop_name_, PROP_BOOLEAN, PROP_NONE); \
1238  RNA_def_property_clear_flag(prop, PROP_EDITABLE); \
1239  RNA_def_property_boolean_funcs( \
1240  prop, "rna_BrushCapabilitiesVertexPaint_" #prop_name_ "_get", NULL); \
1241  RNA_def_property_ui_text(prop, ui_name_, NULL)
1242 
1243  VPAINT_TOOL_CAPABILITY(has_color, "Has Color");
1244 
1245 # undef VPAINT_TOOL_CAPABILITY
1246 }
1247 
1249 {
1250  StructRNA *srna;
1251  PropertyRNA *prop;
1252 
1253  srna = RNA_def_struct(brna, "BrushCapabilitiesWeightPaint", NULL);
1254  RNA_def_struct_sdna(srna, "Brush");
1255  RNA_def_struct_nested(brna, srna, "Brush");
1257  srna, "Weight Paint Capabilities", "Read-only indications of supported operations");
1258 
1259 # define WPAINT_TOOL_CAPABILITY(prop_name_, ui_name_) \
1260  prop = RNA_def_property(srna, #prop_name_, PROP_BOOLEAN, PROP_NONE); \
1261  RNA_def_property_clear_flag(prop, PROP_EDITABLE); \
1262  RNA_def_property_boolean_funcs( \
1263  prop, "rna_BrushCapabilitiesWeightPaint_" #prop_name_ "_get", NULL); \
1264  RNA_def_property_ui_text(prop, ui_name_, NULL)
1265 
1266  WPAINT_TOOL_CAPABILITY(has_weight, "Has Weight");
1267 
1268 # undef WPAINT_TOOL_CAPABILITY
1269 }
1270 
1272 {
1273  StructRNA *srna;
1274  PropertyRNA *prop;
1275 
1276  /* modes */
1277  static EnumPropertyItem gppaint_mode_types_items[] = {
1278  {GPPAINT_MODE_STROKE, "STROKE", 0, "Stroke", "Vertex Color affects to Stroke only"},
1279  {GPPAINT_MODE_FILL, "FILL", 0, "Fill", "Vertex Color affects to Fill only"},
1280  {GPPAINT_MODE_BOTH, "BOTH", 0, "Stroke and Fill", "Vertex Color affects to Stroke and Fill"},
1281  {0, NULL, 0, NULL, NULL},
1282  };
1283 
1284  srna = RNA_def_struct(brna, "BrushGpencilSettings", NULL);
1285  RNA_def_struct_sdna(srna, "BrushGpencilSettings");
1286  RNA_def_struct_path_func(srna, "rna_BrushGpencilSettings_path");
1287  RNA_def_struct_ui_text(srna, "Grease Pencil Brush Settings", "Settings for grease pencil brush");
1288 
1289  /* Strength factor for new strokes */
1290  prop = RNA_def_property(srna, "pen_strength", PROP_FLOAT, PROP_FACTOR);
1291  RNA_def_property_float_sdna(prop, NULL, "draw_strength");
1292  RNA_def_property_range(prop, 0.0f, 1.0f);
1293  RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
1295  prop, "Strength", "Color strength for new strokes (affect alpha factor of color)");
1298 
1299  /* Jitter factor for new strokes */
1300  prop = RNA_def_property(srna, "pen_jitter", PROP_FLOAT, PROP_FACTOR);
1301  RNA_def_property_float_sdna(prop, NULL, "draw_jitter");
1302  RNA_def_property_range(prop, 0.0f, 1.0f);
1303  RNA_def_property_ui_text(prop, "Jitter", "Jitter factor for new strokes");
1306 
1307  /* Randomness factor for pressure */
1308  prop = RNA_def_property(srna, "random_pressure", PROP_FLOAT, PROP_FACTOR);
1309  RNA_def_property_float_sdna(prop, NULL, "draw_random_press");
1310  RNA_def_property_range(prop, 0.0f, 1.0f);
1312  prop, "Pressure Randomness", "Randomness factor for pressure in new strokes");
1315 
1316  /* Randomness factor for strength */
1317  prop = RNA_def_property(srna, "random_strength", PROP_FLOAT, PROP_FACTOR);
1318  RNA_def_property_float_sdna(prop, NULL, "draw_random_strength");
1319  RNA_def_property_range(prop, 0.0f, 1.0f);
1321  prop, "Strength Randomness", "Randomness factor strength in new strokes");
1324 
1325  /* Angle when brush is full size */
1326  prop = RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE);
1327  RNA_def_property_float_sdna(prop, NULL, "draw_angle");
1330  "Angle",
1331  "Direction of the stroke at which brush gives maximal thickness "
1332  "(0° for horizontal)");
1335 
1336  /* Factor to change brush size depending of angle */
1337  prop = RNA_def_property(srna, "angle_factor", PROP_FLOAT, PROP_FACTOR);
1338  RNA_def_property_float_sdna(prop, NULL, "draw_angle_factor");
1339  RNA_def_property_range(prop, 0.0f, 1.0f);
1341  prop,
1342  "Angle Factor",
1343  "Reduce brush thickness by this factor when stroke is perpendicular to 'Angle' direction");
1346 
1347  /* Smoothing factor for new strokes */
1348  prop = RNA_def_property(srna, "pen_smooth_factor", PROP_FLOAT, PROP_NONE);
1349  RNA_def_property_float_sdna(prop, NULL, "draw_smoothfac");
1350  RNA_def_property_range(prop, 0.0, 2.0f);
1352  prop,
1353  "Smooth",
1354  "Amount of smoothing to apply after finish newly created strokes, to reduce jitter/noise");
1357 
1358  /* Iterations of the Smoothing factor */
1359  prop = RNA_def_property(srna, "pen_smooth_steps", PROP_INT, PROP_NONE);
1360  RNA_def_property_int_sdna(prop, NULL, "draw_smoothlvl");
1361  RNA_def_property_range(prop, 1, 3);
1362  RNA_def_property_ui_text(prop, "Iterations", "Number of times to smooth newly created strokes");
1365 
1366  /* Subdivision level for new strokes */
1367  prop = RNA_def_property(srna, "pen_subdivision_steps", PROP_INT, PROP_NONE);
1368  RNA_def_property_int_sdna(prop, NULL, "draw_subdivide");
1369  RNA_def_property_range(prop, 0, 3);
1371  prop,
1372  "Subdivision Steps",
1373  "Number of times to subdivide newly created strokes, for less jagged strokes");
1376 
1377  /* Simplify factor */
1378  prop = RNA_def_property(srna, "simplify_factor", PROP_FLOAT, PROP_NONE);
1379  RNA_def_property_float_sdna(prop, NULL, "simplify_f");
1380  RNA_def_property_range(prop, 0, 100.0);
1381  RNA_def_property_ui_range(prop, 0, 100.0, 1.0f, 3);
1382  RNA_def_property_ui_text(prop, "Simplify", "Factor of Simplify using adaptive algorithm");
1384 
1385  /* Curves for pressure */
1386  prop = RNA_def_property(srna, "curve_sensitivity", PROP_POINTER, PROP_NONE);
1387  RNA_def_property_pointer_sdna(prop, NULL, "curve_sensitivity");
1388  RNA_def_property_struct_type(prop, "CurveMapping");
1389  RNA_def_property_ui_text(prop, "Curve Sensitivity", "Curve used for the sensitivity");
1392 
1393  prop = RNA_def_property(srna, "curve_strength", PROP_POINTER, PROP_NONE);
1394  RNA_def_property_pointer_sdna(prop, NULL, "curve_strength");
1395  RNA_def_property_struct_type(prop, "CurveMapping");
1396  RNA_def_property_ui_text(prop, "Curve Strength", "Curve used for the strength");
1399 
1400  prop = RNA_def_property(srna, "curve_jitter", PROP_POINTER, PROP_NONE);
1401  RNA_def_property_pointer_sdna(prop, NULL, "curve_jitter");
1402  RNA_def_property_struct_type(prop, "CurveMapping");
1403  RNA_def_property_ui_text(prop, "Curve Jitter", "Curve used for the jitter effect");
1406 
1407  prop = RNA_def_property(srna, "curve_random_pressure", PROP_POINTER, PROP_NONE);
1408  RNA_def_property_pointer_sdna(prop, NULL, "curve_rand_pressure");
1409  RNA_def_property_struct_type(prop, "CurveMapping");
1410  RNA_def_property_ui_text(prop, "Random Curve", "Curve used for modulating effect");
1413 
1414  prop = RNA_def_property(srna, "curve_random_strength", PROP_POINTER, PROP_NONE);
1415  RNA_def_property_pointer_sdna(prop, NULL, "curve_rand_strength");
1416  RNA_def_property_struct_type(prop, "CurveMapping");
1417  RNA_def_property_ui_text(prop, "Random Curve", "Curve used for modulating effect");
1420 
1421  prop = RNA_def_property(srna, "curve_random_uv", PROP_POINTER, PROP_NONE);
1422  RNA_def_property_pointer_sdna(prop, NULL, "curve_rand_uv");
1423  RNA_def_property_struct_type(prop, "CurveMapping");
1424  RNA_def_property_ui_text(prop, "Random Curve", "Curve used for modulating effect");
1427 
1428  prop = RNA_def_property(srna, "curve_random_hue", PROP_POINTER, PROP_NONE);
1429  RNA_def_property_pointer_sdna(prop, NULL, "curve_rand_hue");
1430  RNA_def_property_struct_type(prop, "CurveMapping");
1431  RNA_def_property_ui_text(prop, "Random Curve", "Curve used for modulating effect");
1434 
1435  prop = RNA_def_property(srna, "curve_random_saturation", PROP_POINTER, PROP_NONE);
1436  RNA_def_property_pointer_sdna(prop, NULL, "curve_rand_saturation");
1437  RNA_def_property_struct_type(prop, "CurveMapping");
1438  RNA_def_property_ui_text(prop, "Random Curve", "Curve used for modulating effect");
1441 
1442  prop = RNA_def_property(srna, "curve_random_value", PROP_POINTER, PROP_NONE);
1443  RNA_def_property_pointer_sdna(prop, NULL, "curve_rand_value");
1444  RNA_def_property_struct_type(prop, "CurveMapping");
1445  RNA_def_property_ui_text(prop, "Random Curve", "Curve used for modulating effect");
1448 
1449  /* Fill threshold for transparency. */
1450  prop = RNA_def_property(srna, "fill_threshold", PROP_FLOAT, PROP_FACTOR);
1451  RNA_def_property_float_sdna(prop, NULL, "fill_threshold");
1452  RNA_def_property_range(prop, 0.0f, 1.0f);
1454  prop, "Threshold", "Threshold to consider color transparent for filling");
1457 
1458  /* fill leak size */
1459  prop = RNA_def_property(srna, "fill_leak", PROP_INT, PROP_PIXEL);
1460  RNA_def_property_int_sdna(prop, NULL, "fill_leak");
1461  RNA_def_property_range(prop, 0, 100);
1462  RNA_def_property_ui_text(prop, "Leak Size", "Size in pixels to consider the leak closed");
1465 
1466  /* fill factor size */
1467  prop = RNA_def_property(srna, "fill_factor", PROP_FLOAT, PROP_NONE);
1468  RNA_def_property_float_sdna(prop, NULL, "fill_factor");
1471  prop,
1472  "Precision",
1473  "Factor for fill boundary accuracy, higher values are more accurate but slower");
1476 
1477  /* fill simplify steps */
1478  prop = RNA_def_property(srna, "fill_simplify_level", PROP_INT, PROP_NONE);
1479  RNA_def_property_int_sdna(prop, NULL, "fill_simplylvl");
1480  RNA_def_property_range(prop, 0, 10);
1482  prop, "Simplify", "Number of simplify steps (large values reduce fill accuracy)");
1485 
1486  prop = RNA_def_property(srna, "uv_random", PROP_FLOAT, PROP_FACTOR);
1487  RNA_def_property_float_sdna(prop, NULL, "uv_random");
1488  RNA_def_property_range(prop, 0.0, 1.0);
1489  RNA_def_property_ui_text(prop, "UV Random", "Random factor for autogenerated UV rotation");
1492 
1493  /* gradient control */
1494  prop = RNA_def_property(srna, "hardness", PROP_FLOAT, PROP_FACTOR);
1495  RNA_def_property_float_sdna(prop, NULL, "hardeness");
1496  RNA_def_property_range(prop, 0.001f, 1.0f);
1497  RNA_def_property_float_default(prop, 1.0f);
1499  prop,
1500  "Hardness",
1501  "Gradient from the center of Dot and Box strokes (set to 1 for a solid stroke)");
1503 
1504  /* gradient shape ratio */
1505  prop = RNA_def_property(srna, "aspect", PROP_FLOAT, PROP_XYZ);
1506  RNA_def_property_float_sdna(prop, NULL, "aspect_ratio");
1507  RNA_def_property_array(prop, 2);
1508  RNA_def_property_range(prop, 0.01f, 1.0f);
1509  RNA_def_property_float_default(prop, 1.0f);
1510  RNA_def_property_ui_text(prop, "Aspect", "");
1512 
1513  prop = RNA_def_property(srna, "input_samples", PROP_INT, PROP_NONE);
1514  RNA_def_property_int_sdna(prop, NULL, "input_samples");
1517  prop,
1518  "Input Samples",
1519  "Generate intermediate points for very fast mouse movements. Set to 0 to disable");
1522 
1523  /* active smooth factor while drawing */
1524  prop = RNA_def_property(srna, "active_smooth_factor", PROP_FLOAT, PROP_FACTOR);
1525  RNA_def_property_float_sdna(prop, NULL, "active_smooth");
1526  RNA_def_property_range(prop, 0.0f, 1.0f);
1527  RNA_def_property_ui_text(prop, "Active Smooth", "Amount of smoothing while drawing");
1530 
1531  prop = RNA_def_property(srna, "eraser_strength_factor", PROP_FLOAT, PROP_PERCENTAGE);
1532  RNA_def_property_float_sdna(prop, NULL, "era_strength_f");
1533  RNA_def_property_range(prop, 0.0, 100.0);
1534  RNA_def_property_ui_range(prop, 0.0, 100.0, 10, 1);
1535  RNA_def_property_ui_text(prop, "Affect Stroke Strength", "Amount of erasing for strength");
1538 
1539  prop = RNA_def_property(srna, "eraser_thickness_factor", PROP_FLOAT, PROP_PERCENTAGE);
1540  RNA_def_property_float_sdna(prop, NULL, "era_thickness_f");
1541  RNA_def_property_range(prop, 0.0, 100.0);
1542  RNA_def_property_ui_range(prop, 0.0, 100.0, 10, 1);
1543  RNA_def_property_ui_text(prop, "Affect Stroke Thickness", "Amount of erasing for thickness");
1546 
1547  /* brush standard icon */
1548  prop = RNA_def_property(srna, "gpencil_paint_icon", PROP_ENUM, PROP_NONE);
1549  RNA_def_property_enum_sdna(prop, NULL, "icon_id");
1552  RNA_def_property_ui_text(prop, "Grease Pencil Icon", "");
1553 
1554  prop = RNA_def_property(srna, "gpencil_sculpt_icon", PROP_ENUM, PROP_NONE);
1555  RNA_def_property_enum_sdna(prop, NULL, "icon_id");
1558  RNA_def_property_ui_text(prop, "Grease Pencil Icon", "");
1559 
1560  prop = RNA_def_property(srna, "gpencil_weight_icon", PROP_ENUM, PROP_NONE);
1561  RNA_def_property_enum_sdna(prop, NULL, "icon_id");
1564  RNA_def_property_ui_text(prop, "Grease Pencil Icon", "");
1565 
1566  prop = RNA_def_property(srna, "gpencil_vertex_icon", PROP_ENUM, PROP_NONE);
1567  RNA_def_property_enum_sdna(prop, NULL, "icon_id");
1570  RNA_def_property_ui_text(prop, "Grease Pencil Icon", "");
1571 
1572  /* Mode type. */
1573  prop = RNA_def_property(srna, "vertex_mode", PROP_ENUM, PROP_NONE);
1574  RNA_def_property_enum_bitflag_sdna(prop, NULL, "vertex_mode");
1575  RNA_def_property_enum_items(prop, gppaint_mode_types_items);
1576  RNA_def_property_ui_text(prop, "Mode Type", "Defines how vertex color affect to the strokes");
1578 
1579  /* Vertex Color mix factor. */
1580  prop = RNA_def_property(srna, "vertex_color_factor", PROP_FLOAT, PROP_FACTOR);
1581  RNA_def_property_float_sdna(prop, NULL, "vertex_factor");
1582  RNA_def_property_range(prop, 0.0f, 1.0f);
1585  prop, "Vertex Color Factor", "Factor used to mix vertex color to get final color");
1586 
1587  /* Hue randomness. */
1588  prop = RNA_def_property(srna, "random_hue_factor", PROP_FLOAT, PROP_FACTOR);
1589  RNA_def_property_float_sdna(prop, NULL, "random_hue");
1590  RNA_def_property_range(prop, 0.0f, 1.0f);
1591  RNA_def_property_float_default(prop, 0.0f);
1592  RNA_def_property_ui_text(prop, "Hue", "Random factor to modify original hue");
1594 
1595  /* Saturation randomness. */
1596  prop = RNA_def_property(srna, "random_saturation_factor", PROP_FLOAT, PROP_FACTOR);
1597  RNA_def_property_float_sdna(prop, NULL, "random_saturation");
1598  RNA_def_property_range(prop, 0.0f, 1.0f);
1599  RNA_def_property_float_default(prop, 0.0f);
1600  RNA_def_property_ui_text(prop, "Saturation", "Random factor to modify original saturation");
1602 
1603  /* Value randomness. */
1604  prop = RNA_def_property(srna, "random_value_factor", PROP_FLOAT, PROP_FACTOR);
1605  RNA_def_property_float_sdna(prop, NULL, "random_value");
1606  RNA_def_property_range(prop, 0.0f, 1.0f);
1607  RNA_def_property_float_default(prop, 0.0f);
1608  RNA_def_property_ui_text(prop, "Value", "Random factor to modify original value");
1610 
1611  /* Factor to extend stroke extremes in Fill tool. */
1612  prop = RNA_def_property(srna, "extend_stroke_factor", PROP_FLOAT, PROP_NONE);
1613  RNA_def_property_float_sdna(prop, NULL, "fill_extend_fac");
1614  RNA_def_property_range(prop, 0.0f, 10.0f);
1615  RNA_def_property_float_default(prop, 0.0f);
1617  prop, "Stroke Extension", "Strokes end extension for closing gaps, use zero to disable");
1619 
1620  /* Flags */
1621  prop = RNA_def_property(srna, "use_pressure", PROP_BOOLEAN, PROP_NONE);
1623  RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
1624  RNA_def_property_ui_text(prop, "Use Pressure", "Use tablet pressure");
1627 
1628  prop = RNA_def_property(srna, "use_strength_pressure", PROP_BOOLEAN, PROP_NONE);
1630  RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
1632  prop, "Use Pressure Strength", "Use tablet pressure for color strength");
1635 
1636  prop = RNA_def_property(srna, "use_jitter_pressure", PROP_BOOLEAN, PROP_NONE);
1638  RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
1639  RNA_def_property_ui_text(prop, "Use Pressure Jitter", "Use tablet pressure for jitter");
1642 
1643  prop = RNA_def_property(srna, "use_stroke_random_hue", PROP_BOOLEAN, PROP_NONE);
1645  RNA_def_property_ui_icon(prop, ICON_GP_SELECT_STROKES, 0);
1646  RNA_def_property_ui_text(prop, "Stroke Random", "Use randomness at stroke level");
1649 
1650  prop = RNA_def_property(srna, "use_stroke_random_sat", PROP_BOOLEAN, PROP_NONE);
1652  RNA_def_property_ui_icon(prop, ICON_GP_SELECT_STROKES, 0);
1653  RNA_def_property_ui_text(prop, "Stroke Random", "Use randomness at stroke level");
1656 
1657  prop = RNA_def_property(srna, "use_stroke_random_val", PROP_BOOLEAN, PROP_NONE);
1659  RNA_def_property_ui_icon(prop, ICON_GP_SELECT_STROKES, 0);
1660  RNA_def_property_ui_text(prop, "Stroke Random", "Use randomness at stroke level");
1663 
1664  prop = RNA_def_property(srna, "use_stroke_random_radius", PROP_BOOLEAN, PROP_NONE);
1666  RNA_def_property_ui_icon(prop, ICON_GP_SELECT_STROKES, 0);
1667  RNA_def_property_ui_text(prop, "Stroke Random", "Use randomness at stroke level");
1670 
1671  prop = RNA_def_property(srna, "use_stroke_random_strength", PROP_BOOLEAN, PROP_NONE);
1673  RNA_def_property_ui_icon(prop, ICON_GP_SELECT_STROKES, 0);
1674  RNA_def_property_ui_text(prop, "Stroke Random", "Use randomness at stroke level");
1677 
1678  prop = RNA_def_property(srna, "use_stroke_random_uv", PROP_BOOLEAN, PROP_NONE);
1680  RNA_def_property_ui_icon(prop, ICON_GP_SELECT_STROKES, 0);
1681  RNA_def_property_ui_text(prop, "Stroke Random", "Use randomness at stroke level");
1684 
1685  prop = RNA_def_property(srna, "use_random_press_hue", PROP_BOOLEAN, PROP_NONE);
1687  RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
1688  RNA_def_property_ui_text(prop, "Use Pressure", "Use pressure to modulate randomness");
1691 
1692  prop = RNA_def_property(srna, "use_random_press_sat", PROP_BOOLEAN, PROP_NONE);
1694  RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
1695  RNA_def_property_ui_text(prop, "Use Pressure", "Use pressure to modulate randomness");
1698 
1699  prop = RNA_def_property(srna, "use_random_press_val", PROP_BOOLEAN, PROP_NONE);
1701  RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
1702  RNA_def_property_ui_text(prop, "Use Pressure", "Use pressure to modulate randomness");
1705 
1706  prop = RNA_def_property(srna, "use_random_press_radius", PROP_BOOLEAN, PROP_NONE);
1708  RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
1709  RNA_def_property_ui_text(prop, "Use Pressure", "Use pressure to modulate randomness");
1712 
1713  prop = RNA_def_property(srna, "use_random_press_strength", PROP_BOOLEAN, PROP_NONE);
1715  RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
1716  RNA_def_property_ui_text(prop, "Use Pressure", "Use pressure to modulate randomness");
1719 
1720  prop = RNA_def_property(srna, "use_random_press_uv", PROP_BOOLEAN, PROP_NONE);
1722  RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
1723  RNA_def_property_ui_text(prop, "Use Pressure", "Use pressure to modulate randomness");
1726 
1727  prop = RNA_def_property(srna, "use_settings_stabilizer", PROP_BOOLEAN, PROP_NONE);
1731  "Use Stabilizer",
1732  "Draw lines with a delay to allow smooth strokes. Press Shift key to "
1733  "override while drawing");
1735 
1736  prop = RNA_def_property(srna, "eraser_mode", PROP_ENUM, PROP_NONE);
1737  RNA_def_property_enum_sdna(prop, NULL, "eraser_mode");
1739  RNA_def_property_ui_text(prop, "Mode", "Eraser Mode");
1742  prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_eraser_mode_update");
1743 
1744  prop = RNA_def_property(srna, "fill_draw_mode", PROP_ENUM, PROP_NONE);
1745  RNA_def_property_enum_sdna(prop, NULL, "fill_draw_mode");
1747  RNA_def_property_ui_text(prop, "Mode", "Mode to draw boundary limits");
1749 
1750  prop = RNA_def_property(srna, "fill_layer_mode", PROP_ENUM, PROP_NONE);
1751  RNA_def_property_enum_sdna(prop, NULL, "fill_layer_mode");
1753  RNA_def_property_ui_text(prop, "Layer Mode", "Layers used as boundaries");
1755 
1756  prop = RNA_def_property(srna, "fill_direction", PROP_ENUM, PROP_NONE);
1757  RNA_def_property_enum_sdna(prop, NULL, "fill_direction");
1759  RNA_def_property_ui_text(prop, "Direction", "Direction of the fill");
1761 
1762  prop = RNA_def_property(srna, "pin_draw_mode", PROP_BOOLEAN, PROP_NONE);
1764  prop, "rna_GPencilBrush_pin_mode_get", "rna_GPencilBrush_pin_mode_set");
1765  RNA_def_property_ui_icon(prop, ICON_UNPINNED, 1);
1768  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencilBrush_pin_mode_update");
1769  RNA_def_property_ui_text(prop, "Pin Mode", "Pin the mode to the brush");
1770 
1771  prop = RNA_def_property(srna, "brush_draw_mode", PROP_ENUM, PROP_NONE);
1772  RNA_def_property_enum_sdna(prop, NULL, "brush_draw_mode");
1774  RNA_def_property_ui_text(prop, "Mode", "Preselected mode when using this brush");
1776 
1777  prop = RNA_def_property(srna, "use_trim", PROP_BOOLEAN, PROP_NONE);
1779  RNA_def_property_boolean_default(prop, false);
1780  RNA_def_property_ui_text(prop, "Trim Stroke Ends", "Trim intersecting stroke ends");
1782 
1783  prop = RNA_def_property(srna, "direction", PROP_ENUM, PROP_NONE);
1784  RNA_def_property_enum_bitflag_sdna(prop, NULL, "sculpt_flag");
1786  RNA_def_property_ui_text(prop, "Direction", "");
1789 
1790  prop = RNA_def_property(srna, "use_edit_position", PROP_BOOLEAN, PROP_NONE);
1792  RNA_def_property_ui_text(prop, "Affect Position", "The brush affects the position of the point");
1795 
1796  prop = RNA_def_property(srna, "use_edit_strength", PROP_BOOLEAN, PROP_NONE);
1799  prop, "Affect Strength", "The brush affects the color strength of the point");
1802 
1803  prop = RNA_def_property(srna, "use_edit_thickness", PROP_BOOLEAN, PROP_NONE);
1805  prop, NULL, "sculpt_mode_flag", GP_SCULPT_FLAGMODE_APPLY_THICKNESS);
1807  prop, "Affect Thickness", "The brush affects the thickness of the point");
1810 
1811  prop = RNA_def_property(srna, "use_edit_uv", PROP_BOOLEAN, PROP_NONE);
1813  RNA_def_property_ui_text(prop, "Affect UV", "The brush affects the UV rotation of the point");
1816 
1817  /* Material */
1818  prop = RNA_def_property(srna, "material", PROP_POINTER, PROP_NONE);
1819  RNA_def_property_struct_type(prop, "Material");
1820  RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_BrushGpencilSettings_material_poll");
1822  RNA_def_property_ui_text(prop, "Material", "Material used for strokes drawn using this brush");
1824  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_Brush_material_update");
1825 
1826  prop = RNA_def_property(srna, "show_fill_boundary", PROP_BOOLEAN, PROP_NONE);
1829  RNA_def_property_ui_text(prop, "Show Lines", "Show help lines for filling to see boundaries");
1831 
1832  prop = RNA_def_property(srna, "show_fill_extend", PROP_BOOLEAN, PROP_NONE);
1835  RNA_def_property_ui_text(prop, "Show Extend Lines", "Show help lines for stroke extension");
1837 
1838  prop = RNA_def_property(srna, "show_fill", PROP_BOOLEAN, PROP_NONE);
1842  prop, "Show Fill", "Show transparent lines to use as boundary for filling");
1844 
1845  prop = RNA_def_property(srna, "use_fill_limit", PROP_BOOLEAN, PROP_NONE);
1848  RNA_def_property_ui_text(prop, "Limit to Viewport", "Fill only visible areas in viewport");
1850 
1851  prop = RNA_def_property(srna, "use_default_eraser", PROP_BOOLEAN, PROP_NONE);
1854  RNA_def_property_ui_icon(prop, ICON_UNPINNED, 1);
1856  prop, "Default Eraser", "Use this brush when enable eraser with fast switch key");
1859  prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_default_eraser_update");
1860 
1861  prop = RNA_def_property(srna, "use_settings_postprocess", PROP_BOOLEAN, PROP_NONE);
1864  prop, "Use Post-Process Settings", "Additional post processing options for new strokes");
1866 
1867  prop = RNA_def_property(srna, "use_settings_random", PROP_BOOLEAN, PROP_NONE);
1869  RNA_def_property_ui_text(prop, "Random Settings", "Random brush settings");
1871 
1872  prop = RNA_def_property(srna, "use_material_pin", PROP_BOOLEAN, PROP_NONE);
1875  RNA_def_property_ui_icon(prop, ICON_UNPINNED, 1);
1876  RNA_def_property_ui_text(prop, "Pin Material", "Keep material assigned to brush");
1879  prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_use_material_pin_update");
1880 
1881  prop = RNA_def_property(srna, "show_lasso", PROP_BOOLEAN, PROP_NONE);
1884  prop, "Show Lasso", "Do not display fill color while drawing the stroke");
1886 
1887  prop = RNA_def_property(srna, "use_occlude_eraser", PROP_BOOLEAN, PROP_NONE);
1889  RNA_def_property_ui_text(prop, "Occlude Eraser", "Erase only strokes visible and not occluded");
1891 }
1892 
1893 static void rna_def_brush(BlenderRNA *brna)
1894 {
1895  StructRNA *srna;
1896  PropertyRNA *prop;
1897 
1898  static const EnumPropertyItem prop_blend_items[] = {
1899  {IMB_BLEND_MIX, "MIX", 0, "Mix", "Use Mix blending mode while painting"},
1900  {0, "", ICON_NONE, NULL, NULL},
1901  {IMB_BLEND_DARKEN, "DARKEN", 0, "Darken", "Use Darken blending mode while painting"},
1902  {IMB_BLEND_MUL, "MUL", 0, "Multiply", "Use Multiply blending mode while painting"},
1904  "COLORBURN",
1905  0,
1906  "Color Burn",
1907  "Use Color Burn blending mode while painting"},
1909  "LINEARBURN",
1910  0,
1911  "Linear Burn",
1912  "Use Linear Burn blending mode while painting"},
1913  {0, "", ICON_NONE, NULL, NULL},
1914  {IMB_BLEND_LIGHTEN, "LIGHTEN", 0, "Lighten", "Use Lighten blending mode while painting"},
1915  {IMB_BLEND_SCREEN, "SCREEN", 0, "Screen", "Use Screen blending mode while painting"},
1917  "COLORDODGE",
1918  0,
1919  "Color Dodge",
1920  "Use Color Dodge blending mode while painting"},
1921  {IMB_BLEND_ADD, "ADD", 0, "Add", "Use Add blending mode while painting"},
1922  {0, "", ICON_NONE, NULL, NULL},
1923  {IMB_BLEND_OVERLAY, "OVERLAY", 0, "Overlay", "Use Overlay blending mode while painting"},
1925  "SOFTLIGHT",
1926  0,
1927  "Soft Light",
1928  "Use Soft Light blending mode while painting"},
1930  "HARDLIGHT",
1931  0,
1932  "Hard Light",
1933  "Use Hard Light blending mode while painting"},
1935  "VIVIDLIGHT",
1936  0,
1937  "Vivid Light",
1938  "Use Vivid Light blending mode while painting"},
1940  "LINEARLIGHT",
1941  0,
1942  "Linear Light",
1943  "Use Linear Light blending mode while painting"},
1945  "PINLIGHT",
1946  0,
1947  "Pin Light",
1948  "Use Pin Light blending mode while painting"},
1949  {0, "", ICON_NONE, NULL, NULL},
1951  "DIFFERENCE",
1952  0,
1953  "Difference",
1954  "Use Difference blending mode while painting"},
1956  "EXCLUSION",
1957  0,
1958  "Exclusion",
1959  "Use Exclusion blending mode while painting"},
1960  {IMB_BLEND_SUB, "SUB", 0, "Subtract", "Use Subtract blending mode while painting"},
1961  {0, "", ICON_NONE, NULL, NULL},
1962  {IMB_BLEND_HUE, "HUE", 0, "Hue", "Use Hue blending mode while painting"},
1964  "SATURATION",
1965  0,
1966  "Saturation",
1967  "Use Saturation blending mode while painting"},
1968  {IMB_BLEND_COLOR, "COLOR", 0, "Color", "Use Color blending mode while painting"},
1969  {IMB_BLEND_LUMINOSITY, "LUMINOSITY", 0, "Value", "Use Value blending mode while painting"},
1970  {0, "", ICON_NONE, NULL, NULL},
1971  {IMB_BLEND_ERASE_ALPHA, "ERASE_ALPHA", 0, "Erase Alpha", "Erase alpha while painting"},
1972  {IMB_BLEND_ADD_ALPHA, "ADD_ALPHA", 0, "Add Alpha", "Add alpha while painting"},
1973  {0, NULL, 0, NULL, NULL},
1974  };
1975 
1976  static const EnumPropertyItem brush_sculpt_plane_items[] = {
1977  {SCULPT_DISP_DIR_AREA, "AREA", 0, "Area Plane", ""},
1978  {SCULPT_DISP_DIR_VIEW, "VIEW", 0, "View Plane", ""},
1979  {SCULPT_DISP_DIR_X, "X", 0, "X Plane", ""},
1980  {SCULPT_DISP_DIR_Y, "Y", 0, "Y Plane", ""},
1981  {SCULPT_DISP_DIR_Z, "Z", 0, "Z Plane", ""},
1982  {0, NULL, 0, NULL, NULL},
1983  };
1984 
1985  static const EnumPropertyItem brush_mask_tool_items[] = {
1986  {BRUSH_MASK_DRAW, "DRAW", 0, "Draw", ""},
1987  {BRUSH_MASK_SMOOTH, "SMOOTH", 0, "Smooth", ""},
1988  {0, NULL, 0, NULL, NULL},
1989  };
1990 
1991  static const EnumPropertyItem brush_blur_mode_items[] = {
1992  {KERNEL_BOX, "BOX", 0, "Box", ""},
1993  {KERNEL_GAUSSIAN, "GAUSSIAN", 0, "Gaussian", ""},
1994  {0, NULL, 0, NULL, NULL},
1995  };
1996 
1997  static const EnumPropertyItem brush_gradient_items[] = {
1998  {BRUSH_GRADIENT_PRESSURE, "PRESSURE", 0, "Pressure", ""},
1999  {BRUSH_GRADIENT_SPACING_REPEAT, "SPACING_REPEAT", 0, "Repeat", ""},
2000  {BRUSH_GRADIENT_SPACING_CLAMP, "SPACING_CLAMP", 0, "Clamp", ""},
2001  {0, NULL, 0, NULL, NULL},
2002  };
2003 
2004  static const EnumPropertyItem brush_gradient_fill_items[] = {
2005  {BRUSH_GRADIENT_LINEAR, "LINEAR", 0, "Linear", ""},
2006  {BRUSH_GRADIENT_RADIAL, "RADIAL", 0, "Radial", ""},
2007  {0, NULL, 0, NULL, NULL},
2008  };
2009 
2010  static const EnumPropertyItem brush_mask_pressure_items[] = {
2011  {0, "NONE", 0, "Off", ""},
2012  {BRUSH_MASK_PRESSURE_RAMP, "RAMP", ICON_STYLUS_PRESSURE, "Ramp", ""},
2013  {BRUSH_MASK_PRESSURE_CUTOFF, "CUTOFF", ICON_STYLUS_PRESSURE, "Cutoff", ""},
2014  {0, NULL, 0, NULL, NULL},
2015  };
2016 
2017  static const EnumPropertyItem brush_size_unit_items[] = {
2018  {0, "VIEW", 0, "View", "Measure brush size relative to the view"},
2019  {BRUSH_LOCK_SIZE, "SCENE", 0, "Scene", "Measure brush size relative to the scene"},
2020  {0, NULL, 0, NULL, NULL},
2021  };
2022 
2023  static const EnumPropertyItem color_gradient_items[] = {
2024  {0, "COLOR", 0, "Color", "Paint with a single color"},
2025  {BRUSH_USE_GRADIENT, "GRADIENT", 0, "Gradient", "Paint with a gradient"},
2026  {0, NULL, 0, NULL, NULL},
2027  };
2028 
2029  static const EnumPropertyItem brush_spacing_unit_items[] = {
2030  {0, "VIEW", 0, "View", "Calculate brush spacing relative to the view"},
2032  "SCENE",
2033  0,
2034  "Scene",
2035  "Calculate brush spacing relative to the scene using the stroke location"},
2036  {0, NULL, 0, NULL, NULL},
2037  };
2038 
2039  static const EnumPropertyItem brush_jitter_unit_items[] = {
2040  {BRUSH_ABSOLUTE_JITTER, "VIEW", 0, "View", "Jittering happens in screen space, in pixels"},
2041  {0, "BRUSH", 0, "Brush", "Jittering happens relative to the brush size"},
2042  {0, NULL, 0, NULL, NULL},
2043  };
2044 
2045  static const EnumPropertyItem falloff_shape_unit_items[] = {
2046  {0, "SPHERE", 0, "Sphere", "Apply brush influence in a Sphere, outwards from the center"},
2048  "PROJECTED",
2049  0,
2050  "Projected",
2051  "Apply brush influence in a 2D circle, projected from the view"},
2052  {0, NULL, 0, NULL, NULL},
2053  };
2054 
2055  static const EnumPropertyItem brush_curve_preset_items[] = {
2056  {BRUSH_CURVE_CUSTOM, "CUSTOM", ICON_RNDCURVE, "Custom", ""},
2057  {BRUSH_CURVE_SMOOTH, "SMOOTH", ICON_SMOOTHCURVE, "Smooth", ""},
2058  {BRUSH_CURVE_SMOOTHER, "SMOOTHER", ICON_SMOOTHCURVE, "Smoother", ""},
2059  {BRUSH_CURVE_SPHERE, "SPHERE", ICON_SPHERECURVE, "Sphere", ""},
2060  {BRUSH_CURVE_ROOT, "ROOT", ICON_ROOTCURVE, "Root", ""},
2061  {BRUSH_CURVE_SHARP, "SHARP", ICON_SHARPCURVE, "Sharp", ""},
2062  {BRUSH_CURVE_LIN, "LIN", ICON_LINCURVE, "Linear", ""},
2063  {BRUSH_CURVE_POW4, "POW4", ICON_SHARPCURVE, "Sharper", ""},
2064  {BRUSH_CURVE_INVSQUARE, "INVSQUARE", ICON_INVERSESQUARECURVE, "Inverse Square", ""},
2065  {BRUSH_CURVE_CONSTANT, "CONSTANT", ICON_NOCURVE, "Constant", ""},
2066  {0, NULL, 0, NULL, NULL},
2067  };
2068 
2069  static const EnumPropertyItem brush_deformation_target_items[] = {
2071  "GEOMETRY",
2072  0,
2073  "Geometry",
2074  "Brush deformation displaces the vertices of the mesh"},
2076  "CLOTH_SIM",
2077  0,
2078  "Cloth Simulation",
2079  "Brush deforms the mesh by deforming the constraints of a cloth simulation"},
2080  {0, NULL, 0, NULL, NULL},
2081  };
2082 
2083  static const EnumPropertyItem brush_elastic_deform_type_items[] = {
2084  {BRUSH_ELASTIC_DEFORM_GRAB, "GRAB", 0, "Grab", ""},
2085  {BRUSH_ELASTIC_DEFORM_GRAB_BISCALE, "GRAB_BISCALE", 0, "Bi-Scale Grab", ""},
2086  {BRUSH_ELASTIC_DEFORM_GRAB_TRISCALE, "GRAB_TRISCALE", 0, "Tri-Scale Grab", ""},
2087  {BRUSH_ELASTIC_DEFORM_SCALE, "SCALE", 0, "Scale", ""},
2088  {BRUSH_ELASTIC_DEFORM_TWIST, "TWIST", 0, "Twist", ""},
2089  {0, NULL, 0, NULL, NULL},
2090  };
2091 
2092  static const EnumPropertyItem brush_snake_hook_deform_type_items[] = {
2094  "FALLOFF",
2095  0,
2096  "Radius Falloff",
2097  "Applies the brush falloff in the tip of the brush"},
2099  "ELASTIC",
2100  0,
2101  "Elastic",
2102  "Modifies the entire mesh using elastic deform"},
2103  {0, NULL, 0, NULL, NULL},
2104  };
2105 
2106  static const EnumPropertyItem brush_cloth_deform_type_items[] = {
2107  {BRUSH_CLOTH_DEFORM_DRAG, "DRAG", 0, "Drag", ""},
2108  {BRUSH_CLOTH_DEFORM_PUSH, "PUSH", 0, "Push", ""},
2109  {BRUSH_CLOTH_DEFORM_PINCH_POINT, "PINCH_POINT", 0, "Pinch Point", ""},
2111  "PINCH_PERPENDICULAR",
2112  0,
2113  "Pinch Perpendicular",
2114  ""},
2115  {BRUSH_CLOTH_DEFORM_INFLATE, "INFLATE", 0, "Inflate", ""},
2116  {BRUSH_CLOTH_DEFORM_GRAB, "GRAB", 0, "Grab", ""},
2117  {BRUSH_CLOTH_DEFORM_EXPAND, "EXPAND", 0, "Expand", ""},
2118  {BRUSH_CLOTH_DEFORM_SNAKE_HOOK, "SNAKE_HOOK", 0, "Snake Hook", ""},
2119  {0, NULL, 0, NULL, NULL},
2120  };
2121 
2122  static const EnumPropertyItem brush_cloth_force_falloff_type_items[] = {
2123  {BRUSH_CLOTH_FORCE_FALLOFF_RADIAL, "RADIAL", 0, "Radial", ""},
2124  {BRUSH_CLOTH_FORCE_FALLOFF_PLANE, "PLANE", 0, "Plane", ""},
2125  {0, NULL, 0, NULL, NULL},
2126  };
2127 
2128  static const EnumPropertyItem brush_boundary_falloff_type_items[] = {
2130  "CONSTANT",
2131  0,
2132  "Constant",
2133  "Applies the same deformation in the entire boundary"},
2135  "RADIUS",
2136  0,
2137  "Brush Radius",
2138  "Applies the deformation in a localized area limited by the brush radius"},
2140  "LOOP",
2141  0,
2142  "Loop",
2143  "Applies the brush falloff in a loop pattern"},
2145  "LOOP_INVERT",
2146  0,
2147  "Loop and Invert",
2148  "Applies the falloff radius in a loop pattern, inverting the displacement direction in "
2149  "each pattern repetition"},
2150  {0, NULL, 0, NULL, NULL},
2151  };
2152 
2153  static const EnumPropertyItem brush_cloth_simulation_area_type_items[] = {
2155  "LOCAL",
2156  0,
2157  "Local",
2158  "Simulates only a specific area around the brush limited by a fixed radius"},
2159  {BRUSH_CLOTH_SIMULATION_AREA_GLOBAL, "GLOBAL", 0, "Global", "Simulates the entire mesh"},
2161  "DYNAMIC",
2162  0,
2163  "Dynamic",
2164  "The active simulation area moves with the brush"},
2165  {0, NULL, 0, NULL, NULL},
2166  };
2167 
2168  static const EnumPropertyItem brush_smooth_deform_type_items[] = {
2170  "LAPLACIAN",
2171  0,
2172  "Laplacian",
2173  "Smooths the surface and the volume"},
2175  "SURFACE",
2176  0,
2177  "Surface",
2178  "Smooths the surface of the mesh, preserving the volume"},
2179  {0, NULL, 0, NULL, NULL},
2180  };
2181 
2182  static const EnumPropertyItem brush_pose_deform_type_items[] = {
2183  {BRUSH_POSE_DEFORM_ROTATE_TWIST, "ROTATE_TWIST", 0, "Rotate/Twist", ""},
2184  {BRUSH_POSE_DEFORM_SCALE_TRASLATE, "SCALE_TRANSLATE", 0, "Scale/Translate", ""},
2185  {BRUSH_POSE_DEFORM_SQUASH_STRETCH, "SQUASH_STRETCH", 0, "Squash & Stretch", ""},
2186  {0, NULL, 0, NULL, NULL},
2187  };
2188 
2189  static const EnumPropertyItem brush_pose_origin_type_items[] = {
2191  "TOPOLOGY",
2192  0,
2193  "Topology",
2194  "Sets the rotation origin automatically using the topology and shape of the mesh as a "
2195  "guide"},
2197  "FACE_SETS",
2198  0,
2199  "Face Sets",
2200  "Creates a pose segment per face sets, starting from the active face set"},
2202  "FACE_SETS_FK",
2203  0,
2204  "Face Sets FK",
2205  "Simulates an FK deformation using the Face Set under the cursor as control"},
2206  {0, NULL, 0, NULL, NULL},
2207  };
2208 
2209  static const EnumPropertyItem brush_smear_deform_type_items[] = {
2210  {BRUSH_SMEAR_DEFORM_DRAG, "DRAG", 0, "Drag", ""},
2211  {BRUSH_SMEAR_DEFORM_PINCH, "PINCH", 0, "Pinch", ""},
2212  {BRUSH_SMEAR_DEFORM_EXPAND, "EXPAND", 0, "Expand", ""},
2213  {0, NULL, 0, NULL, NULL},
2214  };
2215 
2216  static const EnumPropertyItem brush_slide_deform_type_items[] = {
2217  {BRUSH_SLIDE_DEFORM_DRAG, "DRAG", 0, "Drag", ""},
2218  {BRUSH_SLIDE_DEFORM_PINCH, "PINCH", 0, "Pinch", ""},
2219  {BRUSH_SLIDE_DEFORM_EXPAND, "EXPAND", 0, "Expand", ""},
2220  {0, NULL, 0, NULL, NULL},
2221  };
2222 
2223  static const EnumPropertyItem brush_boundary_deform_type_items[] = {
2224  {BRUSH_BOUNDARY_DEFORM_BEND, "BEND", 0, "Bend", ""},
2225  {BRUSH_BOUNDARY_DEFORM_EXPAND, "EXPAND", 0, "Expand", ""},
2226  {BRUSH_BOUNDARY_DEFORM_INFLATE, "INFLATE", 0, "Inflate", ""},
2227  {BRUSH_BOUNDARY_DEFORM_GRAB, "GRAB", 0, "Grab", ""},
2228  {BRUSH_BOUNDARY_DEFORM_TWIST, "TWIST", 0, "Twist", ""},
2229  {BRUSH_BOUNDARY_DEFORM_SMOOTH, "SMOOTH", 0, "Smooth", ""},
2230  {0, NULL, 0, NULL, NULL},
2231  };
2232 
2233  srna = RNA_def_struct(brna, "Brush", "ID");
2235  srna, "Brush", "Brush data-block for storing brush settings for painting and sculpting");
2236  RNA_def_struct_ui_icon(srna, ICON_BRUSH_DATA);
2237 
2238  /* enums */
2239  prop = RNA_def_property(srna, "blend", PROP_ENUM, PROP_NONE);
2240  RNA_def_property_enum_items(prop, prop_blend_items);
2241  RNA_def_property_ui_text(prop, "Blending Mode", "Brush blending mode");
2242  RNA_def_property_update(prop, 0, "rna_Brush_update");
2243 
2249  prop = RNA_def_property(srna, "sculpt_tool", PROP_ENUM, PROP_NONE);
2251  RNA_def_property_ui_text(prop, "Sculpt Tool", "");
2252  RNA_def_property_update(prop, 0, "rna_Brush_update_and_reset_icon");
2253 
2254  prop = RNA_def_property(srna, "uv_sculpt_tool", PROP_ENUM, PROP_NONE);
2256  RNA_def_property_ui_text(prop, "Sculpt Tool", "");
2257  RNA_def_property_update(prop, 0, "rna_Brush_update_and_reset_icon");
2258 
2259  prop = RNA_def_property(srna, "vertex_tool", PROP_ENUM, PROP_NONE);
2260  RNA_def_property_enum_sdna(prop, NULL, "vertexpaint_tool");
2262  RNA_def_property_ui_text(prop, "Vertex Paint Tool", "");
2263  RNA_def_property_update(prop, 0, "rna_Brush_update_and_reset_icon");
2264 
2265  prop = RNA_def_property(srna, "weight_tool", PROP_ENUM, PROP_NONE);
2266  RNA_def_property_enum_sdna(prop, NULL, "weightpaint_tool");
2268  RNA_def_property_ui_text(prop, "Weight Paint Tool", "");
2269  RNA_def_property_update(prop, 0, "rna_Brush_update_and_reset_icon");
2270 
2271  prop = RNA_def_property(srna, "image_tool", PROP_ENUM, PROP_NONE);
2272  RNA_def_property_enum_sdna(prop, NULL, "imagepaint_tool");
2274  RNA_def_property_ui_text(prop, "Image Paint Tool", "");
2275  RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, "rna_Brush_update_and_reset_icon");
2276 
2277  prop = RNA_def_property(srna, "gpencil_tool", PROP_ENUM, PROP_NONE);
2278  RNA_def_property_enum_sdna(prop, NULL, "gpencil_tool");
2280  RNA_def_property_ui_text(prop, "Grease Pencil Draw Tool", "");
2282 
2283  prop = RNA_def_property(srna, "gpencil_vertex_tool", PROP_ENUM, PROP_NONE);
2284  RNA_def_property_enum_sdna(prop, NULL, "gpencil_vertex_tool");
2286  RNA_def_property_ui_text(prop, "Grease Pencil Vertex Paint Tool", "");
2288 
2289  prop = RNA_def_property(srna, "gpencil_sculpt_tool", PROP_ENUM, PROP_NONE);
2290  RNA_def_property_enum_sdna(prop, NULL, "gpencil_sculpt_tool");
2292  RNA_def_property_ui_text(prop, "Grease Pencil Sculpt Paint Tool", "");
2294 
2295  prop = RNA_def_property(srna, "gpencil_weight_tool", PROP_ENUM, PROP_NONE);
2296  RNA_def_property_enum_sdna(prop, NULL, "gpencil_weight_tool");
2298  RNA_def_property_ui_text(prop, "Grease Pencil Weight Paint Tool", "");
2300 
2303  prop = RNA_def_property(srna, "direction", PROP_ENUM, PROP_NONE);
2306  RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Brush_direction_itemf");
2307  RNA_def_property_ui_text(prop, "Direction", "");
2308  RNA_def_property_update(prop, 0, "rna_Brush_update");
2309 
2310  prop = RNA_def_property(srna, "stroke_method", PROP_ENUM, PROP_NONE);
2313  RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Brush_stroke_itemf");
2314  RNA_def_property_ui_text(prop, "Stroke Method", "");
2315  RNA_def_property_update(prop, 0, "rna_Brush_stroke_update");
2316 
2317  prop = RNA_def_property(srna, "sculpt_plane", PROP_ENUM, PROP_NONE);
2318  RNA_def_property_enum_items(prop, brush_sculpt_plane_items);
2319  RNA_def_property_ui_text(prop, "Sculpt Plane", "");
2320  RNA_def_property_update(prop, 0, "rna_Brush_update");
2321 
2322  prop = RNA_def_property(srna, "mask_tool", PROP_ENUM, PROP_NONE);
2323  RNA_def_property_enum_items(prop, brush_mask_tool_items);
2324  RNA_def_property_ui_text(prop, "Mask Tool", "");
2325  RNA_def_property_update(prop, 0, "rna_Brush_update");
2326 
2327  prop = RNA_def_property(srna, "curve_preset", PROP_ENUM, PROP_NONE);
2328  RNA_def_property_enum_items(prop, brush_curve_preset_items);
2329  RNA_def_property_ui_text(prop, "Curve Preset", "");
2330  RNA_def_property_update(prop, 0, "rna_Brush_update");
2331 
2332  prop = RNA_def_property(srna, "deform_target", PROP_ENUM, PROP_NONE);
2333  RNA_def_property_enum_items(prop, brush_deformation_target_items);
2335  prop, "Deformation Target", "How the deformation of the brush will affect the object");
2336  RNA_def_property_update(prop, 0, "rna_Brush_update");
2337 
2338  prop = RNA_def_property(srna, "elastic_deform_type", PROP_ENUM, PROP_NONE);
2339  RNA_def_property_enum_items(prop, brush_elastic_deform_type_items);
2340  RNA_def_property_ui_text(prop, "Deformation", "Deformation type that is used in the brush");
2341  RNA_def_property_update(prop, 0, "rna_Brush_update");
2342 
2343  prop = RNA_def_property(srna, "snake_hook_deform_type", PROP_ENUM, PROP_NONE);
2344  RNA_def_property_enum_items(prop, brush_snake_hook_deform_type_items);
2345  RNA_def_property_ui_text(prop, "Deformation", "Deformation type that is used in the brush");
2346  RNA_def_property_update(prop, 0, "rna_Brush_update");
2347 
2348  prop = RNA_def_property(srna, "cloth_deform_type", PROP_ENUM, PROP_NONE);
2349  RNA_def_property_enum_items(prop, brush_cloth_deform_type_items);
2350  RNA_def_property_ui_text(prop, "Deformation", "Deformation type that is used in the brush");
2351  RNA_def_property_update(prop, 0, "rna_Brush_update");
2352 
2353  prop = RNA_def_property(srna, "cloth_force_falloff_type", PROP_ENUM, PROP_NONE);
2354  RNA_def_property_enum_items(prop, brush_cloth_force_falloff_type_items);
2356  prop, "Force Falloff", "Shape used in the brush to apply force to the cloth");
2357  RNA_def_property_update(prop, 0, "rna_Brush_update");
2358 
2359  prop = RNA_def_property(srna, "cloth_simulation_area_type", PROP_ENUM, PROP_NONE);
2360  RNA_def_property_enum_items(prop, brush_cloth_simulation_area_type_items);
2362  prop,
2363  "Simulation Area",
2364  "Part of the mesh that is going to be simulated when the stroke is active");
2365  RNA_def_property_update(prop, 0, "rna_Brush_update");
2366 
2367  prop = RNA_def_property(srna, "boundary_falloff_type", PROP_ENUM, PROP_NONE);
2368  RNA_def_property_enum_items(prop, brush_boundary_falloff_type_items);
2370  prop, "Boundary Falloff", "How the brush falloff is applied across the boundary");
2371  RNA_def_property_update(prop, 0, "rna_Brush_update");
2372 
2373  prop = RNA_def_property(srna, "smooth_deform_type", PROP_ENUM, PROP_NONE);
2374  RNA_def_property_enum_items(prop, brush_smooth_deform_type_items);
2375  RNA_def_property_ui_text(prop, "Deformation", "Deformation type that is used in the brush");
2376  RNA_def_property_update(prop, 0, "rna_Brush_update");
2377 
2378  prop = RNA_def_property(srna, "smear_deform_type", PROP_ENUM, PROP_NONE);
2379  RNA_def_property_enum_items(prop, brush_smear_deform_type_items);
2380  RNA_def_property_ui_text(prop, "Deformation", "Deformation type that is used in the brush");
2381  RNA_def_property_update(prop, 0, "rna_Brush_update");
2382 
2383  prop = RNA_def_property(srna, "slide_deform_type", PROP_ENUM, PROP_NONE);
2384  RNA_def_property_enum_items(prop, brush_slide_deform_type_items);
2385  RNA_def_property_ui_text(prop, "Deformation", "Deformation type that is used in the brush");
2386  RNA_def_property_update(prop, 0, "rna_Brush_update");
2387 
2388  prop = RNA_def_property(srna, "boundary_deform_type", PROP_ENUM, PROP_NONE);
2389  RNA_def_property_enum_items(prop, brush_boundary_deform_type_items);
2390  RNA_def_property_ui_text(prop, "Deformation", "Deformation type that is used in the brush");
2391  RNA_def_property_update(prop, 0, "rna_Brush_update");
2392 
2393  prop = RNA_def_property(srna, "pose_deform_type", PROP_ENUM, PROP_NONE);
2394  RNA_def_property_enum_items(prop, brush_pose_deform_type_items);
2395  RNA_def_property_ui_text(prop, "Deformation", "Deformation type that is used in the brush");
2396  RNA_def_property_update(prop, 0, "rna_Brush_update");
2397 
2398  prop = RNA_def_property(srna, "pose_origin_type", PROP_ENUM, PROP_NONE);
2399  RNA_def_property_enum_items(prop, brush_pose_origin_type_items);
2401  "Rotation Origins",
2402  "Method to set the rotation origins for the segments of the brush");
2403  RNA_def_property_update(prop, 0, "rna_Brush_update");
2404 
2405  prop = RNA_def_property(srna, "jitter_unit", PROP_ENUM, PROP_NONE); /* as an enum */
2407  RNA_def_property_enum_items(prop, brush_jitter_unit_items);
2409  prop, "Jitter Unit", "Jitter in screen space or relative to brush size");
2410  RNA_def_property_update(prop, 0, "rna_Brush_update");
2411 
2412  prop = RNA_def_property(srna, "falloff_shape", PROP_ENUM, PROP_NONE); /* as an enum */
2413  RNA_def_property_enum_bitflag_sdna(prop, NULL, "falloff_shape");
2414  RNA_def_property_enum_items(prop, falloff_shape_unit_items);
2415  RNA_def_property_ui_text(prop, "Falloff Shape", "Use projected or spherical falloff");
2416  RNA_def_property_update(prop, 0, "rna_Brush_update");
2417 
2418  /* number values */
2419  prop = RNA_def_property(srna, "size", PROP_INT, PROP_PIXEL);
2420  RNA_def_property_int_funcs(prop, NULL, "rna_Brush_set_size", NULL);
2423  RNA_def_property_ui_text(prop, "Radius", "Radius of the brush in pixels");
2424  RNA_def_property_update(prop, 0, "rna_Brush_size_update");
2425 
2426  prop = RNA_def_property(srna, "unprojected_radius", PROP_FLOAT, PROP_DISTANCE);
2427  RNA_def_property_float_funcs(prop, NULL, "rna_Brush_set_unprojected_radius", NULL);
2428  RNA_def_property_range(prop, 0.001, FLT_MAX);
2429  RNA_def_property_ui_range(prop, 0.001, 1, 1, -1);
2430  RNA_def_property_ui_text(prop, "Unprojected Radius", "Radius of brush in Blender units");
2431  RNA_def_property_update(prop, 0, "rna_Brush_size_update");
2432 
2433  prop = RNA_def_property(srna, "jitter", PROP_FLOAT, PROP_NONE);
2434  RNA_def_property_float_sdna(prop, NULL, "jitter");
2435  RNA_def_property_range(prop, 0.0f, 1000.0f);
2436  RNA_def_property_ui_range(prop, 0.0f, 2.0f, 0.1, 4);
2437  RNA_def_property_ui_text(prop, "Jitter", "Jitter the position of the brush while painting");
2438  RNA_def_property_update(prop, 0, "rna_Brush_update");
2439 
2440  prop = RNA_def_property(srna, "jitter_absolute", PROP_INT, PROP_PIXEL);
2441  RNA_def_property_int_sdna(prop, NULL, "jitter_absolute");
2442  RNA_def_property_range(prop, 0, 1000000);
2444  prop, "Jitter", "Jitter the position of the brush in pixels while painting");
2445  RNA_def_property_update(prop, 0, "rna_Brush_update");
2446 
2447  prop = RNA_def_property(srna, "spacing", PROP_INT, PROP_PERCENTAGE);
2448  RNA_def_property_int_sdna(prop, NULL, "spacing");
2449  RNA_def_property_range(prop, 1, 1000);
2450  RNA_def_property_ui_range(prop, 1, 500, 5, -1);
2452  prop, "Spacing", "Spacing between brush daubs as a percentage of brush diameter");
2453  RNA_def_property_update(prop, 0, "rna_Brush_update");
2454 
2455  prop = RNA_def_property(srna, "grad_spacing", PROP_INT, PROP_PIXEL);
2456  RNA_def_property_int_sdna(prop, NULL, "gradient_spacing");
2457  RNA_def_property_range(prop, 1, 10000);
2458  RNA_def_property_ui_range(prop, 1, 10000, 5, -1);
2460  prop, "Gradient Spacing", "Spacing before brush gradient goes full circle");
2461  RNA_def_property_update(prop, 0, "rna_Brush_update");
2462 
2463  prop = RNA_def_property(srna, "smooth_stroke_radius", PROP_INT, PROP_PIXEL);
2464  RNA_def_property_range(prop, 10, 200);
2466  prop, "Smooth Stroke Radius", "Minimum distance from last point before stroke continues");
2467  RNA_def_property_update(prop, 0, "rna_Brush_update");
2468 
2469  prop = RNA_def_property(srna, "smooth_stroke_factor", PROP_FLOAT, PROP_FACTOR);
2470  RNA_def_property_range(prop, 0.5, 0.99);
2471  RNA_def_property_ui_text(prop, "Smooth Stroke Factor", "Higher values give a smoother stroke");
2472  RNA_def_property_update(prop, 0, "rna_Brush_update");
2473 
2474  prop = RNA_def_property(srna, "rate", PROP_FLOAT, PROP_NONE);
2475  RNA_def_property_float_sdna(prop, NULL, "rate");
2476  RNA_def_property_range(prop, 0.0001f, 10000.0f);
2477  RNA_def_property_ui_range(prop, 0.01f, 1.0f, 1, 3);
2478  RNA_def_property_ui_text(prop, "Rate", "Interval between paints for Airbrush");
2479  RNA_def_property_update(prop, 0, "rna_Brush_update");
2480 
2481  prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR_GAMMA);
2482  RNA_def_property_range(prop, 0.0, 1.0);
2483  RNA_def_property_float_sdna(prop, NULL, "rgb");
2484  RNA_def_property_ui_text(prop, "Color", "");
2485  RNA_def_property_update(prop, 0, "rna_Brush_update");
2486 
2487  prop = RNA_def_property(srna, "secondary_color", PROP_FLOAT, PROP_COLOR_GAMMA);
2488  RNA_def_property_range(prop, 0.0, 1.0);
2489  RNA_def_property_float_sdna(prop, NULL, "secondary_rgb");
2490  RNA_def_property_ui_text(prop, "Secondary Color", "");
2491  RNA_def_property_update(prop, 0, "rna_Brush_update");
2492 
2493  prop = RNA_def_property(srna, "weight", PROP_FLOAT, PROP_FACTOR);
2494  RNA_def_property_range(prop, 0.0f, 1.0f);
2495  RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
2496  RNA_def_property_ui_text(prop, "Weight", "Vertex weight when brush is applied");
2497  RNA_def_property_update(prop, 0, "rna_Brush_update");
2498 
2499  prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_FACTOR);
2500  RNA_def_property_float_sdna(prop, NULL, "alpha");
2501  RNA_def_property_range(prop, 0.0f, 10.0f);
2502  RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
2504  prop, "Strength", "How powerful the effect of the brush is when applied");
2505  RNA_def_property_update(prop, 0, "rna_Brush_update");
2506 
2507  prop = RNA_def_property(srna, "flow", PROP_FLOAT, PROP_FACTOR);
2508  RNA_def_property_float_sdna(prop, NULL, "flow");
2509  RNA_def_property_range(prop, 0.0f, 1.0f);
2510  RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
2511  RNA_def_property_ui_text(prop, "Flow", "Amount of paint that is applied per stroke sample");
2512  RNA_def_property_update(prop, 0, "rna_Brush_update");
2513 
2514  prop = RNA_def_property(srna, "wet_mix", PROP_FLOAT, PROP_FACTOR);
2515  RNA_def_property_float_sdna(prop, NULL, "wet_mix");
2516  RNA_def_property_range(prop, 0.0f, 1.0f);
2517  RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
2519  prop, "Wet Mix", "Amount of paint that is picked from the surface into the brush color");
2520  RNA_def_property_update(prop, 0, "rna_Brush_update");
2521 
2522  prop = RNA_def_property(srna, "wet_persistence", PROP_FLOAT, PROP_FACTOR);
2523  RNA_def_property_float_sdna(prop, NULL, "wet_persistence");
2524  RNA_def_property_range(prop, 0.0f, 1.0f);
2525  RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
2527  prop,
2528  "Wet Persistence",
2529  "Amount of wet paint that stays in the brush after applying paint to the surface");
2530  RNA_def_property_update(prop, 0, "rna_Brush_update");
2531 
2532  prop = RNA_def_property(srna, "density", PROP_FLOAT, PROP_FACTOR);
2533  RNA_def_property_float_sdna(prop, NULL, "density");
2534  RNA_def_property_range(prop, 0.0f, 1.0f);
2535  RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
2537  prop, "Density", "Amount of random elements that are going to be affected by the brush");
2538  RNA_def_property_update(prop, 0, "rna_Brush_update");
2539 
2540  prop = RNA_def_property(srna, "tip_scale_x", PROP_FLOAT, PROP_FACTOR);
2541  RNA_def_property_float_sdna(prop, NULL, "tip_scale_x");
2542  RNA_def_property_range(prop, 0.0f, 1.0f);
2543  RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
2544  RNA_def_property_ui_text(prop, "Tip Scale X", "Scale of the brush tip in the X axis");
2545  RNA_def_property_update(prop, 0, "rna_Brush_update");
2546 
2547  prop = RNA_def_property(srna, "use_hardness_pressure", PROP_BOOLEAN, PROP_NONE);
2549  RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
2550  RNA_def_property_ui_text(prop, "Use Pressure for Hardness", "Use pressure to modulate hardness");
2552  RNA_def_property_update(prop, 0, "rna_Brush_update");
2553 
2554  prop = RNA_def_property(srna, "invert_hardness_pressure", PROP_BOOLEAN, PROP_NONE);
2556  RNA_def_property_ui_icon(prop, ICON_ARROW_LEFTRIGHT, 0);
2558  prop, "Invert Pressure for Hardness", "Invert the modulation of pressure in hardness");
2560  RNA_def_property_update(prop, 0, "rna_Brush_update");
2561 
2562  prop = RNA_def_property(srna, "use_flow_pressure", PROP_BOOLEAN, PROP_NONE);
2564  RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
2565  RNA_def_property_ui_text(prop, "Use Pressure for Flow", "Use pressure to modulate flow");
2567  RNA_def_property_update(prop, 0, "rna_Brush_update");
2568 
2569  prop = RNA_def_property(srna, "invert_flow_pressure", PROP_BOOLEAN, PROP_NONE);
2571  RNA_def_property_ui_icon(prop, ICON_ARROW_LEFTRIGHT, 0);
2573  prop, "Invert Pressure for Flow", "Invert the modulation of pressure in flow");
2575  RNA_def_property_update(prop, 0, "rna_Brush_update");
2576 
2577  prop = RNA_def_property(srna, "use_wet_mix_pressure", PROP_BOOLEAN, PROP_NONE);
2579  RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
2580  RNA_def_property_ui_text(prop, "Use Pressure for Wet Mix", "Use pressure to modulate wet mix");
2582  RNA_def_property_update(prop, 0, "rna_Brush_update");
2583 
2584  prop = RNA_def_property(srna, "invert_wet_mix_pressure", PROP_BOOLEAN, PROP_NONE);
2586  RNA_def_property_ui_icon(prop, ICON_ARROW_LEFTRIGHT, 0);
2588  prop, "Invert Pressure for Wet Mix", "Invert the modulation of pressure in wet mix");
2590  RNA_def_property_update(prop, 0, "rna_Brush_update");
2591 
2592  prop = RNA_def_property(srna, "use_wet_persistence_pressure", PROP_BOOLEAN, PROP_NONE);
2594  RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
2596  prop, "Use Pressure for Wet Persistence", "Use pressure to modulate wet persistence");
2598  RNA_def_property_update(prop, 0, "rna_Brush_update");
2599 
2600  prop = RNA_def_property(srna, "invert_wet_persistence_pressure", PROP_BOOLEAN, PROP_NONE);
2602  prop, NULL, "paint_flags", BRUSH_PAINT_WET_PERSISTENCE_PRESSURE_INVERT);
2603  RNA_def_property_ui_icon(prop, ICON_ARROW_LEFTRIGHT, 0);
2605  "Invert Pressure for Wet Persistence",
2606  "Invert the modulation of pressure in wet persistence");
2608  RNA_def_property_update(prop, 0, "rna_Brush_update");
2609 
2610  prop = RNA_def_property(srna, "use_density_pressure", PROP_BOOLEAN, PROP_NONE);
2612  RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
2613  RNA_def_property_ui_text(prop, "Use Pressure for Density", "Use pressure to modulate density");
2615  RNA_def_property_update(prop, 0, "rna_Brush_update");
2616 
2617  prop = RNA_def_property(srna, "invert_density_pressure", PROP_BOOLEAN, PROP_NONE);
2619  RNA_def_property_ui_icon(prop, ICON_ARROW_LEFTRIGHT, 0);
2621  prop, "Invert Pressure for Density", "Invert the modulation of pressure in density");
2623  RNA_def_property_update(prop, 0, "rna_Brush_update");
2624 
2625  prop = RNA_def_property(srna, "dash_ratio", PROP_FLOAT, PROP_FACTOR);
2626  RNA_def_property_float_sdna(prop, NULL, "dash_ratio");
2627  RNA_def_property_range(prop, 0.0f, 1.0f);
2628  RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
2630  prop, "Dash Ratio", "Ratio of samples in a cycle that the brush is enabled");
2631  RNA_def_property_update(prop, 0, "rna_Brush_update");
2632 
2633  prop = RNA_def_property(srna, "dash_samples", PROP_INT, PROP_UNSIGNED);
2634  RNA_def_property_int_sdna(prop, NULL, "dash_samples");
2635  RNA_def_property_range(prop, 1, 10000);
2636  RNA_def_property_ui_range(prop, 1, 10000, 5, -1);
2638  prop, "Dash Length", "Length of a dash cycle measured in stroke samples");
2639  RNA_def_property_update(prop, 0, "rna_Brush_update");
2640 
2641  prop = RNA_def_property(srna, "plane_offset", PROP_FLOAT, PROP_DISTANCE);
2642  RNA_def_property_float_sdna(prop, NULL, "plane_offset");
2644  RNA_def_property_range(prop, -2.0f, 2.0f);
2645  RNA_def_property_ui_range(prop, -0.5f, 0.5f, 0.001, 3);
2647  prop,
2648  "Plane Offset",
2649  "Adjust plane on which the brush acts towards or away from the object surface");
2650  RNA_def_property_update(prop, 0, "rna_Brush_update");
2651 
2652  prop = RNA_def_property(srna, "plane_trim", PROP_FLOAT, PROP_DISTANCE);
2653  RNA_def_property_float_sdna(prop, NULL, "plane_trim");
2654  RNA_def_property_range(prop, 0, 1.0f);
2656  prop,
2657  "Plane Trim",
2658  "If a vertex is further away from offset plane than this, then it is not affected");
2659  RNA_def_property_update(prop, 0, "rna_Brush_update");
2660 
2661  prop = RNA_def_property(srna, "height", PROP_FLOAT, PROP_DISTANCE);
2662  RNA_def_property_float_sdna(prop, NULL, "height");
2663  RNA_def_property_float_default(prop, 0.5f);
2664  RNA_def_property_range(prop, 0, 1.0f);
2665  RNA_def_property_ui_range(prop, 0, 0.2f, 1, 3);
2667  prop, "Brush Height", "Affectable height of brush (layer height for layer tool, i.e.)");
2668  RNA_def_property_update(prop, 0, "rna_Brush_update");
2669 
2670  prop = RNA_def_property(srna, "texture_sample_bias", PROP_FLOAT, PROP_DISTANCE);
2671  RNA_def_property_float_sdna(prop, NULL, "texture_sample_bias");
2673  RNA_def_property_range(prop, -1, 1);
2674  RNA_def_property_ui_text(prop, "Texture Sample Bias", "Value added to texture samples");
2675  RNA_def_property_update(prop, 0, "rna_Brush_update");
2676 
2677  prop = RNA_def_property(srna, "normal_weight", PROP_FLOAT, PROP_FACTOR);
2678  RNA_def_property_float_sdna(prop, NULL, "normal_weight");
2680  RNA_def_property_range(prop, 0.0f, 1.0f);
2682  prop, "Normal Weight", "How much grab will pull vertexes out of surface during a grab");
2683  RNA_def_property_update(prop, 0, "rna_Brush_update");
2684 
2685  prop = RNA_def_property(srna, "elastic_deform_volume_preservation", PROP_FLOAT, PROP_NONE);
2686  RNA_def_property_float_sdna(prop, NULL, "elastic_deform_volume_preservation");
2687  RNA_def_property_range(prop, 0.0f, 0.9f);
2688  RNA_def_property_ui_range(prop, 0.0f, 0.9f, 0.01f, 3);
2690  "Volume Preservation",
2691  "Poisson ratio for elastic deformation. Higher values preserve volume "
2692  "more, but also lead to more bulging");
2693  RNA_def_property_update(prop, 0, "rna_Brush_update");
2694 
2695  prop = RNA_def_property(srna, "rake_factor", PROP_FLOAT, PROP_FACTOR);
2696  RNA_def_property_float_sdna(prop, NULL, "rake_factor");
2698  RNA_def_property_range(prop, 0.0f, 10.0f);
2699  RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
2700  RNA_def_property_ui_text(prop, "Rake", "How much grab will follow cursor rotation");
2701  RNA_def_property_update(prop, 0, "rna_Brush_update");
2702 
2703  prop = RNA_def_property(srna, "crease_pinch_factor", PROP_FLOAT, PROP_FACTOR);
2704  RNA_def_property_float_sdna(prop, NULL, "crease_pinch_factor");
2705  RNA_def_property_range(prop, 0.0f, 1.0f);
2706  RNA_def_property_ui_text(prop, "Crease Brush Pinch Factor", "How much the crease brush pinches");
2707  RNA_def_property_update(prop, 0, "rna_Brush_update");
2708 
2709  prop = RNA_def_property(srna, "pose_offset", PROP_FLOAT, PROP_FACTOR);
2710  RNA_def_property_float_sdna(prop, NULL, "pose_offset");
2711  RNA_def_property_range(prop, 0.0f, 2.0f);
2713  prop, "Pose Origin Offset", "Offset of the pose origin in relation to the brush radius");
2714  RNA_def_property_update(prop, 0, "rna_Brush_update");
2715 
2716  prop = RNA_def_property(srna, "disconnected_distance_max", PROP_FLOAT, PROP_DISTANCE);
2717  RNA_def_property_float_sdna(prop, NULL, "disconnected_distance_max");
2718  RNA_def_property_range(prop, 0.0f, 10.0f);
2720  "Max Element Distance",
2721  "Maximum distance to search for disconnected loose parts in the mesh");
2722  RNA_def_property_update(prop, 0, "rna_Brush_update");
2723 
2724  prop = RNA_def_property(srna, "boundary_offset", PROP_FLOAT, PROP_FACTOR);
2725  RNA_def_property_float_sdna(prop, NULL, "boundary_offset");
2726  RNA_def_property_range(prop, 0.0f, 30.0f);
2728  "Boundary Origin Offset",
2729  "Offset of the boundary origin in relation to the brush radius");
2730  RNA_def_property_update(prop, 0, "rna_Brush_update");
2731 
2732  prop = RNA_def_property(srna, "surface_smooth_shape_preservation", PROP_FLOAT, PROP_FACTOR);
2733  RNA_def_property_float_sdna(prop, NULL, "surface_smooth_shape_preservation");
2734  RNA_def_property_range(prop, 0.0f, 1.0f);
2736  prop, "Shape Preservation", "How much of the original shape is preserved when smoothing");
2737  RNA_def_property_update(prop, 0, "rna_Brush_update");
2738 
2739  prop = RNA_def_property(srna, "surface_smooth_current_vertex", PROP_FLOAT, PROP_FACTOR);
2740  RNA_def_property_float_sdna(prop, NULL, "surface_smooth_current_vertex");
2741  RNA_def_property_range(prop, 0.0f, 1.0f);
2743  prop,
2744  "Per Vertex Displacement",
2745  "How much the position of each individual vertex influences the final result");
2746  RNA_def_property_update(prop, 0, "rna_Brush_update");
2747 
2748  prop = RNA_def_property(srna, "surface_smooth_iterations", PROP_INT, PROP_UNSIGNED);
2749  RNA_def_property_int_sdna(prop, NULL, "surface_smooth_iterations");
2750  RNA_def_property_range(prop, 1, 10);
2751  RNA_def_property_ui_range(prop, 1, 10, 1, 3);
2752  RNA_def_property_ui_text(prop, "Iterations", "Number of smoothing iterations per brush step");
2753  RNA_def_property_update(prop, 0, "rna_Brush_update");
2754 
2755  prop = RNA_def_property(srna, "multiplane_scrape_angle", PROP_FLOAT, PROP_FACTOR);
2756  RNA_def_property_float_sdna(prop, NULL, "multiplane_scrape_angle");
2757  RNA_def_property_range(prop, 0.0f, 160.0f);
2758  RNA_def_property_ui_text(prop, "Plane Angle", "Angle between the planes of the crease");
2759  RNA_def_property_update(prop, 0, "rna_Brush_update");
2760 
2761  prop = RNA_def_property(srna, "pose_smooth_iterations", PROP_INT, PROP_UNSIGNED);
2762  RNA_def_property_int_sdna(prop, NULL, "pose_smooth_iterations");
2763  RNA_def_property_range(prop, 0, 100);
2765  prop,
2766  "Smooth Iterations",
2767  "Smooth iterations applied after calculating the pose factor of each vertex");
2768  RNA_def_property_update(prop, 0, "rna_Brush_update");
2769 
2770  prop = RNA_def_property(srna, "pose_ik_segments", PROP_INT, PROP_UNSIGNED);
2771  RNA_def_property_int_sdna(prop, NULL, "pose_ik_segments");
2772  RNA_def_property_range(prop, 1, 20);
2773  RNA_def_property_ui_range(prop, 1, 20, 1, 3);
2775  prop,
2776  "Pose IK Segments",
2777  "Number of segments of the inverse kinematics chain that will deform the mesh");
2778  RNA_def_property_update(prop, 0, "rna_Brush_update");
2779 
2780  prop = RNA_def_property(srna, "tip_roundness", PROP_FLOAT, PROP_FACTOR);
2781  RNA_def_property_float_sdna(prop, NULL, "tip_roundness");
2782  RNA_def_property_range(prop, 0.0f, 1.0f);
2783  RNA_def_property_ui_text(prop, "Tip Roundness", "Roundness of the brush tip");
2784  RNA_def_property_update(prop, 0, "rna_Brush_update");
2785 
2786  prop = RNA_def_property(srna, "cloth_mass", PROP_FLOAT, PROP_FACTOR);
2787  RNA_def_property_float_sdna(prop, NULL, "cloth_mass");
2788  RNA_def_property_range(prop, 0.01f, 2.0f);
2789  RNA_def_property_ui_text(prop, "Cloth Mass", "Mass of each simulation particle");
2790  RNA_def_property_update(prop, 0, "rna_Brush_update");
2791 
2792  prop = RNA_def_property(srna, "cloth_damping", PROP_FLOAT, PROP_FACTOR);
2793  RNA_def_property_float_sdna(prop, NULL, "cloth_damping");
2794  RNA_def_property_range(prop, 0.01f, 1.0f);
2796  prop, "Cloth Damping", "How much the applied forces are propagated through the cloth");
2797  RNA_def_property_update(prop, 0, "rna_Brush_update");
2798 
2799  prop = RNA_def_property(srna, "cloth_sim_limit", PROP_FLOAT, PROP_FACTOR);
2800  RNA_def_property_float_sdna(prop, NULL, "cloth_sim_limit");
2801  RNA_def_property_range(prop, 0.1f, 10.0f);
2803  prop,
2804  "Simulation Limit",
2805  "Factor added relative to the size of the radius to limit the cloth simulation effects");
2806  RNA_def_property_update(prop, 0, "rna_Brush_update");
2807 
2808  prop = RNA_def_property(srna, "cloth_sim_falloff", PROP_FLOAT, PROP_FACTOR);
2809  RNA_def_property_float_sdna(prop, NULL, "cloth_sim_falloff");
2810  RNA_def_property_range(prop, 0.0f, 1.0f);
2812  "Simulation Falloff",
2813  "Area to apply deformation falloff to the effects of the simulation");
2814  RNA_def_property_update(prop, 0, "rna_Brush_update");
2815 
2816  prop = RNA_def_property(srna, "cloth_constraint_softbody_strength", PROP_FLOAT, PROP_FACTOR);
2817  RNA_def_property_float_sdna(prop, NULL, "cloth_constraint_softbody_strength");
2818  RNA_def_property_range(prop, 0.0f, 1.0f);
2820  prop,
2821  "Soft Body Plasticity",
2822  "How much the cloth preserves the original shape, acting as a soft body");
2823  RNA_def_property_update(prop, 0, "rna_Brush_update");
2824 
2825  prop = RNA_def_property(srna, "hardness", PROP_FLOAT, PROP_FACTOR);
2826  RNA_def_property_float_sdna(prop, NULL, "hardness");
2827  RNA_def_property_range(prop, 0.0f, 1.0f);
2829  prop, "Hardness", "How close the brush falloff starts from the edge of the brush");
2830  RNA_def_property_update(prop, 0, "rna_Brush_update");
2831 
2832  prop = RNA_def_property(
2833  srna, "automasking_boundary_edges_propagation_steps", PROP_INT, PROP_UNSIGNED);
2834  RNA_def_property_int_sdna(prop, NULL, "automasking_boundary_edges_propagation_steps");
2835  RNA_def_property_range(prop, 1, 20);
2836  RNA_def_property_ui_range(prop, 1, 20, 1, 3);
2838  "Propagation Steps",
2839  "Distance where boundary edge automasking is going to protect vertices "
2840  "from the fully masked edge");
2841  RNA_def_property_update(prop, 0, "rna_Brush_update");
2842 
2843  prop = RNA_def_property(srna, "auto_smooth_factor", PROP_FLOAT, PROP_FACTOR);
2844  RNA_def_property_float_sdna(prop, NULL, "autosmooth_factor");
2846  RNA_def_property_range(prop, 0.0f, 1.0f);
2847  RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
2849  prop, "Auto-Smooth", "Amount of smoothing to automatically apply to each stroke");
2850  RNA_def_property_update(prop, 0, "rna_Brush_update");
2851 
2852  prop = RNA_def_property(srna, "topology_rake_factor", PROP_FLOAT, PROP_FACTOR);
2853  RNA_def_property_float_sdna(prop, NULL, "topology_rake_factor");
2855  RNA_def_property_range(prop, 0.0f, 1.0f);
2856  RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
2858  "Topology Rake",
2859  "Automatically align edges to the brush direction to "
2860  "generate cleaner topology and define sharp features. "
2861  "Best used on low-poly meshes as it has a performance impact");
2862  RNA_def_property_update(prop, 0, "rna_Brush_update");
2863 
2864  prop = RNA_def_property(srna, "tilt_strength_factor", PROP_FLOAT, PROP_FACTOR);
2865  RNA_def_property_float_sdna(prop, NULL, "tilt_strength_factor");
2867  RNA_def_property_range(prop, 0.0f, 1.0f);
2868  RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
2870  prop, "Tilt Strength", "How much the tilt of the pen will affect the brush");
2871  RNA_def_property_update(prop, 0, "rna_Brush_update");
2872 
2873  prop = RNA_def_property(srna, "normal_radius_factor", PROP_FLOAT, PROP_FACTOR);
2874  RNA_def_property_float_sdna(prop, NULL, "normal_radius_factor");
2875  RNA_def_property_range(prop, 0.0f, 2.0f);
2876  RNA_def_property_ui_range(prop, 0.0f, 2.0f, 0.001, 3);
2878  "Normal Radius",
2879  "Ratio between the brush radius and the radius that is going to be "
2880  "used to sample the normal");
2881  RNA_def_property_update(prop, 0, "rna_Brush_update");
2882 
2883  prop = RNA_def_property(srna, "area_radius_factor", PROP_FLOAT, PROP_FACTOR);
2884  RNA_def_property_float_sdna(prop, NULL, "area_radius_factor");
2885  RNA_def_property_range(prop, 0.0f, 2.0f);
2886  RNA_def_property_ui_range(prop, 0.0f, 2.0f, 0.001, 3);
2888  "Area Radius",
2889  "Ratio between the brush radius and the radius that is going to be "
2890  "used to sample the area center");
2891  RNA_def_property_update(prop, 0, "rna_Brush_update");
2892 
2893  prop = RNA_def_property(srna, "wet_paint_radius_factor", PROP_FLOAT, PROP_FACTOR);
2894  RNA_def_property_float_sdna(prop, NULL, "wet_paint_radius_factor");
2895  RNA_def_property_range(prop, 0.0f, 2.0f);
2896  RNA_def_property_ui_range(prop, 0.0f, 2.0f, 0.001, 3);
2898  "Wet Paint Radius",
2899  "Ratio between the brush radius and the radius that is going to be "
2900  "used to sample the color to blend in wet paint");
2901  RNA_def_property_update(prop, 0, "rna_Brush_update");
2902 
2903  prop = RNA_def_property(srna, "stencil_pos", PROP_FLOAT, PROP_XYZ);
2904  RNA_def_property_float_sdna(prop, NULL, "stencil_pos");
2905  RNA_def_property_array(prop, 2);
2906  RNA_def_property_ui_text(prop, "Stencil Position", "Position of stencil in viewport");
2907  RNA_def_property_update(prop, 0, "rna_Brush_update");
2908 
2909  prop = RNA_def_property(srna, "stencil_dimension", PROP_FLOAT, PROP_XYZ);
2910  RNA_def_property_float_sdna(prop, NULL, "stencil_dimension");
2911  RNA_def_property_array(prop, 2);
2912  RNA_def_property_ui_text(prop, "Stencil Dimensions", "Dimensions of stencil in viewport");
2913  RNA_def_property_update(prop, 0, "rna_Brush_update");
2914 
2915  prop = RNA_def_property(srna, "mask_stencil_pos", PROP_FLOAT, PROP_XYZ);
2916  RNA_def_property_float_sdna(prop, NULL, "mask_stencil_pos");
2917  RNA_def_property_array(prop, 2);
2918  RNA_def_property_ui_text(prop, "Mask Stencil Position", "Position of mask stencil in viewport");
2919  RNA_def_property_update(prop, 0, "rna_Brush_update");
2920 
2921  prop = RNA_def_property(srna, "mask_stencil_dimension", PROP_FLOAT, PROP_XYZ);
2922  RNA_def_property_float_sdna(prop, NULL, "mask_stencil_dimension");
2923  RNA_def_property_array(prop, 2);
2925  prop, "Mask Stencil Dimensions", "Dimensions of mask stencil in viewport");
2926  RNA_def_property_update(prop, 0, "rna_Brush_update");
2927 
2928  prop = RNA_def_property(srna, "sharp_threshold", PROP_FLOAT, PROP_NONE);
2929  RNA_def_property_range(prop, 0.0, 100.0);
2930  RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 3);
2931  RNA_def_property_float_sdna(prop, NULL, "sharp_threshold");
2933  prop, "Sharp Threshold", "Threshold below which, no sharpening is done");
2934  RNA_def_property_update(prop, 0, "rna_Brush_update");
2935 
2936  prop = RNA_def_property(srna, "fill_threshold", PROP_FLOAT, PROP_NONE);
2937  RNA_def_property_range(prop, 0.0, 100.0);
2938  RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 3);
2939  RNA_def_property_float_sdna(prop, NULL, "fill_threshold");
2941  prop, "Fill Threshold", "Threshold above which filling is not propagated");
2942  RNA_def_property_update(prop, 0, "rna_Brush_update");
2943 
2944  prop = RNA_def_property(srna, "blur_kernel_radius", PROP_INT, PROP_NONE);
2945  RNA_def_property_int_sdna(prop, NULL, "blur_kernel_radius");
2946  RNA_def_property_range(prop, 1, 10000);
2947  RNA_def_property_ui_range(prop, 1, 50, 1, -1);
2949  prop, "Kernel Radius", "Radius of kernel used for soften and sharpen in pixels");
2950  RNA_def_property_update(prop, 0, "rna_Brush_update");
2951 
2952  prop = RNA_def_property(srna, "blur_mode", PROP_ENUM, PROP_NONE);
2953  RNA_def_property_enum_items(prop, brush_blur_mode_items);
2954  RNA_def_property_ui_text(prop, "Blur Mode", "");
2955  RNA_def_property_update(prop, 0, "rna_Brush_update");
2956 
2957  prop = RNA_def_property(srna, "falloff_angle", PROP_FLOAT, PROP_ANGLE);
2958  RNA_def_property_float_sdna(prop, NULL, "falloff_angle");
2959  RNA_def_property_range(prop, 0, M_PI / 2);
2961  prop,
2962  "Falloff Angle",
2963  "Paint most on faces pointing towards the view according to this angle");
2964  RNA_def_property_update(prop, 0, "rna_Brush_update");
2965 
2966  /* flag */
2967  prop = RNA_def_property(srna, "use_airbrush", PROP_BOOLEAN, PROP_NONE);
2970  prop, "Airbrush", "Keep applying paint effect while holding mouse (spray)");
2971  RNA_def_property_update(prop, 0, "rna_Brush_update");
2972 
2973  prop = RNA_def_property(srna, "use_original_normal", PROP_BOOLEAN, PROP_NONE);
2976  "Original Normal",
2977  "When locked keep using normal of surface where stroke was initiated");
2978  RNA_def_property_update(prop, 0, "rna_Brush_update");
2979 
2980  prop = RNA_def_property(srna, "use_original_plane", PROP_BOOLEAN, PROP_NONE);
2983  prop,
2984  "Original Plane",
2985  "When locked keep using the plane origin of surface where stroke was initiated");
2986  RNA_def_property_update(prop, 0, "rna_Brush_update");
2987 
2988  prop = RNA_def_property(srna, "use_automasking_topology", PROP_BOOLEAN, PROP_NONE);
2989  RNA_def_property_boolean_sdna(prop, NULL, "automasking_flags", BRUSH_AUTOMASKING_TOPOLOGY);
2991  "Topology Auto-Masking",
2992  "Affect only vertices connected to the active vertex under the brush");
2993  RNA_def_property_update(prop, 0, "rna_Brush_update");
2994 
2995  prop = RNA_def_property(srna, "use_automasking_face_sets", PROP_BOOLEAN, PROP_NONE);
2996  RNA_def_property_boolean_sdna(prop, NULL, "automasking_flags", BRUSH_AUTOMASKING_FACE_SETS);
2998  "Face Sets Auto-Masking",
2999  "Affect only vertices that share Face Sets with the active vertex");
3000  RNA_def_property_update(prop, 0, "rna_Brush_update");
3001 
3002  prop = RNA_def_property(srna, "use_automasking_boundary_edges", PROP_BOOLEAN, PROP_NONE);
3005  prop, "Mesh Boundary Auto-Masking", "Do not affect non manifold boundary edges");
3006  RNA_def_property_update(prop, 0, "rna_Brush_update");
3007 
3008  prop = RNA_def_property(srna, "use_automasking_boundary_face_sets", PROP_BOOLEAN, PROP_NONE);
3010  prop, NULL, "automasking_flags", BRUSH_AUTOMASKING_BOUNDARY_FACE_SETS);
3012  "Face Sets Boundary Automasking",
3013  "Do not affect vertices that belong to a Face Set boundary");
3014  RNA_def_property_update(prop, 0, "rna_Brush_update");
3015 
3016  prop = RNA_def_property(srna, "use_scene_spacing", PROP_ENUM, PROP_NONE);
3018  RNA_def_property_enum_items(prop, brush_spacing_unit_items);
3020  prop, "Spacing Distance", "Calculate the brush spacing using view or scene distance");
3021  RNA_def_property_update(prop, 0, "rna_Brush_update");
3022 
3023  prop = RNA_def_property(srna, "use_grab_active_vertex", PROP_BOOLEAN, PROP_NONE);
3026  prop,
3027  "Grab Active Vertex",
3028  "Apply the maximum grab strength to the active vertex instead of the cursor location");
3029  RNA_def_property_update(prop, 0, "rna_Brush_update");
3030 
3031  prop = RNA_def_property(srna, "use_grab_silhouette", PROP_BOOLEAN, PROP_NONE);
3034  prop, "Grab Silhouette", "Grabs trying to automask the silhouette of the object");
3035  RNA_def_property_update(prop, 0, "rna_Brush_update");
3036 
3037  prop = RNA_def_property(srna, "use_paint_antialiasing", PROP_BOOLEAN, PROP_NONE);
3039  RNA_def_property_ui_text(prop, "Anti-Aliasing", "Smooths the edges of the strokes");
3040 
3041  prop = RNA_def_property(srna, "use_multiplane_scrape_dynamic", PROP_BOOLEAN, PROP_NONE);
3044  "Dynamic Mode",
3045  "The angle between the planes changes during the stroke to fit the "
3046  "surface under the cursor");
3047  RNA_def_property_update(prop, 0, "rna_Brush_update");
3048 
3049  prop = RNA_def_property(srna, "show_multiplane_scrape_planes_preview", PROP_BOOLEAN, PROP_NONE);
3052  prop, "Show Cursor Preview", "Preview the scrape planes in the cursor during the stroke");
3053  RNA_def_property_update(prop, 0, "rna_Brush_update");
3054 
3055  prop = RNA_def_property(srna, "use_pose_ik_anchored", PROP_BOOLEAN, PROP_NONE);
3058  prop, "Keep Anchor Point", "Keep the position of the last segment in the IK chain fixed");
3059  RNA_def_property_update(prop, 0, "rna_Brush_update");
3060 
3061  prop = RNA_def_property(srna, "use_pose_lock_rotation", PROP_BOOLEAN, PROP_NONE);
3064  "Lock Rotation When Scaling",
3065  "Do not rotate the segment when using the scale deform mode");
3066  RNA_def_property_update(prop, 0, "rna_Brush_update");
3067 
3068  prop = RNA_def_property(srna, "use_connected_only", PROP_BOOLEAN, PROP_NONE);
3070  RNA_def_property_ui_text(prop, "Connected Only", "Affect only topologically connected elements");
3071  RNA_def_property_update(prop, 0, "rna_Brush_update");
3072 
3073  prop = RNA_def_property(srna, "use_cloth_pin_simulation_boundary", PROP_BOOLEAN, PROP_NONE);
3076  prop,
3077  "Pin Simulation Boundary",
3078  "Lock the position of the vertices in the simulation falloff area to avoid artifacts and "
3079  "create a softer transition with unaffected areas");
3080  RNA_def_property_update(prop, 0, "rna_Brush_update");
3081 
3082  prop = RNA_def_property(srna, "use_cloth_collision", PROP_BOOLEAN, PROP_NONE);
3084  RNA_def_property_ui_text(prop, "Enable Collision", "Collide with objects during the simulation");
3085  RNA_def_property_update(prop, 0, "rna_Brush_update");
3086 
3087  prop = RNA_def_property(srna, "invert_to_scrape_fill", PROP_BOOLEAN, PROP_NONE);
3090  "Invert to Scrape or Fill",
3091  "Use Scrape or Fill tool when inverting this brush instead of "
3092  "inverting its displacement direction");
3093  RNA_def_property_update(prop, 0, "rna_Brush_update");
3094 
3095  prop = RNA_def_property(srna, "use_pressure_strength", PROP_BOOLEAN, PROP_NONE);
3097  RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
3099  prop, "Strength Pressure", "Enable tablet pressure sensitivity for strength");
3100  RNA_def_property_update(prop, 0, "rna_Brush_update");
3101 
3102  prop = RNA_def_property(srna, "use_offset_pressure", PROP_BOOLEAN, PROP_NONE);
3104  RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
3106  prop, "Plane Offset Pressure", "Enable tablet pressure sensitivity for offset");
3107  RNA_def_property_update(prop, 0, "rna_Brush_update");
3108 
3109  prop = RNA_def_property(srna, "use_pressure_area_radius", PROP_BOOLEAN, PROP_NONE);
3111  RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
3113  prop, "Area Radius Pressure", "Enable tablet pressure sensitivity for area radius");
3114  RNA_def_property_update(prop, 0, "rna_Brush_update");
3115 
3116  prop = RNA_def_property(srna, "use_pressure_size", PROP_BOOLEAN, PROP_NONE);
3118  RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
3119  RNA_def_property_ui_text(prop, "Size Pressure", "Enable tablet pressure sensitivity for size");
3120  RNA_def_property_update(prop, 0, "rna_Brush_update");
3121 
3122  prop = RNA_def_property(srna, "use_pressure_jitter", PROP_BOOLEAN, PROP_NONE);
3124  RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
3126  prop, "Jitter Pressure", "Enable tablet pressure sensitivity for jitter");
3127  RNA_def_property_update(prop, 0, "rna_Brush_update");
3128 
3129  prop = RNA_def_property(srna, "use_pressure_spacing", PROP_BOOLEAN, PROP_NONE);
3131  RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
3133  prop, "Spacing Pressure", "Enable tablet pressure sensitivity for spacing");
3134  RNA_def_property_update(prop, 0, "rna_Brush_update");
3135 
3136  prop = RNA_def_property(srna, "use_pressure_masking", PROP_ENUM, PROP_NONE);
3137  RNA_def_property_enum_sdna(prop, NULL, "mask_pressure");
3138  RNA_def_property_enum_items(prop, brush_mask_pressure_items);
3140  prop, "Mask Pressure Mode", "Pen pressure makes texture influence smaller");
3141  RNA_def_property_update(prop, 0, "rna_Brush_update");
3142 
3143  prop = RNA_def_property(srna, "use_inverse_smooth_pressure", PROP_BOOLEAN, PROP_NONE);
3145  RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
3147  prop, "Inverse Smooth Pressure", "Lighter pressure causes more smoothing to be applied");
3148  RNA_def_property_update(prop, 0, "rna_Brush_update");
3149 
3150  prop = RNA_def_property(srna, "use_plane_trim", PROP_BOOLEAN, PROP_NONE);
3152  RNA_def_property_ui_text(prop, "Use Plane Trim", "Enable Plane Trim");
3153  RNA_def_property_update(prop, 0, "rna_Brush_update");
3154 
3155  prop = RNA_def_property(srna, "use_frontface", PROP_BOOLEAN, PROP_NONE);
3158  prop, "Use Front-Face", "Brush only affects vertexes that face the viewer");
3159  RNA_def_property_update(prop, 0, "rna_Brush_update");
3160 
3161  prop = RNA_def_property(srna, "use_frontface_falloff", PROP_BOOLEAN, PROP_NONE);
3164  prop, "Use Front-Face Falloff", "Blend brush influence by how much they face the front");
3165  RNA_def_property_update(prop, 0, "rna_Brush_update");
3166 
3167  prop = RNA_def_property(srna, "use_anchor", PROP_BOOLEAN, PROP_NONE);
3169  RNA_def_property_ui_text(prop, "Anchored", "Keep the brush anchored to the initial location");
3170  RNA_def_property_update(prop, 0, "rna_Brush_update");
3171 
3172  prop = RNA_def_property(srna, "use_space", PROP_BOOLEAN, PROP_NONE);
3175  prop, "Space", "Limit brush application to the distance specified by spacing");
3176  RNA_def_property_update(prop, 0, "rna_Brush_update");
3177 
3178  prop = RNA_def_property(srna, "use_line", PROP_BOOLEAN, PROP_NONE);
3180  RNA_def_property_ui_text(prop, "Line", "Draw a line with dabs separated according to spacing");
3181  RNA_def_property_update(prop, 0, "rna_Brush_update");
3182 
3183  prop = RNA_def_property(srna, "use_curve", PROP_BOOLEAN, PROP_NONE);
3186  prop,
3187  "Curve",
3188  "Define the stroke curve with a bezier curve. Dabs are separated according to spacing");
3189  RNA_def_property_update(prop, 0, "rna_Brush_update");
3190 
3191  prop = RNA_def_property(srna, "use_smooth_stroke", PROP_BOOLEAN, PROP_NONE);
3194  prop, "Smooth Stroke", "Brush lags behind mouse and follows a smoother path");
3195  RNA_def_property_update(prop, 0, "rna_Brush_update");
3196 
3197  prop = RNA_def_property(srna, "use_persistent", PROP_BOOLEAN, PROP_NONE);
3199  RNA_def_property_ui_text(prop, "Persistent", "Sculpt on a persistent layer of the mesh");
3200  RNA_def_property_update(prop, 0, "rna_Brush_update");
3201 
3202  prop = RNA_def_property(srna, "use_accumulate", PROP_BOOLEAN, PROP_NONE);
3204  RNA_def_property_ui_text(prop, "Accumulate", "Accumulate stroke daubs on top of each other");
3205  RNA_def_property_update(prop, 0, "rna_Brush_update");
3206 
3207  prop = RNA_def_property(srna, "use_space_attenuation", PROP_BOOLEAN, PROP_NONE);
3210  prop,
3211  "Adjust Strength for Spacing",
3212  "Automatically adjust strength to give consistent results for different spacings");
3213  RNA_def_property_update(prop, 0, "rna_Brush_update");
3214 
3215  /* adaptive space is not implemented yet */
3216  prop = RNA_def_property(srna, "use_adaptive_space", PROP_BOOLEAN, PROP_NONE);
3219  "Adaptive Spacing",
3220  "Space daubs according to surface orientation instead of screen space");
3221  RNA_def_property_update(prop, 0, "rna_Brush_update");
3222 
3223  prop = RNA_def_property(srna, "use_locked_size", PROP_ENUM, PROP_NONE); /* as an enum */
3225  RNA_def_property_enum_items(prop, brush_size_unit_items);
3227  prop, "Radius Unit", "Measure brush size relative to the view or the scene");
3228  RNA_def_property_update(prop, 0, "rna_Brush_update");
3229 
3230  prop = RNA_def_property(srna, "color_type", PROP_ENUM, PROP_NONE); /* as an enum */
3232  RNA_def_property_enum_items(prop, color_gradient_items);
3233  RNA_def_property_enum_funcs(prop, NULL, "rna_Brush_use_gradient_set", NULL);
3234  RNA_def_property_ui_text(prop, "Color Type", "Use single color or gradient when painting");
3235  RNA_def_property_update(prop, 0, "rna_Brush_update");
3236 
3237  prop = RNA_def_property(srna, "use_edge_to_edge", PROP_BOOLEAN, PROP_NONE);
3239  RNA_def_property_ui_text(prop, "Edge-to-Edge", "Drag anchor brush from edge-to-edge");
3240  RNA_def_property_update(prop, 0, "rna_Brush_update");
3241 
3242  prop = RNA_def_property(srna, "use_restore_mesh", PROP_BOOLEAN, PROP_NONE);
3244  RNA_def_property_ui_text(prop, "Restore Mesh", "Allow a single dot to be carefully positioned");
3245  RNA_def_property_update(prop, 0, "rna_Brush_update");
3246 
3247  /* only for projection paint & vertex paint, TODO, other paint modes */
3248  prop = RNA_def_property(srna, "use_alpha", PROP_BOOLEAN, PROP_NONE);
3251  prop, "Affect Alpha", "When this is disabled, lock alpha while painting");
3252  RNA_def_property_update(prop, 0, "rna_Brush_update");
3253 
3254  prop = RNA_def_property(srna, "curve", PROP_POINTER, PROP_NONE);
3256  RNA_def_property_ui_text(prop, "Curve", "Editable falloff curve");
3257  RNA_def_property_update(prop, 0, "rna_Brush_update");
3258 
3259  prop = RNA_def_property(srna, "paint_curve", PROP_POINTER, PROP_NONE);
3261  RNA_def_property_ui_text(prop, "Paint Curve", "Active paint curve");
3262  RNA_def_property_update(prop, 0, "rna_Brush_update");
3263 
3264  prop = RNA_def_property(srna, "gradient", PROP_POINTER, PROP_NEVER_NULL);
3265  RNA_def_property_pointer_sdna(prop, NULL, "gradient");
3266  RNA_def_property_struct_type(prop, "ColorRamp");
3267  RNA_def_property_ui_text(prop, "Gradient", "");
3268  RNA_def_property_update(prop, 0, "rna_Brush_update");
3269 
3270  /* gradient source */
3271  prop = RNA_def_property(srna, "gradient_stroke_mode", PROP_ENUM, PROP_NONE);
3272  RNA_def_property_enum_items(prop, brush_gradient_items);
3273  RNA_def_property_ui_text(prop, "Gradient Stroke Mode", "");
3274  RNA_def_property_update(prop, 0, "rna_Brush_update");
3275 
3276  prop = RNA_def_property(srna, "gradient_fill_mode", PROP_ENUM, PROP_NONE);
3277  RNA_def_property_enum_items(prop, brush_gradient_fill_items);
3278  RNA_def_property_ui_text(prop, "Gradient Fill Mode", "");
3279  RNA_def_property_update(prop, 0, "rna_Brush_update");
3280 
3281  /* overlay flags */
3282  prop = RNA_def_property(srna, "use_primary_overlay", PROP_BOOLEAN, PROP_NONE);
3283  RNA_def_property_boolean_sdna(prop, NULL, "overlay_flags", BRUSH_OVERLAY_PRIMARY);
3284  RNA_def_property_ui_text(prop, "Use Texture Overlay", "Show texture in viewport");
3285  RNA_def_property_update(prop, 0, "rna_Brush_update");
3286 
3287  prop = RNA_def_property(srna, "use_secondary_overlay", PROP_BOOLEAN, PROP_NONE);
3289  RNA_def_property_ui_text(prop, "Use Texture Overlay", "Show texture in viewport");
3290  RNA_def_property_update(prop, 0, "rna_Brush_update");
3291 
3292  prop = RNA_def_property(srna, "use_cursor_overlay", PROP_BOOLEAN, PROP_NONE);
3293  RNA_def_property_boolean_sdna(prop, NULL, "overlay_flags", BRUSH_OVERLAY_CURSOR);
3294  RNA_def_property_ui_text(prop, "Use Cursor Overlay", "Show cursor in viewport");
3295  RNA_def_property_update(prop, 0, "rna_Brush_update");
3296 
3297  prop = RNA_def_property(srna, "use_cursor_overlay_override", PROP_BOOLEAN, PROP_NONE);
3299  prop, NULL, "overlay_flags", BRUSH_OVERLAY_CURSOR_OVERRIDE_ON_STROKE);
3300  RNA_def_property_ui_text(prop, "Override Overlay", "Don't show overlay during a stroke");
3301  RNA_def_property_update(prop, 0, "rna_Brush_update");
3302 
3303  prop = RNA_def_property(srna, "use_primary_overlay_override", PROP_BOOLEAN, PROP_NONE);
3305  prop, NULL, "overlay_flags", BRUSH_OVERLAY_PRIMARY_OVERRIDE_ON_STROKE);
3306  RNA_def_property_ui_text(prop, "Override Overlay", "Don't show overlay during a stroke");
3307  RNA_def_property_update(prop, 0, "rna_Brush_update");
3308 
3309  prop = RNA_def_property(srna, "use_secondary_overlay_override", PROP_BOOLEAN, PROP_NONE);
3311  prop, NULL, "overlay_flags", BRUSH_OVERLAY_SECONDARY_OVERRIDE_ON_STROKE);
3312  RNA_def_property_ui_text(prop, "Override Overlay", "Don't show overlay during a stroke");
3313  RNA_def_property_update(prop, 0, "rna_Brush_update");
3314 
3315  /* paint mode flags */
3316  prop = RNA_def_property(srna, "use_paint_sculpt", PROP_BOOLEAN, PROP_NONE);
3318  RNA_def_property_ui_text(prop, "Use Sculpt", "Use this brush in sculpt mode");
3319 
3320  prop = RNA_def_property(srna, "use_paint_uv_sculpt", PROP_BOOLEAN, PROP_NONE);
3321  RNA_def_property_boolean_sdna(prop, NULL, "ob_mode", OB_MODE_EDIT);
3322  RNA_def_property_ui_text(prop, "Use UV Sculpt", "Use this brush in UV sculpt mode");
3323 
3324  prop = RNA_def_property(srna, "use_paint_vertex", PROP_BOOLEAN, PROP_NONE);
3326  RNA_def_property_ui_text(prop, "Use Vertex", "Use this brush in vertex paint mode");
3327 
3328  prop = RNA_def_property(srna, "use_paint_weight", PROP_BOOLEAN, PROP_NONE);
3330  RNA_def_property_ui_text(prop, "Use Weight", "Use this brush in weight paint mode");
3331 
3332  prop = RNA_def_property(srna, "use_paint_image", PROP_BOOLEAN, PROP_NONE);
3334  RNA_def_property_ui_text(prop, "Use Texture", "Use this brush in texture paint mode");
3335 
3336  prop = RNA_def_property(srna, "use_paint_grease_pencil", PROP_BOOLEAN, PROP_NONE);
3338  RNA_def_property_ui_text(prop, "Use Paint", "Use this brush in grease pencil drawing mode");
3339 
3340  prop = RNA_def_property(srna, "use_vertex_grease_pencil", PROP_BOOLEAN, PROP_NONE);
3343  prop, "Use Vertex", "Use this brush in grease pencil vertex color mode");
3344 
3345  /* texture */
3346  prop = RNA_def_property(srna, "texture_slot", PROP_POINTER, PROP_NONE);
3347  RNA_def_property_struct_type(prop, "BrushTextureSlot");
3348  RNA_def_property_pointer_sdna(prop, NULL, "mtex");
3350  RNA_def_property_ui_text(prop, "Texture Slot", "");
3351 
3352  prop = RNA_def_property(srna, "texture", PROP_POINTER, PROP_NONE);
3353  RNA_def_property_pointer_sdna(prop, NULL, "mtex.tex");
3355  RNA_def_property_ui_text(prop, "Texture", "");
3356  RNA_def_property_update(prop, NC_TEXTURE, "rna_Brush_main_tex_update");
3357 
3358  prop = RNA_def_property(srna, "mask_texture_slot", PROP_POINTER, PROP_NONE);
3359  RNA_def_property_struct_type(prop, "BrushTextureSlot");
3360  RNA_def_property_pointer_sdna(prop, NULL, "mask_mtex");
3362  RNA_def_property_ui_text(prop, "Mask Texture Slot", "");
3363 
3364  prop = RNA_def_property(srna, "mask_texture", PROP_POINTER, PROP_NONE);
3365  RNA_def_property_pointer_sdna(prop, NULL, "mask_mtex.tex");
3367  RNA_def_property_ui_text(prop, "Mask Texture", "");
3368  RNA_def_property_update(prop, NC_TEXTURE, "rna_Brush_secondary_tex_update");
3369 
3370  prop = RNA_def_property(srna, "texture_overlay_alpha", PROP_INT, PROP_PERCENTAGE);
3371  RNA_def_property_int_sdna(prop, NULL, "texture_overlay_alpha");
3372  RNA_def_property_range(prop, 0, 100);
3373  RNA_def_property_ui_text(prop, "Texture Overlay Alpha", "");
3374  RNA_def_property_update(prop, 0, "rna_Brush_update");
3375 
3376  prop = RNA_def_property(srna, "mask_overlay_alpha", PROP_INT, PROP_PERCENTAGE);
3377  RNA_def_property_int_sdna(prop, NULL, "mask_overlay_alpha");
3378  RNA_def_property_range(prop, 0, 100);
3379  RNA_def_property_ui_text(prop, "Mask Texture Overlay Alpha", "");
3380  RNA_def_property_update(prop, 0, "rna_Brush_update");
3381 
3382  prop = RNA_def_property(srna, "cursor_overlay_alpha", PROP_INT, PROP_PERCENTAGE);
3383  RNA_def_property_int_sdna(prop, NULL, "cursor_overlay_alpha");
3384  RNA_def_property_range(prop, 0, 100);
3385  RNA_def_property_ui_text(prop, "Mask Texture Overlay Alpha", "");
3386  RNA_def_property_update(prop, 0, "rna_Brush_update");
3387 
3388  prop = RNA_def_property(srna, "cursor_color_add", PROP_FLOAT, PROP_COLOR);
3389  RNA_def_property_float_sdna(prop, NULL, "add_col");
3390  RNA_def_property_array(prop, 4);
3391  RNA_def_property_ui_text(prop, "Add Color", "Color of cursor when adding");
3392  RNA_def_property_update(prop, 0, "rna_Brush_update");
3393 
3394  prop = RNA_def_property(srna, "cursor_color_subtract", PROP_FLOAT, PROP_COLOR);
3395  RNA_def_property_float_sdna(prop, NULL, "sub_col");
3396  RNA_def_property_array(prop, 4);
3397  RNA_def_property_ui_text(prop, "Subtract Color", "Color of cursor when subtracting");
3398  RNA_def_property_update(prop, 0, "rna_Brush_update");
3399 
3400  prop = RNA_def_property(srna, "use_custom_icon", PROP_BOOLEAN, PROP_NONE);
3402  RNA_def_property_ui_text(prop, "Custom Icon", "Set the brush icon from an image file");
3403  RNA_def_property_update(prop, 0, "rna_Brush_icon_update");
3404 
3405  prop = RNA_def_property(srna, "icon_filepath", PROP_STRING, PROP_FILEPATH);
3406  RNA_def_property_string_sdna(prop, NULL, "icon_filepath");
3407  RNA_def_property_ui_text(prop, "Brush Icon Filepath", "File path to brush icon");
3408  RNA_def_property_update(prop, 0, "rna_Brush_icon_update");
3409 
3410  /* clone tool */
3411  prop = RNA_def_property(srna, "clone_image", PROP_POINTER, PROP_NONE);
3412  RNA_def_property_pointer_sdna(prop, NULL, "clone.image");
3414  RNA_def_property_ui_text(prop, "Clone Image", "Image for clone tool");
3415  RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, "rna_Brush_update");
3416 
3417  prop = RNA_def_property(srna, "clone_alpha", PROP_FLOAT, PROP_FACTOR);
3418  RNA_def_property_float_sdna(prop, NULL, "clone.alpha");
3419  RNA_def_property_range(prop, 0.0f, 1.0f);
3420  RNA_def_property_ui_text(prop, "Clone Alpha", "Opacity of clone image display");
3421  RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, "rna_Brush_update");
3422 
3423  prop = RNA_def_property(srna, "clone_offset", PROP_FLOAT, PROP_XYZ);
3424  RNA_def_property_float_sdna(prop, NULL, "clone.offset");
3425  RNA_def_property_ui_text(prop, "Clone Offset", "");
3426  RNA_def_property_ui_range(prop, -1.0f, 1.0f, 10.0f, 3);
3427  RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, "rna_Brush_update");
3428 
3429  prop = RNA_def_property(srna, "brush_capabilities", PROP_POINTER, PROP_NONE);
3431  RNA_def_property_struct_type(prop, "BrushCapabilities");
3432  RNA_def_property_pointer_funcs(prop, "rna_Brush_capabilities_get", NULL, NULL, NULL);
3433  RNA_def_property_ui_text(prop, "Brush Capabilities", "Brush's capabilities");
3434 
3435  /* brush capabilities (mode-dependent) */
3436  prop = RNA_def_property(srna, "sculpt_capabilities", PROP_POINTER, PROP_NONE);
3438  RNA_def_property_struct_type(prop, "BrushCapabilitiesSculpt");
3439  RNA_def_property_pointer_funcs(prop, "rna_Sculpt_tool_capabilities_get", NULL, NULL, NULL);
3440  RNA_def_property_ui_text(prop, "Sculpt Capabilities", "");
3441 
3442  prop = RNA_def_property(srna, "image_paint_capabilities", PROP_POINTER, PROP_NONE);
3444  RNA_def_property_struct_type(prop, "BrushCapabilitiesImagePaint");
3445  RNA_def_property_pointer_funcs(prop, "rna_Imapaint_tool_capabilities_get", NULL, NULL, NULL);
3446  RNA_def_property_ui_text(prop, "Image Paint Capabilities", "");
3447 
3448  prop = RNA_def_property(srna, "vertex_paint_capabilities", PROP_POINTER, PROP_NONE);
3450  RNA_def_property_struct_type(prop, "BrushCapabilitiesVertexPaint");
3451  RNA_def_property_pointer_funcs(prop, "rna_Vertexpaint_tool_capabilities_get", NULL, NULL, NULL);
3452  RNA_def_property_ui_text(prop, "Vertex Paint Capabilities", "");
3453 
3454  prop = RNA_def_property(srna, "weight_paint_capabilities", PROP_POINTER, PROP_NONE);
3456  RNA_def_property_struct_type(prop, "BrushCapabilitiesWeightPaint");
3457  RNA_def_property_pointer_funcs(prop, "rna_Weightpaint_tool_capabilities_get", NULL, NULL, NULL);
3458  RNA_def_property_ui_text(prop, "Weight Paint Capabilities", "");
3459 
3460  prop = RNA_def_property(srna, "gpencil_settings", PROP_POINTER, PROP_NONE);
3461  RNA_def_property_struct_type(prop, "BrushGpencilSettings");
3462  RNA_def_property_pointer_sdna(prop, NULL, "gpencil_settings");
3464  RNA_def_property_ui_text(prop, "Gpencil Settings", "");
3465 }
3466 
3479 {
3480  StructRNA *srna;
3481  PropertyRNA *prop;
3482 
3483  srna = RNA_def_struct(brna, "OperatorStrokeElement", "PropertyGroup");
3484  RNA_def_struct_ui_text(srna, "Operator Stroke Element", "");
3485 
3486  prop = RNA_def_property(srna, "location", PROP_FLOAT, PROP_XYZ);
3488  RNA_def_property_array(prop, 3);
3489  RNA_def_property_ui_text(prop, "Location", "");
3490 
3491  prop = RNA_def_property(srna, "mouse", PROP_FLOAT, PROP_XYZ);
3493  RNA_def_property_array(prop, 2);
3494  RNA_def_property_ui_text(prop, "Mouse", "");
3495 
3496  prop = RNA_def_property(srna, "mouse_event", PROP_FLOAT, PROP_XYZ);
3498  RNA_def_property_array(prop, 2);
3499  RNA_def_property_ui_text(prop, "Mouse Event", "");
3500 
3501  prop = RNA_def_property(srna, "pressure", PROP_FLOAT, PROP_FACTOR);
3503  RNA_def_property_range(prop, 0.0f, 1.0f);
3504  RNA_def_property_ui_text(prop, "Pressure", "Tablet pressure");
3505 
3506  prop = RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE);
3508  RNA_def_property_range(prop, 0.0f, FLT_MAX);
3509  RNA_def_property_ui_text(prop, "Brush Size", "Brush size in screen space");
3510 
3511  prop = RNA_def_property(srna, "pen_flip", PROP_BOOLEAN, PROP_NONE);
3513  RNA_def_property_ui_text(prop, "Flip", "");
3514 
3515  prop = RNA_def_property(srna, "x_tilt", PROP_FLOAT, PROP_FACTOR);
3517  RNA_def_property_range(prop, -1.0f, 1.0f);
3518  RNA_def_property_ui_text(prop, "Tilt X", "");
3519 
3520  prop = RNA_def_property(srna, "y_tilt", PROP_FLOAT, PROP_FACTOR);
3522  RNA_def_property_range(prop, -1.0f, 1.0f);
3523  RNA_def_property_ui_text(prop, "Tilt Y", "");
3524 
3525  /* used in uv painting */
3526  prop = RNA_def_property(srna, "time", PROP_FLOAT, PROP_UNSIGNED);
3528  RNA_def_property_ui_text(prop, "Time", "");
3529 
3530  /* used for Grease Pencil sketching sessions */
3531  prop = RNA_def_property(srna, "is_start", PROP_BOOLEAN, PROP_NONE);
3533  RNA_def_property_ui_text(prop, "Is Stroke Start", "");
3534 
3535  /* XXX: Tool (this will be for pressing a modifier key for a different brush,
3536  * e.g. switching to a Smooth brush in the middle of the stroke */
3537 
3538  /* XXX: i don't think blender currently supports the ability to properly do a remappable modifier
3539  * in the middle of a stroke */
3540 }
3541 
3543 {
3544  rna_def_brush(brna);
3553 }
3554 
3555 #endif
bool BKE_brush_sculpt_has_secondary_color(const struct Brush *brush)
void BKE_brush_scale_size(int *r_brush_size, float new_unprojected_radius, float old_unprojected_radius)
Definition: brush.c:2365
void BKE_brush_scale_unprojected_radius(float *unprojected_radius, int new_brush_size, int old_brush_size)
Definition: brush.c:2352
struct ColorBand * BKE_colorband_add(bool rangetype)
Definition: colorband.c:312
struct Scene * CTX_data_scene(const bContext *C)
Definition: context.c:1034
struct ViewLayer * CTX_data_view_layer(const bContext *C)
Definition: context.c:1044
struct Main * CTX_data_main(const bContext *C)
Definition: context.c:1018
struct ToolSettings * CTX_data_tool_settings(const bContext *C)
Definition: context.c:1208
#define GPENCIL_USE_VERTEX_COLOR(toolsettings)
Definition: BKE_gpencil.h:70
void BKE_gpencil_brush_material_set(struct Brush *brush, struct Material *material)
Definition: gpencil.c:1804
void BKE_icon_id_delete(struct ID *id)
Definition: icons.cc:919
void BKE_icon_changed(const int icon_id)
Definition: icons.cc:678
void BKE_previewimg_id_free(struct ID *id)
Definition: icons.cc:392
int BKE_icon_id_ensure(struct ID *id)
Definition: icons.cc:740
General operations, lookup, etc. for materials.
struct Material * BKE_object_material_get(struct Object *ob, short act)
Definition: material.c:697
void BKE_paint_invalidate_overlay_tex(struct Scene *scene, struct ViewLayer *view_layer, const struct Tex *tex)
ePaintMode BKE_paintmode_get_active_from_context(const struct bContext *C)
void BKE_paint_invalidate_overlay_all(void)
Definition: paint.c:272
ePaintMode
Definition: BKE_paint.h:78
@ PAINT_MODE_TEXTURE_3D
Definition: BKE_paint.h:84
@ PAINT_MODE_SCULPT
Definition: BKE_paint.h:79
@ PAINT_MODE_TEXTURE_2D
Definition: BKE_paint.h:86
#define M_PI_2
Definition: BLI_math_base.h:41
#define M_PI
Definition: BLI_math_base.h:38
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL() ATTR_MALLOC
Definition: string.c:70
#define UNUSED(x)
#define ELEM(...)
@ GPAINT_TOOL_ERASE
@ GPAINT_TOOL_FILL
@ GPAINT_TOOL_DRAW
@ GPAINT_TOOL_TINT
@ GP_BRUSH_USE_SAT_RAND_PRESS
@ GP_BRUSH_USE_STRENGTH_RAND_PRESS
@ GP_BRUSH_USE_VAL_RAND_PRESS
@ GP_BRUSH_USE_HUE_RAND_PRESS
@ GP_BRUSH_USE_STRENGTH_AT_STROKE
@ GP_BRUSH_USE_UV_RAND_PRESS
@ GP_BRUSH_USE_HUE_AT_STROKE
@ GP_BRUSH_USE_VAL_AT_STROKE
@ GP_BRUSH_USE_SAT_AT_STROKE
@ GP_BRUSH_USE_PRESS_AT_STROKE
@ GP_BRUSH_USE_UV_AT_STROKE
@ GP_BRUSH_USE_PRESSURE_RAND_PRESS
@ BRUSH_PAINT_ANTIALIASING
@ KERNEL_BOX
@ KERNEL_GAUSSIAN
@ GP_FILL_DMODE_STROKE
@ GP_FILL_DMODE_CONTROL
@ GP_FILL_DMODE_BOTH
@ GPWEIGHT_TOOL_DRAW
@ GPVERTEX_TOOL_AVERAGE
@ GPVERTEX_TOOL_REPLACE
@ GPVERTEX_TOOL_DRAW
@ GPVERTEX_TOOL_BLUR
@ GPVERTEX_TOOL_SMEAR
#define SCULPT_TOOL_HAS_ACCUMULATE(t)
@ GP_SCULPT_FLAGMODE_APPLY_UV
@ GP_SCULPT_FLAGMODE_APPLY_POSITION
@ GP_SCULPT_FLAGMODE_APPLY_THICKNESS
@ GP_SCULPT_FLAGMODE_APPLY_STRENGTH
@ BRUSH_CURVE_CUSTOM
@ BRUSH_CURVE_SHARP
@ BRUSH_CURVE_INVSQUARE
@ BRUSH_CURVE_SPHERE
@ BRUSH_CURVE_CONSTANT
@ BRUSH_CURVE_POW4
@ BRUSH_CURVE_ROOT
@ BRUSH_CURVE_SMOOTH
@ BRUSH_CURVE_SMOOTHER
@ BRUSH_CURVE_LIN
@ BRUSH_AUTOMASKING_BOUNDARY_EDGES
@ BRUSH_AUTOMASKING_BOUNDARY_FACE_SETS
@ BRUSH_AUTOMASKING_FACE_SETS
@ BRUSH_AUTOMASKING_TOPOLOGY
@ BRUSH_DEFORM_TARGET_CLOTH_SIM
@ BRUSH_DEFORM_TARGET_GEOMETRY
@ BRUSH_POSE_DEFORM_SQUASH_STRETCH
@ BRUSH_POSE_DEFORM_ROTATE_TWIST
@ BRUSH_POSE_DEFORM_SCALE_TRASLATE
@ BRUSH_SMEAR_DEFORM_PINCH
@ BRUSH_SMEAR_DEFORM_EXPAND
@ BRUSH_SMEAR_DEFORM_DRAG
@ GP_BRUSH_MODE_VERTEXCOLOR
@ GP_BRUSH_MODE_MATERIAL
@ GP_BRUSH_MODE_ACTIVE
#define SCULPT_TOOL_HAS_TOPOLOGY_RAKE(t)
@ GP_BRUSH_FILL_SHOW_HELPLINES
@ GP_BRUSH_STABILIZE_MOUSE
@ GP_BRUSH_GROUP_RANDOM
@ GP_BRUSH_DISSABLE_LASSO
@ GP_BRUSH_FILL_HIDE
@ GP_BRUSH_TRIM_STROKE
@ GP_BRUSH_OCCLUDE_ERASER
@ GP_BRUSH_DEFAULT_ERASER
@ GP_BRUSH_USE_STRENGTH_PRESSURE
@ GP_BRUSH_GROUP_SETTINGS
@ GP_BRUSH_MATERIAL_PINNED
@ GP_BRUSH_FILL_SHOW_EXTENDLINES
@ GP_BRUSH_FILL_FIT_DISABLE
@ GP_BRUSH_USE_JITTER_PRESSURE
@ GP_BRUSH_USE_PRESSURE
@ BRUSH_OFFSET_PRESSURE
@ BRUSH_ORIGINAL_NORMAL
@ BRUSH_ALPHA_PRESSURE
@ BRUSH_SPACE_ATTEN
@ BRUSH_LOCK_ALPHA
@ BRUSH_FRONTFACE
@ BRUSH_ADAPTIVE_SPACE
@ BRUSH_DRAG_DOT
@ BRUSH_SPACING_PRESSURE
@ BRUSH_LINE
@ BRUSH_CURVE
@ BRUSH_GRAB_ACTIVE_VERTEX
@ BRUSH_EDGE_TO_EDGE
@ BRUSH_SMOOTH_STROKE
@ BRUSH_ORIGINAL_PLANE
@ BRUSH_ACCUMULATE
@ BRUSH_DIR_IN
@ BRUSH_ANCHORED
@ BRUSH_FRONTFACE_FALLOFF
@ BRUSH_CUSTOM_ICON
@ BRUSH_JITTER_PRESSURE
@ BRUSH_PLANE_TRIM
@ BRUSH_LOCK_SIZE
@ BRUSH_INVERSE_SMOOTH_PRESSURE
@ BRUSH_ABSOLUTE_JITTER
@ BRUSH_USE_GRADIENT
@ BRUSH_SCENE_SPACING
@ BRUSH_PERSISTENT
@ BRUSH_SIZE_PRESSURE
@ BRUSH_AIRBRUSH
@ BRUSH_SPACE
@ BRUSH_INVERT_TO_SCRAPE_FILL
@ WPAINT_TOOL_BLUR
@ WPAINT_TOOL_AVERAGE
@ WPAINT_TOOL_SMEAR
@ WPAINT_TOOL_DRAW
@ BRUSH_CLOTH_DEFORM_DRAG
@ BRUSH_CLOTH_DEFORM_EXPAND
@ BRUSH_CLOTH_DEFORM_GRAB
@ BRUSH_CLOTH_DEFORM_PINCH_POINT
@ BRUSH_CLOTH_DEFORM_PUSH
@ BRUSH_CLOTH_DEFORM_INFLATE
@ BRUSH_CLOTH_DEFORM_SNAKE_HOOK
@ BRUSH_CLOTH_DEFORM_PINCH_PERPENDICULAR
@ BRUSH_SNAKE_HOOK_DEFORM_ELASTIC
@ BRUSH_SNAKE_HOOK_DEFORM_FALLOFF
@ SCULPT_TOOL_SMOOTH
@ SCULPT_TOOL_CLOTH
@ SCULPT_TOOL_DRAW_SHARP
@ SCULPT_TOOL_NUDGE
@ SCULPT_TOOL_SCRAPE
@ SCULPT_TOOL_THUMB
@ SCULPT_TOOL_SIMPLIFY
@ SCULPT_TOOL_DRAW_FACE_SETS
@ SCULPT_TOOL_GRAB
@ SCULPT_TOOL_INFLATE
@ SCULPT_TOOL_CLAY_THUMB
@ SCULPT_TOOL_DRAW
@ SCULPT_TOOL_FLATTEN
@ SCULPT_TOOL_BOUNDARY
@ SCULPT_TOOL_PAINT
@ SCULPT_TOOL_PINCH
@ SCULPT_TOOL_BLOB
@ SCULPT_TOOL_FILL
@ SCULPT_TOOL_POSE
@ SCULPT_TOOL_LAYER
@ SCULPT_TOOL_DISPLACEMENT_ERASER
@ SCULPT_TOOL_SLIDE_RELAX
@ SCULPT_TOOL_SMEAR
@ SCULPT_TOOL_DISPLACEMENT_SMEAR
@ SCULPT_TOOL_CLAY
@ SCULPT_TOOL_MASK
@ SCULPT_TOOL_MULTIPLANE_SCRAPE
@ SCULPT_TOOL_ROTATE
@ SCULPT_TOOL_ELASTIC_DEFORM
@ SCULPT_TOOL_SNAKE_HOOK
@ SCULPT_TOOL_CLAY_STRIPS
@ SCULPT_TOOL_CREASE
@ BRUSH_MASK_PRESSURE_RAMP
@ BRUSH_MASK_PRESSURE_CUTOFF
@ GP_BRUSH_ERASER_SOFT
@ GP_BRUSH_ERASER_STROKE
@ GP_BRUSH_ERASER_HARD
@ VPAINT_TOOL_BLUR
@ VPAINT_TOOL_DRAW
@ VPAINT_TOOL_SMEAR
@ VPAINT_TOOL_AVERAGE
@ BRUSH_ELASTIC_DEFORM_SCALE
@ BRUSH_ELASTIC_DEFORM_GRAB
@ BRUSH_ELASTIC_DEFORM_TWIST
@ BRUSH_ELASTIC_DEFORM_GRAB_BISCALE
@ BRUSH_ELASTIC_DEFORM_GRAB_TRISCALE
@ BRUSH_GRADIENT_SPACING_CLAMP
@ BRUSH_GRADIENT_PRESSURE
@ BRUSH_GRADIENT_SPACING_REPEAT
@ UV_SCULPT_TOOL_GRAB
@ UV_SCULPT_TOOL_RELAX
@ UV_SCULPT_TOOL_PINCH
@ PAINT_TOOL_CLONE
@ PAINT_TOOL_SMEAR
@ PAINT_TOOL_SOFTEN
@ PAINT_TOOL_MASK
@ PAINT_TOOL_FILL
@ PAINT_TOOL_DRAW
@ BRUSH_SMOOTH_DEFORM_SURFACE
@ BRUSH_SMOOTH_DEFORM_LAPLACIAN
@ GPSCULPT_TOOL_GRAB
@ GPSCULPT_TOOL_TWIST
@ GPSCULPT_TOOL_PUSH
@ GPSCULPT_TOOL_STRENGTH
@ GPSCULPT_TOOL_PINCH
@ GPSCULPT_TOOL_SMOOTH
@ GPSCULPT_TOOL_CLONE
@ GPSCULPT_TOOL_THICKNESS
@ GPSCULPT_TOOL_RANDOMIZE
@ BRUSH_PAINT_WET_MIX_PRESSURE
@ BRUSH_PAINT_HARDNESS_PRESSURE
@ BRUSH_PAINT_FLOW_PRESSURE
@ BRUSH_PAINT_DENSITY_PRESSURE
@ BRUSH_PAINT_WET_PERSISTENCE_PRESSURE
@ BRUSH_PAINT_WET_MIX_PRESSURE_INVERT
@ BRUSH_PAINT_HARDNESS_PRESSURE_INVERT
@ BRUSH_PAINT_FLOW_PRESSURE_INVERT
@ BRUSH_PAINT_DENSITY_PRESSURE_INVERT
@ BRUSH_PAINT_WET_PERSISTENCE_PRESSURE_INVERT
@ PAINT_FALLOFF_SHAPE_TUBE
@ SCULPT_DISP_DIR_VIEW
@ SCULPT_DISP_DIR_X
@ SCULPT_DISP_DIR_Z
@ SCULPT_DISP_DIR_Y
@ SCULPT_DISP_DIR_AREA
@ BRUSH_OVERLAY_SECONDARY_OVERRIDE_ON_STROKE
@ BRUSH_OVERLAY_PRIMARY_OVERRIDE_ON_STROKE
@ BRUSH_OVERLAY_SECONDARY
@ BRUSH_OVERLAY_CURSOR
@ BRUSH_OVERLAY_CURSOR_OVERRIDE_ON_STROKE
@ BRUSH_OVERLAY_PRIMARY
@ GP_BRUSH_ICON_ERASE_SOFT
@ GP_BRUSH_ICON_GPBRUSH_RANDOMIZE
@ GP_BRUSH_ICON_VERTEX_BLUR
@ GP_BRUSH_ICON_FILL
@ GP_BRUSH_ICON_PENCIL
@ GP_BRUSH_ICON_GPBRUSH_GRAB
@ GP_BRUSH_ICON_GPBRUSH_STRENGTH
@ GP_BRUSH_ICON_INKNOISE
@ GP_BRUSH_ICON_GPBRUSH_TWIST
@ GP_BRUSH_ICON_PEN
@ GP_BRUSH_ICON_VERTEX_REPLACE
@ GP_BRUSH_ICON_MARKER
@ GP_BRUSH_ICON_VERTEX_DRAW
@ GP_BRUSH_ICON_BLOCK
@ GP_BRUSH_ICON_GPBRUSH_WEIGHT
@ GP_BRUSH_ICON_INK
@ GP_BRUSH_ICON_GPBRUSH_PINCH
@ GP_BRUSH_ICON_VERTEX_SMEAR
@ GP_BRUSH_ICON_GPBRUSH_THICKNESS
@ GP_BRUSH_ICON_AIRBRUSH
@ GP_BRUSH_ICON_GPBRUSH_CLONE
@ GP_BRUSH_ICON_CHISEL
@ GP_BRUSH_ICON_ERASE_STROKE
@ GP_BRUSH_ICON_ERASE_HARD
@ GP_BRUSH_ICON_GPBRUSH_SMOOTH
@ GP_BRUSH_ICON_GPBRUSH_PUSH
@ GP_BRUSH_ICON_VERTEX_AVERAGE
@ BRUSH_GRADIENT_LINEAR
@ BRUSH_GRADIENT_RADIAL
#define MAX_BRUSH_PIXEL_RADIUS
@ BRUSH_BOUNDARY_DEFORM_GRAB
@ BRUSH_BOUNDARY_DEFORM_TWIST
@ BRUSH_BOUNDARY_DEFORM_BEND
@ BRUSH_BOUNDARY_DEFORM_EXPAND
@ BRUSH_BOUNDARY_DEFORM_INFLATE
@ BRUSH_BOUNDARY_DEFORM_SMOOTH
@ BRUSH_GRAB_SILHOUETTE
@ BRUSH_CLOTH_PIN_SIMULATION_BOUNDARY
@ BRUSH_AREA_RADIUS_PRESSURE
@ BRUSH_MULTIPLANE_SCRAPE_PLANES_PREVIEW
@ BRUSH_MULTIPLANE_SCRAPE_DYNAMIC
@ BRUSH_USE_CONNECTED_ONLY
@ BRUSH_POSE_USE_LOCK_ROTATION
@ BRUSH_POSE_IK_ANCHORED
@ BRUSH_CLOTH_USE_COLLISION
BrushMaskTool
@ BRUSH_MASK_DRAW
@ BRUSH_MASK_SMOOTH
@ BRUSH_CLOTH_FORCE_FALLOFF_RADIAL
@ BRUSH_CLOTH_FORCE_FALLOFF_PLANE
#define SCULPT_TOOL_HAS_NORMAL_WEIGHT(t)
@ GPPAINT_MODE_STROKE
@ GPPAINT_MODE_FILL
@ GPPAINT_MODE_BOTH
@ GP_FILL_GPLMODE_ABOVE
@ GP_FILL_GPLMODE_ALL_ABOVE
@ GP_FILL_GPLMODE_VISIBLE
@ GP_FILL_GPLMODE_ALL_BELOW
@ GP_FILL_GPLMODE_BELOW
@ GP_FILL_GPLMODE_ACTIVE
#define SCULPT_TOOL_HAS_RAKE(t)
@ BRUSH_CLOTH_SIMULATION_AREA_LOCAL
@ BRUSH_CLOTH_SIMULATION_AREA_DYNAMIC
@ BRUSH_CLOTH_SIMULATION_AREA_GLOBAL
@ BRUSH_POSE_ORIGIN_FACE_SETS_FK
@ BRUSH_POSE_ORIGIN_TOPOLOGY
@ BRUSH_POSE_ORIGIN_FACE_SETS
@ BRUSH_SLIDE_DEFORM_DRAG
@ BRUSH_SLIDE_DEFORM_EXPAND
@ BRUSH_SLIDE_DEFORM_PINCH
@ BRUSH_BOUNDARY_FALLOFF_CONSTANT
@ BRUSH_BOUNDARY_FALLOFF_LOOP
@ BRUSH_BOUNDARY_FALLOFF_LOOP_INVERT
@ BRUSH_BOUNDARY_FALLOFF_RADIUS
#define GPENCIL_MIN_FILL_FAC
#define GP_MAX_INPUT_SAMPLES
#define GPENCIL_MAX_FILL_FAC
@ OB_MODE_VERTEX_GPENCIL
@ OB_MODE_EDIT
@ OB_MODE_WEIGHT_PAINT
@ OB_MODE_SCULPT
@ OB_MODE_TEXTURE_PAINT
@ OB_MODE_VERTEX_PAINT
@ OB_MODE_PAINT_GPENCIL
Object is a sort of wrapper for general info.
#define OBACT(_view_layer)
#define MTEX_MAP_MODE_VIEW
#define MTEX_ANGLE_RAKE
#define MTEX_MAP_MODE_3D
#define MTEX_MAP_MODE_STENCIL
#define MTEX_MAP_MODE_TILED
#define MTEX_MAP_MODE_AREA
#define MTEX_ANGLE_RANDOM
#define MTEX_MAP_MODE_RANDOM
void IMB_freeImBuf(struct ImBuf *ibuf)
Definition: allocimbuf.c:211
@ IMB_BLEND_EXCLUSION
Definition: IMB_imbuf.h:217
@ IMB_BLEND_DIFFERENCE
Definition: IMB_imbuf.h:216
@ IMB_BLEND_HARDLIGHT
Definition: IMB_imbuf.h:207
@ IMB_BLEND_COLORBURN
Definition: IMB_imbuf.h:208
@ IMB_BLEND_COLORDODGE
Definition: IMB_imbuf.h:210
@ IMB_BLEND_ERASE_ALPHA
Definition: IMB_imbuf.h:204
@ IMB_BLEND_SCREEN
Definition: IMB_imbuf.h:211
@ IMB_BLEND_HUE
Definition: IMB_imbuf.h:218
@ IMB_BLEND_MUL
Definition: IMB_imbuf.h:201
@ IMB_BLEND_ADD_ALPHA
Definition: IMB_imbuf.h:205
@ IMB_BLEND_DARKEN
Definition: IMB_imbuf.h:203
@ IMB_BLEND_OVERLAY
Definition: IMB_imbuf.h:206
@ IMB_BLEND_SATURATION
Definition: IMB_imbuf.h:219
@ IMB_BLEND_VIVIDLIGHT
Definition: IMB_imbuf.h:214
@ IMB_BLEND_LUMINOSITY
Definition: IMB_imbuf.h:220
@ IMB_BLEND_LIGHTEN
Definition: IMB_imbuf.h:202
@ IMB_BLEND_SOFTLIGHT
Definition: IMB_imbuf.h:212
@ IMB_BLEND_COLOR
Definition: IMB_imbuf.h:221
@ IMB_BLEND_LINEARLIGHT
Definition: IMB_imbuf.h:215
@ IMB_BLEND_PINLIGHT
Definition: IMB_imbuf.h:213
@ IMB_BLEND_MIX
Definition: IMB_imbuf.h:198
@ IMB_BLEND_ADD
Definition: IMB_imbuf.h:199
@ IMB_BLEND_SUB
Definition: IMB_imbuf.h:200
@ IMB_BLEND_LINEARBURN
Definition: IMB_imbuf.h:209
Read Guarded memory(de)allocation.
StructRNA RNA_BrushCapabilitiesImagePaint
StructRNA RNA_BrushCapabilitiesVertexPaint
@ PROP_FLOAT
Definition: RNA_types.h:75
@ PROP_BOOLEAN
Definition: RNA_types.h:73
@ PROP_ENUM
Definition: RNA_types.h:77
@ PROP_INT
Definition: RNA_types.h:74
@ PROP_STRING
Definition: RNA_types.h:76
@ PROP_POINTER
Definition: RNA_types.h:78
@ PROP_CONTEXT_UPDATE
Definition: RNA_types.h:254
@ PROP_ANIMATABLE
Definition: RNA_types.h:188
@ PROP_EDITABLE
Definition: RNA_types.h:175
@ PROP_NEVER_NULL
Definition: RNA_types.h:225
@ PROP_ID_SELF_CHECK
Definition: RNA_types.h:218
@ PROP_IDPROPERTY
Definition: RNA_types.h:273
@ PROP_XYZ
Definition: RNA_types.h:148
@ PROP_DISTANCE
Definition: RNA_types.h:135
@ PROP_COLOR
Definition: RNA_types.h:139
@ PROP_PIXEL
Definition: RNA_types.h:128
@ PROP_ANGLE
Definition: RNA_types.h:132
@ PROP_NONE
Definition: RNA_types.h:113
@ PROP_PERCENTAGE
Definition: RNA_types.h:130
@ PROP_FACTOR
Definition: RNA_types.h:131
@ PROP_COLOR_GAMMA
Definition: RNA_types.h:151
@ PROP_UNSIGNED
Definition: RNA_types.h:129
@ PROP_FILEPATH
Definition: RNA_types.h:116
#define C
Definition: RandGen.cpp:39
@ BIFICONID_LAST
Definition: UI_resources.h:37
#define NC_BRUSH
Definition: WM_types.h:286
#define ND_DATA
Definition: WM_types.h:408
#define ND_SPACE_PROPERTIES
Definition: WM_types.h:424
#define NC_SCENE
Definition: WM_types.h:279
#define ND_TOOLSETTINGS
Definition: WM_types.h:349
#define ND_SPACE_IMAGE
Definition: WM_types.h:417
#define NA_EDITED
Definition: WM_types.h:462
#define NC_GPENCIL
Definition: WM_types.h:300
#define NC_TEXTURE
Definition: WM_types.h:282
#define NC_SPACE
Definition: WM_types.h:293
return(oflags[bm->toolflag_index].f &oflag) !=0
Scene scene
Material material
PointerRNA rna_pointer_inherit_refine(PointerRNA *ptr, StructRNA *type, void *data)
Definition: rna_access.c:196
#define TEXTURE_CAPABILITY(prop_name_, ui_name_)
static EnumPropertyItem rna_enum_gpencil_brush_eraser_modes_items[]
Definition: rna_brush.c:261
static EnumPropertyItem rna_enum_gpencil_brush_paint_icons_items[]
Definition: rna_brush.c:303
static void rna_def_gpencil_options(BlenderRNA *brna)
Definition: rna_brush.c:1271
const EnumPropertyItem rna_enum_brush_image_tool_items[]
Definition: rna_brush.c:168
static void rna_def_sculpt_capabilities(BlenderRNA *brna)
Definition: rna_brush.c:1130
#define IMAPAINT_TOOL_CAPABILITY(prop_name_, ui_name_)
static void rna_def_operator_stroke_element(BlenderRNA *brna)
Definition: rna_brush.c:3478
static EnumPropertyItem rna_enum_gpencil_brush_vertex_icons_items[]
Definition: rna_brush.c:336
static EnumPropertyItem rna_enum_gpencil_fill_direction_items[]
Definition: rna_brush.c:291
static const EnumPropertyItem sculpt_stroke_method_items[]
Definition: rna_brush.c:60
const EnumPropertyItem rna_enum_brush_weight_tool_items[]
Definition: rna_brush.c:160
static EnumPropertyItem rna_enum_gpencil_fill_layers_modes_items[]
Definition: rna_brush.c:282
#define WPAINT_TOOL_CAPABILITY(prop_name_, ui_name_)
const EnumPropertyItem rna_enum_brush_gpencil_sculpt_types_items[]
Definition: rna_brush.c:207
#define BRUSH_CAPABILITY(prop_name_, ui_name_)
static EnumPropertyItem rna_enum_gpencil_fill_draw_modes_items[]
Definition: rna_brush.c:272
const EnumPropertyItem rna_enum_brush_sculpt_tool_items[]
Definition: rna_brush.c:105
#define VPAINT_TOOL_CAPABILITY(prop_name_, ui_name_)
void RNA_def_brush(BlenderRNA *brna)
Definition: rna_brush.c:3542
const EnumPropertyItem rna_enum_brush_vertex_tool_items[]
Definition: rna_brush.c:152
const EnumPropertyItem rna_enum_brush_uv_sculpt_tool_items[]
Definition: rna_brush.c:145
static void rna_def_brush(BlenderRNA *brna)
Definition: rna_brush.c:1893
static const EnumPropertyItem prop_direction_items[]
Definition: rna_brush.c:42
static const EnumPropertyItem rna_enum_brush_texture_slot_map_all_mode_items[]
Definition: rna_brush.c:83
const EnumPropertyItem rna_enum_brush_gpencil_vertex_types_items[]
Definition: rna_brush.c:198
static EnumPropertyItem rna_enum_gpencil_brush_modes_items[]
Definition: rna_brush.c:297
static void rna_def_image_paint_capabilities(BlenderRNA *brna)
Definition: rna_brush.c:1199
static void rna_def_vertex_paint_capabilities(BlenderRNA *brna)
Definition: rna_brush.c:1225
const EnumPropertyItem rna_enum_brush_gpencil_weight_types_items[]
Definition: rna_brush.c:251
static EnumPropertyItem rna_enum_gpencil_brush_sculpt_icons_items[]
Definition: rna_brush.c:319
static void rna_def_brush_texture_slot(BlenderRNA *brna)
Definition: rna_brush.c:1061
static EnumPropertyItem rna_enum_gpencil_brush_weight_icons_items[]
Definition: rna_brush.c:332
const EnumPropertyItem rna_enum_brush_gpencil_types_items[]
Definition: rna_brush.c:178
static void rna_def_weight_paint_capabilities(BlenderRNA *brna)
Definition: rna_brush.c:1248
static void rna_def_brush_capabilities(BlenderRNA *brna)
Definition: rna_brush.c:1174
#define SCULPT_TOOL_CAPABILITY(prop_name_, ui_name_)
void RNA_def_property_pointer_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2762
void RNA_def_struct_path_func(StructRNA *srna, const char *path)
Definition: rna_define.c:1212
void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t bit)
Definition: rna_define.c:2257
void RNA_def_parameter_clear_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
Definition: rna_define.c:1555
void RNA_def_property_float_default(PropertyRNA *prop, float value)
Definition: rna_define.c:2042
void RNA_def_property_float_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
Definition: rna_define.c:3153
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
Definition: rna_define.c:1676
void RNA_def_property_string_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2717
void RNA_def_property_ui_icon(PropertyRNA *prop, int icon, int consecutive)
Definition: rna_define.c:1684
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
Definition: rna_define.c:1259
void RNA_def_property_boolean_default(PropertyRNA *prop, bool value)
Definition: rna_define.c:1957
void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const char *set)
Definition: rna_define.c:2971
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
Definition: rna_define.c:1892
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
Definition: rna_define.c:1067
void RNA_def_property_array(PropertyRNA *prop, int length)
Definition: rna_define.c:1568
void RNA_def_property_range(PropertyRNA *prop, double min, double max)
Definition: rna_define.c:1757
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
Definition: rna_define.c:1792
void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *func)
Definition: rna_define.c:2927
void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char *set, const char *item)
Definition: rna_define.c:3251
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier, int type, int subtype)
Definition: rna_define.c:1279
void RNA_def_property_enum_bitflag_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2691
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
Definition: rna_define.c:1517
void RNA_def_property_pointer_funcs(PropertyRNA *prop, const char *get, const char *set, const char *type_fn, const char *poll)
Definition: rna_define.c:3373
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
Definition: rna_define.c:1047
void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2623
void RNA_def_property_int_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
Definition: rna_define.c:3055
void RNA_def_struct_ui_icon(StructRNA *srna, int icon)
Definition: rna_define.c:1267
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
Definition: rna_define.c:1512
void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2515
void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double step, int precision)
Definition: rna_define.c:1706
void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2364
void RNA_def_property_boolean_negative_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
Definition: rna_define.c:2348
void RNA_def_struct_nested(BlenderRNA *brna, StructRNA *srna, const char *structname)
Definition: rna_define.c:1138
void rna_TextureSlot_update(struct bContext *C, struct PointerRNA *ptr)
const EnumPropertyItem DummyRNA_DEFAULT_items[]
Definition: rna_rna.c:45
struct ImBuf * icon_imbuf
struct ColorBand * gradient
struct MTex mtex
char vertexpaint_tool
float unprojected_radius
char imagepaint_tool
struct BrushGpencilSettings * gpencil_settings
char mask_tool
char sculpt_tool
char gpencil_tool
struct MTex mask_mtex
char weightpaint_tool
Definition: DNA_ID.h:273
int icon_id
Definition: DNA_ID.h:294
void * first
Definition: DNA_listBase.h:47
char mapping
char brush_map_mode
struct Tex * tex
Definition: BKE_main.h:116
ListBase brushes
Definition: BKE_main.h:171
struct MaterialGPencilStyle * gp_style
struct Brush * brush
void * data
Definition: RNA_types.h:52
struct ID * owner_id
Definition: RNA_types.h:50
struct ToolSettings * toolsettings
GpPaint * gp_paint
void WM_main_add_notifier(unsigned int type, void *reference)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
PointerRNA * ptr
Definition: wm_files.c:3157