Blender  V3.3
rna_brush.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
7 #include <stdlib.h>
8 
9 #include "DNA_brush_types.h"
10 #include "DNA_gpencil_types.h"
11 #include "DNA_material_types.h"
12 #include "DNA_object_types.h"
13 #include "DNA_scene_types.h"
14 #include "DNA_texture_types.h"
15 #include "DNA_workspace_types.h"
16 
17 #include "BLI_math.h"
18 
19 #include "RNA_define.h"
20 #include "RNA_enum_types.h"
21 
22 #include "rna_internal.h"
23 
24 #include "IMB_imbuf.h"
25 
26 #include "WM_types.h"
27 
29  {0, "ADD", ICON_ADD, "Add", "Add effect of brush"},
30  {BRUSH_DIR_IN, "SUBTRACT", ICON_REMOVE, "Subtract", "Subtract effect of brush"},
31  {0, NULL, 0, NULL, NULL},
32 };
33 
34 #ifdef RNA_RUNTIME
35 static const EnumPropertyItem prop_smooth_direction_items[] = {
36  {0, "SMOOTH", ICON_ADD, "Smooth", "Smooth the surface"},
37  {BRUSH_DIR_IN,
38  "ENHANCE_DETAILS",
39  ICON_REMOVE,
40  "Enhance Details",
41  "Enhance the surface detail"},
42  {0, NULL, 0, NULL, NULL},
43 };
44 #endif
45 
47  {0, "DOTS", 0, "Dots", "Apply paint on each mouse move step"},
48  {BRUSH_DRAG_DOT, "DRAG_DOT", 0, "Drag Dot", "Allows a single dot to be carefully positioned"},
49  {BRUSH_SPACE,
50  "SPACE",
51  0,
52  "Space",
53  "Limit brush application to the distance specified by spacing"},
55  "AIRBRUSH",
56  0,
57  "Airbrush",
58  "Keep applying paint effect while holding mouse (spray)"},
59  {BRUSH_ANCHORED, "ANCHORED", 0, "Anchored", "Keep the brush anchored to the initial location"},
60  {BRUSH_LINE, "LINE", 0, "Line", "Draw a line with dabs separated according to spacing"},
61  {BRUSH_CURVE,
62  "CURVE",
63  0,
64  "Curve",
65  "Define the stroke curve with a bezier curve (dabs are separated according to spacing)"},
66  {0, NULL, 0, NULL, NULL},
67 };
68 
70  {MTEX_MAP_MODE_VIEW, "VIEW_PLANE", 0, "View Plane", ""},
71  {MTEX_MAP_MODE_AREA, "AREA_PLANE", 0, "Area Plane", ""},
72  {MTEX_MAP_MODE_TILED, "TILED", 0, "Tiled", ""},
73  {MTEX_MAP_MODE_3D, "3D", 0, "3D", ""},
74  {MTEX_MAP_MODE_RANDOM, "RANDOM", 0, "Random", ""},
75  {MTEX_MAP_MODE_STENCIL, "STENCIL", 0, "Stencil", ""},
76  {0, NULL, 0, NULL, NULL},
77 };
78 
79 #ifdef RNA_RUNTIME
80 static const EnumPropertyItem rna_enum_brush_texture_slot_map_texture_mode_items[] = {
81  {MTEX_MAP_MODE_VIEW, "VIEW_PLANE", 0, "View Plane", ""},
82  {MTEX_MAP_MODE_TILED, "TILED", 0, "Tiled", ""},
83  {MTEX_MAP_MODE_3D, "3D", 0, "3D", ""},
84  {MTEX_MAP_MODE_RANDOM, "RANDOM", 0, "Random", ""},
85  {MTEX_MAP_MODE_STENCIL, "STENCIL", 0, "Stencil", ""},
86  {0, NULL, 0, NULL, NULL},
87 };
88 #endif
89 
90 /* clang-format off */
92  {SCULPT_TOOL_DRAW, "DRAW", ICON_BRUSH_SCULPT_DRAW, "Draw", ""},
93  {SCULPT_TOOL_DRAW_SHARP, "DRAW_SHARP", ICON_BRUSH_SCULPT_DRAW, "Draw Sharp", ""},
94  {SCULPT_TOOL_CLAY, "CLAY", ICON_BRUSH_CLAY, "Clay", ""},
95  {SCULPT_TOOL_CLAY_STRIPS, "CLAY_STRIPS", ICON_BRUSH_CLAY_STRIPS, "Clay Strips", ""},
96  {SCULPT_TOOL_CLAY_THUMB, "CLAY_THUMB", ICON_BRUSH_CLAY_STRIPS, "Clay Thumb", ""},
97  {SCULPT_TOOL_LAYER, "LAYER", ICON_BRUSH_LAYER, "Layer", ""},
98  {SCULPT_TOOL_INFLATE, "INFLATE", ICON_BRUSH_INFLATE, "Inflate", ""},
99  {SCULPT_TOOL_BLOB, "BLOB", ICON_BRUSH_BLOB, "Blob", ""},
100  {SCULPT_TOOL_CREASE, "CREASE", ICON_BRUSH_CREASE, "Crease", ""},
102  {SCULPT_TOOL_SMOOTH, "SMOOTH", ICON_BRUSH_SMOOTH, "Smooth", ""},
103  {SCULPT_TOOL_FLATTEN, "FLATTEN", ICON_BRUSH_FLATTEN, "Flatten", ""},
104  {SCULPT_TOOL_FILL, "FILL", ICON_BRUSH_FILL, "Fill", ""},
105  {SCULPT_TOOL_SCRAPE, "SCRAPE", ICON_BRUSH_SCRAPE, "Scrape", ""},
106  {SCULPT_TOOL_MULTIPLANE_SCRAPE, "MULTIPLANE_SCRAPE", ICON_BRUSH_SCRAPE, "Multi-plane Scrape", ""},
107  {SCULPT_TOOL_PINCH, "PINCH", ICON_BRUSH_PINCH, "Pinch", ""},
109  {SCULPT_TOOL_GRAB, "GRAB", ICON_BRUSH_GRAB, "Grab", ""},
110  {SCULPT_TOOL_ELASTIC_DEFORM, "ELASTIC_DEFORM", ICON_BRUSH_GRAB, "Elastic Deform", ""},
111  {SCULPT_TOOL_SNAKE_HOOK, "SNAKE_HOOK", ICON_BRUSH_SNAKE_HOOK, "Snake Hook", ""},
112  {SCULPT_TOOL_THUMB, "THUMB", ICON_BRUSH_THUMB, "Thumb", ""},
113  {SCULPT_TOOL_POSE, "POSE", ICON_BRUSH_GRAB, "Pose", ""},
114  {SCULPT_TOOL_NUDGE, "NUDGE", ICON_BRUSH_NUDGE, "Nudge", ""},
115  {SCULPT_TOOL_ROTATE, "ROTATE", ICON_BRUSH_ROTATE, "Rotate", ""},
116  {SCULPT_TOOL_SLIDE_RELAX, "TOPOLOGY", ICON_BRUSH_GRAB, "Slide Relax", ""},
117  {SCULPT_TOOL_BOUNDARY, "BOUNDARY", ICON_BRUSH_GRAB, "Boundary", ""},
119  {SCULPT_TOOL_CLOTH, "CLOTH", ICON_BRUSH_SCULPT_DRAW, "Cloth", ""},
120  {SCULPT_TOOL_SIMPLIFY, "SIMPLIFY", ICON_BRUSH_DATA, "Simplify", ""},
121  {SCULPT_TOOL_MASK, "MASK", ICON_BRUSH_MASK, "Mask", ""},
122  {SCULPT_TOOL_DRAW_FACE_SETS, "DRAW_FACE_SETS", ICON_BRUSH_MASK, "Draw Face Sets", ""},
123  {SCULPT_TOOL_DISPLACEMENT_ERASER, "DISPLACEMENT_ERASER", ICON_BRUSH_SCULPT_DRAW, "Multires Displacement Eraser", ""},
124  {SCULPT_TOOL_DISPLACEMENT_SMEAR, "DISPLACEMENT_SMEAR", ICON_BRUSH_SCULPT_DRAW, "Multires Displacement Smear", ""},
125  {SCULPT_TOOL_PAINT, "PAINT", ICON_BRUSH_SCULPT_DRAW, "Paint", ""},
126  {SCULPT_TOOL_SMEAR, "SMEAR", ICON_BRUSH_SCULPT_DRAW, "Smear", ""},
127  {0, NULL, 0, NULL, NULL},
128 };
129 /* clang-format on */
130 
132  {UV_SCULPT_TOOL_GRAB, "GRAB", 0, "Grab", "Grab UVs"},
133  {UV_SCULPT_TOOL_RELAX, "RELAX", 0, "Relax", "Relax UVs"},
134  {UV_SCULPT_TOOL_PINCH, "PINCH", 0, "Pinch", "Pinch UVs"},
135  {0, NULL, 0, NULL, NULL},
136 };
137 
139  {VPAINT_TOOL_DRAW, "DRAW", ICON_BRUSH_MIX, "Draw", ""},
140  {VPAINT_TOOL_BLUR, "BLUR", ICON_BRUSH_BLUR, "Blur", ""},
141  {VPAINT_TOOL_AVERAGE, "AVERAGE", ICON_BRUSH_BLUR, "Average", ""},
142  {VPAINT_TOOL_SMEAR, "SMEAR", ICON_BRUSH_BLUR, "Smear", ""},
143  {0, NULL, 0, NULL, NULL},
144 };
145 
147  {WPAINT_TOOL_DRAW, "DRAW", ICON_BRUSH_MIX, "Draw", ""},
148  {WPAINT_TOOL_BLUR, "BLUR", ICON_BRUSH_BLUR, "Blur", ""},
149  {WPAINT_TOOL_AVERAGE, "AVERAGE", ICON_BRUSH_BLUR, "Average", ""},
150  {WPAINT_TOOL_SMEAR, "SMEAR", ICON_BRUSH_BLUR, "Smear", ""},
151  {0, NULL, 0, NULL, NULL},
152 };
153 
155  {PAINT_TOOL_DRAW, "DRAW", ICON_BRUSH_TEXDRAW, "Draw", ""},
156  {PAINT_TOOL_SOFTEN, "SOFTEN", ICON_BRUSH_SOFTEN, "Soften", ""},
157  {PAINT_TOOL_SMEAR, "SMEAR", ICON_BRUSH_SMEAR, "Smear", ""},
158  {PAINT_TOOL_CLONE, "CLONE", ICON_BRUSH_CLONE, "Clone", ""},
159  {PAINT_TOOL_FILL, "FILL", ICON_BRUSH_TEXFILL, "Fill", ""},
160  {PAINT_TOOL_MASK, "MASK", ICON_BRUSH_TEXMASK, "Mask", ""},
161  {0, NULL, 0, NULL, NULL},
162 };
163 
166  "DRAW",
167  ICON_STROKE,
168  "Draw",
169  "The brush is of type used for drawing strokes"},
170  {GPAINT_TOOL_FILL, "FILL", ICON_COLOR, "Fill", "The brush is of type used for filling areas"},
172  "ERASE",
173  ICON_PANEL_CLOSE,
174  "Erase",
175  "The brush is used for erasing strokes"},
177  "TINT",
178  ICON_BRUSH_TEXDRAW,
179  "Tint",
180  "The brush is of type used for tinting strokes"},
181  {0, NULL, 0, NULL, NULL},
182 };
183 
185  {GPVERTEX_TOOL_DRAW, "DRAW", ICON_BRUSH_MIX, "Draw", ""},
186  {GPVERTEX_TOOL_BLUR, "BLUR", ICON_BRUSH_BLUR, "Blur", ""},
187  {GPVERTEX_TOOL_AVERAGE, "AVERAGE", ICON_BRUSH_BLUR, "Average", ""},
188  {GPVERTEX_TOOL_SMEAR, "SMEAR", ICON_BRUSH_BLUR, "Smear", ""},
189  {GPVERTEX_TOOL_REPLACE, "REPLACE", ICON_BRUSH_BLUR, "Replace", ""},
190  {0, NULL, 0, NULL, NULL},
191 };
192 
194  {GPSCULPT_TOOL_SMOOTH, "SMOOTH", ICON_GPBRUSH_SMOOTH, "Smooth", "Smooth stroke points"},
196  "THICKNESS",
197  ICON_GPBRUSH_THICKNESS,
198  "Thickness",
199  "Adjust thickness of strokes"},
201  "STRENGTH",
202  ICON_GPBRUSH_STRENGTH,
203  "Strength",
204  "Adjust color strength of strokes"},
206  "RANDOMIZE",
207  ICON_GPBRUSH_RANDOMIZE,
208  "Randomize",
209  "Introduce jitter/randomness into strokes"},
211  "GRAB",
212  ICON_GPBRUSH_GRAB,
213  "Grab",
214  "Translate the set of points initially within the brush circle"},
216  "PUSH",
217  ICON_GPBRUSH_PUSH,
218  "Push",
219  "Move points out of the way, as if combing them"},
221  "TWIST",
222  ICON_GPBRUSH_TWIST,
223  "Twist",
224  "Rotate points around the midpoint of the brush"},
226  "PINCH",
227  ICON_GPBRUSH_PINCH,
228  "Pinch",
229  "Pull points towards the midpoint of the brush"},
231  "CLONE",
232  ICON_GPBRUSH_CLONE,
233  "Clone",
234  "Paste copies of the strokes stored on the clipboard"},
235  {0, NULL, 0, NULL, NULL}};
236 
239  "WEIGHT",
240  ICON_GPBRUSH_WEIGHT,
241  "Weight",
242  "Weight Paint for Vertex Groups"},
243  {0, NULL, 0, NULL, NULL},
244 };
245 
246 /* clang-format off */
248  {CURVES_SCULPT_TOOL_COMB, "COMB", ICON_BRUSH_CURVES_COMB, "Comb Curves", ""},
249  {CURVES_SCULPT_TOOL_DELETE, "DELETE", ICON_BRUSH_CURVES_DELETE, "Delete Curves", ""},
250  {CURVES_SCULPT_TOOL_SNAKE_HOOK, "SNAKE_HOOK", ICON_BRUSH_CURVES_SNAKE_HOOK, "Curves Snake Hook", ""},
251  {CURVES_SCULPT_TOOL_ADD, "ADD", ICON_BRUSH_CURVES_ADD, "Add Curves", ""},
252  {CURVES_SCULPT_TOOL_GROW_SHRINK, "GROW_SHRINK", ICON_BRUSH_CURVES_GROW_SHRINK, "Grow / Shrink Curves", ""},
253  {CURVES_SCULPT_TOOL_SELECTION_PAINT, "SELECTION_PAINT", ICON_BRUSH_PAINT_SELECT, "Paint Selection", ""},
254  {CURVES_SCULPT_TOOL_PINCH, "PINCH", ICON_BRUSH_CURVES_PINCH, "Pinch Curves", ""},
255  {CURVES_SCULPT_TOOL_SMOOTH, "SMOOTH", ICON_BRUSH_CURVES_SMOOTH, "Smooth Curves", ""},
256  {CURVES_SCULPT_TOOL_PUFF, "PUFF", ICON_BRUSH_CURVES_PUFF, "Puff Curves", ""},
257  {CURVES_SCULPT_TOOL_DENSITY, "DENSITY", ICON_BRUSH_CURVES_DENSITY, "Density Curves", ""},
258  {CURVES_SCULPT_TOOL_SLIDE, "SLIDE", ICON_BRUSH_CURVES_SLIDE, "Slide Curves", ""},
259  {0, NULL, 0, NULL, NULL},
260 };
261 /* clang-format on */
262 
263 #ifndef RNA_RUNTIME
266  "SOFT",
267  0,
268  "Dissolve",
269  "Erase strokes, fading their points strength and thickness"},
270  {GP_BRUSH_ERASER_HARD, "HARD", 0, "Point", "Erase stroke points"},
271  {GP_BRUSH_ERASER_STROKE, "STROKE", 0, "Stroke", "Erase entire strokes"},
272  {0, NULL, 0, NULL, NULL},
273 };
274 
277  "BOTH",
278  0,
279  "All",
280  "Use both visible strokes and edit lines as fill boundary limits"},
281  {GP_FILL_DMODE_STROKE, "STROKE", 0, "Strokes", "Use visible strokes as fill boundary limits"},
282  {GP_FILL_DMODE_CONTROL, "CONTROL", 0, "Edit Lines", "Use edit lines as fill boundary limits"},
283  {0, NULL, 0, NULL, NULL}};
284 
286  {GP_FILL_GPLMODE_VISIBLE, "VISIBLE", 0, "Visible", "Visible layers"},
287  {GP_FILL_GPLMODE_ACTIVE, "ACTIVE", 0, "Active", "Only active layer"},
288  {GP_FILL_GPLMODE_ABOVE, "ABOVE", 0, "Layer Above", "Layer above active"},
289  {GP_FILL_GPLMODE_BELOW, "BELOW", 0, "Layer Below", "Layer below active"},
290  {GP_FILL_GPLMODE_ALL_ABOVE, "ALL_ABOVE", 0, "All Above", "All layers above active"},
291  {GP_FILL_GPLMODE_ALL_BELOW, "ALL_BELOW", 0, "All Below", "All layers below active"},
292  {0, NULL, 0, NULL, NULL}};
293 
295  {0, "NORMAL", ICON_ADD, "Normal", "Fill internal area"},
296  {BRUSH_DIR_IN, "INVERT", ICON_REMOVE, "Inverted", "Fill inverted area"},
297  {0, NULL, 0, NULL, NULL},
298 };
299 
301  {GP_BRUSH_MODE_ACTIVE, "ACTIVE", 0, "Active", "Use current mode"},
302  {GP_BRUSH_MODE_MATERIAL, "MATERIAL", 0, "Material", "Use always material mode"},
303  {GP_BRUSH_MODE_VERTEXCOLOR, "VERTEXCOLOR", 0, "Vertex Color", "Use always Vertex Color mode"},
304  {0, NULL, 0, NULL, NULL}};
305 
307  {GP_BRUSH_ICON_PENCIL, "PENCIL", ICON_GPBRUSH_PENCIL, "Pencil", ""},
308  {GP_BRUSH_ICON_PEN, "PEN", ICON_GPBRUSH_PEN, "Pen", ""},
309  {GP_BRUSH_ICON_INK, "INK", ICON_GPBRUSH_INK, "Ink", ""},
310  {GP_BRUSH_ICON_INKNOISE, "INKNOISE", ICON_GPBRUSH_INKNOISE, "Ink Noise", ""},
311  {GP_BRUSH_ICON_BLOCK, "BLOCK", ICON_GPBRUSH_BLOCK, "Block", ""},
312  {GP_BRUSH_ICON_MARKER, "MARKER", ICON_GPBRUSH_MARKER, "Marker", ""},
313  {GP_BRUSH_ICON_AIRBRUSH, "AIRBRUSH", ICON_GPBRUSH_AIRBRUSH, "Airbrush", ""},
314  {GP_BRUSH_ICON_CHISEL, "CHISEL", ICON_GPBRUSH_CHISEL, "Chisel", ""},
315  {GP_BRUSH_ICON_FILL, "FILL", ICON_GPBRUSH_FILL, "Fill", ""},
316  {GP_BRUSH_ICON_ERASE_SOFT, "SOFT", ICON_GPBRUSH_ERASE_SOFT, "Eraser Soft", ""},
317  {GP_BRUSH_ICON_ERASE_HARD, "HARD", ICON_GPBRUSH_ERASE_HARD, "Eraser Hard", ""},
318  {GP_BRUSH_ICON_ERASE_STROKE, "STROKE", ICON_GPBRUSH_ERASE_STROKE, "Eraser Stroke", ""},
319  {0, NULL, 0, NULL, NULL},
320 };
321 
323  {GP_BRUSH_ICON_GPBRUSH_SMOOTH, "SMOOTH", ICON_GPBRUSH_SMOOTH, "Smooth", ""},
324  {GP_BRUSH_ICON_GPBRUSH_THICKNESS, "THICKNESS", ICON_GPBRUSH_THICKNESS, "Thickness", ""},
325  {GP_BRUSH_ICON_GPBRUSH_STRENGTH, "STRENGTH", ICON_GPBRUSH_STRENGTH, "Strength", ""},
326  {GP_BRUSH_ICON_GPBRUSH_RANDOMIZE, "RANDOMIZE", ICON_GPBRUSH_RANDOMIZE, "Randomize", ""},
327  {GP_BRUSH_ICON_GPBRUSH_GRAB, "GRAB", ICON_GPBRUSH_GRAB, "Grab", ""},
328  {GP_BRUSH_ICON_GPBRUSH_PUSH, "PUSH", ICON_GPBRUSH_PUSH, "Push", ""},
329  {GP_BRUSH_ICON_GPBRUSH_TWIST, "TWIST", ICON_GPBRUSH_TWIST, "Twist", ""},
330  {GP_BRUSH_ICON_GPBRUSH_PINCH, "PINCH", ICON_GPBRUSH_PINCH, "Pinch", ""},
331  {GP_BRUSH_ICON_GPBRUSH_CLONE, "CLONE", ICON_GPBRUSH_CLONE, "Clone", ""},
332  {0, NULL, 0, NULL, NULL},
333 };
334 
336  {GP_BRUSH_ICON_GPBRUSH_WEIGHT, "DRAW", ICON_GPBRUSH_WEIGHT, "Draw", ""},
337  {0, NULL, 0, NULL, NULL},
338 };
340  {GP_BRUSH_ICON_VERTEX_DRAW, "DRAW", ICON_BRUSH_MIX, "Draw", ""},
341  {GP_BRUSH_ICON_VERTEX_BLUR, "BLUR", ICON_BRUSH_BLUR, "Blur", ""},
342  {GP_BRUSH_ICON_VERTEX_AVERAGE, "AVERAGE", ICON_BRUSH_BLUR, "Average", ""},
343  {GP_BRUSH_ICON_VERTEX_SMEAR, "SMEAR", ICON_BRUSH_BLUR, "Smear", ""},
344  {GP_BRUSH_ICON_VERTEX_REPLACE, "REPLACE", ICON_BRUSH_MIX, "Replace", ""},
345  {0, NULL, 0, NULL, NULL},
346 };
347 #endif
348 
349 #ifdef RNA_RUNTIME
350 
351 # include "MEM_guardedalloc.h"
352 
353 # include "RNA_access.h"
354 
355 # include "BKE_brush.h"
356 # include "BKE_colorband.h"
357 # include "BKE_gpencil.h"
358 # include "BKE_icons.h"
359 # include "BKE_material.h"
360 # include "BKE_paint.h"
361 
362 # include "WM_api.h"
363 
364 static bool rna_BrushCapabilitiesSculpt_has_accumulate_get(PointerRNA *ptr)
365 {
366  Brush *br = (Brush *)ptr->data;
368 }
369 
370 static bool rna_BrushCapabilitiesSculpt_has_topology_rake_get(PointerRNA *ptr)
371 {
372  Brush *br = (Brush *)ptr->data;
374 }
375 
376 static bool rna_BrushCapabilitiesSculpt_has_auto_smooth_get(PointerRNA *ptr)
377 {
378  Brush *br = (Brush *)ptr->data;
379  return !ELEM(
381 }
382 
383 static bool rna_BrushCapabilitiesSculpt_has_height_get(PointerRNA *ptr)
384 {
385  Brush *br = (Brush *)ptr->data;
386  return br->sculpt_tool == SCULPT_TOOL_LAYER;
387 }
388 
389 static bool rna_BrushCapabilitiesSculpt_has_jitter_get(PointerRNA *ptr)
390 {
391  Brush *br = (Brush *)ptr->data;
392  return (!(br->flag & BRUSH_ANCHORED) && !(br->flag & BRUSH_DRAG_DOT) &&
393  !ELEM(br->sculpt_tool,
398 }
399 
400 static bool rna_BrushCapabilitiesSculpt_has_normal_weight_get(PointerRNA *ptr)
401 {
402  Brush *br = (Brush *)ptr->data;
404 }
405 
406 static bool rna_BrushCapabilitiesSculpt_has_rake_factor_get(PointerRNA *ptr)
407 {
408  Brush *br = (Brush *)ptr->data;
409  return SCULPT_TOOL_HAS_RAKE(br->sculpt_tool);
410 }
411 
412 static bool rna_BrushCapabilities_has_overlay_get(PointerRNA *ptr)
413 {
414  Brush *br = (Brush *)ptr->data;
415  return ELEM(
417 }
418 
419 static bool rna_BrushCapabilitiesSculpt_has_persistence_get(PointerRNA *ptr)
420 {
421  Brush *br = (Brush *)ptr->data;
423 }
424 
425 static bool rna_BrushCapabilitiesSculpt_has_pinch_factor_get(PointerRNA *ptr)
426 {
427  Brush *br = (Brush *)ptr->data;
429 }
430 
431 static bool rna_BrushCapabilitiesSculpt_has_plane_offset_get(PointerRNA *ptr)
432 {
433  Brush *br = (Brush *)ptr->data;
434  return ELEM(br->sculpt_tool,
441 }
442 
443 static bool rna_BrushCapabilitiesSculpt_has_random_texture_angle_get(PointerRNA *ptr)
444 {
445  Brush *br = (Brush *)ptr->data;
446  return (!ELEM(br->sculpt_tool,
451 }
452 
453 static bool rna_TextureCapabilities_has_random_texture_angle_get(PointerRNA *ptr)
454 {
455  MTex *mtex = (MTex *)ptr->data;
457 }
458 
459 static bool rna_BrushCapabilities_has_random_texture_angle_get(PointerRNA *ptr)
460 {
461  Brush *br = (Brush *)ptr->data;
462  return !(br->flag & BRUSH_ANCHORED);
463 }
464 
465 static bool rna_BrushCapabilitiesSculpt_has_sculpt_plane_get(PointerRNA *ptr)
466 {
467  Brush *br = (Brush *)ptr->data;
468  return !ELEM(br->sculpt_tool,
473 }
474 
475 static bool rna_BrushCapabilitiesSculpt_has_color_get(PointerRNA *ptr)
476 {
477  Brush *br = (Brush *)ptr->data;
478  return ELEM(br->sculpt_tool, SCULPT_TOOL_PAINT);
479 }
480 
481 static bool rna_BrushCapabilitiesSculpt_has_secondary_color_get(PointerRNA *ptr)
482 {
483  Brush *br = (Brush *)ptr->data;
485 }
486 
487 static bool rna_BrushCapabilitiesSculpt_has_smooth_stroke_get(PointerRNA *ptr)
488 {
489  Brush *br = (Brush *)ptr->data;
490  return (!(br->flag & BRUSH_ANCHORED) && !(br->flag & BRUSH_DRAG_DOT) &&
491  !(br->flag & BRUSH_LINE) && !(br->flag & BRUSH_CURVE) &&
492  !ELEM(br->sculpt_tool,
497 }
498 
499 static bool rna_BrushCapabilities_has_smooth_stroke_get(PointerRNA *ptr)
500 {
501  Brush *br = (Brush *)ptr->data;
502  return (!(br->flag & BRUSH_ANCHORED) && !(br->flag & BRUSH_DRAG_DOT) &&
503  !(br->flag & BRUSH_LINE) && !(br->flag & BRUSH_CURVE));
504 }
505 
506 static bool rna_BrushCapabilitiesSculpt_has_space_attenuation_get(PointerRNA *ptr)
507 {
508  Brush *br = (Brush *)ptr->data;
514 }
515 
516 static bool rna_BrushCapabilitiesImagePaint_has_space_attenuation_get(PointerRNA *ptr)
517 {
518  Brush *br = (Brush *)ptr->data;
519  return (br->flag & (BRUSH_SPACE | BRUSH_LINE | BRUSH_CURVE)) &&
521 }
522 
523 static bool rna_BrushCapabilitiesImagePaint_has_color_get(PointerRNA *ptr)
524 {
525  Brush *br = (Brush *)ptr->data;
527 }
528 
529 static bool rna_BrushCapabilitiesVertexPaint_has_color_get(PointerRNA *ptr)
530 {
531  Brush *br = (Brush *)ptr->data;
533 }
534 
535 static bool rna_BrushCapabilitiesWeightPaint_has_weight_get(PointerRNA *ptr)
536 {
537  Brush *br = (Brush *)ptr->data;
539 }
540 
541 static bool rna_BrushCapabilities_has_spacing_get(PointerRNA *ptr)
542 {
543  Brush *br = (Brush *)ptr->data;
544  return (!(br->flag & BRUSH_ANCHORED));
545 }
546 
547 static bool rna_BrushCapabilitiesSculpt_has_strength_pressure_get(PointerRNA *ptr)
548 {
549  Brush *br = (Brush *)ptr->data;
551 }
552 
553 static bool rna_TextureCapabilities_has_texture_angle_get(PointerRNA *ptr)
554 {
555  MTex *mtex = (MTex *)ptr->data;
556  return mtex->brush_map_mode != MTEX_MAP_MODE_3D;
557 }
558 
559 static bool rna_BrushCapabilitiesSculpt_has_direction_get(PointerRNA *ptr)
560 {
561  Brush *br = (Brush *)ptr->data;
562  return !ELEM(br->sculpt_tool,
578 }
579 
580 static bool rna_BrushCapabilitiesSculpt_has_gravity_get(PointerRNA *ptr)
581 {
582  Brush *br = (Brush *)ptr->data;
584 }
585 
586 static bool rna_BrushCapabilitiesSculpt_has_tilt_get(PointerRNA *ptr)
587 {
588  Brush *br = (Brush *)ptr->data;
589  return ELEM(br->sculpt_tool,
597 }
598 
599 static bool rna_TextureCapabilities_has_texture_angle_source_get(PointerRNA *ptr)
600 {
601  MTex *mtex = (MTex *)ptr->data;
603 }
604 
605 static bool rna_BrushCapabilitiesImagePaint_has_accumulate_get(PointerRNA *ptr)
606 {
607  /* only support for draw tool */
608  Brush *br = (Brush *)ptr->data;
609 
610  return ((br->flag & BRUSH_AIRBRUSH) || (br->flag & BRUSH_DRAG_DOT) ||
613  (br->mtex.tex && !ELEM(br->mtex.brush_map_mode,
616  MTEX_MAP_MODE_3D))) ?
617  false :
618  true;
619 }
620 
621 static bool rna_BrushCapabilitiesImagePaint_has_radius_get(PointerRNA *ptr)
622 {
623  /* only support for draw tool */
624  Brush *br = (Brush *)ptr->data;
625 
627 }
628 
629 static PointerRNA rna_Sculpt_tool_capabilities_get(PointerRNA *ptr)
630 {
631  return rna_pointer_inherit_refine(ptr, &RNA_BrushCapabilitiesSculpt, ptr->owner_id);
632 }
633 
634 static PointerRNA rna_Imapaint_tool_capabilities_get(PointerRNA *ptr)
635 {
636  return rna_pointer_inherit_refine(ptr, &RNA_BrushCapabilitiesImagePaint, ptr->owner_id);
637 }
638 
639 static PointerRNA rna_Vertexpaint_tool_capabilities_get(PointerRNA *ptr)
640 {
641  return rna_pointer_inherit_refine(ptr, &RNA_BrushCapabilitiesVertexPaint, ptr->owner_id);
642 }
643 
644 static PointerRNA rna_Weightpaint_tool_capabilities_get(PointerRNA *ptr)
645 {
646  return rna_pointer_inherit_refine(ptr, &RNA_BrushCapabilitiesWeightPaint, ptr->owner_id);
647 }
648 
649 static PointerRNA rna_Brush_capabilities_get(PointerRNA *ptr)
650 {
651  return rna_pointer_inherit_refine(ptr, &RNA_BrushCapabilities, ptr->owner_id);
652 }
653 
654 static void rna_Brush_reset_icon(Brush *br)
655 {
656  ID *id = &br->id;
657 
658  if (br->flag & BRUSH_CUSTOM_ICON) {
659  return;
660  }
661 
662  if (id->icon_id >= BIFICONID_LAST) {
663  BKE_icon_id_delete(id);
665  }
666 
667  id->icon_id = 0;
668 }
669 
670 static void rna_Brush_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
671 {
672  Brush *br = (Brush *)ptr->data;
674  // WM_main_add_notifier(NC_SPACE | ND_SPACE_VIEW3D, NULL);
675 }
676 
677 static void rna_Brush_material_update(bContext *UNUSED(C), PointerRNA *UNUSED(ptr))
678 {
679  /* number of material users changed */
681 }
682 
683 static void rna_Brush_main_tex_update(bContext *C, PointerRNA *ptr)
684 {
685  Main *bmain = CTX_data_main(C);
687  ViewLayer *view_layer = CTX_data_view_layer(C);
688  Brush *br = (Brush *)ptr->data;
690  rna_Brush_update(bmain, scene, ptr);
691 }
692 
693 static void rna_Brush_secondary_tex_update(bContext *C, PointerRNA *ptr)
694 {
695  Main *bmain = CTX_data_main(C);
697  ViewLayer *view_layer = CTX_data_view_layer(C);
698  Brush *br = (Brush *)ptr->data;
700  rna_Brush_update(bmain, scene, ptr);
701 }
702 
703 static void rna_Brush_size_update(Main *bmain, Scene *scene, PointerRNA *ptr)
704 {
706  rna_Brush_update(bmain, scene, ptr);
707 }
708 
709 static void rna_Brush_update_and_reset_icon(Main *bmain, Scene *scene, PointerRNA *ptr)
710 {
711  Brush *br = ptr->data;
712  rna_Brush_reset_icon(br);
713  rna_Brush_update(bmain, scene, ptr);
714 }
715 
716 static void rna_Brush_stroke_update(Main *bmain, Scene *scene, PointerRNA *ptr)
717 {
719  rna_Brush_update(bmain, scene, ptr);
720 }
721 
722 static void rna_Brush_icon_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
723 {
724  Brush *br = (Brush *)ptr->data;
725 
726  if (br->icon_imbuf) {
728  br->icon_imbuf = NULL;
729  }
730 
731  br->id.icon_id = 0;
732 
733  if (br->flag & BRUSH_CUSTOM_ICON) {
735  }
736 
738 }
739 
740 static bool rna_Brush_imagetype_poll(PointerRNA *UNUSED(ptr), PointerRNA value)
741 {
742  Image *image = (Image *)value.owner_id;
743  return image->type != IMA_TYPE_R_RESULT && image->type != IMA_TYPE_COMPOSITE;
744 }
745 
746 static void rna_TextureSlot_brush_angle_update(bContext *C, PointerRNA *ptr)
747 {
749  MTex *mtex = ptr->data;
750  /* skip invalidation of overlay for stencil mode */
751  if (mtex->mapping != MTEX_MAP_MODE_STENCIL) {
752  ViewLayer *view_layer = CTX_data_view_layer(C);
753  BKE_paint_invalidate_overlay_tex(scene, view_layer, mtex->tex);
754  }
755 
757 }
758 
759 static void rna_Brush_set_size(PointerRNA *ptr, int value)
760 {
761  Brush *brush = ptr->data;
762 
763  /* scale unprojected radius so it stays consistent with brush size */
765  brush->size = value;
766 }
767 
768 static void rna_Brush_use_gradient_set(PointerRNA *ptr, bool value)
769 {
770  Brush *br = (Brush *)ptr->data;
771 
772  if (value) {
773  br->flag |= BRUSH_USE_GRADIENT;
774  }
775  else {
776  br->flag &= ~BRUSH_USE_GRADIENT;
777  }
778 
779  if ((br->flag & BRUSH_USE_GRADIENT) && br->gradient == NULL) {
780  br->gradient = BKE_colorband_add(true);
781  }
782 }
783 
784 static void rna_Brush_set_unprojected_radius(PointerRNA *ptr, float value)
785 {
786  Brush *brush = ptr->data;
787 
788  /* scale brush size so it stays consistent with unprojected_radius */
789  BKE_brush_scale_size(&brush->size, value, brush->unprojected_radius);
790  brush->unprojected_radius = value;
791 }
792 
793 static const EnumPropertyItem *rna_Brush_direction_itemf(bContext *C,
794  PointerRNA *ptr,
795  PropertyRNA *UNUSED(prop),
796  bool *UNUSED(r_free))
797 {
799 
800  /* sculpt mode */
801  static const EnumPropertyItem prop_flatten_contrast_items[] = {
802  {BRUSH_DIR_IN, "CONTRAST", ICON_ADD, "Contrast", "Subtract effect of brush"},
803  {0, "FLATTEN", ICON_REMOVE, "Flatten", "Add effect of brush"},
804  {0, NULL, 0, NULL, NULL},
805  };
806 
807  static const EnumPropertyItem prop_fill_deepen_items[] = {
808  {0, "FILL", ICON_ADD, "Fill", "Add effect of brush"},
809  {BRUSH_DIR_IN, "DEEPEN", ICON_REMOVE, "Deepen", "Subtract effect of brush"},
810  {0, NULL, 0, NULL, NULL},
811  };
812 
813  static const EnumPropertyItem prop_scrape_peaks_items[] = {
814  {0, "SCRAPE", ICON_ADD, "Scrape", "Add effect of brush"},
815  {BRUSH_DIR_IN, "PEAKS", ICON_REMOVE, "Peaks", "Subtract effect of brush"},
816  {0, NULL, 0, NULL, NULL},
817  };
818 
819  static const EnumPropertyItem prop_pinch_magnify_items[] = {
820  {BRUSH_DIR_IN, "MAGNIFY", ICON_ADD, "Magnify", "Subtract effect of brush"},
821  {0, "PINCH", ICON_REMOVE, "Pinch", "Add effect of brush"},
822  {0, NULL, 0, NULL, NULL},
823  };
824 
825  static const EnumPropertyItem prop_inflate_deflate_items[] = {
826  {0, "INFLATE", ICON_ADD, "Inflate", "Add effect of brush"},
827  {BRUSH_DIR_IN, "DEFLATE", ICON_REMOVE, "Deflate", "Subtract effect of brush"},
828  {0, NULL, 0, NULL, NULL},
829  };
830 
831  /* texture paint mode */
832  static const EnumPropertyItem prop_soften_sharpen_items[] = {
833  {BRUSH_DIR_IN, "SHARPEN", ICON_ADD, "Sharpen", "Sharpen effect of brush"},
834  {0, "SOFTEN", ICON_REMOVE, "Soften", "Blur effect of brush"},
835  {0, NULL, 0, NULL, NULL},
836  };
837 
838  Brush *me = (Brush *)(ptr->data);
839 
840  switch (mode) {
841  case PAINT_MODE_SCULPT:
842  switch (me->sculpt_tool) {
843  case SCULPT_TOOL_DRAW:
845  case SCULPT_TOOL_CREASE:
846  case SCULPT_TOOL_BLOB:
847  case SCULPT_TOOL_LAYER:
848  case SCULPT_TOOL_CLAY:
850  return prop_direction_items;
851  case SCULPT_TOOL_SMOOTH:
852  return prop_smooth_direction_items;
853  case SCULPT_TOOL_MASK:
854  switch ((BrushMaskTool)me->mask_tool) {
855  case BRUSH_MASK_DRAW:
856  return prop_direction_items;
857 
858  case BRUSH_MASK_SMOOTH:
859  return DummyRNA_DEFAULT_items;
860 
861  default:
862  return DummyRNA_DEFAULT_items;
863  }
864 
865  case SCULPT_TOOL_FLATTEN:
866  return prop_flatten_contrast_items;
867 
868  case SCULPT_TOOL_FILL:
869  return prop_fill_deepen_items;
870 
871  case SCULPT_TOOL_SCRAPE:
872  return prop_scrape_peaks_items;
873 
874  case SCULPT_TOOL_PINCH:
875  return prop_pinch_magnify_items;
876 
877  case SCULPT_TOOL_INFLATE:
878  return prop_inflate_deflate_items;
879 
880  default:
881  return DummyRNA_DEFAULT_items;
882  }
883 
886  switch (me->imagepaint_tool) {
887  case PAINT_TOOL_SOFTEN:
888  return prop_soften_sharpen_items;
889 
890  default:
891  return DummyRNA_DEFAULT_items;
892  }
894  switch (me->curves_sculpt_tool) {
898  return prop_direction_items;
899  default:
900  return DummyRNA_DEFAULT_items;
901  }
902  default:
903  return DummyRNA_DEFAULT_items;
904  }
905 }
906 
907 static const EnumPropertyItem *rna_Brush_stroke_itemf(bContext *C,
909  PropertyRNA *UNUSED(prop),
910  bool *UNUSED(r_free))
911 {
913 
914  static const EnumPropertyItem brush_stroke_method_items[] = {
915  {0, "DOTS", 0, "Dots", "Apply paint on each mouse move step"},
916  {BRUSH_SPACE,
917  "SPACE",
918  0,
919  "Space",
920  "Limit brush application to the distance specified by spacing"},
922  "AIRBRUSH",
923  0,
924  "Airbrush",
925  "Keep applying paint effect while holding mouse (spray)"},
926  {BRUSH_LINE, "LINE", 0, "Line", "Drag a line with dabs separated according to spacing"},
927  {BRUSH_CURVE,
928  "CURVE",
929  0,
930  "Curve",
931  "Define the stroke curve with a bezier curve. Dabs are separated according to spacing"},
932  {0, NULL, 0, NULL, NULL},
933  };
934 
935  switch (mode) {
936  case PAINT_MODE_SCULPT:
940 
941  default:
942  return brush_stroke_method_items;
943  }
944 }
945 
946 /* Grease Pencil Drawing Brushes Settings */
947 static char *rna_BrushGpencilSettings_path(const PointerRNA *UNUSED(ptr))
948 {
949  return BLI_strdup("tool_settings.gpencil_paint.brush.gpencil_settings");
950 }
951 
952 static void rna_BrushGpencilSettings_default_eraser_update(Main *bmain,
953  Scene *scene,
955 {
957  Paint *paint = &ts->gp_paint->paint;
958  Brush *brush_cur = paint->brush;
959 
960  /* disable default eraser in all brushes */
961  for (Brush *brush = bmain->brushes.first; brush; brush = brush->id.next) {
962  if ((brush != brush_cur) && (brush->ob_mode == OB_MODE_PAINT_GPENCIL) &&
963  (brush->gpencil_tool == GPAINT_TOOL_ERASE)) {
965  }
966  }
967 }
968 
969 static void rna_BrushGpencilSettings_use_material_pin_update(bContext *C, PointerRNA *ptr)
970 {
971  ViewLayer *view_layer = CTX_data_view_layer(C);
972  Object *ob = OBACT(view_layer);
973  Brush *brush = (Brush *)ptr->owner_id;
974 
978  }
979  else {
981  }
982 
983  /* number of material users changed */
985 }
986 
987 static void rna_BrushGpencilSettings_eraser_mode_update(Main *UNUSED(bmain),
988  Scene *scene,
990 {
992  Paint *paint = &ts->gp_paint->paint;
993  Brush *brush = paint->brush;
994 
995  /* set eraser icon */
996  if ((brush) && (brush->gpencil_tool == GPAINT_TOOL_ERASE)) {
997  switch (brush->gpencil_settings->eraser_mode) {
1000  break;
1001  case GP_BRUSH_ERASER_HARD:
1003  break;
1006  break;
1007  default:
1009  break;
1010  }
1011  }
1012 }
1013 
1014 static bool rna_BrushGpencilSettings_material_poll(PointerRNA *UNUSED(ptr), PointerRNA value)
1015 {
1016  Material *ma = (Material *)value.data;
1017 
1018  /* GP materials only */
1019  return (ma->gp_style != NULL);
1020 }
1021 
1022 static bool rna_GPencilBrush_pin_mode_get(PointerRNA *ptr)
1023 {
1024  Brush *brush = (Brush *)ptr->owner_id;
1025  if ((brush != NULL) && (brush->gpencil_settings != NULL)) {
1027  }
1028  return false;
1029 }
1030 
1031 static void rna_GPencilBrush_pin_mode_set(PointerRNA *UNUSED(ptr), bool UNUSED(value))
1032 {
1033  /* All data is set in update. Keep this function only to avoid RNA compilation errors. */
1034  return;
1035 }
1036 
1037 static void rna_GPencilBrush_pin_mode_update(bContext *C, PointerRNA *ptr)
1038 {
1039  Brush *brush = (Brush *)ptr->owner_id;
1040  if ((brush != NULL) && (brush->gpencil_settings != NULL)) {
1042  /* If not active, means that must be set to off. */
1044  }
1045  else {
1050  }
1051  }
1052 }
1053 
1054 static const EnumPropertyItem *rna_BrushTextureSlot_map_mode_itemf(bContext *C,
1055  PointerRNA *UNUSED(ptr),
1056  PropertyRNA *UNUSED(prop),
1057  bool *UNUSED(r_free))
1058 {
1059 
1060  if (C == NULL) {
1062  }
1063 
1064 # define rna_enum_brush_texture_slot_map_sculpt_mode_items \
1065  rna_enum_brush_texture_slot_map_all_mode_items;
1066 
1068  if (mode == PAINT_MODE_SCULPT) {
1069  return rna_enum_brush_texture_slot_map_sculpt_mode_items;
1070  }
1071  return rna_enum_brush_texture_slot_map_texture_mode_items;
1072 
1073 # undef rna_enum_brush_texture_slot_map_sculpt_mode_items
1074 }
1075 
1076 #else
1077 
1079 {
1080  StructRNA *srna;
1081  PropertyRNA *prop;
1082 
1083  static const EnumPropertyItem prop_mask_paint_map_mode_items[] = {
1084  {MTEX_MAP_MODE_VIEW, "VIEW_PLANE", 0, "View Plane", ""},
1085  {MTEX_MAP_MODE_TILED, "TILED", 0, "Tiled", ""},
1086  {MTEX_MAP_MODE_RANDOM, "RANDOM", 0, "Random", ""},
1087  {MTEX_MAP_MODE_STENCIL, "STENCIL", 0, "Stencil", ""},
1088  {0, NULL, 0, NULL, NULL},
1089  };
1090 
1091 # define TEXTURE_CAPABILITY(prop_name_, ui_name_) \
1092  prop = RNA_def_property(srna, #prop_name_, PROP_BOOLEAN, PROP_NONE); \
1093  RNA_def_property_clear_flag(prop, PROP_EDITABLE); \
1094  RNA_def_property_boolean_funcs(prop, "rna_TextureCapabilities_" #prop_name_ "_get", NULL); \
1095  RNA_def_property_ui_text(prop, ui_name_, NULL)
1096 
1097  srna = RNA_def_struct(brna, "BrushTextureSlot", "TextureSlot");
1098  RNA_def_struct_sdna(srna, "MTex");
1100  srna, "Brush Texture Slot", "Texture slot for textures in a Brush data-block");
1101 
1102  prop = RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE);
1103  RNA_def_property_float_sdna(prop, NULL, "rot");
1104  RNA_def_property_range(prop, 0, M_PI * 2);
1105  RNA_def_property_ui_text(prop, "Angle", "Brush texture rotation");
1107  RNA_def_property_update(prop, 0, "rna_TextureSlot_brush_angle_update");
1108 
1109  prop = RNA_def_property(srna, "map_mode", PROP_ENUM, PROP_NONE);
1110  RNA_def_property_enum_sdna(prop, NULL, "brush_map_mode");
1112  RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_BrushTextureSlot_map_mode_itemf");
1113  RNA_def_property_ui_text(prop, "Mode", "");
1115  RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
1116 
1117  prop = RNA_def_property(srna, "mask_map_mode", PROP_ENUM, PROP_NONE);
1118  RNA_def_property_enum_sdna(prop, NULL, "brush_map_mode");
1119  RNA_def_property_enum_items(prop, prop_mask_paint_map_mode_items);
1120  RNA_def_property_ui_text(prop, "Mode", "");
1122  RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
1123 
1124  prop = RNA_def_property(srna, "use_rake", PROP_BOOLEAN, PROP_NONE);
1125  RNA_def_property_boolean_sdna(prop, NULL, "brush_angle_mode", MTEX_ANGLE_RAKE);
1126  RNA_def_property_ui_text(prop, "Rake", "");
1128  RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
1129 
1130  prop = RNA_def_property(srna, "use_random", PROP_BOOLEAN, PROP_NONE);
1131  RNA_def_property_boolean_sdna(prop, NULL, "brush_angle_mode", MTEX_ANGLE_RANDOM);
1132  RNA_def_property_ui_text(prop, "Random", "");
1134  RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
1135 
1136  prop = RNA_def_property(srna, "random_angle", PROP_FLOAT, PROP_ANGLE);
1137  RNA_def_property_range(prop, 0, M_PI * 2);
1138  RNA_def_property_ui_text(prop, "Random Angle", "Brush texture random angle");
1140  RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
1141 
1142  TEXTURE_CAPABILITY(has_texture_angle_source, "Has Texture Angle Source");
1143  TEXTURE_CAPABILITY(has_random_texture_angle, "Has Random Texture Angle");
1144  TEXTURE_CAPABILITY(has_texture_angle, "Has Texture Angle Source");
1145 }
1146 
1148 {
1149  StructRNA *srna;
1150  PropertyRNA *prop;
1151 
1152  srna = RNA_def_struct(brna, "BrushCapabilitiesSculpt", NULL);
1153  RNA_def_struct_sdna(srna, "Brush");
1154  RNA_def_struct_nested(brna, srna, "Brush");
1156  "Sculpt Capabilities",
1157  "Read-only indications of which brush operations "
1158  "are supported by the current sculpt tool");
1159 
1160 # define SCULPT_TOOL_CAPABILITY(prop_name_, ui_name_) \
1161  prop = RNA_def_property(srna, #prop_name_, PROP_BOOLEAN, PROP_NONE); \
1162  RNA_def_property_clear_flag(prop, PROP_EDITABLE); \
1163  RNA_def_property_boolean_funcs( \
1164  prop, "rna_BrushCapabilitiesSculpt_" #prop_name_ "_get", NULL); \
1165  RNA_def_property_ui_text(prop, ui_name_, NULL)
1166 
1167  SCULPT_TOOL_CAPABILITY(has_accumulate, "Has Accumulate");
1168  SCULPT_TOOL_CAPABILITY(has_auto_smooth, "Has Auto Smooth");
1169  SCULPT_TOOL_CAPABILITY(has_topology_rake, "Has Topology Rake");
1170  SCULPT_TOOL_CAPABILITY(has_height, "Has Height");
1171  SCULPT_TOOL_CAPABILITY(has_jitter, "Has Jitter");
1172  SCULPT_TOOL_CAPABILITY(has_normal_weight, "Has Crease/Pinch Factor");
1173  SCULPT_TOOL_CAPABILITY(has_rake_factor, "Has Rake Factor");
1174  SCULPT_TOOL_CAPABILITY(has_persistence, "Has Persistence");
1175  SCULPT_TOOL_CAPABILITY(has_pinch_factor, "Has Pinch Factor");
1176  SCULPT_TOOL_CAPABILITY(has_plane_offset, "Has Plane Offset");
1177  SCULPT_TOOL_CAPABILITY(has_random_texture_angle, "Has Random Texture Angle");
1178  SCULPT_TOOL_CAPABILITY(has_sculpt_plane, "Has Sculpt Plane");
1179  SCULPT_TOOL_CAPABILITY(has_color, "Has Color");
1180  SCULPT_TOOL_CAPABILITY(has_secondary_color, "Has Secondary Color");
1181  SCULPT_TOOL_CAPABILITY(has_smooth_stroke, "Has Smooth Stroke");
1182  SCULPT_TOOL_CAPABILITY(has_space_attenuation, "Has Space Attenuation");
1183  SCULPT_TOOL_CAPABILITY(has_strength_pressure, "Has Strength Pressure");
1184  SCULPT_TOOL_CAPABILITY(has_direction, "Has Direction");
1185  SCULPT_TOOL_CAPABILITY(has_gravity, "Has Gravity");
1186  SCULPT_TOOL_CAPABILITY(has_tilt, "Has Tilt");
1187 
1188 # undef SCULPT_CAPABILITY
1189 }
1190 
1192 {
1193  StructRNA *srna;
1194  PropertyRNA *prop;
1195 
1196  srna = RNA_def_struct(brna, "BrushCapabilities", NULL);
1197  RNA_def_struct_sdna(srna, "Brush");
1198  RNA_def_struct_nested(brna, srna, "Brush");
1200  srna, "Brush Capabilities", "Read-only indications of supported operations");
1201 
1202 # define BRUSH_CAPABILITY(prop_name_, ui_name_) \
1203  prop = RNA_def_property(srna, #prop_name_, PROP_BOOLEAN, PROP_NONE); \
1204  RNA_def_property_clear_flag(prop, PROP_EDITABLE); \
1205  RNA_def_property_boolean_funcs(prop, "rna_BrushCapabilities_" #prop_name_ "_get", NULL); \
1206  RNA_def_property_ui_text(prop, ui_name_, NULL)
1207 
1208  BRUSH_CAPABILITY(has_overlay, "Has Overlay");
1209  BRUSH_CAPABILITY(has_random_texture_angle, "Has Random Texture Angle");
1210  BRUSH_CAPABILITY(has_spacing, "Has Spacing");
1211  BRUSH_CAPABILITY(has_smooth_stroke, "Has Smooth Stroke");
1212 
1213 # undef BRUSH_CAPABILITY
1214 }
1215 
1217 {
1218  StructRNA *srna;
1219  PropertyRNA *prop;
1220 
1221  srna = RNA_def_struct(brna, "BrushCapabilitiesImagePaint", NULL);
1222  RNA_def_struct_sdna(srna, "Brush");
1223  RNA_def_struct_nested(brna, srna, "Brush");
1225  srna, "Image Paint Capabilities", "Read-only indications of supported operations");
1226 
1227 # define IMAPAINT_TOOL_CAPABILITY(prop_name_, ui_name_) \
1228  prop = RNA_def_property(srna, #prop_name_, PROP_BOOLEAN, PROP_NONE); \
1229  RNA_def_property_clear_flag(prop, PROP_EDITABLE); \
1230  RNA_def_property_boolean_funcs( \
1231  prop, "rna_BrushCapabilitiesImagePaint_" #prop_name_ "_get", NULL); \
1232  RNA_def_property_ui_text(prop, ui_name_, NULL)
1233 
1234  IMAPAINT_TOOL_CAPABILITY(has_accumulate, "Has Accumulate");
1235  IMAPAINT_TOOL_CAPABILITY(has_space_attenuation, "Has Space Attenuation");
1236  IMAPAINT_TOOL_CAPABILITY(has_radius, "Has Radius");
1237  IMAPAINT_TOOL_CAPABILITY(has_color, "Has Color");
1238 
1239 # undef IMAPAINT_TOOL_CAPABILITY
1240 }
1241 
1243 {
1244  StructRNA *srna;
1245  PropertyRNA *prop;
1246 
1247  srna = RNA_def_struct(brna, "BrushCapabilitiesVertexPaint", NULL);
1248  RNA_def_struct_sdna(srna, "Brush");
1249  RNA_def_struct_nested(brna, srna, "Brush");
1251  srna, "Vertex Paint Capabilities", "Read-only indications of supported operations");
1252 
1253 # define VPAINT_TOOL_CAPABILITY(prop_name_, ui_name_) \
1254  prop = RNA_def_property(srna, #prop_name_, PROP_BOOLEAN, PROP_NONE); \
1255  RNA_def_property_clear_flag(prop, PROP_EDITABLE); \
1256  RNA_def_property_boolean_funcs( \
1257  prop, "rna_BrushCapabilitiesVertexPaint_" #prop_name_ "_get", NULL); \
1258  RNA_def_property_ui_text(prop, ui_name_, NULL)
1259 
1260  VPAINT_TOOL_CAPABILITY(has_color, "Has Color");
1261 
1262 # undef VPAINT_TOOL_CAPABILITY
1263 }
1264 
1266 {
1267  StructRNA *srna;
1268  PropertyRNA *prop;
1269 
1270  srna = RNA_def_struct(brna, "BrushCapabilitiesWeightPaint", NULL);
1271  RNA_def_struct_sdna(srna, "Brush");
1272  RNA_def_struct_nested(brna, srna, "Brush");
1274  srna, "Weight Paint Capabilities", "Read-only indications of supported operations");
1275 
1276 # define WPAINT_TOOL_CAPABILITY(prop_name_, ui_name_) \
1277  prop = RNA_def_property(srna, #prop_name_, PROP_BOOLEAN, PROP_NONE); \
1278  RNA_def_property_clear_flag(prop, PROP_EDITABLE); \
1279  RNA_def_property_boolean_funcs( \
1280  prop, "rna_BrushCapabilitiesWeightPaint_" #prop_name_ "_get", NULL); \
1281  RNA_def_property_ui_text(prop, ui_name_, NULL)
1282 
1283  WPAINT_TOOL_CAPABILITY(has_weight, "Has Weight");
1284 
1285 # undef WPAINT_TOOL_CAPABILITY
1286 }
1287 
1289 {
1290  StructRNA *srna;
1291  PropertyRNA *prop;
1292 
1293  /* modes */
1294  static EnumPropertyItem gppaint_mode_types_items[] = {
1295  {GPPAINT_MODE_STROKE, "STROKE", 0, "Stroke", "Vertex Color affects to Stroke only"},
1296  {GPPAINT_MODE_FILL, "FILL", 0, "Fill", "Vertex Color affects to Fill only"},
1297  {GPPAINT_MODE_BOTH, "BOTH", 0, "Stroke & Fill", "Vertex Color affects to Stroke and Fill"},
1298  {0, NULL, 0, NULL, NULL},
1299  };
1300 
1301  static EnumPropertyItem rna_enum_gpencil_brush_caps_types_items[] = {
1302  {GP_STROKE_CAP_ROUND, "ROUND", ICON_GP_CAPS_ROUND, "Round", ""},
1303  {GP_STROKE_CAP_FLAT, "FLAT", ICON_GP_CAPS_FLAT, "Flat", ""},
1304  {0, NULL, 0, NULL, NULL},
1305  };
1306 
1307  srna = RNA_def_struct(brna, "BrushGpencilSettings", NULL);
1308  RNA_def_struct_sdna(srna, "BrushGpencilSettings");
1309  RNA_def_struct_path_func(srna, "rna_BrushGpencilSettings_path");
1310  RNA_def_struct_ui_text(srna, "Grease Pencil Brush Settings", "Settings for grease pencil brush");
1311 
1312  /* Strength factor for new strokes */
1313  prop = RNA_def_property(srna, "pen_strength", PROP_FLOAT, PROP_FACTOR);
1314  RNA_def_property_float_sdna(prop, NULL, "draw_strength");
1315  RNA_def_property_range(prop, 0.0f, 1.0f);
1316  RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
1318  prop, "Strength", "Color strength for new strokes (affect alpha factor of color)");
1321 
1322  /* Jitter factor for new strokes */
1323  prop = RNA_def_property(srna, "pen_jitter", PROP_FLOAT, PROP_FACTOR);
1324  RNA_def_property_float_sdna(prop, NULL, "draw_jitter");
1325  RNA_def_property_range(prop, 0.0f, 1.0f);
1326  RNA_def_property_ui_text(prop, "Jitter", "Jitter factor for new strokes");
1329 
1330  /* Randomness factor for pressure */
1331  prop = RNA_def_property(srna, "random_pressure", PROP_FLOAT, PROP_FACTOR);
1332  RNA_def_property_float_sdna(prop, NULL, "draw_random_press");
1333  RNA_def_property_range(prop, 0.0f, 1.0f);
1335  prop, "Pressure Randomness", "Randomness factor for pressure in new strokes");
1338 
1339  /* Randomness factor for strength */
1340  prop = RNA_def_property(srna, "random_strength", PROP_FLOAT, PROP_FACTOR);
1341  RNA_def_property_float_sdna(prop, NULL, "draw_random_strength");
1342  RNA_def_property_range(prop, 0.0f, 1.0f);
1344  prop, "Strength Randomness", "Randomness factor strength in new strokes");
1347 
1348  /* Angle when brush is full size */
1349  prop = RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE);
1350  RNA_def_property_float_sdna(prop, NULL, "draw_angle");
1353  "Angle",
1354  "Direction of the stroke at which brush gives maximal thickness "
1355  "(0° for horizontal)");
1358 
1359  /* Factor to change brush size depending of angle */
1360  prop = RNA_def_property(srna, "angle_factor", PROP_FLOAT, PROP_FACTOR);
1361  RNA_def_property_float_sdna(prop, NULL, "draw_angle_factor");
1362  RNA_def_property_range(prop, 0.0f, 1.0f);
1364  prop,
1365  "Angle Factor",
1366  "Reduce brush thickness by this factor when stroke is perpendicular to 'Angle' direction");
1369 
1370  /* Smoothing factor for new strokes */
1371  prop = RNA_def_property(srna, "pen_smooth_factor", PROP_FLOAT, PROP_NONE);
1372  RNA_def_property_float_sdna(prop, NULL, "draw_smoothfac");
1373  RNA_def_property_range(prop, 0.0, 2.0);
1374  RNA_def_property_ui_range(prop, 0.0, 1.0, 10, 3);
1376  prop,
1377  "Smooth",
1378  "Amount of smoothing to apply after finish newly created strokes, to reduce jitter/noise");
1381 
1382  /* Iterations of the Smoothing factor */
1383  prop = RNA_def_property(srna, "pen_smooth_steps", PROP_INT, PROP_NONE);
1384  RNA_def_property_int_sdna(prop, NULL, "draw_smoothlvl");
1385  RNA_def_property_range(prop, 0, 100);
1386  RNA_def_property_ui_text(prop, "Iterations", "Number of times to smooth newly created strokes");
1389 
1390  /* Subdivision level for new strokes */
1391  prop = RNA_def_property(srna, "pen_subdivision_steps", PROP_INT, PROP_NONE);
1392  RNA_def_property_int_sdna(prop, NULL, "draw_subdivide");
1393  RNA_def_property_range(prop, 0, 3);
1395  prop,
1396  "Subdivision Steps",
1397  "Number of times to subdivide newly created strokes, for less jagged strokes");
1400 
1401  /* Simplify factor */
1402  prop = RNA_def_property(srna, "simplify_factor", PROP_FLOAT, PROP_NONE);
1403  RNA_def_property_float_sdna(prop, NULL, "simplify_f");
1404  RNA_def_property_range(prop, 0, 100.0);
1405  RNA_def_property_ui_range(prop, 0, 100.0, 1.0f, 3);
1406  RNA_def_property_ui_text(prop, "Simplify", "Factor of Simplify using adaptive algorithm");
1408 
1409  /* Curves for pressure */
1410  prop = RNA_def_property(srna, "curve_sensitivity", PROP_POINTER, PROP_NONE);
1411  RNA_def_property_pointer_sdna(prop, NULL, "curve_sensitivity");
1412  RNA_def_property_struct_type(prop, "CurveMapping");
1413  RNA_def_property_ui_text(prop, "Curve Sensitivity", "Curve used for the sensitivity");
1416 
1417  prop = RNA_def_property(srna, "curve_strength", PROP_POINTER, PROP_NONE);
1418  RNA_def_property_pointer_sdna(prop, NULL, "curve_strength");
1419  RNA_def_property_struct_type(prop, "CurveMapping");
1420  RNA_def_property_ui_text(prop, "Curve Strength", "Curve used for the strength");
1423 
1424  prop = RNA_def_property(srna, "curve_jitter", PROP_POINTER, PROP_NONE);
1425  RNA_def_property_pointer_sdna(prop, NULL, "curve_jitter");
1426  RNA_def_property_struct_type(prop, "CurveMapping");
1427  RNA_def_property_ui_text(prop, "Curve Jitter", "Curve used for the jitter effect");
1430 
1431  prop = RNA_def_property(srna, "curve_random_pressure", PROP_POINTER, PROP_NONE);
1432  RNA_def_property_pointer_sdna(prop, NULL, "curve_rand_pressure");
1433  RNA_def_property_struct_type(prop, "CurveMapping");
1434  RNA_def_property_ui_text(prop, "Random Curve", "Curve used for modulating effect");
1437 
1438  prop = RNA_def_property(srna, "curve_random_strength", PROP_POINTER, PROP_NONE);
1439  RNA_def_property_pointer_sdna(prop, NULL, "curve_rand_strength");
1440  RNA_def_property_struct_type(prop, "CurveMapping");
1441  RNA_def_property_ui_text(prop, "Random Curve", "Curve used for modulating effect");
1444 
1445  prop = RNA_def_property(srna, "curve_random_uv", PROP_POINTER, PROP_NONE);
1446  RNA_def_property_pointer_sdna(prop, NULL, "curve_rand_uv");
1447  RNA_def_property_struct_type(prop, "CurveMapping");
1448  RNA_def_property_ui_text(prop, "Random Curve", "Curve used for modulating effect");
1451 
1452  prop = RNA_def_property(srna, "curve_random_hue", PROP_POINTER, PROP_NONE);
1453  RNA_def_property_pointer_sdna(prop, NULL, "curve_rand_hue");
1454  RNA_def_property_struct_type(prop, "CurveMapping");
1455  RNA_def_property_ui_text(prop, "Random Curve", "Curve used for modulating effect");
1458 
1459  prop = RNA_def_property(srna, "curve_random_saturation", PROP_POINTER, PROP_NONE);
1460  RNA_def_property_pointer_sdna(prop, NULL, "curve_rand_saturation");
1461  RNA_def_property_struct_type(prop, "CurveMapping");
1462  RNA_def_property_ui_text(prop, "Random Curve", "Curve used for modulating effect");
1465 
1466  prop = RNA_def_property(srna, "curve_random_value", PROP_POINTER, PROP_NONE);
1467  RNA_def_property_pointer_sdna(prop, NULL, "curve_rand_value");
1468  RNA_def_property_struct_type(prop, "CurveMapping");
1469  RNA_def_property_ui_text(prop, "Random Curve", "Curve used for modulating effect");
1472 
1473  /* Fill threshold for transparency. */
1474  prop = RNA_def_property(srna, "fill_threshold", PROP_FLOAT, PROP_FACTOR);
1475  RNA_def_property_float_sdna(prop, NULL, "fill_threshold");
1476  RNA_def_property_range(prop, 0.0f, 1.0f);
1478  prop, "Threshold", "Threshold to consider color transparent for filling");
1481 
1482  /* fill leak size */
1483  prop = RNA_def_property(srna, "fill_leak", PROP_INT, PROP_PIXEL);
1484  RNA_def_property_int_sdna(prop, NULL, "fill_leak");
1485  RNA_def_property_range(prop, 0, 100);
1486  RNA_def_property_ui_text(prop, "Leak Size", "Size in pixels to consider the leak closed");
1489 
1490  /* fill factor size */
1491  prop = RNA_def_property(srna, "fill_factor", PROP_FLOAT, PROP_NONE);
1492  RNA_def_property_float_sdna(prop, NULL, "fill_factor");
1495  prop,
1496  "Precision",
1497  "Factor for fill boundary accuracy, higher values are more accurate but slower");
1500 
1501  /* fill simplify steps */
1502  prop = RNA_def_property(srna, "fill_simplify_level", PROP_INT, PROP_NONE);
1503  RNA_def_property_int_sdna(prop, NULL, "fill_simplylvl");
1504  RNA_def_property_range(prop, 0, 10);
1506  prop, "Simplify", "Number of simplify steps (large values reduce fill accuracy)");
1509 
1510  prop = RNA_def_property(srna, "uv_random", PROP_FLOAT, PROP_FACTOR);
1511  RNA_def_property_float_sdna(prop, NULL, "uv_random");
1512  RNA_def_property_range(prop, 0.0, 1.0);
1513  RNA_def_property_ui_text(prop, "UV Random", "Random factor for auto-generated UV rotation");
1516 
1517  /* gradient control */
1518  prop = RNA_def_property(srna, "hardness", PROP_FLOAT, PROP_FACTOR);
1519  RNA_def_property_float_sdna(prop, NULL, "hardeness");
1520  RNA_def_property_range(prop, 0.001f, 1.0f);
1521  RNA_def_property_float_default(prop, 1.0f);
1523  prop,
1524  "Hardness",
1525  "Gradient from the center of Dot and Box strokes (set to 1 for a solid stroke)");
1527 
1528  /* gradient shape ratio */
1529  prop = RNA_def_property(srna, "aspect", PROP_FLOAT, PROP_XYZ);
1530  RNA_def_property_float_sdna(prop, NULL, "aspect_ratio");
1531  RNA_def_property_array(prop, 2);
1532  RNA_def_property_range(prop, 0.01f, 1.0f);
1533  RNA_def_property_float_default(prop, 1.0f);
1534  RNA_def_property_ui_text(prop, "Aspect", "");
1536 
1537  prop = RNA_def_property(srna, "input_samples", PROP_INT, PROP_NONE);
1538  RNA_def_property_int_sdna(prop, NULL, "input_samples");
1541  prop,
1542  "Input Samples",
1543  "Generate intermediate points for very fast mouse movements. Set to 0 to disable");
1546 
1547  /* active smooth factor while drawing */
1548  prop = RNA_def_property(srna, "active_smooth_factor", PROP_FLOAT, PROP_FACTOR);
1549  RNA_def_property_float_sdna(prop, NULL, "active_smooth");
1550  RNA_def_property_range(prop, 0.0f, 1.0f);
1551  RNA_def_property_ui_text(prop, "Active Smooth", "Amount of smoothing while drawing");
1554 
1555  prop = RNA_def_property(srna, "eraser_strength_factor", PROP_FLOAT, PROP_PERCENTAGE);
1556  RNA_def_property_float_sdna(prop, NULL, "era_strength_f");
1557  RNA_def_property_range(prop, 0.0, 100.0);
1558  RNA_def_property_ui_range(prop, 0.0, 100.0, 10, 1);
1559  RNA_def_property_ui_text(prop, "Affect Stroke Strength", "Amount of erasing for strength");
1562 
1563  prop = RNA_def_property(srna, "eraser_thickness_factor", PROP_FLOAT, PROP_PERCENTAGE);
1564  RNA_def_property_float_sdna(prop, NULL, "era_thickness_f");
1565  RNA_def_property_range(prop, 0.0, 100.0);
1566  RNA_def_property_ui_range(prop, 0.0, 100.0, 10, 1);
1567  RNA_def_property_ui_text(prop, "Affect Stroke Thickness", "Amount of erasing for thickness");
1570 
1571  /* brush standard icon */
1572  prop = RNA_def_property(srna, "gpencil_paint_icon", PROP_ENUM, PROP_NONE);
1573  RNA_def_property_enum_sdna(prop, NULL, "icon_id");
1576  RNA_def_property_ui_text(prop, "Grease Pencil Icon", "");
1577 
1578  prop = RNA_def_property(srna, "gpencil_sculpt_icon", PROP_ENUM, PROP_NONE);
1579  RNA_def_property_enum_sdna(prop, NULL, "icon_id");
1582  RNA_def_property_ui_text(prop, "Grease Pencil Icon", "");
1583 
1584  prop = RNA_def_property(srna, "gpencil_weight_icon", PROP_ENUM, PROP_NONE);
1585  RNA_def_property_enum_sdna(prop, NULL, "icon_id");
1588  RNA_def_property_ui_text(prop, "Grease Pencil Icon", "");
1589 
1590  prop = RNA_def_property(srna, "gpencil_vertex_icon", PROP_ENUM, PROP_NONE);
1591  RNA_def_property_enum_sdna(prop, NULL, "icon_id");
1594  RNA_def_property_ui_text(prop, "Grease Pencil Icon", "");
1595 
1596  /* Mode type. */
1597  prop = RNA_def_property(srna, "vertex_mode", PROP_ENUM, PROP_NONE);
1598  RNA_def_property_enum_bitflag_sdna(prop, NULL, "vertex_mode");
1599  RNA_def_property_enum_items(prop, gppaint_mode_types_items);
1600  RNA_def_property_ui_text(prop, "Mode Type", "Defines how vertex color affect to the strokes");
1602 
1603  /* Vertex Color mix factor. */
1604  prop = RNA_def_property(srna, "vertex_color_factor", PROP_FLOAT, PROP_FACTOR);
1605  RNA_def_property_float_sdna(prop, NULL, "vertex_factor");
1606  RNA_def_property_range(prop, 0.0f, 1.0f);
1609  prop, "Vertex Color Factor", "Factor used to mix vertex color to get final color");
1610 
1611  /* Hue randomness. */
1612  prop = RNA_def_property(srna, "random_hue_factor", PROP_FLOAT, PROP_FACTOR);
1613  RNA_def_property_float_sdna(prop, NULL, "random_hue");
1614  RNA_def_property_range(prop, 0.0f, 1.0f);
1615  RNA_def_property_float_default(prop, 0.0f);
1616  RNA_def_property_ui_text(prop, "Hue", "Random factor to modify original hue");
1618 
1619  /* Saturation randomness. */
1620  prop = RNA_def_property(srna, "random_saturation_factor", PROP_FLOAT, PROP_FACTOR);
1621  RNA_def_property_float_sdna(prop, NULL, "random_saturation");
1622  RNA_def_property_range(prop, 0.0f, 1.0f);
1623  RNA_def_property_float_default(prop, 0.0f);
1624  RNA_def_property_ui_text(prop, "Saturation", "Random factor to modify original saturation");
1626 
1627  /* Value randomness. */
1628  prop = RNA_def_property(srna, "random_value_factor", PROP_FLOAT, PROP_FACTOR);
1629  RNA_def_property_float_sdna(prop, NULL, "random_value");
1630  RNA_def_property_range(prop, 0.0f, 1.0f);
1631  RNA_def_property_float_default(prop, 0.0f);
1632  RNA_def_property_ui_text(prop, "Value", "Random factor to modify original value");
1634 
1635  /* Factor to extend stroke extremes in Fill tool. */
1636  prop = RNA_def_property(srna, "extend_stroke_factor", PROP_FLOAT, PROP_NONE);
1637  RNA_def_property_float_sdna(prop, NULL, "fill_extend_fac");
1638  RNA_def_property_range(prop, 0.0f, 10.0f);
1639  RNA_def_property_float_default(prop, 0.0f);
1641  prop, "Stroke Extension", "Strokes end extension for closing gaps, use zero to disable");
1643 
1644  /* Number of pixels to dilate fill area. Negative values contract the filled area. */
1645  prop = RNA_def_property(srna, "dilate", PROP_INT, PROP_PIXEL);
1646  RNA_def_property_int_sdna(prop, NULL, "dilate_pixels");
1647  RNA_def_property_range(prop, -40, 40);
1650  prop, "Dilate/Contract", "Number of pixels to expand or contract fill area");
1653 
1654  /* Flags */
1655  prop = RNA_def_property(srna, "use_pressure", PROP_BOOLEAN, PROP_NONE);
1657  RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
1658  RNA_def_property_ui_text(prop, "Use Pressure", "Use tablet pressure");
1661 
1662  prop = RNA_def_property(srna, "use_strength_pressure", PROP_BOOLEAN, PROP_NONE);
1664  RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
1666  prop, "Use Pressure Strength", "Use tablet pressure for color strength");
1669 
1670  prop = RNA_def_property(srna, "use_jitter_pressure", PROP_BOOLEAN, PROP_NONE);
1672  RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
1673  RNA_def_property_ui_text(prop, "Use Pressure Jitter", "Use tablet pressure for jitter");
1676 
1677  prop = RNA_def_property(srna, "use_stroke_random_hue", PROP_BOOLEAN, PROP_NONE);
1679  RNA_def_property_ui_icon(prop, ICON_GP_SELECT_STROKES, 0);
1680  RNA_def_property_ui_text(prop, "Stroke Random", "Use randomness at stroke level");
1683 
1684  prop = RNA_def_property(srna, "use_stroke_random_sat", PROP_BOOLEAN, PROP_NONE);
1686  RNA_def_property_ui_icon(prop, ICON_GP_SELECT_STROKES, 0);
1687  RNA_def_property_ui_text(prop, "Stroke Random", "Use randomness at stroke level");
1690 
1691  prop = RNA_def_property(srna, "use_stroke_random_val", PROP_BOOLEAN, PROP_NONE);
1693  RNA_def_property_ui_icon(prop, ICON_GP_SELECT_STROKES, 0);
1694  RNA_def_property_ui_text(prop, "Stroke Random", "Use randomness at stroke level");
1697 
1698  prop = RNA_def_property(srna, "use_stroke_random_radius", PROP_BOOLEAN, PROP_NONE);
1700  RNA_def_property_ui_icon(prop, ICON_GP_SELECT_STROKES, 0);
1701  RNA_def_property_ui_text(prop, "Stroke Random", "Use randomness at stroke level");
1704 
1705  prop = RNA_def_property(srna, "use_stroke_random_strength", PROP_BOOLEAN, PROP_NONE);
1707  RNA_def_property_ui_icon(prop, ICON_GP_SELECT_STROKES, 0);
1708  RNA_def_property_ui_text(prop, "Stroke Random", "Use randomness at stroke level");
1711 
1712  prop = RNA_def_property(srna, "use_stroke_random_uv", PROP_BOOLEAN, PROP_NONE);
1714  RNA_def_property_ui_icon(prop, ICON_GP_SELECT_STROKES, 0);
1715  RNA_def_property_ui_text(prop, "Stroke Random", "Use randomness at stroke level");
1718 
1719  prop = RNA_def_property(srna, "use_random_press_hue", PROP_BOOLEAN, PROP_NONE);
1721  RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
1722  RNA_def_property_ui_text(prop, "Use Pressure", "Use pressure to modulate randomness");
1725 
1726  prop = RNA_def_property(srna, "use_random_press_sat", PROP_BOOLEAN, PROP_NONE);
1728  RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
1729  RNA_def_property_ui_text(prop, "Use Pressure", "Use pressure to modulate randomness");
1732 
1733  prop = RNA_def_property(srna, "use_random_press_val", PROP_BOOLEAN, PROP_NONE);
1735  RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
1736  RNA_def_property_ui_text(prop, "Use Pressure", "Use pressure to modulate randomness");
1739 
1740  prop = RNA_def_property(srna, "use_random_press_radius", PROP_BOOLEAN, PROP_NONE);
1742  RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
1743  RNA_def_property_ui_text(prop, "Use Pressure", "Use pressure to modulate randomness");
1746 
1747  prop = RNA_def_property(srna, "use_random_press_strength", PROP_BOOLEAN, PROP_NONE);
1749  RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
1750  RNA_def_property_ui_text(prop, "Use Pressure", "Use pressure to modulate randomness");
1753 
1754  prop = RNA_def_property(srna, "use_random_press_uv", PROP_BOOLEAN, PROP_NONE);
1756  RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
1757  RNA_def_property_ui_text(prop, "Use Pressure", "Use pressure to modulate randomness");
1760 
1761  prop = RNA_def_property(srna, "use_settings_stabilizer", PROP_BOOLEAN, PROP_NONE);
1765  "Use Stabilizer",
1766  "Draw lines with a delay to allow smooth strokes. Press Shift key to "
1767  "override while drawing");
1769 
1770  prop = RNA_def_property(srna, "eraser_mode", PROP_ENUM, PROP_NONE);
1771  RNA_def_property_enum_sdna(prop, NULL, "eraser_mode");
1773  RNA_def_property_ui_text(prop, "Mode", "Eraser Mode");
1776  prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_eraser_mode_update");
1777 
1778  prop = RNA_def_property(srna, "caps_type", PROP_ENUM, PROP_NONE);
1779  RNA_def_property_enum_sdna(prop, NULL, "caps_type");
1780  RNA_def_property_enum_items(prop, rna_enum_gpencil_brush_caps_types_items);
1781  RNA_def_property_ui_text(prop, "Caps Type", "The shape of the start and end of the stroke");
1783 
1784  prop = RNA_def_property(srna, "fill_draw_mode", PROP_ENUM, PROP_NONE);
1785  RNA_def_property_enum_sdna(prop, NULL, "fill_draw_mode");
1787  RNA_def_property_ui_text(prop, "Mode", "Mode to draw boundary limits");
1789 
1790  prop = RNA_def_property(srna, "fill_layer_mode", PROP_ENUM, PROP_NONE);
1791  RNA_def_property_enum_sdna(prop, NULL, "fill_layer_mode");
1793  RNA_def_property_ui_text(prop, "Layer Mode", "Layers used as boundaries");
1795 
1796  prop = RNA_def_property(srna, "fill_direction", PROP_ENUM, PROP_NONE);
1797  RNA_def_property_enum_sdna(prop, NULL, "fill_direction");
1799  RNA_def_property_ui_text(prop, "Direction", "Direction of the fill");
1801 
1802  prop = RNA_def_property(srna, "pin_draw_mode", PROP_BOOLEAN, PROP_NONE);
1804  prop, "rna_GPencilBrush_pin_mode_get", "rna_GPencilBrush_pin_mode_set");
1805  RNA_def_property_ui_icon(prop, ICON_UNPINNED, 1);
1808  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencilBrush_pin_mode_update");
1809  RNA_def_property_ui_text(prop, "Pin Mode", "Pin the mode to the brush");
1810 
1811  prop = RNA_def_property(srna, "brush_draw_mode", PROP_ENUM, PROP_NONE);
1812  RNA_def_property_enum_sdna(prop, NULL, "brush_draw_mode");
1814  RNA_def_property_ui_text(prop, "Mode", "Preselected mode when using this brush");
1816 
1817  prop = RNA_def_property(srna, "use_trim", PROP_BOOLEAN, PROP_NONE);
1819  RNA_def_property_boolean_default(prop, false);
1820  RNA_def_property_ui_text(prop, "Trim Stroke Ends", "Trim intersecting stroke ends");
1822 
1823  prop = RNA_def_property(srna, "direction", PROP_ENUM, PROP_NONE);
1824  RNA_def_property_enum_bitflag_sdna(prop, NULL, "sculpt_flag");
1826  RNA_def_property_ui_text(prop, "Direction", "");
1829 
1830  prop = RNA_def_property(srna, "use_edit_position", PROP_BOOLEAN, PROP_NONE);
1832  RNA_def_property_ui_text(prop, "Affect Position", "The brush affects the position of the point");
1835 
1836  prop = RNA_def_property(srna, "use_edit_strength", PROP_BOOLEAN, PROP_NONE);
1839  prop, "Affect Strength", "The brush affects the color strength of the point");
1842 
1843  prop = RNA_def_property(srna, "use_edit_thickness", PROP_BOOLEAN, PROP_NONE);
1845  prop, NULL, "sculpt_mode_flag", GP_SCULPT_FLAGMODE_APPLY_THICKNESS);
1847  prop, "Affect Thickness", "The brush affects the thickness of the point");
1850 
1851  prop = RNA_def_property(srna, "use_edit_uv", PROP_BOOLEAN, PROP_NONE);
1853  RNA_def_property_ui_text(prop, "Affect UV", "The brush affects the UV rotation of the point");
1856 
1857  prop = RNA_def_property(srna, "use_automasking_stroke", PROP_BOOLEAN, PROP_NONE);
1859  prop, NULL, "sculpt_mode_flag", GP_SCULPT_FLAGMODE_AUTOMASK_STROKE);
1860  RNA_def_property_ui_text(prop, "Auto-Masking Strokes", "Mask strokes below brush cursor");
1863 
1864  prop = RNA_def_property(srna, "use_automasking_layer", PROP_BOOLEAN, PROP_NONE);
1866  RNA_def_property_ui_text(prop, "Auto-Masking Layer", "Mask strokes using active layer");
1869 
1870  prop = RNA_def_property(srna, "use_automasking_material", PROP_BOOLEAN, PROP_NONE);
1872  prop, NULL, "sculpt_mode_flag", GP_SCULPT_FLAGMODE_AUTOMASK_MATERIAL);
1873  RNA_def_property_ui_text(prop, "Auto-Masking Material", "Mask strokes using active material");
1876 
1877  /* Material */
1878  prop = RNA_def_property(srna, "material", PROP_POINTER, PROP_NONE);
1879  RNA_def_property_struct_type(prop, "Material");
1880  RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_BrushGpencilSettings_material_poll");
1882  RNA_def_property_ui_text(prop, "Material", "Material used for strokes drawn using this brush");
1884  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_Brush_material_update");
1885 
1886  prop = RNA_def_property(srna, "show_fill_boundary", PROP_BOOLEAN, PROP_NONE);
1889  RNA_def_property_ui_text(prop, "Show Lines", "Show help lines for filling to see boundaries");
1891 
1892  prop = RNA_def_property(srna, "show_fill_extend", PROP_BOOLEAN, PROP_NONE);
1895  RNA_def_property_ui_text(prop, "Show Extend Lines", "Show help lines for stroke extension");
1897 
1898  prop = RNA_def_property(srna, "show_fill", PROP_BOOLEAN, PROP_NONE);
1902  prop, "Show Fill", "Show transparent lines to use as boundary for filling");
1904 
1905  prop = RNA_def_property(srna, "use_fill_limit", PROP_BOOLEAN, PROP_NONE);
1908  RNA_def_property_ui_text(prop, "Limit to Viewport", "Fill only visible areas in viewport");
1910 
1911  prop = RNA_def_property(srna, "use_default_eraser", PROP_BOOLEAN, PROP_NONE);
1914  RNA_def_property_ui_icon(prop, ICON_UNPINNED, 1);
1916  prop, "Default Eraser", "Use this brush when enable eraser with fast switch key");
1919  prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_default_eraser_update");
1920 
1921  prop = RNA_def_property(srna, "use_settings_postprocess", PROP_BOOLEAN, PROP_NONE);
1924  prop, "Use Post-Process Settings", "Additional post processing options for new strokes");
1926 
1927  prop = RNA_def_property(srna, "use_settings_random", PROP_BOOLEAN, PROP_NONE);
1929  RNA_def_property_ui_text(prop, "Random Settings", "Random brush settings");
1931 
1932  prop = RNA_def_property(srna, "use_material_pin", PROP_BOOLEAN, PROP_NONE);
1935  RNA_def_property_ui_icon(prop, ICON_UNPINNED, 1);
1936  RNA_def_property_ui_text(prop, "Pin Material", "Keep material assigned to brush");
1939  prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_use_material_pin_update");
1940 
1941  prop = RNA_def_property(srna, "show_lasso", PROP_BOOLEAN, PROP_NONE);
1944  prop, "Show Lasso", "Do not display fill color while drawing the stroke");
1946 
1947  prop = RNA_def_property(srna, "use_occlude_eraser", PROP_BOOLEAN, PROP_NONE);
1949  RNA_def_property_ui_text(prop, "Occlude Eraser", "Erase only strokes visible and not occluded");
1951 }
1952 
1954 {
1955  StructRNA *srna;
1956  PropertyRNA *prop;
1957 
1958  static const EnumPropertyItem density_mode_items[] = {
1960  "AUTO",
1961  ICON_AUTO,
1962  "Auto",
1963  "Either add or remove curves depending on the minimum distance of the curves under the "
1964  "cursor"},
1966  "ADD",
1967  ICON_ADD,
1968  "Add",
1969  "Add new curves between existing curves, taking the minimum distance into account"},
1971  "REMOVE",
1972  ICON_REMOVE,
1973  "Remove",
1974  "Remove curves whose root points are too close"},
1975  {0, NULL, 0, NULL, NULL},
1976  };
1977 
1978  srna = RNA_def_struct(brna, "BrushCurvesSculptSettings", NULL);
1979  RNA_def_struct_sdna(srna, "BrushCurvesSculptSettings");
1980  RNA_def_struct_ui_text(srna, "Curves Sculpt Brush Settings", "");
1981 
1982  prop = RNA_def_property(srna, "add_amount", PROP_INT, PROP_NONE);
1984  RNA_def_property_ui_text(prop, "Count", "Number of curves added by the Add brush");
1985 
1986  prop = RNA_def_property(srna, "points_per_curve", PROP_INT, PROP_NONE);
1989  prop, "Points per Curve", "Number of control points in a newly added curve");
1990 
1991  prop = RNA_def_property(srna, "scale_uniform", PROP_BOOLEAN, PROP_NONE);
1994  "Scale Uniform",
1995  "Grow or shrink curves by changing their size uniformly instead of "
1996  "using trimming or extrapolation");
1997 
1998  prop = RNA_def_property(srna, "minimum_length", PROP_FLOAT, PROP_DISTANCE);
1999  RNA_def_property_range(prop, 0.0f, FLT_MAX);
2001  prop, "Minimum Length", "Avoid shrinking curves shorter than this length");
2002 
2003  prop = RNA_def_property(srna, "interpolate_length", PROP_BOOLEAN, PROP_NONE);
2006  prop, "Interpolate Length", "Use length of the curves in close proximity");
2007 
2008  prop = RNA_def_property(srna, "interpolate_point_count", PROP_BOOLEAN, PROP_NONE);
2012  "Interpolate Point Count",
2013  "Use the number of points from the curves in close proximity");
2014 
2015  prop = RNA_def_property(srna, "interpolate_shape", PROP_BOOLEAN, PROP_NONE);
2018  prop, "Interpolate Shape", "Use shape of the curves in close proximity");
2019 
2020  prop = RNA_def_property(srna, "curve_length", PROP_FLOAT, PROP_DISTANCE);
2021  RNA_def_property_range(prop, 0.0, FLT_MAX);
2023  prop,
2024  "Curve Length",
2025  "Length of newly added curves when it is not interpolated from other curves");
2026 
2027  prop = RNA_def_property(srna, "minimum_distance", PROP_FLOAT, PROP_DISTANCE);
2028  RNA_def_property_range(prop, 0.0f, FLT_MAX);
2029  RNA_def_property_ui_range(prop, 0.0, 1000.0f, 0.001, 2);
2031  prop, "Minimum Distance", "Goal distance between curve roots for the Density brush");
2032 
2033  prop = RNA_def_property(srna, "density_add_attempts", PROP_INT, PROP_NONE);
2036  prop, "Density Add Attempts", "How many times the Density brush tries to add a new curve");
2037 
2038  prop = RNA_def_property(srna, "density_mode", PROP_ENUM, PROP_NONE);
2039  RNA_def_property_enum_items(prop, density_mode_items);
2041  prop, "Density Mode", "Determines whether the brush adds or removes curves");
2042 }
2043 
2044 static void rna_def_brush(BlenderRNA *brna)
2045 {
2046  StructRNA *srna;
2047  PropertyRNA *prop;
2048 
2049  static const EnumPropertyItem prop_blend_items[] = {
2050  {IMB_BLEND_MIX, "MIX", 0, "Mix", "Use Mix blending mode while painting"},
2052  {IMB_BLEND_DARKEN, "DARKEN", 0, "Darken", "Use Darken blending mode while painting"},
2053  {IMB_BLEND_MUL, "MUL", 0, "Multiply", "Use Multiply blending mode while painting"},
2055  "COLORBURN",
2056  0,
2057  "Color Burn",
2058  "Use Color Burn blending mode while painting"},
2060  "LINEARBURN",
2061  0,
2062  "Linear Burn",
2063  "Use Linear Burn blending mode while painting"},
2065  {IMB_BLEND_LIGHTEN, "LIGHTEN", 0, "Lighten", "Use Lighten blending mode while painting"},
2066  {IMB_BLEND_SCREEN, "SCREEN", 0, "Screen", "Use Screen blending mode while painting"},
2068  "COLORDODGE",
2069  0,
2070  "Color Dodge",
2071  "Use Color Dodge blending mode while painting"},
2072  {IMB_BLEND_ADD, "ADD", 0, "Add", "Use Add blending mode while painting"},
2074  {IMB_BLEND_OVERLAY, "OVERLAY", 0, "Overlay", "Use Overlay blending mode while painting"},
2076  "SOFTLIGHT",
2077  0,
2078  "Soft Light",
2079  "Use Soft Light blending mode while painting"},
2081  "HARDLIGHT",
2082  0,
2083  "Hard Light",
2084  "Use Hard Light blending mode while painting"},
2086  "VIVIDLIGHT",
2087  0,
2088  "Vivid Light",
2089  "Use Vivid Light blending mode while painting"},
2091  "LINEARLIGHT",
2092  0,
2093  "Linear Light",
2094  "Use Linear Light blending mode while painting"},
2096  "PINLIGHT",
2097  0,
2098  "Pin Light",
2099  "Use Pin Light blending mode while painting"},
2102  "DIFFERENCE",
2103  0,
2104  "Difference",
2105  "Use Difference blending mode while painting"},
2107  "EXCLUSION",
2108  0,
2109  "Exclusion",
2110  "Use Exclusion blending mode while painting"},
2111  {IMB_BLEND_SUB, "SUB", 0, "Subtract", "Use Subtract blending mode while painting"},
2113  {IMB_BLEND_HUE, "HUE", 0, "Hue", "Use Hue blending mode while painting"},
2115  "SATURATION",
2116  0,
2117  "Saturation",
2118  "Use Saturation blending mode while painting"},
2119  {IMB_BLEND_COLOR, "COLOR", 0, "Color", "Use Color blending mode while painting"},
2120  {IMB_BLEND_LUMINOSITY, "LUMINOSITY", 0, "Value", "Use Value blending mode while painting"},
2122  {IMB_BLEND_ERASE_ALPHA, "ERASE_ALPHA", 0, "Erase Alpha", "Erase alpha while painting"},
2123  {IMB_BLEND_ADD_ALPHA, "ADD_ALPHA", 0, "Add Alpha", "Add alpha while painting"},
2124  {0, NULL, 0, NULL, NULL},
2125  };
2126 
2127  static const EnumPropertyItem brush_sculpt_plane_items[] = {
2128  {SCULPT_DISP_DIR_AREA, "AREA", 0, "Area Plane", ""},
2129  {SCULPT_DISP_DIR_VIEW, "VIEW", 0, "View Plane", ""},
2130  {SCULPT_DISP_DIR_X, "X", 0, "X Plane", ""},
2131  {SCULPT_DISP_DIR_Y, "Y", 0, "Y Plane", ""},
2132  {SCULPT_DISP_DIR_Z, "Z", 0, "Z Plane", ""},
2133  {0, NULL, 0, NULL, NULL},
2134  };
2135 
2136  static const EnumPropertyItem brush_mask_tool_items[] = {
2137  {BRUSH_MASK_DRAW, "DRAW", 0, "Draw", ""},
2138  {BRUSH_MASK_SMOOTH, "SMOOTH", 0, "Smooth", ""},
2139  {0, NULL, 0, NULL, NULL},
2140  };
2141 
2142  static const EnumPropertyItem brush_blur_mode_items[] = {
2143  {KERNEL_BOX, "BOX", 0, "Box", ""},
2144  {KERNEL_GAUSSIAN, "GAUSSIAN", 0, "Gaussian", ""},
2145  {0, NULL, 0, NULL, NULL},
2146  };
2147 
2148  static const EnumPropertyItem brush_gradient_items[] = {
2149  {BRUSH_GRADIENT_PRESSURE, "PRESSURE", 0, "Pressure", ""},
2150  {BRUSH_GRADIENT_SPACING_REPEAT, "SPACING_REPEAT", 0, "Repeat", ""},
2151  {BRUSH_GRADIENT_SPACING_CLAMP, "SPACING_CLAMP", 0, "Clamp", ""},
2152  {0, NULL, 0, NULL, NULL},
2153  };
2154 
2155  static const EnumPropertyItem brush_gradient_fill_items[] = {
2156  {BRUSH_GRADIENT_LINEAR, "LINEAR", 0, "Linear", ""},
2157  {BRUSH_GRADIENT_RADIAL, "RADIAL", 0, "Radial", ""},
2158  {0, NULL, 0, NULL, NULL},
2159  };
2160 
2161  static const EnumPropertyItem brush_mask_pressure_items[] = {
2162  {0, "NONE", 0, "Off", ""},
2163  {BRUSH_MASK_PRESSURE_RAMP, "RAMP", ICON_STYLUS_PRESSURE, "Ramp", ""},
2164  {BRUSH_MASK_PRESSURE_CUTOFF, "CUTOFF", ICON_STYLUS_PRESSURE, "Cutoff", ""},
2165  {0, NULL, 0, NULL, NULL},
2166  };
2167 
2168  static const EnumPropertyItem brush_size_unit_items[] = {
2169  {0, "VIEW", 0, "View", "Measure brush size relative to the view"},
2170  {BRUSH_LOCK_SIZE, "SCENE", 0, "Scene", "Measure brush size relative to the scene"},
2171  {0, NULL, 0, NULL, NULL},
2172  };
2173 
2174  static const EnumPropertyItem color_gradient_items[] = {
2175  {0, "COLOR", 0, "Color", "Paint with a single color"},
2176  {BRUSH_USE_GRADIENT, "GRADIENT", 0, "Gradient", "Paint with a gradient"},
2177  {0, NULL, 0, NULL, NULL},
2178  };
2179 
2180  static const EnumPropertyItem brush_spacing_unit_items[] = {
2181  {0, "VIEW", 0, "View", "Calculate brush spacing relative to the view"},
2183  "SCENE",
2184  0,
2185  "Scene",
2186  "Calculate brush spacing relative to the scene using the stroke location"},
2187  {0, NULL, 0, NULL, NULL},
2188  };
2189 
2190  static const EnumPropertyItem brush_jitter_unit_items[] = {
2191  {BRUSH_ABSOLUTE_JITTER, "VIEW", 0, "View", "Jittering happens in screen space, in pixels"},
2192  {0, "BRUSH", 0, "Brush", "Jittering happens relative to the brush size"},
2193  {0, NULL, 0, NULL, NULL},
2194  };
2195 
2196  static const EnumPropertyItem falloff_shape_unit_items[] = {
2197  {0, "SPHERE", 0, "Sphere", "Apply brush influence in a Sphere, outwards from the center"},
2199  "PROJECTED",
2200  0,
2201  "Projected",
2202  "Apply brush influence in a 2D circle, projected from the view"},
2203  {0, NULL, 0, NULL, NULL},
2204  };
2205 
2206  static const EnumPropertyItem brush_curve_preset_items[] = {
2207  {BRUSH_CURVE_CUSTOM, "CUSTOM", ICON_RNDCURVE, "Custom", ""},
2208  {BRUSH_CURVE_SMOOTH, "SMOOTH", ICON_SMOOTHCURVE, "Smooth", ""},
2209  {BRUSH_CURVE_SMOOTHER, "SMOOTHER", ICON_SMOOTHCURVE, "Smoother", ""},
2210  {BRUSH_CURVE_SPHERE, "SPHERE", ICON_SPHERECURVE, "Sphere", ""},
2211  {BRUSH_CURVE_ROOT, "ROOT", ICON_ROOTCURVE, "Root", ""},
2212  {BRUSH_CURVE_SHARP, "SHARP", ICON_SHARPCURVE, "Sharp", ""},
2213  {BRUSH_CURVE_LIN, "LIN", ICON_LINCURVE, "Linear", ""},
2214  {BRUSH_CURVE_POW4, "POW4", ICON_SHARPCURVE, "Sharper", ""},
2215  {BRUSH_CURVE_INVSQUARE, "INVSQUARE", ICON_INVERSESQUARECURVE, "Inverse Square", ""},
2216  {BRUSH_CURVE_CONSTANT, "CONSTANT", ICON_NOCURVE, "Constant", ""},
2217  {0, NULL, 0, NULL, NULL},
2218  };
2219 
2220  static const EnumPropertyItem brush_deformation_target_items[] = {
2222  "GEOMETRY",
2223  0,
2224  "Geometry",
2225  "Brush deformation displaces the vertices of the mesh"},
2227  "CLOTH_SIM",
2228  0,
2229  "Cloth Simulation",
2230  "Brush deforms the mesh by deforming the constraints of a cloth simulation"},
2231  {0, NULL, 0, NULL, NULL},
2232  };
2233 
2234  static const EnumPropertyItem brush_elastic_deform_type_items[] = {
2235  {BRUSH_ELASTIC_DEFORM_GRAB, "GRAB", 0, "Grab", ""},
2236  {BRUSH_ELASTIC_DEFORM_GRAB_BISCALE, "GRAB_BISCALE", 0, "Bi-Scale Grab", ""},
2237  {BRUSH_ELASTIC_DEFORM_GRAB_TRISCALE, "GRAB_TRISCALE", 0, "Tri-Scale Grab", ""},
2238  {BRUSH_ELASTIC_DEFORM_SCALE, "SCALE", 0, "Scale", ""},
2239  {BRUSH_ELASTIC_DEFORM_TWIST, "TWIST", 0, "Twist", ""},
2240  {0, NULL, 0, NULL, NULL},
2241  };
2242 
2243  static const EnumPropertyItem brush_snake_hook_deform_type_items[] = {
2245  "FALLOFF",
2246  0,
2247  "Radius Falloff",
2248  "Applies the brush falloff in the tip of the brush"},
2250  "ELASTIC",
2251  0,
2252  "Elastic",
2253  "Modifies the entire mesh using elastic deform"},
2254  {0, NULL, 0, NULL, NULL},
2255  };
2256 
2257  static const EnumPropertyItem brush_cloth_deform_type_items[] = {
2258  {BRUSH_CLOTH_DEFORM_DRAG, "DRAG", 0, "Drag", ""},
2259  {BRUSH_CLOTH_DEFORM_PUSH, "PUSH", 0, "Push", ""},
2260  {BRUSH_CLOTH_DEFORM_PINCH_POINT, "PINCH_POINT", 0, "Pinch Point", ""},
2262  "PINCH_PERPENDICULAR",
2263  0,
2264  "Pinch Perpendicular",
2265  ""},
2266  {BRUSH_CLOTH_DEFORM_INFLATE, "INFLATE", 0, "Inflate", ""},
2267  {BRUSH_CLOTH_DEFORM_GRAB, "GRAB", 0, "Grab", ""},
2268  {BRUSH_CLOTH_DEFORM_EXPAND, "EXPAND", 0, "Expand", ""},
2269  {BRUSH_CLOTH_DEFORM_SNAKE_HOOK, "SNAKE_HOOK", 0, "Snake Hook", ""},
2270  {0, NULL, 0, NULL, NULL},
2271  };
2272 
2273  static const EnumPropertyItem brush_cloth_force_falloff_type_items[] = {
2274  {BRUSH_CLOTH_FORCE_FALLOFF_RADIAL, "RADIAL", 0, "Radial", ""},
2275  {BRUSH_CLOTH_FORCE_FALLOFF_PLANE, "PLANE", 0, "Plane", ""},
2276  {0, NULL, 0, NULL, NULL},
2277  };
2278 
2279  static const EnumPropertyItem brush_boundary_falloff_type_items[] = {
2281  "CONSTANT",
2282  0,
2283  "Constant",
2284  "Applies the same deformation in the entire boundary"},
2286  "RADIUS",
2287  0,
2288  "Brush Radius",
2289  "Applies the deformation in a localized area limited by the brush radius"},
2291  "LOOP",
2292  0,
2293  "Loop",
2294  "Applies the brush falloff in a loop pattern"},
2296  "LOOP_INVERT",
2297  0,
2298  "Loop and Invert",
2299  "Applies the falloff radius in a loop pattern, inverting the displacement direction in "
2300  "each pattern repetition"},
2301  {0, NULL, 0, NULL, NULL},
2302  };
2303 
2304  static const EnumPropertyItem brush_cloth_simulation_area_type_items[] = {
2306  "LOCAL",
2307  0,
2308  "Local",
2309  "Simulates only a specific area around the brush limited by a fixed radius"},
2310  {BRUSH_CLOTH_SIMULATION_AREA_GLOBAL, "GLOBAL", 0, "Global", "Simulates the entire mesh"},
2312  "DYNAMIC",
2313  0,
2314  "Dynamic",
2315  "The active simulation area moves with the brush"},
2316  {0, NULL, 0, NULL, NULL},
2317  };
2318 
2319  static const EnumPropertyItem brush_smooth_deform_type_items[] = {
2321  "LAPLACIAN",
2322  0,
2323  "Laplacian",
2324  "Smooths the surface and the volume"},
2326  "SURFACE",
2327  0,
2328  "Surface",
2329  "Smooths the surface of the mesh, preserving the volume"},
2330  {0, NULL, 0, NULL, NULL},
2331  };
2332 
2333  static const EnumPropertyItem brush_pose_deform_type_items[] = {
2334  {BRUSH_POSE_DEFORM_ROTATE_TWIST, "ROTATE_TWIST", 0, "Rotate/Twist", ""},
2335  {BRUSH_POSE_DEFORM_SCALE_TRASLATE, "SCALE_TRANSLATE", 0, "Scale/Translate", ""},
2336  {BRUSH_POSE_DEFORM_SQUASH_STRETCH, "SQUASH_STRETCH", 0, "Squash & Stretch", ""},
2337  {0, NULL, 0, NULL, NULL},
2338  };
2339 
2340  static const EnumPropertyItem brush_pose_origin_type_items[] = {
2342  "TOPOLOGY",
2343  0,
2344  "Topology",
2345  "Sets the rotation origin automatically using the topology and shape of the mesh as a "
2346  "guide"},
2348  "FACE_SETS",
2349  0,
2350  "Face Sets",
2351  "Creates a pose segment per face sets, starting from the active face set"},
2353  "FACE_SETS_FK",
2354  0,
2355  "Face Sets FK",
2356  "Simulates an FK deformation using the Face Set under the cursor as control"},
2357  {0, NULL, 0, NULL, NULL},
2358  };
2359 
2360  static const EnumPropertyItem brush_smear_deform_type_items[] = {
2361  {BRUSH_SMEAR_DEFORM_DRAG, "DRAG", 0, "Drag", ""},
2362  {BRUSH_SMEAR_DEFORM_PINCH, "PINCH", 0, "Pinch", ""},
2363  {BRUSH_SMEAR_DEFORM_EXPAND, "EXPAND", 0, "Expand", ""},
2364  {0, NULL, 0, NULL, NULL},
2365  };
2366 
2367  static const EnumPropertyItem brush_slide_deform_type_items[] = {
2368  {BRUSH_SLIDE_DEFORM_DRAG, "DRAG", 0, "Drag", ""},
2369  {BRUSH_SLIDE_DEFORM_PINCH, "PINCH", 0, "Pinch", ""},
2370  {BRUSH_SLIDE_DEFORM_EXPAND, "EXPAND", 0, "Expand", ""},
2371  {0, NULL, 0, NULL, NULL},
2372  };
2373 
2374  static const EnumPropertyItem brush_boundary_deform_type_items[] = {
2375  {BRUSH_BOUNDARY_DEFORM_BEND, "BEND", 0, "Bend", ""},
2376  {BRUSH_BOUNDARY_DEFORM_EXPAND, "EXPAND", 0, "Expand", ""},
2377  {BRUSH_BOUNDARY_DEFORM_INFLATE, "INFLATE", 0, "Inflate", ""},
2378  {BRUSH_BOUNDARY_DEFORM_GRAB, "GRAB", 0, "Grab", ""},
2379  {BRUSH_BOUNDARY_DEFORM_TWIST, "TWIST", 0, "Twist", ""},
2380  {BRUSH_BOUNDARY_DEFORM_SMOOTH, "SMOOTH", 0, "Smooth", ""},
2381  {0, NULL, 0, NULL, NULL},
2382  };
2383 
2384  srna = RNA_def_struct(brna, "Brush", "ID");
2386  srna, "Brush", "Brush data-block for storing brush settings for painting and sculpting");
2387  RNA_def_struct_ui_icon(srna, ICON_BRUSH_DATA);
2388 
2389  /* enums */
2390  prop = RNA_def_property(srna, "blend", PROP_ENUM, PROP_NONE);
2391  RNA_def_property_enum_items(prop, prop_blend_items);
2392  RNA_def_property_ui_text(prop, "Blending Mode", "Brush blending mode");
2393  RNA_def_property_update(prop, 0, "rna_Brush_update");
2394 
2400  prop = RNA_def_property(srna, "sculpt_tool", PROP_ENUM, PROP_NONE);
2402  RNA_def_property_ui_text(prop, "Sculpt Tool", "");
2403  RNA_def_property_update(prop, 0, "rna_Brush_update_and_reset_icon");
2404 
2405  prop = RNA_def_property(srna, "uv_sculpt_tool", PROP_ENUM, PROP_NONE);
2407  RNA_def_property_ui_text(prop, "Sculpt Tool", "");
2408  RNA_def_property_update(prop, 0, "rna_Brush_update_and_reset_icon");
2409 
2410  prop = RNA_def_property(srna, "vertex_tool", PROP_ENUM, PROP_NONE);
2411  RNA_def_property_enum_sdna(prop, NULL, "vertexpaint_tool");
2413  RNA_def_property_ui_text(prop, "Vertex Paint Tool", "");
2414  RNA_def_property_update(prop, 0, "rna_Brush_update_and_reset_icon");
2415 
2416  prop = RNA_def_property(srna, "weight_tool", PROP_ENUM, PROP_NONE);
2417  RNA_def_property_enum_sdna(prop, NULL, "weightpaint_tool");
2419  RNA_def_property_ui_text(prop, "Weight Paint Tool", "");
2420  RNA_def_property_update(prop, 0, "rna_Brush_update_and_reset_icon");
2421 
2422  prop = RNA_def_property(srna, "image_tool", PROP_ENUM, PROP_NONE);
2423  RNA_def_property_enum_sdna(prop, NULL, "imagepaint_tool");
2425  RNA_def_property_ui_text(prop, "Image Paint Tool", "");
2426  RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, "rna_Brush_update_and_reset_icon");
2427 
2428  prop = RNA_def_property(srna, "gpencil_tool", PROP_ENUM, PROP_NONE);
2429  RNA_def_property_enum_sdna(prop, NULL, "gpencil_tool");
2431  RNA_def_property_ui_text(prop, "Grease Pencil Draw Tool", "");
2433 
2434  prop = RNA_def_property(srna, "gpencil_vertex_tool", PROP_ENUM, PROP_NONE);
2435  RNA_def_property_enum_sdna(prop, NULL, "gpencil_vertex_tool");
2437  RNA_def_property_ui_text(prop, "Grease Pencil Vertex Paint Tool", "");
2439 
2440  prop = RNA_def_property(srna, "gpencil_sculpt_tool", PROP_ENUM, PROP_NONE);
2441  RNA_def_property_enum_sdna(prop, NULL, "gpencil_sculpt_tool");
2443  RNA_def_property_ui_text(prop, "Grease Pencil Sculpt Paint Tool", "");
2445 
2446  prop = RNA_def_property(srna, "gpencil_weight_tool", PROP_ENUM, PROP_NONE);
2447  RNA_def_property_enum_sdna(prop, NULL, "gpencil_weight_tool");
2449  RNA_def_property_ui_text(prop, "Grease Pencil Weight Paint Tool", "");
2451 
2452  prop = RNA_def_property(srna, "curves_sculpt_tool", PROP_ENUM, PROP_NONE);
2454  RNA_def_property_ui_text(prop, "Curves Sculpt Tool", "");
2456 
2459  prop = RNA_def_property(srna, "direction", PROP_ENUM, PROP_NONE);
2462  RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Brush_direction_itemf");
2463  RNA_def_property_ui_text(prop, "Direction", "");
2464  RNA_def_property_update(prop, 0, "rna_Brush_update");
2465 
2466  prop = RNA_def_property(srna, "stroke_method", PROP_ENUM, PROP_NONE);
2469  RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Brush_stroke_itemf");
2470  RNA_def_property_ui_text(prop, "Stroke Method", "");
2471  RNA_def_property_update(prop, 0, "rna_Brush_stroke_update");
2472 
2473  prop = RNA_def_property(srna, "sculpt_plane", PROP_ENUM, PROP_NONE);
2474  RNA_def_property_enum_items(prop, brush_sculpt_plane_items);
2475  RNA_def_property_ui_text(prop, "Sculpt Plane", "");
2476  RNA_def_property_update(prop, 0, "rna_Brush_update");
2477 
2478  prop = RNA_def_property(srna, "mask_tool", PROP_ENUM, PROP_NONE);
2479  RNA_def_property_enum_items(prop, brush_mask_tool_items);
2480  RNA_def_property_ui_text(prop, "Mask Tool", "");
2481  RNA_def_property_update(prop, 0, "rna_Brush_update");
2482 
2483  prop = RNA_def_property(srna, "curve_preset", PROP_ENUM, PROP_NONE);
2484  RNA_def_property_enum_items(prop, brush_curve_preset_items);
2485  RNA_def_property_ui_text(prop, "Curve Preset", "");
2486  RNA_def_property_update(prop, 0, "rna_Brush_update");
2487 
2488  prop = RNA_def_property(srna, "deform_target", PROP_ENUM, PROP_NONE);
2489  RNA_def_property_enum_items(prop, brush_deformation_target_items);
2491  prop, "Deformation Target", "How the deformation of the brush will affect the object");
2492  RNA_def_property_update(prop, 0, "rna_Brush_update");
2493 
2494  prop = RNA_def_property(srna, "elastic_deform_type", PROP_ENUM, PROP_NONE);
2495  RNA_def_property_enum_items(prop, brush_elastic_deform_type_items);
2496  RNA_def_property_ui_text(prop, "Deformation", "Deformation type that is used in the brush");
2497  RNA_def_property_update(prop, 0, "rna_Brush_update");
2498 
2499  prop = RNA_def_property(srna, "snake_hook_deform_type", PROP_ENUM, PROP_NONE);
2500  RNA_def_property_enum_items(prop, brush_snake_hook_deform_type_items);
2501  RNA_def_property_ui_text(prop, "Deformation", "Deformation type that is used in the brush");
2502  RNA_def_property_update(prop, 0, "rna_Brush_update");
2503 
2504  prop = RNA_def_property(srna, "cloth_deform_type", PROP_ENUM, PROP_NONE);
2505  RNA_def_property_enum_items(prop, brush_cloth_deform_type_items);
2506  RNA_def_property_ui_text(prop, "Deformation", "Deformation type that is used in the brush");
2507  RNA_def_property_update(prop, 0, "rna_Brush_update");
2508 
2509  prop = RNA_def_property(srna, "cloth_force_falloff_type", PROP_ENUM, PROP_NONE);
2510  RNA_def_property_enum_items(prop, brush_cloth_force_falloff_type_items);
2512  prop, "Force Falloff", "Shape used in the brush to apply force to the cloth");
2513  RNA_def_property_update(prop, 0, "rna_Brush_update");
2514 
2515  prop = RNA_def_property(srna, "cloth_simulation_area_type", PROP_ENUM, PROP_NONE);
2516  RNA_def_property_enum_items(prop, brush_cloth_simulation_area_type_items);
2518  prop,
2519  "Simulation Area",
2520  "Part of the mesh that is going to be simulated when the stroke is active");
2521  RNA_def_property_update(prop, 0, "rna_Brush_update");
2522 
2523  prop = RNA_def_property(srna, "boundary_falloff_type", PROP_ENUM, PROP_NONE);
2524  RNA_def_property_enum_items(prop, brush_boundary_falloff_type_items);
2526  prop, "Boundary Falloff", "How the brush falloff is applied across the boundary");
2527  RNA_def_property_update(prop, 0, "rna_Brush_update");
2528 
2529  prop = RNA_def_property(srna, "smooth_deform_type", PROP_ENUM, PROP_NONE);
2530  RNA_def_property_enum_items(prop, brush_smooth_deform_type_items);
2531  RNA_def_property_ui_text(prop, "Deformation", "Deformation type that is used in the brush");
2532  RNA_def_property_update(prop, 0, "rna_Brush_update");
2533 
2534  prop = RNA_def_property(srna, "smear_deform_type", PROP_ENUM, PROP_NONE);
2535  RNA_def_property_enum_items(prop, brush_smear_deform_type_items);
2536  RNA_def_property_ui_text(prop, "Deformation", "Deformation type that is used in the brush");
2537  RNA_def_property_update(prop, 0, "rna_Brush_update");
2538 
2539  prop = RNA_def_property(srna, "slide_deform_type", PROP_ENUM, PROP_NONE);
2540  RNA_def_property_enum_items(prop, brush_slide_deform_type_items);
2541  RNA_def_property_ui_text(prop, "Deformation", "Deformation type that is used in the brush");
2542  RNA_def_property_update(prop, 0, "rna_Brush_update");
2543 
2544  prop = RNA_def_property(srna, "boundary_deform_type", PROP_ENUM, PROP_NONE);
2545  RNA_def_property_enum_items(prop, brush_boundary_deform_type_items);
2546  RNA_def_property_ui_text(prop, "Deformation", "Deformation type that is used in the brush");
2547  RNA_def_property_update(prop, 0, "rna_Brush_update");
2548 
2549  prop = RNA_def_property(srna, "pose_deform_type", PROP_ENUM, PROP_NONE);
2550  RNA_def_property_enum_items(prop, brush_pose_deform_type_items);
2551  RNA_def_property_ui_text(prop, "Deformation", "Deformation type that is used in the brush");
2552  RNA_def_property_update(prop, 0, "rna_Brush_update");
2553 
2554  prop = RNA_def_property(srna, "pose_origin_type", PROP_ENUM, PROP_NONE);
2555  RNA_def_property_enum_items(prop, brush_pose_origin_type_items);
2557  "Rotation Origins",
2558  "Method to set the rotation origins for the segments of the brush");
2559  RNA_def_property_update(prop, 0, "rna_Brush_update");
2560 
2561  prop = RNA_def_property(srna, "jitter_unit", PROP_ENUM, PROP_NONE); /* as an enum */
2563  RNA_def_property_enum_items(prop, brush_jitter_unit_items);
2565  prop, "Jitter Unit", "Jitter in screen space or relative to brush size");
2566  RNA_def_property_update(prop, 0, "rna_Brush_update");
2567 
2568  prop = RNA_def_property(srna, "falloff_shape", PROP_ENUM, PROP_NONE); /* as an enum */
2569  RNA_def_property_enum_bitflag_sdna(prop, NULL, "falloff_shape");
2570  RNA_def_property_enum_items(prop, falloff_shape_unit_items);
2571  RNA_def_property_ui_text(prop, "Falloff Shape", "Use projected or spherical falloff");
2572  RNA_def_property_update(prop, 0, "rna_Brush_update");
2573 
2574  /* number values */
2575  prop = RNA_def_property(srna, "size", PROP_INT, PROP_PIXEL);
2576  RNA_def_property_int_funcs(prop, NULL, "rna_Brush_set_size", NULL);
2579  RNA_def_property_ui_text(prop, "Radius", "Radius of the brush in pixels");
2580  RNA_def_property_update(prop, 0, "rna_Brush_size_update");
2581 
2582  prop = RNA_def_property(srna, "unprojected_radius", PROP_FLOAT, PROP_DISTANCE);
2583  RNA_def_property_float_funcs(prop, NULL, "rna_Brush_set_unprojected_radius", NULL);
2584  RNA_def_property_range(prop, 0.001, FLT_MAX);
2585  RNA_def_property_ui_range(prop, 0.001, 1, 1, -1);
2586  RNA_def_property_ui_text(prop, "Unprojected Radius", "Radius of brush in Blender units");
2587  RNA_def_property_update(prop, 0, "rna_Brush_size_update");
2588 
2589  prop = RNA_def_property(srna, "jitter", PROP_FLOAT, PROP_NONE);
2590  RNA_def_property_float_sdna(prop, NULL, "jitter");
2591  RNA_def_property_range(prop, 0.0f, 1000.0f);
2592  RNA_def_property_ui_range(prop, 0.0f, 2.0f, 0.1, 4);
2593  RNA_def_property_ui_text(prop, "Jitter", "Jitter the position of the brush while painting");
2594  RNA_def_property_update(prop, 0, "rna_Brush_update");
2595 
2596  prop = RNA_def_property(srna, "jitter_absolute", PROP_INT, PROP_PIXEL);
2597  RNA_def_property_int_sdna(prop, NULL, "jitter_absolute");
2598  RNA_def_property_range(prop, 0, 1000000);
2600  prop, "Jitter", "Jitter the position of the brush in pixels while painting");
2601  RNA_def_property_update(prop, 0, "rna_Brush_update");
2602 
2603  prop = RNA_def_property(srna, "spacing", PROP_INT, PROP_PERCENTAGE);
2604  RNA_def_property_int_sdna(prop, NULL, "spacing");
2605  RNA_def_property_range(prop, 1, 1000);
2606  RNA_def_property_ui_range(prop, 1, 500, 5, -1);
2608  prop, "Spacing", "Spacing between brush daubs as a percentage of brush diameter");
2609  RNA_def_property_update(prop, 0, "rna_Brush_update");
2610 
2611  prop = RNA_def_property(srna, "grad_spacing", PROP_INT, PROP_PIXEL);
2612  RNA_def_property_int_sdna(prop, NULL, "gradient_spacing");
2613  RNA_def_property_range(prop, 1, 10000);
2614  RNA_def_property_ui_range(prop, 1, 10000, 5, -1);
2616  prop, "Gradient Spacing", "Spacing before brush gradient goes full circle");
2617  RNA_def_property_update(prop, 0, "rna_Brush_update");
2618 
2619  prop = RNA_def_property(srna, "smooth_stroke_radius", PROP_INT, PROP_PIXEL);
2620  RNA_def_property_range(prop, 10, 200);
2622  prop, "Smooth Stroke Radius", "Minimum distance from last point before stroke continues");
2623  RNA_def_property_update(prop, 0, "rna_Brush_update");
2624 
2625  prop = RNA_def_property(srna, "smooth_stroke_factor", PROP_FLOAT, PROP_FACTOR);
2626  RNA_def_property_range(prop, 0.5, 0.99);
2627  RNA_def_property_ui_text(prop, "Smooth Stroke Factor", "Higher values give a smoother stroke");
2628  RNA_def_property_update(prop, 0, "rna_Brush_update");
2629 
2630  prop = RNA_def_property(srna, "rate", PROP_FLOAT, PROP_NONE);
2631  RNA_def_property_float_sdna(prop, NULL, "rate");
2632  RNA_def_property_range(prop, 0.0001f, 10000.0f);
2633  RNA_def_property_ui_range(prop, 0.01f, 1.0f, 1, 3);
2634  RNA_def_property_ui_text(prop, "Rate", "Interval between paints for Airbrush");
2635  RNA_def_property_update(prop, 0, "rna_Brush_update");
2636 
2637  prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR_GAMMA);
2638  RNA_def_property_range(prop, 0.0, 1.0);
2639  RNA_def_property_float_sdna(prop, NULL, "rgb");
2640  RNA_def_property_ui_text(prop, "Color", "");
2641  RNA_def_property_update(prop, 0, "rna_Brush_update");
2642 
2643  prop = RNA_def_property(srna, "secondary_color", PROP_FLOAT, PROP_COLOR_GAMMA);
2644  RNA_def_property_range(prop, 0.0, 1.0);
2645  RNA_def_property_float_sdna(prop, NULL, "secondary_rgb");
2646  RNA_def_property_ui_text(prop, "Secondary Color", "");
2647  RNA_def_property_update(prop, 0, "rna_Brush_update");
2648 
2649  prop = RNA_def_property(srna, "weight", PROP_FLOAT, PROP_FACTOR);
2650  RNA_def_property_range(prop, 0.0f, 1.0f);
2651  RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
2652  RNA_def_property_ui_text(prop, "Weight", "Vertex weight when brush is applied");
2653  RNA_def_property_update(prop, 0, "rna_Brush_update");
2654 
2655  prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_FACTOR);
2656  RNA_def_property_float_sdna(prop, NULL, "alpha");
2657  RNA_def_property_range(prop, 0.0f, 10.0f);
2658  RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
2660  prop, "Strength", "How powerful the effect of the brush is when applied");
2661  RNA_def_property_update(prop, 0, "rna_Brush_update");
2662 
2663  prop = RNA_def_property(srna, "flow", PROP_FLOAT, PROP_FACTOR);
2664  RNA_def_property_float_sdna(prop, NULL, "flow");
2665  RNA_def_property_range(prop, 0.0f, 1.0f);
2666  RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
2667  RNA_def_property_ui_text(prop, "Flow", "Amount of paint that is applied per stroke sample");
2668  RNA_def_property_update(prop, 0, "rna_Brush_update");
2669 
2670  prop = RNA_def_property(srna, "wet_mix", PROP_FLOAT, PROP_FACTOR);
2671  RNA_def_property_float_sdna(prop, NULL, "wet_mix");
2672  RNA_def_property_range(prop, 0.0f, 1.0f);
2673  RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
2675  prop, "Wet Mix", "Amount of paint that is picked from the surface into the brush color");
2676  RNA_def_property_update(prop, 0, "rna_Brush_update");
2677 
2678  prop = RNA_def_property(srna, "wet_persistence", PROP_FLOAT, PROP_FACTOR);
2679  RNA_def_property_float_sdna(prop, NULL, "wet_persistence");
2680  RNA_def_property_range(prop, 0.0f, 1.0f);
2681  RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
2683  prop,
2684  "Wet Persistence",
2685  "Amount of wet paint that stays in the brush after applying paint to the surface");
2686  RNA_def_property_update(prop, 0, "rna_Brush_update");
2687 
2688  prop = RNA_def_property(srna, "density", PROP_FLOAT, PROP_FACTOR);
2689  RNA_def_property_float_sdna(prop, NULL, "density");
2690  RNA_def_property_range(prop, 0.0f, 1.0f);
2691  RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
2693  prop, "Density", "Amount of random elements that are going to be affected by the brush");
2694  RNA_def_property_update(prop, 0, "rna_Brush_update");
2695 
2696  prop = RNA_def_property(srna, "tip_scale_x", PROP_FLOAT, PROP_FACTOR);
2697  RNA_def_property_float_sdna(prop, NULL, "tip_scale_x");
2698  RNA_def_property_range(prop, 0.0f, 1.0f);
2699  RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
2700  RNA_def_property_ui_text(prop, "Tip Scale X", "Scale of the brush tip in the X axis");
2701  RNA_def_property_update(prop, 0, "rna_Brush_update");
2702 
2703  prop = RNA_def_property(srna, "use_hardness_pressure", PROP_BOOLEAN, PROP_NONE);
2705  RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
2706  RNA_def_property_ui_text(prop, "Use Pressure for Hardness", "Use pressure to modulate hardness");
2708  RNA_def_property_update(prop, 0, "rna_Brush_update");
2709 
2710  prop = RNA_def_property(srna, "invert_hardness_pressure", PROP_BOOLEAN, PROP_NONE);
2712  RNA_def_property_ui_icon(prop, ICON_ARROW_LEFTRIGHT, 0);
2714  prop, "Invert Pressure for Hardness", "Invert the modulation of pressure in hardness");
2716  RNA_def_property_update(prop, 0, "rna_Brush_update");
2717 
2718  prop = RNA_def_property(srna, "use_flow_pressure", PROP_BOOLEAN, PROP_NONE);
2720  RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
2721  RNA_def_property_ui_text(prop, "Use Pressure for Flow", "Use pressure to modulate flow");
2723  RNA_def_property_update(prop, 0, "rna_Brush_update");
2724 
2725  prop = RNA_def_property(srna, "invert_flow_pressure", PROP_BOOLEAN, PROP_NONE);
2727  RNA_def_property_ui_icon(prop, ICON_ARROW_LEFTRIGHT, 0);
2729  prop, "Invert Pressure for Flow", "Invert the modulation of pressure in flow");
2731  RNA_def_property_update(prop, 0, "rna_Brush_update");
2732 
2733  prop = RNA_def_property(srna, "use_wet_mix_pressure", PROP_BOOLEAN, PROP_NONE);
2735  RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
2736  RNA_def_property_ui_text(prop, "Use Pressure for Wet Mix", "Use pressure to modulate wet mix");
2738  RNA_def_property_update(prop, 0, "rna_Brush_update");
2739 
2740  prop = RNA_def_property(srna, "invert_wet_mix_pressure", PROP_BOOLEAN, PROP_NONE);
2742  RNA_def_property_ui_icon(prop, ICON_ARROW_LEFTRIGHT, 0);
2744  prop, "Invert Pressure for Wet Mix", "Invert the modulation of pressure in wet mix");
2746  RNA_def_property_update(prop, 0, "rna_Brush_update");
2747 
2748  prop = RNA_def_property(srna, "use_wet_persistence_pressure", PROP_BOOLEAN, PROP_NONE);
2750  RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
2752  prop, "Use Pressure for Wet Persistence", "Use pressure to modulate wet persistence");
2754  RNA_def_property_update(prop, 0, "rna_Brush_update");
2755 
2756  prop = RNA_def_property(srna, "invert_wet_persistence_pressure", PROP_BOOLEAN, PROP_NONE);
2758  prop, NULL, "paint_flags", BRUSH_PAINT_WET_PERSISTENCE_PRESSURE_INVERT);
2759  RNA_def_property_ui_icon(prop, ICON_ARROW_LEFTRIGHT, 0);
2761  "Invert Pressure for Wet Persistence",
2762  "Invert the modulation of pressure in wet persistence");
2764  RNA_def_property_update(prop, 0, "rna_Brush_update");
2765 
2766  prop = RNA_def_property(srna, "use_density_pressure", PROP_BOOLEAN, PROP_NONE);
2768  RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
2769  RNA_def_property_ui_text(prop, "Use Pressure for Density", "Use pressure to modulate density");
2771  RNA_def_property_update(prop, 0, "rna_Brush_update");
2772 
2773  prop = RNA_def_property(srna, "invert_density_pressure", PROP_BOOLEAN, PROP_NONE);
2775  RNA_def_property_ui_icon(prop, ICON_ARROW_LEFTRIGHT, 0);
2777  prop, "Invert Pressure for Density", "Invert the modulation of pressure in density");
2779  RNA_def_property_update(prop, 0, "rna_Brush_update");
2780 
2781  prop = RNA_def_property(srna, "dash_ratio", PROP_FLOAT, PROP_FACTOR);
2782  RNA_def_property_float_sdna(prop, NULL, "dash_ratio");
2783  RNA_def_property_range(prop, 0.0f, 1.0f);
2784  RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
2786  prop, "Dash Ratio", "Ratio of samples in a cycle that the brush is enabled");
2787  RNA_def_property_update(prop, 0, "rna_Brush_update");
2788 
2789  prop = RNA_def_property(srna, "dash_samples", PROP_INT, PROP_UNSIGNED);
2790  RNA_def_property_int_sdna(prop, NULL, "dash_samples");
2791  RNA_def_property_range(prop, 1, 10000);
2792  RNA_def_property_ui_range(prop, 1, 10000, 5, -1);
2794  prop, "Dash Length", "Length of a dash cycle measured in stroke samples");
2795  RNA_def_property_update(prop, 0, "rna_Brush_update");
2796 
2797  prop = RNA_def_property(srna, "plane_offset", PROP_FLOAT, PROP_DISTANCE);
2798  RNA_def_property_float_sdna(prop, NULL, "plane_offset");
2800  RNA_def_property_range(prop, -2.0f, 2.0f);
2801  RNA_def_property_ui_range(prop, -0.5f, 0.5f, 0.001, 3);
2803  prop,
2804  "Plane Offset",
2805  "Adjust plane on which the brush acts towards or away from the object surface");
2806  RNA_def_property_update(prop, 0, "rna_Brush_update");
2807 
2808  prop = RNA_def_property(srna, "plane_trim", PROP_FLOAT, PROP_DISTANCE);
2809  RNA_def_property_float_sdna(prop, NULL, "plane_trim");
2810  RNA_def_property_range(prop, 0, 1.0f);
2812  prop,
2813  "Plane Trim",
2814  "If a vertex is further away from offset plane than this, then it is not affected");
2815  RNA_def_property_update(prop, 0, "rna_Brush_update");
2816 
2817  prop = RNA_def_property(srna, "height", PROP_FLOAT, PROP_DISTANCE);
2818  RNA_def_property_float_sdna(prop, NULL, "height");
2819  RNA_def_property_float_default(prop, 0.5f);
2820  RNA_def_property_range(prop, 0, 1.0f);
2821  RNA_def_property_ui_range(prop, 0, 0.2f, 1, 3);
2823  prop, "Brush Height", "Affectable height of brush (layer height for layer tool, i.e.)");
2824  RNA_def_property_update(prop, 0, "rna_Brush_update");
2825 
2826  prop = RNA_def_property(srna, "texture_sample_bias", PROP_FLOAT, PROP_DISTANCE);
2827  RNA_def_property_float_sdna(prop, NULL, "texture_sample_bias");
2829  RNA_def_property_range(prop, -1, 1);
2830  RNA_def_property_ui_text(prop, "Texture Sample Bias", "Value added to texture samples");
2831  RNA_def_property_update(prop, 0, "rna_Brush_update");
2832 
2833  prop = RNA_def_property(srna, "normal_weight", PROP_FLOAT, PROP_FACTOR);
2834  RNA_def_property_float_sdna(prop, NULL, "normal_weight");
2836  RNA_def_property_range(prop, 0.0f, 1.0f);
2838  prop, "Normal Weight", "How much grab will pull vertices out of surface during a grab");
2839  RNA_def_property_update(prop, 0, "rna_Brush_update");
2840 
2841  prop = RNA_def_property(srna, "elastic_deform_volume_preservation", PROP_FLOAT, PROP_NONE);
2842  RNA_def_property_float_sdna(prop, NULL, "elastic_deform_volume_preservation");
2843  RNA_def_property_range(prop, 0.0f, 0.9f);
2844  RNA_def_property_ui_range(prop, 0.0f, 0.9f, 0.01f, 3);
2846  "Volume Preservation",
2847  "Poisson ratio for elastic deformation. Higher values preserve volume "
2848  "more, but also lead to more bulging");
2849  RNA_def_property_update(prop, 0, "rna_Brush_update");
2850 
2851  prop = RNA_def_property(srna, "rake_factor", PROP_FLOAT, PROP_FACTOR);
2852  RNA_def_property_float_sdna(prop, NULL, "rake_factor");
2854  RNA_def_property_range(prop, 0.0f, 10.0f);
2855  RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
2856  RNA_def_property_ui_text(prop, "Rake", "How much grab will follow cursor rotation");
2857  RNA_def_property_update(prop, 0, "rna_Brush_update");
2858 
2859  prop = RNA_def_property(srna, "crease_pinch_factor", PROP_FLOAT, PROP_FACTOR);
2860  RNA_def_property_float_sdna(prop, NULL, "crease_pinch_factor");
2861  RNA_def_property_range(prop, 0.0f, 1.0f);
2862  RNA_def_property_ui_text(prop, "Crease Brush Pinch Factor", "How much the crease brush pinches");
2863  RNA_def_property_update(prop, 0, "rna_Brush_update");
2864 
2865  prop = RNA_def_property(srna, "pose_offset", PROP_FLOAT, PROP_FACTOR);
2866  RNA_def_property_float_sdna(prop, NULL, "pose_offset");
2867  RNA_def_property_range(prop, 0.0f, 2.0f);
2869  prop, "Pose Origin Offset", "Offset of the pose origin in relation to the brush radius");
2870  RNA_def_property_update(prop, 0, "rna_Brush_update");
2871 
2872  prop = RNA_def_property(srna, "disconnected_distance_max", PROP_FLOAT, PROP_DISTANCE);
2873  RNA_def_property_float_sdna(prop, NULL, "disconnected_distance_max");
2874  RNA_def_property_range(prop, 0.0f, 10.0f);
2876  "Max Element Distance",
2877  "Maximum distance to search for disconnected loose parts in the mesh");
2878  RNA_def_property_update(prop, 0, "rna_Brush_update");
2879 
2880  prop = RNA_def_property(srna, "boundary_offset", PROP_FLOAT, PROP_FACTOR);
2881  RNA_def_property_float_sdna(prop, NULL, "boundary_offset");
2882  RNA_def_property_range(prop, 0.0f, 30.0f);
2884  "Boundary Origin Offset",
2885  "Offset of the boundary origin in relation to the brush radius");
2886  RNA_def_property_update(prop, 0, "rna_Brush_update");
2887 
2888  prop = RNA_def_property(srna, "surface_smooth_shape_preservation", PROP_FLOAT, PROP_FACTOR);
2889  RNA_def_property_float_sdna(prop, NULL, "surface_smooth_shape_preservation");
2890  RNA_def_property_range(prop, 0.0f, 1.0f);
2892  prop, "Shape Preservation", "How much of the original shape is preserved when smoothing");
2893  RNA_def_property_update(prop, 0, "rna_Brush_update");
2894 
2895  prop = RNA_def_property(srna, "surface_smooth_current_vertex", PROP_FLOAT, PROP_FACTOR);
2896  RNA_def_property_float_sdna(prop, NULL, "surface_smooth_current_vertex");
2897  RNA_def_property_range(prop, 0.0f, 1.0f);
2899  prop,
2900  "Per Vertex Displacement",
2901  "How much the position of each individual vertex influences the final result");
2902  RNA_def_property_update(prop, 0, "rna_Brush_update");
2903 
2904  prop = RNA_def_property(srna, "surface_smooth_iterations", PROP_INT, PROP_UNSIGNED);
2905  RNA_def_property_int_sdna(prop, NULL, "surface_smooth_iterations");
2906  RNA_def_property_range(prop, 1, 10);
2907  RNA_def_property_ui_range(prop, 1, 10, 1, 3);
2908  RNA_def_property_ui_text(prop, "Iterations", "Number of smoothing iterations per brush step");
2909  RNA_def_property_update(prop, 0, "rna_Brush_update");
2910 
2911  prop = RNA_def_property(srna, "multiplane_scrape_angle", PROP_FLOAT, PROP_FACTOR);
2912  RNA_def_property_float_sdna(prop, NULL, "multiplane_scrape_angle");
2913  RNA_def_property_range(prop, 0.0f, 160.0f);
2914  RNA_def_property_ui_text(prop, "Plane Angle", "Angle between the planes of the crease");
2915  RNA_def_property_update(prop, 0, "rna_Brush_update");
2916 
2917  prop = RNA_def_property(srna, "pose_smooth_iterations", PROP_INT, PROP_UNSIGNED);
2918  RNA_def_property_int_sdna(prop, NULL, "pose_smooth_iterations");
2919  RNA_def_property_range(prop, 0, 100);
2921  prop,
2922  "Smooth Iterations",
2923  "Smooth iterations applied after calculating the pose factor of each vertex");
2924  RNA_def_property_update(prop, 0, "rna_Brush_update");
2925 
2926  prop = RNA_def_property(srna, "pose_ik_segments", PROP_INT, PROP_UNSIGNED);
2927  RNA_def_property_int_sdna(prop, NULL, "pose_ik_segments");
2928  RNA_def_property_range(prop, 1, 20);
2929  RNA_def_property_ui_range(prop, 1, 20, 1, 3);
2931  prop,
2932  "Pose IK Segments",
2933  "Number of segments of the inverse kinematics chain that will deform the mesh");
2934  RNA_def_property_update(prop, 0, "rna_Brush_update");
2935 
2936  prop = RNA_def_property(srna, "tip_roundness", PROP_FLOAT, PROP_FACTOR);
2937  RNA_def_property_float_sdna(prop, NULL, "tip_roundness");
2938  RNA_def_property_range(prop, 0.0f, 1.0f);
2939  RNA_def_property_ui_text(prop, "Tip Roundness", "Roundness of the brush tip");
2940  RNA_def_property_update(prop, 0, "rna_Brush_update");
2941 
2942  prop = RNA_def_property(srna, "cloth_mass", PROP_FLOAT, PROP_FACTOR);
2943  RNA_def_property_float_sdna(prop, NULL, "cloth_mass");
2944  RNA_def_property_range(prop, 0.01f, 2.0f);
2945  RNA_def_property_ui_text(prop, "Cloth Mass", "Mass of each simulation particle");
2946  RNA_def_property_update(prop, 0, "rna_Brush_update");
2947 
2948  prop = RNA_def_property(srna, "cloth_damping", PROP_FLOAT, PROP_FACTOR);
2949  RNA_def_property_float_sdna(prop, NULL, "cloth_damping");
2950  RNA_def_property_range(prop, 0.01f, 1.0f);
2952  prop, "Cloth Damping", "How much the applied forces are propagated through the cloth");
2953  RNA_def_property_update(prop, 0, "rna_Brush_update");
2954 
2955  prop = RNA_def_property(srna, "cloth_sim_limit", PROP_FLOAT, PROP_FACTOR);
2956  RNA_def_property_float_sdna(prop, NULL, "cloth_sim_limit");
2957  RNA_def_property_range(prop, 0.1f, 10.0f);
2959  prop,
2960  "Simulation Limit",
2961  "Factor added relative to the size of the radius to limit the cloth simulation effects");
2962  RNA_def_property_update(prop, 0, "rna_Brush_update");
2963 
2964  prop = RNA_def_property(srna, "cloth_sim_falloff", PROP_FLOAT, PROP_FACTOR);
2965  RNA_def_property_float_sdna(prop, NULL, "cloth_sim_falloff");
2966  RNA_def_property_range(prop, 0.0f, 1.0f);
2968  "Simulation Falloff",
2969  "Area to apply deformation falloff to the effects of the simulation");
2970  RNA_def_property_update(prop, 0, "rna_Brush_update");
2971 
2972  prop = RNA_def_property(srna, "cloth_constraint_softbody_strength", PROP_FLOAT, PROP_FACTOR);
2973  RNA_def_property_float_sdna(prop, NULL, "cloth_constraint_softbody_strength");
2974  RNA_def_property_range(prop, 0.0f, 1.0f);
2976  prop,
2977  "Soft Body Plasticity",
2978  "How much the cloth preserves the original shape, acting as a soft body");
2979  RNA_def_property_update(prop, 0, "rna_Brush_update");
2980 
2981  prop = RNA_def_property(srna, "hardness", PROP_FLOAT, PROP_FACTOR);
2982  RNA_def_property_float_sdna(prop, NULL, "hardness");
2983  RNA_def_property_range(prop, 0.0f, 1.0f);
2985  prop, "Hardness", "How close the brush falloff starts from the edge of the brush");
2986  RNA_def_property_update(prop, 0, "rna_Brush_update");
2987 
2988  prop = RNA_def_property(
2989  srna, "automasking_boundary_edges_propagation_steps", PROP_INT, PROP_UNSIGNED);
2990  RNA_def_property_int_sdna(prop, NULL, "automasking_boundary_edges_propagation_steps");
2991  RNA_def_property_range(prop, 1, 20);
2992  RNA_def_property_ui_range(prop, 1, 20, 1, 3);
2994  "Propagation Steps",
2995  "Distance where boundary edge automasking is going to protect vertices "
2996  "from the fully masked edge");
2997  RNA_def_property_update(prop, 0, "rna_Brush_update");
2998 
2999  prop = RNA_def_property(srna, "auto_smooth_factor", PROP_FLOAT, PROP_FACTOR);
3000  RNA_def_property_float_sdna(prop, NULL, "autosmooth_factor");
3002  RNA_def_property_range(prop, 0.0f, 1.0f);
3003  RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
3005  prop, "Auto-Smooth", "Amount of smoothing to automatically apply to each stroke");
3006  RNA_def_property_update(prop, 0, "rna_Brush_update");
3007 
3008  prop = RNA_def_property(srna, "topology_rake_factor", PROP_FLOAT, PROP_FACTOR);
3009  RNA_def_property_float_sdna(prop, NULL, "topology_rake_factor");
3011  RNA_def_property_range(prop, 0.0f, 1.0f);
3012  RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
3014  "Topology Rake",
3015  "Automatically align edges to the brush direction to "
3016  "generate cleaner topology and define sharp features. "
3017  "Best used on low-poly meshes as it has a performance impact");
3018  RNA_def_property_update(prop, 0, "rna_Brush_update");
3019 
3020  prop = RNA_def_property(srna, "tilt_strength_factor", PROP_FLOAT, PROP_FACTOR);
3021  RNA_def_property_float_sdna(prop, NULL, "tilt_strength_factor");
3023  RNA_def_property_range(prop, 0.0f, 1.0f);
3024  RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
3026  prop, "Tilt Strength", "How much the tilt of the pen will affect the brush");
3027  RNA_def_property_update(prop, 0, "rna_Brush_update");
3028 
3029  prop = RNA_def_property(srna, "normal_radius_factor", PROP_FLOAT, PROP_FACTOR);
3030  RNA_def_property_float_sdna(prop, NULL, "normal_radius_factor");
3031  RNA_def_property_range(prop, 0.0f, 2.0f);
3032  RNA_def_property_ui_range(prop, 0.0f, 2.0f, 0.001, 3);
3034  "Normal Radius",
3035  "Ratio between the brush radius and the radius that is going to be "
3036  "used to sample the normal");
3037  RNA_def_property_update(prop, 0, "rna_Brush_update");
3038 
3039  prop = RNA_def_property(srna, "area_radius_factor", PROP_FLOAT, PROP_FACTOR);
3040  RNA_def_property_float_sdna(prop, NULL, "area_radius_factor");
3041  RNA_def_property_range(prop, 0.0f, 2.0f);
3042  RNA_def_property_ui_range(prop, 0.0f, 2.0f, 0.001, 3);
3044  "Area Radius",
3045  "Ratio between the brush radius and the radius that is going to be "
3046  "used to sample the area center");
3047  RNA_def_property_update(prop, 0, "rna_Brush_update");
3048 
3049  prop = RNA_def_property(srna, "wet_paint_radius_factor", PROP_FLOAT, PROP_FACTOR);
3050  RNA_def_property_float_sdna(prop, NULL, "wet_paint_radius_factor");
3051  RNA_def_property_range(prop, 0.0f, 2.0f);
3052  RNA_def_property_ui_range(prop, 0.0f, 2.0f, 0.001, 3);
3054  "Wet Paint Radius",
3055  "Ratio between the brush radius and the radius that is going to be "
3056  "used to sample the color to blend in wet paint");
3057  RNA_def_property_update(prop, 0, "rna_Brush_update");
3058 
3059  prop = RNA_def_property(srna, "stencil_pos", PROP_FLOAT, PROP_XYZ);
3060  RNA_def_property_float_sdna(prop, NULL, "stencil_pos");
3061  RNA_def_property_array(prop, 2);
3062  RNA_def_property_ui_text(prop, "Stencil Position", "Position of stencil in viewport");
3063  RNA_def_property_update(prop, 0, "rna_Brush_update");
3064 
3065  prop = RNA_def_property(srna, "stencil_dimension", PROP_FLOAT, PROP_XYZ);
3066  RNA_def_property_float_sdna(prop, NULL, "stencil_dimension");
3067  RNA_def_property_array(prop, 2);
3068  RNA_def_property_ui_text(prop, "Stencil Dimensions", "Dimensions of stencil in viewport");
3069  RNA_def_property_update(prop, 0, "rna_Brush_update");
3070 
3071  prop = RNA_def_property(srna, "mask_stencil_pos", PROP_FLOAT, PROP_XYZ);
3072  RNA_def_property_float_sdna(prop, NULL, "mask_stencil_pos");
3073  RNA_def_property_array(prop, 2);
3074  RNA_def_property_ui_text(prop, "Mask Stencil Position", "Position of mask stencil in viewport");
3075  RNA_def_property_update(prop, 0, "rna_Brush_update");
3076 
3077  prop = RNA_def_property(srna, "mask_stencil_dimension", PROP_FLOAT, PROP_XYZ);
3078  RNA_def_property_float_sdna(prop, NULL, "mask_stencil_dimension");
3079  RNA_def_property_array(prop, 2);
3081  prop, "Mask Stencil Dimensions", "Dimensions of mask stencil in viewport");
3082  RNA_def_property_update(prop, 0, "rna_Brush_update");
3083 
3084  prop = RNA_def_property(srna, "sharp_threshold", PROP_FLOAT, PROP_NONE);
3085  RNA_def_property_range(prop, 0.0, 100.0);
3086  RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 3);
3087  RNA_def_property_float_sdna(prop, NULL, "sharp_threshold");
3089  prop, "Sharp Threshold", "Threshold below which, no sharpening is done");
3090  RNA_def_property_update(prop, 0, "rna_Brush_update");
3091 
3092  prop = RNA_def_property(srna, "fill_threshold", PROP_FLOAT, PROP_NONE);
3093  RNA_def_property_range(prop, 0.0, 100.0);
3094  RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 3);
3095  RNA_def_property_float_sdna(prop, NULL, "fill_threshold");
3097  prop, "Fill Threshold", "Threshold above which filling is not propagated");
3098  RNA_def_property_update(prop, 0, "rna_Brush_update");
3099 
3100  prop = RNA_def_property(srna, "blur_kernel_radius", PROP_INT, PROP_NONE);
3101  RNA_def_property_int_sdna(prop, NULL, "blur_kernel_radius");
3102  RNA_def_property_range(prop, 1, 10000);
3103  RNA_def_property_ui_range(prop, 1, 50, 1, -1);
3105  prop, "Kernel Radius", "Radius of kernel used for soften and sharpen in pixels");
3106  RNA_def_property_update(prop, 0, "rna_Brush_update");
3107 
3108  prop = RNA_def_property(srna, "blur_mode", PROP_ENUM, PROP_NONE);
3109  RNA_def_property_enum_items(prop, brush_blur_mode_items);
3110  RNA_def_property_ui_text(prop, "Blur Mode", "");
3111  RNA_def_property_update(prop, 0, "rna_Brush_update");
3112 
3113  prop = RNA_def_property(srna, "falloff_angle", PROP_FLOAT, PROP_ANGLE);
3114  RNA_def_property_float_sdna(prop, NULL, "falloff_angle");
3115  RNA_def_property_range(prop, 0, M_PI_2);
3117  prop,
3118  "Falloff Angle",
3119  "Paint most on faces pointing towards the view according to this angle");
3120  RNA_def_property_update(prop, 0, "rna_Brush_update");
3121 
3122  /* flag */
3123  prop = RNA_def_property(srna, "use_airbrush", PROP_BOOLEAN, PROP_NONE);
3126  prop, "Airbrush", "Keep applying paint effect while holding mouse (spray)");
3127  RNA_def_property_update(prop, 0, "rna_Brush_update");
3128 
3129  prop = RNA_def_property(srna, "use_original_normal", PROP_BOOLEAN, PROP_NONE);
3132  "Original Normal",
3133  "When locked keep using normal of surface where stroke was initiated");
3134  RNA_def_property_update(prop, 0, "rna_Brush_update");
3135 
3136  prop = RNA_def_property(srna, "use_original_plane", PROP_BOOLEAN, PROP_NONE);
3139  prop,
3140  "Original Plane",
3141  "When locked keep using the plane origin of surface where stroke was initiated");
3142  RNA_def_property_update(prop, 0, "rna_Brush_update");
3143 
3144  prop = RNA_def_property(srna, "use_automasking_topology", PROP_BOOLEAN, PROP_NONE);
3145  RNA_def_property_boolean_sdna(prop, NULL, "automasking_flags", BRUSH_AUTOMASKING_TOPOLOGY);
3147  "Topology Auto-Masking",
3148  "Affect only vertices connected to the active vertex under the brush");
3149  RNA_def_property_update(prop, 0, "rna_Brush_update");
3150 
3151  prop = RNA_def_property(srna, "use_automasking_face_sets", PROP_BOOLEAN, PROP_NONE);
3152  RNA_def_property_boolean_sdna(prop, NULL, "automasking_flags", BRUSH_AUTOMASKING_FACE_SETS);
3154  "Face Sets Auto-Masking",
3155  "Affect only vertices that share Face Sets with the active vertex");
3156  RNA_def_property_update(prop, 0, "rna_Brush_update");
3157 
3158  prop = RNA_def_property(srna, "use_automasking_boundary_edges", PROP_BOOLEAN, PROP_NONE);
3161  prop, "Mesh Boundary Auto-Masking", "Do not affect non manifold boundary edges");
3162  RNA_def_property_update(prop, 0, "rna_Brush_update");
3163 
3164  prop = RNA_def_property(srna, "use_automasking_boundary_face_sets", PROP_BOOLEAN, PROP_NONE);
3166  prop, NULL, "automasking_flags", BRUSH_AUTOMASKING_BOUNDARY_FACE_SETS);
3168  "Face Sets Boundary Automasking",
3169  "Do not affect vertices that belong to a Face Set boundary");
3170  RNA_def_property_update(prop, 0, "rna_Brush_update");
3171 
3172  prop = RNA_def_property(srna, "use_scene_spacing", PROP_ENUM, PROP_NONE);
3174  RNA_def_property_enum_items(prop, brush_spacing_unit_items);
3176  prop, "Spacing Distance", "Calculate the brush spacing using view or scene distance");
3177  RNA_def_property_update(prop, 0, "rna_Brush_update");
3178 
3179  prop = RNA_def_property(srna, "use_grab_active_vertex", PROP_BOOLEAN, PROP_NONE);
3182  prop,
3183  "Grab Active Vertex",
3184  "Apply the maximum grab strength to the active vertex instead of the cursor location");
3185  RNA_def_property_update(prop, 0, "rna_Brush_update");
3186 
3187  prop = RNA_def_property(srna, "use_grab_silhouette", PROP_BOOLEAN, PROP_NONE);
3190  prop, "Grab Silhouette", "Grabs trying to automask the silhouette of the object");
3191  RNA_def_property_update(prop, 0, "rna_Brush_update");
3192 
3193  prop = RNA_def_property(srna, "use_paint_antialiasing", PROP_BOOLEAN, PROP_NONE);
3195  RNA_def_property_ui_text(prop, "Anti-Aliasing", "Smooths the edges of the strokes");
3196 
3197  prop = RNA_def_property(srna, "use_multiplane_scrape_dynamic", PROP_BOOLEAN, PROP_NONE);
3200  "Dynamic Mode",
3201  "The angle between the planes changes during the stroke to fit the "
3202  "surface under the cursor");
3203  RNA_def_property_update(prop, 0, "rna_Brush_update");
3204 
3205  prop = RNA_def_property(srna, "show_multiplane_scrape_planes_preview", PROP_BOOLEAN, PROP_NONE);
3208  prop, "Show Cursor Preview", "Preview the scrape planes in the cursor during the stroke");
3209  RNA_def_property_update(prop, 0, "rna_Brush_update");
3210 
3211  prop = RNA_def_property(srna, "use_pose_ik_anchored", PROP_BOOLEAN, PROP_NONE);
3214  prop, "Keep Anchor Point", "Keep the position of the last segment in the IK chain fixed");
3215  RNA_def_property_update(prop, 0, "rna_Brush_update");
3216 
3217  prop = RNA_def_property(srna, "use_pose_lock_rotation", PROP_BOOLEAN, PROP_NONE);
3220  "Lock Rotation When Scaling",
3221  "Do not rotate the segment when using the scale deform mode");
3222  RNA_def_property_update(prop, 0, "rna_Brush_update");
3223 
3224  prop = RNA_def_property(srna, "use_connected_only", PROP_BOOLEAN, PROP_NONE);
3226  RNA_def_property_ui_text(prop, "Connected Only", "Affect only topologically connected elements");
3227  RNA_def_property_update(prop, 0, "rna_Brush_update");
3228 
3229  prop = RNA_def_property(srna, "use_cloth_pin_simulation_boundary", PROP_BOOLEAN, PROP_NONE);
3232  prop,
3233  "Pin Simulation Boundary",
3234  "Lock the position of the vertices in the simulation falloff area to avoid artifacts and "
3235  "create a softer transition with unaffected areas");
3236  RNA_def_property_update(prop, 0, "rna_Brush_update");
3237 
3238  prop = RNA_def_property(srna, "use_cloth_collision", PROP_BOOLEAN, PROP_NONE);
3240  RNA_def_property_ui_text(prop, "Enable Collision", "Collide with objects during the simulation");
3241  RNA_def_property_update(prop, 0, "rna_Brush_update");
3242 
3243  prop = RNA_def_property(srna, "invert_to_scrape_fill", PROP_BOOLEAN, PROP_NONE);
3246  "Invert to Scrape or Fill",
3247  "Use Scrape or Fill tool when inverting this brush instead of "
3248  "inverting its displacement direction");
3249  RNA_def_property_update(prop, 0, "rna_Brush_update");
3250 
3251  prop = RNA_def_property(srna, "use_pressure_strength", PROP_BOOLEAN, PROP_NONE);
3253  RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
3255  prop, "Strength Pressure", "Enable tablet pressure sensitivity for strength");
3256  RNA_def_property_update(prop, 0, "rna_Brush_update");
3257 
3258  prop = RNA_def_property(srna, "use_offset_pressure", PROP_BOOLEAN, PROP_NONE);
3260  RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
3262  prop, "Plane Offset Pressure", "Enable tablet pressure sensitivity for offset");
3263  RNA_def_property_update(prop, 0, "rna_Brush_update");
3264 
3265  prop = RNA_def_property(srna, "use_pressure_area_radius", PROP_BOOLEAN, PROP_NONE);
3267  RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
3269  prop, "Area Radius Pressure", "Enable tablet pressure sensitivity for area radius");
3270  RNA_def_property_update(prop, 0, "rna_Brush_update");
3271 
3272  prop = RNA_def_property(srna, "use_pressure_size", PROP_BOOLEAN, PROP_NONE);
3274  RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
3275  RNA_def_property_ui_text(prop, "Size Pressure", "Enable tablet pressure sensitivity for size");
3276  RNA_def_property_update(prop, 0, "rna_Brush_update");
3277 
3278  prop = RNA_def_property(srna, "use_pressure_jitter", PROP_BOOLEAN, PROP_NONE);
3280  RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
3282  prop, "Jitter Pressure", "Enable tablet pressure sensitivity for jitter");
3283  RNA_def_property_update(prop, 0, "rna_Brush_update");
3284 
3285  prop = RNA_def_property(srna, "use_pressure_spacing", PROP_BOOLEAN, PROP_NONE);
3287  RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
3289  prop, "Spacing Pressure", "Enable tablet pressure sensitivity for spacing");
3290  RNA_def_property_update(prop, 0, "rna_Brush_update");
3291 
3292  prop = RNA_def_property(srna, "use_pressure_masking", PROP_ENUM, PROP_NONE);
3293  RNA_def_property_enum_sdna(prop, NULL, "mask_pressure");
3294  RNA_def_property_enum_items(prop, brush_mask_pressure_items);
3296  prop, "Mask Pressure Mode", "Pen pressure makes texture influence smaller");
3297  RNA_def_property_update(prop, 0, "rna_Brush_update");
3298 
3299  prop = RNA_def_property(srna, "use_inverse_smooth_pressure", PROP_BOOLEAN, PROP_NONE);
3301  RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
3303  prop, "Inverse Smooth Pressure", "Lighter pressure causes more smoothing to be applied");
3304  RNA_def_property_update(prop, 0, "rna_Brush_update");
3305 
3306  prop = RNA_def_property(srna, "use_plane_trim", PROP_BOOLEAN, PROP_NONE);
3308  RNA_def_property_ui_text(prop, "Use Plane Trim", "Enable Plane Trim");
3309  RNA_def_property_update(prop, 0, "rna_Brush_update");
3310 
3311  prop = RNA_def_property(srna, "use_frontface", PROP_BOOLEAN, PROP_NONE);
3314  prop, "Use Front-Face", "Brush only affects vertices that face the viewer");
3315  RNA_def_property_update(prop, 0, "rna_Brush_update");
3316 
3317  prop = RNA_def_property(srna, "use_frontface_falloff", PROP_BOOLEAN, PROP_NONE);
3320  prop, "Use Front-Face Falloff", "Blend brush influence by how much they face the front");
3321  RNA_def_property_update(prop, 0, "rna_Brush_update");
3322 
3323  prop = RNA_def_property(srna, "use_anchor", PROP_BOOLEAN, PROP_NONE);
3325  RNA_def_property_ui_text(prop, "Anchored", "Keep the brush anchored to the initial location");
3326  RNA_def_property_update(prop, 0, "rna_Brush_update");
3327 
3328  prop = RNA_def_property(srna, "use_space", PROP_BOOLEAN, PROP_NONE);
3331  prop, "Space", "Limit brush application to the distance specified by spacing");
3332  RNA_def_property_update(prop, 0, "rna_Brush_update");
3333 
3334  prop = RNA_def_property(srna, "use_line", PROP_BOOLEAN, PROP_NONE);
3336  RNA_def_property_ui_text(prop, "Line", "Draw a line with dabs separated according to spacing");
3337  RNA_def_property_update(prop, 0, "rna_Brush_update");
3338 
3339  prop = RNA_def_property(srna, "use_curve", PROP_BOOLEAN, PROP_NONE);
3342  prop,
3343  "Curve",
3344  "Define the stroke curve with a bezier curve. Dabs are separated according to spacing");
3345  RNA_def_property_update(prop, 0, "rna_Brush_update");
3346 
3347  prop = RNA_def_property(srna, "use_smooth_stroke", PROP_BOOLEAN, PROP_NONE);
3350  prop, "Smooth Stroke", "Brush lags behind mouse and follows a smoother path");
3351  RNA_def_property_update(prop, 0, "rna_Brush_update");
3352 
3353  prop = RNA_def_property(srna, "use_persistent", PROP_BOOLEAN, PROP_NONE);
3355  RNA_def_property_ui_text(prop, "Persistent", "Sculpt on a persistent layer of the mesh");
3356  RNA_def_property_update(prop, 0, "rna_Brush_update");
3357 
3358  prop = RNA_def_property(srna, "use_accumulate", PROP_BOOLEAN, PROP_NONE);
3360  RNA_def_property_ui_text(prop, "Accumulate", "Accumulate stroke daubs on top of each other");
3361  RNA_def_property_update(prop, 0, "rna_Brush_update");
3362 
3363  prop = RNA_def_property(srna, "use_space_attenuation", PROP_BOOLEAN, PROP_NONE);
3366  prop,
3367  "Adjust Strength for Spacing",
3368  "Automatically adjust strength to give consistent results for different spacings");
3369  RNA_def_property_update(prop, 0, "rna_Brush_update");
3370 
3371  /* adaptive space is not implemented yet */
3372  prop = RNA_def_property(srna, "use_adaptive_space", PROP_BOOLEAN, PROP_NONE);
3375  "Adaptive Spacing",
3376  "Space daubs according to surface orientation instead of screen space");
3377  RNA_def_property_update(prop, 0, "rna_Brush_update");
3378 
3379  prop = RNA_def_property(srna, "use_locked_size", PROP_ENUM, PROP_NONE); /* as an enum */
3381  RNA_def_property_enum_items(prop, brush_size_unit_items);
3383  prop, "Radius Unit", "Measure brush size relative to the view or the scene");
3384  RNA_def_property_update(prop, 0, "rna_Brush_update");
3385 
3386  prop = RNA_def_property(srna, "color_type", PROP_ENUM, PROP_NONE); /* as an enum */
3388  RNA_def_property_enum_items(prop, color_gradient_items);
3389  RNA_def_property_enum_funcs(prop, NULL, "rna_Brush_use_gradient_set", NULL);
3390  RNA_def_property_ui_text(prop, "Color Type", "Use single color or gradient when painting");
3391  RNA_def_property_update(prop, 0, "rna_Brush_update");
3392 
3393  prop = RNA_def_property(srna, "use_edge_to_edge", PROP_BOOLEAN, PROP_NONE);
3395  RNA_def_property_ui_text(prop, "Edge-to-Edge", "Drag anchor brush from edge-to-edge");
3396  RNA_def_property_update(prop, 0, "rna_Brush_update");
3397 
3398  prop = RNA_def_property(srna, "use_restore_mesh", PROP_BOOLEAN, PROP_NONE);
3400  RNA_def_property_ui_text(prop, "Restore Mesh", "Allow a single dot to be carefully positioned");
3401  RNA_def_property_update(prop, 0, "rna_Brush_update");
3402 
3403  /* only for projection paint & vertex paint, TODO: other paint modes. */
3404  prop = RNA_def_property(srna, "use_alpha", PROP_BOOLEAN, PROP_NONE);
3407  prop, "Affect Alpha", "When this is disabled, lock alpha while painting");
3408  RNA_def_property_update(prop, 0, "rna_Brush_update");
3409 
3410  prop = RNA_def_property(srna, "curve", PROP_POINTER, PROP_NONE);
3412  RNA_def_property_ui_text(prop, "Curve", "Editable falloff curve");
3413  RNA_def_property_update(prop, 0, "rna_Brush_update");
3414 
3415  prop = RNA_def_property(srna, "paint_curve", PROP_POINTER, PROP_NONE);
3417  RNA_def_property_ui_text(prop, "Paint Curve", "Active paint curve");
3418  RNA_def_property_update(prop, 0, "rna_Brush_update");
3419 
3420  prop = RNA_def_property(srna, "gradient", PROP_POINTER, PROP_NEVER_NULL);
3421  RNA_def_property_pointer_sdna(prop, NULL, "gradient");
3422  RNA_def_property_struct_type(prop, "ColorRamp");
3423  RNA_def_property_ui_text(prop, "Gradient", "");
3424  RNA_def_property_update(prop, 0, "rna_Brush_update");
3425 
3426  /* gradient source */
3427  prop = RNA_def_property(srna, "gradient_stroke_mode", PROP_ENUM, PROP_NONE);
3428  RNA_def_property_enum_items(prop, brush_gradient_items);
3429  RNA_def_property_ui_text(prop, "Gradient Stroke Mode", "");
3430  RNA_def_property_update(prop, 0, "rna_Brush_update");
3431 
3432  prop = RNA_def_property(srna, "gradient_fill_mode", PROP_ENUM, PROP_NONE);
3433  RNA_def_property_enum_items(prop, brush_gradient_fill_items);
3434  RNA_def_property_ui_text(prop, "Gradient Fill Mode", "");
3435  RNA_def_property_update(prop, 0, "rna_Brush_update");
3436 
3437  /* overlay flags */
3438  prop = RNA_def_property(srna, "use_primary_overlay", PROP_BOOLEAN, PROP_NONE);
3439  RNA_def_property_boolean_sdna(prop, NULL, "overlay_flags", BRUSH_OVERLAY_PRIMARY);
3440  RNA_def_property_ui_text(prop, "Use Texture Overlay", "Show texture in viewport");
3441  RNA_def_property_update(prop, 0, "rna_Brush_update");
3442 
3443  prop = RNA_def_property(srna, "use_secondary_overlay", PROP_BOOLEAN, PROP_NONE);
3445  RNA_def_property_ui_text(prop, "Use Texture Overlay", "Show texture in viewport");
3446  RNA_def_property_update(prop, 0, "rna_Brush_update");
3447 
3448  prop = RNA_def_property(srna, "use_cursor_overlay", PROP_BOOLEAN, PROP_NONE);
3449  RNA_def_property_boolean_sdna(prop, NULL, "overlay_flags", BRUSH_OVERLAY_CURSOR);
3450  RNA_def_property_ui_text(prop, "Use Cursor Overlay", "Show cursor in viewport");
3451  RNA_def_property_update(prop, 0, "rna_Brush_update");
3452 
3453  prop = RNA_def_property(srna, "use_cursor_overlay_override", PROP_BOOLEAN, PROP_NONE);
3455  prop, NULL, "overlay_flags", BRUSH_OVERLAY_CURSOR_OVERRIDE_ON_STROKE);
3456  RNA_def_property_ui_text(prop, "Override Overlay", "Don't show overlay during a stroke");
3457  RNA_def_property_update(prop, 0, "rna_Brush_update");
3458 
3459  prop = RNA_def_property(srna, "use_primary_overlay_override", PROP_BOOLEAN, PROP_NONE);
3461  prop, NULL, "overlay_flags", BRUSH_OVERLAY_PRIMARY_OVERRIDE_ON_STROKE);
3462  RNA_def_property_ui_text(prop, "Override Overlay", "Don't show overlay during a stroke");
3463  RNA_def_property_update(prop, 0, "rna_Brush_update");
3464 
3465  prop = RNA_def_property(srna, "use_secondary_overlay_override", PROP_BOOLEAN, PROP_NONE);
3467  prop, NULL, "overlay_flags", BRUSH_OVERLAY_SECONDARY_OVERRIDE_ON_STROKE);
3468  RNA_def_property_ui_text(prop, "Override Overlay", "Don't show overlay during a stroke");
3469  RNA_def_property_update(prop, 0, "rna_Brush_update");
3470 
3471  /* paint mode flags */
3472  prop = RNA_def_property(srna, "use_paint_sculpt", PROP_BOOLEAN, PROP_NONE);
3474  RNA_def_property_ui_text(prop, "Use Sculpt", "Use this brush in sculpt mode");
3475 
3476  prop = RNA_def_property(srna, "use_paint_uv_sculpt", PROP_BOOLEAN, PROP_NONE);
3477  RNA_def_property_boolean_sdna(prop, NULL, "ob_mode", OB_MODE_EDIT);
3478  RNA_def_property_ui_text(prop, "Use UV Sculpt", "Use this brush in UV sculpt mode");
3479 
3480  prop = RNA_def_property(srna, "use_paint_vertex", PROP_BOOLEAN, PROP_NONE);
3482  RNA_def_property_ui_text(prop, "Use Vertex", "Use this brush in vertex paint mode");
3483 
3484  prop = RNA_def_property(srna, "use_paint_weight", PROP_BOOLEAN, PROP_NONE);
3486  RNA_def_property_ui_text(prop, "Use Weight", "Use this brush in weight paint mode");
3487 
3488  prop = RNA_def_property(srna, "use_paint_image", PROP_BOOLEAN, PROP_NONE);
3490  RNA_def_property_ui_text(prop, "Use Texture", "Use this brush in texture paint mode");
3491 
3492  prop = RNA_def_property(srna, "use_paint_grease_pencil", PROP_BOOLEAN, PROP_NONE);
3494  RNA_def_property_ui_text(prop, "Use Paint", "Use this brush in grease pencil drawing mode");
3495 
3496  prop = RNA_def_property(srna, "use_vertex_grease_pencil", PROP_BOOLEAN, PROP_NONE);
3499  prop, "Use Vertex", "Use this brush in grease pencil vertex color mode");
3500 
3501  /* texture */
3502  prop = RNA_def_property(srna, "texture_slot", PROP_POINTER, PROP_NONE);
3503  RNA_def_property_struct_type(prop, "BrushTextureSlot");
3504  RNA_def_property_pointer_sdna(prop, NULL, "mtex");
3506  RNA_def_property_ui_text(prop, "Texture Slot", "");
3507 
3508  prop = RNA_def_property(srna, "texture", PROP_POINTER, PROP_NONE);
3509  RNA_def_property_pointer_sdna(prop, NULL, "mtex.tex");
3511  RNA_def_property_ui_text(prop, "Texture", "");
3512  RNA_def_property_update(prop, NC_TEXTURE, "rna_Brush_main_tex_update");
3513 
3514  prop = RNA_def_property(srna, "mask_texture_slot", PROP_POINTER, PROP_NONE);
3515  RNA_def_property_struct_type(prop, "BrushTextureSlot");
3516  RNA_def_property_pointer_sdna(prop, NULL, "mask_mtex");
3518  RNA_def_property_ui_text(prop, "Mask Texture Slot", "");
3519 
3520  prop = RNA_def_property(srna, "mask_texture", PROP_POINTER, PROP_NONE);
3521  RNA_def_property_pointer_sdna(prop, NULL, "mask_mtex.tex");
3523  RNA_def_property_ui_text(prop, "Mask Texture", "");
3524  RNA_def_property_update(prop, NC_TEXTURE, "rna_Brush_secondary_tex_update");
3525 
3526  prop = RNA_def_property(srna, "texture_overlay_alpha", PROP_INT, PROP_PERCENTAGE);
3527  RNA_def_property_int_sdna(prop, NULL, "texture_overlay_alpha");
3528  RNA_def_property_range(prop, 0, 100);
3529  RNA_def_property_ui_text(prop, "Texture Overlay Alpha", "");
3530  RNA_def_property_update(prop, 0, "rna_Brush_update");
3531 
3532  prop = RNA_def_property(srna, "mask_overlay_alpha", PROP_INT, PROP_PERCENTAGE);
3533  RNA_def_property_int_sdna(prop, NULL, "mask_overlay_alpha");
3534  RNA_def_property_range(prop, 0, 100);
3535  RNA_def_property_ui_text(prop, "Mask Texture Overlay Alpha", "");
3536  RNA_def_property_update(prop, 0, "rna_Brush_update");
3537 
3538  prop = RNA_def_property(srna, "cursor_overlay_alpha", PROP_INT, PROP_PERCENTAGE);
3539  RNA_def_property_int_sdna(prop, NULL, "cursor_overlay_alpha");
3540  RNA_def_property_range(prop, 0, 100);
3541  RNA_def_property_ui_text(prop, "Mask Texture Overlay Alpha", "");
3542  RNA_def_property_update(prop, 0, "rna_Brush_update");
3543 
3544  prop = RNA_def_property(srna, "cursor_color_add", PROP_FLOAT, PROP_COLOR_GAMMA);
3545  RNA_def_property_float_sdna(prop, NULL, "add_col");
3546  RNA_def_property_array(prop, 4);
3547  RNA_def_property_ui_text(prop, "Add Color", "Color of cursor when adding");
3548  RNA_def_property_update(prop, 0, "rna_Brush_update");
3549 
3550  prop = RNA_def_property(srna, "cursor_color_subtract", PROP_FLOAT, PROP_COLOR_GAMMA);
3551  RNA_def_property_float_sdna(prop, NULL, "sub_col");
3552  RNA_def_property_array(prop, 4);
3553  RNA_def_property_ui_text(prop, "Subtract Color", "Color of cursor when subtracting");
3554  RNA_def_property_update(prop, 0, "rna_Brush_update");
3555 
3556  prop = RNA_def_property(srna, "use_custom_icon", PROP_BOOLEAN, PROP_NONE);
3558  RNA_def_property_ui_text(prop, "Custom Icon", "Set the brush icon from an image file");
3559  RNA_def_property_update(prop, 0, "rna_Brush_icon_update");
3560 
3561  prop = RNA_def_property(srna, "icon_filepath", PROP_STRING, PROP_FILEPATH);
3562  RNA_def_property_string_sdna(prop, NULL, "icon_filepath");
3563  RNA_def_property_ui_text(prop, "Brush Icon Filepath", "File path to brush icon");
3564  RNA_def_property_update(prop, 0, "rna_Brush_icon_update");
3565 
3566  /* clone tool */
3567  prop = RNA_def_property(srna, "clone_image", PROP_POINTER, PROP_NONE);
3568  RNA_def_property_pointer_sdna(prop, NULL, "clone.image");
3570  RNA_def_property_ui_text(prop, "Clone Image", "Image for clone tool");
3571  RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, "rna_Brush_update");
3572  RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Brush_imagetype_poll");
3573 
3574  prop = RNA_def_property(srna, "clone_alpha", PROP_FLOAT, PROP_FACTOR);
3575  RNA_def_property_float_sdna(prop, NULL, "clone.alpha");
3576  RNA_def_property_range(prop, 0.0f, 1.0f);
3577  RNA_def_property_ui_text(prop, "Clone Alpha", "Opacity of clone image display");
3578  RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, "rna_Brush_update");
3579 
3580  prop = RNA_def_property(srna, "clone_offset", PROP_FLOAT, PROP_XYZ);
3581  RNA_def_property_float_sdna(prop, NULL, "clone.offset");
3582  RNA_def_property_ui_text(prop, "Clone Offset", "");
3583  RNA_def_property_ui_range(prop, -1.0f, 1.0f, 10.0f, 3);
3584  RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, "rna_Brush_update");
3585 
3586  prop = RNA_def_property(srna, "brush_capabilities", PROP_POINTER, PROP_NONE);
3588  RNA_def_property_struct_type(prop, "BrushCapabilities");
3589  RNA_def_property_pointer_funcs(prop, "rna_Brush_capabilities_get", NULL, NULL, NULL);
3590  RNA_def_property_ui_text(prop, "Brush Capabilities", "Brush's capabilities");
3591 
3592  /* brush capabilities (mode-dependent) */
3593  prop = RNA_def_property(srna, "sculpt_capabilities", PROP_POINTER, PROP_NONE);
3595  RNA_def_property_struct_type(prop, "BrushCapabilitiesSculpt");
3596  RNA_def_property_pointer_funcs(prop, "rna_Sculpt_tool_capabilities_get", NULL, NULL, NULL);
3597  RNA_def_property_ui_text(prop, "Sculpt Capabilities", "");
3598 
3599  prop = RNA_def_property(srna, "image_paint_capabilities", PROP_POINTER, PROP_NONE);
3601  RNA_def_property_struct_type(prop, "BrushCapabilitiesImagePaint");
3602  RNA_def_property_pointer_funcs(prop, "rna_Imapaint_tool_capabilities_get", NULL, NULL, NULL);
3603  RNA_def_property_ui_text(prop, "Image Paint Capabilities", "");
3604 
3605  prop = RNA_def_property(srna, "vertex_paint_capabilities", PROP_POINTER, PROP_NONE);
3607  RNA_def_property_struct_type(prop, "BrushCapabilitiesVertexPaint");
3608  RNA_def_property_pointer_funcs(prop, "rna_Vertexpaint_tool_capabilities_get", NULL, NULL, NULL);
3609  RNA_def_property_ui_text(prop, "Vertex Paint Capabilities", "");
3610 
3611  prop = RNA_def_property(srna, "weight_paint_capabilities", PROP_POINTER, PROP_NONE);
3613  RNA_def_property_struct_type(prop, "BrushCapabilitiesWeightPaint");
3614  RNA_def_property_pointer_funcs(prop, "rna_Weightpaint_tool_capabilities_get", NULL, NULL, NULL);
3615  RNA_def_property_ui_text(prop, "Weight Paint Capabilities", "");
3616 
3617  prop = RNA_def_property(srna, "gpencil_settings", PROP_POINTER, PROP_NONE);
3618  RNA_def_property_struct_type(prop, "BrushGpencilSettings");
3619  RNA_def_property_pointer_sdna(prop, NULL, "gpencil_settings");
3621  RNA_def_property_ui_text(prop, "Gpencil Settings", "");
3622 
3623  prop = RNA_def_property(srna, "curves_sculpt_settings", PROP_POINTER, PROP_NONE);
3624  RNA_def_property_struct_type(prop, "BrushCurvesSculptSettings");
3626  RNA_def_property_ui_text(prop, "Curves Sculpt Settings", "");
3627 }
3628 
3641 {
3642  StructRNA *srna;
3643  PropertyRNA *prop;
3644 
3645  srna = RNA_def_struct(brna, "OperatorStrokeElement", "PropertyGroup");
3646  RNA_def_struct_ui_text(srna, "Operator Stroke Element", "");
3647 
3648  prop = RNA_def_property(srna, "location", PROP_FLOAT, PROP_XYZ);
3650  RNA_def_property_array(prop, 3);
3651  RNA_def_property_ui_text(prop, "Location", "");
3652 
3653  prop = RNA_def_property(srna, "mouse", PROP_FLOAT, PROP_XYZ);
3655  RNA_def_property_array(prop, 2);
3656  RNA_def_property_ui_text(prop, "Mouse", "");
3657 
3658  prop = RNA_def_property(srna, "mouse_event", PROP_FLOAT, PROP_XYZ);
3660  RNA_def_property_array(prop, 2);
3661  RNA_def_property_ui_text(prop, "Mouse Event", "");
3662 
3663  prop = RNA_def_property(srna, "pressure", PROP_FLOAT, PROP_FACTOR);
3665  RNA_def_property_range(prop, 0.0f, 1.0f);
3666  RNA_def_property_ui_text(prop, "Pressure", "Tablet pressure");
3667 
3668  prop = RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE);
3670  RNA_def_property_range(prop, 0.0f, FLT_MAX);
3671  RNA_def_property_ui_text(prop, "Brush Size", "Brush size in screen space");
3672 
3673  prop = RNA_def_property(srna, "pen_flip", PROP_BOOLEAN, PROP_NONE);
3675  RNA_def_property_ui_text(prop, "Flip", "");
3676 
3677  prop = RNA_def_property(srna, "x_tilt", PROP_FLOAT, PROP_FACTOR);
3679  RNA_def_property_range(prop, -1.0f, 1.0f);
3680  RNA_def_property_ui_text(prop, "Tilt X", "");
3681 
3682  prop = RNA_def_property(srna, "y_tilt", PROP_FLOAT, PROP_FACTOR);
3684  RNA_def_property_range(prop, -1.0f, 1.0f);
3685  RNA_def_property_ui_text(prop, "Tilt Y", "");
3686 
3687  /* used in uv painting */
3688  prop = RNA_def_property(srna, "time", PROP_FLOAT, PROP_UNSIGNED);
3690  RNA_def_property_ui_text(prop, "Time", "");
3691 
3692  /* used for Grease Pencil sketching sessions */
3693  prop = RNA_def_property(srna, "is_start", PROP_BOOLEAN, PROP_NONE);
3695  RNA_def_property_ui_text(prop, "Is Stroke Start", "");
3696 
3697  /* XXX: Tool (this will be for pressing a modifier key for a different brush,
3698  * e.g. switching to a Smooth brush in the middle of the stroke */
3699 
3700  /* XXX: i don't think blender currently supports the ability to properly do a remappable modifier
3701  * in the middle of a stroke */
3702 }
3703 
3705 {
3706  rna_def_brush(brna);
3716 }
3717 
3718 #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.cc:2363
void BKE_brush_scale_unprojected_radius(float *unprojected_radius, int new_brush_size, int old_brush_size)
Definition: brush.cc:2351
struct ColorBand * BKE_colorband_add(bool rangetype)
Definition: colorband.c:296
struct Scene * CTX_data_scene(const bContext *C)
Definition: context.c:1090
struct ViewLayer * CTX_data_view_layer(const bContext *C)
Definition: context.c:1100
struct Main * CTX_data_main(const bContext *C)
Definition: context.c:1074
struct ToolSettings * CTX_data_tool_settings(const bContext *C)
Definition: context.c:1282
#define GPENCIL_USE_VERTEX_COLOR(toolsettings)
Definition: BKE_gpencil.h:56
void BKE_gpencil_brush_material_set(struct Brush *brush, struct Material *material)
Definition: gpencil.c:1687
void BKE_icon_id_delete(struct ID *id)
Definition: icons.cc:870
void BKE_previewimg_id_free(struct ID *id)
Definition: icons.cc:377
void BKE_icon_changed(int icon_id)
Definition: icons.cc:637
int BKE_icon_id_ensure(struct ID *id)
Definition: icons.cc:699
General operations, lookup, etc. for materials.
struct Material * BKE_object_material_get(struct Object *ob, short act)
Definition: material.c:687
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:260
ePaintMode
Definition: BKE_paint.h:67
@ PAINT_MODE_SCULPT_CURVES
Definition: BKE_paint.h:83
@ PAINT_MODE_TEXTURE_3D
Definition: BKE_paint.h:73
@ PAINT_MODE_SCULPT
Definition: BKE_paint.h:68
@ PAINT_MODE_TEXTURE_2D
Definition: BKE_paint.h:75
#define M_PI_2
Definition: BLI_math_base.h:23
#define M_PI
Definition: BLI_math_base.h:20
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL() ATTR_MALLOC
Definition: string.c:42
#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_AUTOMASK_LAYER
@ GP_SCULPT_FLAGMODE_AUTOMASK_MATERIAL
@ GP_SCULPT_FLAGMODE_APPLY_THICKNESS
@ GP_SCULPT_FLAGMODE_AUTOMASK_STROKE
@ 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
@ SCULPT_DISP_DIR_VIEW
@ SCULPT_DISP_DIR_X
@ SCULPT_DISP_DIR_Z
@ SCULPT_DISP_DIR_Y
@ SCULPT_DISP_DIR_AREA
@ 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
@ PAINT_FALLOFF_SHAPE_TUBE
@ 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
@ BRUSH_CURVES_SCULPT_FLAG_INTERPOLATE_POINT_COUNT
@ BRUSH_CURVES_SCULPT_FLAG_SCALE_UNIFORM
@ BRUSH_CURVES_SCULPT_FLAG_INTERPOLATE_LENGTH
@ BRUSH_CURVES_SCULPT_FLAG_INTERPOLATE_SHAPE
@ 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
@ BRUSH_CURVES_SCULPT_DENSITY_MODE_REMOVE
@ BRUSH_CURVES_SCULPT_DENSITY_MODE_ADD
@ BRUSH_CURVES_SCULPT_DENSITY_MODE_AUTO
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
@ CURVES_SCULPT_TOOL_SMOOTH
@ CURVES_SCULPT_TOOL_SELECTION_PAINT
@ CURVES_SCULPT_TOOL_DENSITY
@ CURVES_SCULPT_TOOL_GROW_SHRINK
@ CURVES_SCULPT_TOOL_DELETE
@ CURVES_SCULPT_TOOL_PINCH
@ CURVES_SCULPT_TOOL_SNAKE_HOOK
@ CURVES_SCULPT_TOOL_ADD
@ CURVES_SCULPT_TOOL_COMB
@ CURVES_SCULPT_TOOL_PUFF
@ CURVES_SCULPT_TOOL_SLIDE
#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
@ GP_STROKE_CAP_ROUND
@ GP_STROKE_CAP_FLAT
#define GP_MAX_INPUT_SAMPLES
#define GPENCIL_MAX_FILL_FAC
@ IMA_TYPE_R_RESULT
@ IMA_TYPE_COMPOSITE
@ 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
@ IMB_BLEND_EXCLUSION
Definition: IMB_imbuf.h:229
@ IMB_BLEND_DIFFERENCE
Definition: IMB_imbuf.h:228
@ IMB_BLEND_HARDLIGHT
Definition: IMB_imbuf.h:219
@ IMB_BLEND_COLORBURN
Definition: IMB_imbuf.h:220
@ IMB_BLEND_COLORDODGE
Definition: IMB_imbuf.h:222
@ IMB_BLEND_ERASE_ALPHA
Definition: IMB_imbuf.h:216
@ IMB_BLEND_SCREEN
Definition: IMB_imbuf.h:223
@ IMB_BLEND_HUE
Definition: IMB_imbuf.h:230
@ IMB_BLEND_MUL
Definition: IMB_imbuf.h:213
@ IMB_BLEND_ADD_ALPHA
Definition: IMB_imbuf.h:217
@ IMB_BLEND_DARKEN
Definition: IMB_imbuf.h:215
@ IMB_BLEND_OVERLAY
Definition: IMB_imbuf.h:218
@ IMB_BLEND_SATURATION
Definition: IMB_imbuf.h:231
@ IMB_BLEND_VIVIDLIGHT
Definition: IMB_imbuf.h:226
@ IMB_BLEND_LUMINOSITY
Definition: IMB_imbuf.h:232
@ IMB_BLEND_LIGHTEN
Definition: IMB_imbuf.h:214
@ IMB_BLEND_SOFTLIGHT
Definition: IMB_imbuf.h:224
@ IMB_BLEND_COLOR
Definition: IMB_imbuf.h:233
@ IMB_BLEND_LINEARLIGHT
Definition: IMB_imbuf.h:227
@ IMB_BLEND_PINLIGHT
Definition: IMB_imbuf.h:225
@ IMB_BLEND_MIX
Definition: IMB_imbuf.h:210
@ IMB_BLEND_ADD
Definition: IMB_imbuf.h:211
@ IMB_BLEND_SUB
Definition: IMB_imbuf.h:212
@ IMB_BLEND_LINEARBURN
Definition: IMB_imbuf.h:221
Read Guarded memory(de)allocation.
@ PROP_FLOAT
Definition: RNA_types.h:61
@ PROP_BOOLEAN
Definition: RNA_types.h:59
@ PROP_ENUM
Definition: RNA_types.h:63
@ PROP_INT
Definition: RNA_types.h:60
@ PROP_STRING
Definition: RNA_types.h:62
@ PROP_POINTER
Definition: RNA_types.h:64
#define RNA_ENUM_ITEM_SEPR
Definition: RNA_types.h:483
@ PROP_CONTEXT_UPDATE
Definition: RNA_types.h:269
@ PROP_ANIMATABLE
Definition: RNA_types.h:202
@ PROP_EDITABLE
Definition: RNA_types.h:189
@ PROP_NEVER_NULL
Definition: RNA_types.h:239
@ PROP_ID_SELF_CHECK
Definition: RNA_types.h:232
@ PROP_IDPROPERTY
Definition: RNA_types.h:288
@ PROP_XYZ
Definition: RNA_types.h:162
@ PROP_DISTANCE
Definition: RNA_types.h:149
@ PROP_PIXEL
Definition: RNA_types.h:141
@ PROP_ANGLE
Definition: RNA_types.h:145
@ PROP_NONE
Definition: RNA_types.h:126
@ PROP_PERCENTAGE
Definition: RNA_types.h:143
@ PROP_FACTOR
Definition: RNA_types.h:144
@ PROP_COLOR_GAMMA
Definition: RNA_types.h:165
@ PROP_UNSIGNED
Definition: RNA_types.h:142
@ PROP_FILEPATH
Definition: RNA_types.h:129
#define C
Definition: RandGen.cpp:25
@ BIFICONID_LAST
Definition: UI_resources.h:21
#define NC_BRUSH
Definition: WM_types.h:335
#define ND_DATA
Definition: WM_types.h:456
#define ND_SPACE_PROPERTIES
Definition: WM_types.h:472
#define NC_SCENE
Definition: WM_types.h:328
#define ND_TOOLSETTINGS
Definition: WM_types.h:397
#define ND_SPACE_IMAGE
Definition: WM_types.h:465
#define NA_EDITED
Definition: WM_types.h:523
#define NC_GPENCIL
Definition: WM_types.h:349
#define NC_TEXTURE
Definition: WM_types.h:331
#define NC_SPACE
Definition: WM_types.h:342
return(oflags[bm->toolflag_index].f &oflag) !=0
Scene scene
Material material
depth_tx normal_tx diffuse_light_tx specular_light_tx volume_light_tx environment_tx ambient_occlusion_tx aov_value_tx in_weight_img image(1, GPU_R32F, Qualifier::WRITE, ImageType::FLOAT_2D_ARRAY, "out_weight_img") .image(3
void IMB_freeImBuf(ImBuf *UNUSED(ibuf))
PointerRNA rna_pointer_inherit_refine(PointerRNA *ptr, StructRNA *type, void *data)
Definition: rna_access.c:186
#define TEXTURE_CAPABILITY(prop_name_, ui_name_)
static EnumPropertyItem rna_enum_gpencil_brush_eraser_modes_items[]
Definition: rna_brush.c:264
static EnumPropertyItem rna_enum_gpencil_brush_paint_icons_items[]
Definition: rna_brush.c:306
static void rna_def_gpencil_options(BlenderRNA *brna)
Definition: rna_brush.c:1288
const EnumPropertyItem rna_enum_brush_image_tool_items[]
Definition: rna_brush.c:154
static void rna_def_sculpt_capabilities(BlenderRNA *brna)
Definition: rna_brush.c:1147
#define IMAPAINT_TOOL_CAPABILITY(prop_name_, ui_name_)
static void rna_def_operator_stroke_element(BlenderRNA *brna)
Definition: rna_brush.c:3640
static EnumPropertyItem rna_enum_gpencil_brush_vertex_icons_items[]
Definition: rna_brush.c:339
static EnumPropertyItem rna_enum_gpencil_fill_direction_items[]
Definition: rna_brush.c:294
static const EnumPropertyItem sculpt_stroke_method_items[]
Definition: rna_brush.c:46
const EnumPropertyItem rna_enum_brush_curves_sculpt_tool_items[]
Definition: rna_brush.c:247
const EnumPropertyItem rna_enum_brush_weight_tool_items[]
Definition: rna_brush.c:146
static void rna_def_curves_sculpt_options(BlenderRNA *brna)
Definition: rna_brush.c:1953
static EnumPropertyItem rna_enum_gpencil_fill_layers_modes_items[]
Definition: rna_brush.c:285
#define WPAINT_TOOL_CAPABILITY(prop_name_, ui_name_)
const EnumPropertyItem rna_enum_brush_gpencil_sculpt_types_items[]
Definition: rna_brush.c:193
#define BRUSH_CAPABILITY(prop_name_, ui_name_)
static EnumPropertyItem rna_enum_gpencil_fill_draw_modes_items[]
Definition: rna_brush.c:275
const EnumPropertyItem rna_enum_brush_sculpt_tool_items[]
Definition: rna_brush.c:91
#define VPAINT_TOOL_CAPABILITY(prop_name_, ui_name_)
void RNA_def_brush(BlenderRNA *brna)
Definition: rna_brush.c:3704
const EnumPropertyItem rna_enum_brush_vertex_tool_items[]
Definition: rna_brush.c:138
const EnumPropertyItem rna_enum_brush_uv_sculpt_tool_items[]
Definition: rna_brush.c:131
static void rna_def_brush(BlenderRNA *brna)
Definition: rna_brush.c:2044
static const EnumPropertyItem prop_direction_items[]
Definition: rna_brush.c:28
static const EnumPropertyItem rna_enum_brush_texture_slot_map_all_mode_items[]
Definition: rna_brush.c:69
const EnumPropertyItem rna_enum_brush_gpencil_vertex_types_items[]
Definition: rna_brush.c:184
static EnumPropertyItem rna_enum_gpencil_brush_modes_items[]
Definition: rna_brush.c:300
static void rna_def_image_paint_capabilities(BlenderRNA *brna)
Definition: rna_brush.c:1216
static void rna_def_vertex_paint_capabilities(BlenderRNA *brna)
Definition: rna_brush.c:1242
const EnumPropertyItem rna_enum_brush_gpencil_weight_types_items[]
Definition: rna_brush.c:237
static EnumPropertyItem rna_enum_gpencil_brush_sculpt_icons_items[]
Definition: rna_brush.c:322
static void rna_def_brush_texture_slot(BlenderRNA *brna)
Definition: rna_brush.c:1078
static EnumPropertyItem rna_enum_gpencil_brush_weight_icons_items[]
Definition: rna_brush.c:335
const EnumPropertyItem rna_enum_brush_gpencil_types_items[]
Definition: rna_brush.c:164
static void rna_def_weight_paint_capabilities(BlenderRNA *brna)
Definition: rna_brush.c:1265
static void rna_def_brush_capabilities(BlenderRNA *brna)
Definition: rna_brush.c:1191
#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:2740
void RNA_def_struct_path_func(StructRNA *srna, const char *path)
Definition: rna_define.c:1193
void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t bit)
Definition: rna_define.c:2236
void RNA_def_parameter_clear_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
Definition: rna_define.c:1526
void RNA_def_property_float_default(PropertyRNA *prop, float value)
Definition: rna_define.c:2022
void RNA_def_property_float_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
Definition: rna_define.c:3126
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
Definition: rna_define.c:1645
void RNA_def_property_string_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2695
void RNA_def_property_ui_icon(PropertyRNA *prop, int icon, int consecutive)
Definition: rna_define.c:1653
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
Definition: rna_define.c:1237
void RNA_def_property_boolean_default(PropertyRNA *prop, bool value)
Definition: rna_define.c:1937
void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const char *set)
Definition: rna_define.c:2944
void RNA_def_property_int_default(PropertyRNA *prop, int value)
Definition: rna_define.c:1978
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
Definition: rna_define.c:1872
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
Definition: rna_define.c:1048
void RNA_def_property_array(PropertyRNA *prop, int length)
Definition: rna_define.c:1539
void RNA_def_property_range(PropertyRNA *prop, double min, double max)
Definition: rna_define.c:1737
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
Definition: rna_define.c:1772
void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *func)
Definition: rna_define.c:2900
void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char *set, const char *item)
Definition: rna_define.c:3224
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier, int type, int subtype)
Definition: rna_define.c:1257
void RNA_def_property_enum_bitflag_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2669
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
Definition: rna_define.c:1495
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:3385
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
Definition: rna_define.c:1028
void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2601
void RNA_def_property_int_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
Definition: rna_define.c:3028
void RNA_def_struct_ui_icon(StructRNA *srna, int icon)
Definition: rna_define.c:1245
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
Definition: rna_define.c:1490
void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2493
void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double step, int precision)
Definition: rna_define.c:1664
void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2343
void RNA_def_property_boolean_negative_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
Definition: rna_define.c:2327
void RNA_def_struct_nested(BlenderRNA *brna, StructRNA *srna, const char *structname)
Definition: rna_define.c:1119
void rna_TextureSlot_update(struct bContext *C, struct PointerRNA *ptr)
const EnumPropertyItem DummyRNA_DEFAULT_items[]
Definition: rna_rna.c:31
#define INT32_MAX
Definition: stdint.h:137
struct ImBuf * icon_imbuf
struct ColorBand * gradient
struct MTex mtex
char vertexpaint_tool
float unprojected_radius
char curves_sculpt_tool
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:368
int icon_id
Definition: DNA_ID.h:389
void * first
Definition: DNA_listBase.h:31
char mapping
char brush_map_mode
struct Tex * tex
Definition: BKE_main.h:121
ListBase brushes
Definition: BKE_main.h:193
struct MaterialGPencilStyle * gp_style
struct Brush * brush
void * data
Definition: RNA_types.h:38
struct ID * owner_id
Definition: RNA_types.h:36
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:3480