Blender V4.5
rna_brush.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#include <cstdlib>
10
11#include "DNA_brush_types.h"
13#include "DNA_scene_types.h"
14#include "DNA_texture_types.h"
15
16#include "BLI_math_base.h"
18
19#include "BLT_translation.hh"
20
21#include "RNA_define.hh"
22#include "RNA_enum_types.hh"
23
24#include "rna_internal.hh"
25
26#include "IMB_imbuf.hh"
27
28#include "WM_types.hh"
29
31 {0, "ADD", ICON_ADD, "Add", "Add effect of brush"},
32 {BRUSH_DIR_IN, "SUBTRACT", ICON_REMOVE, "Subtract", "Subtract effect of brush"},
33 {0, nullptr, 0, nullptr, nullptr},
34};
35
36#ifdef RNA_RUNTIME
37
38# include "DNA_material_types.h"
39
40static const EnumPropertyItem prop_smooth_direction_items[] = {
41 {0, "SMOOTH", ICON_ADD, "Smooth", "Smooth the surface"},
43 "ENHANCE_DETAILS",
44 ICON_REMOVE,
45 "Enhance Details",
46 "Enhance the surface detail"},
47 {0, nullptr, 0, nullptr, nullptr},
48};
49#endif
50
52 {0, "DOTS", 0, "Dots", "Apply paint on each mouse move step"},
53 {BRUSH_DRAG_DOT, "DRAG_DOT", 0, "Drag Dot", "Allows a single dot to be carefully positioned"},
55 "SPACE",
56 0,
57 "Space",
58 "Limit brush application to the distance specified by spacing"},
60 "AIRBRUSH",
61 0,
62 "Airbrush",
63 "Keep applying paint effect while holding mouse (spray)"},
64 {BRUSH_ANCHORED, "ANCHORED", 0, "Anchored", "Keep the brush anchored to the initial location"},
65 {BRUSH_LINE, "LINE", 0, "Line", "Draw a line with dabs separated according to spacing"},
66 {int(BRUSH_CURVE),
67 "CURVE",
68 0,
69 "Curve",
70 "Define the stroke curve with a Bézier curve (dabs are separated according to spacing)"},
71 {0, nullptr, 0, nullptr, nullptr},
72};
73
75 {MTEX_MAP_MODE_VIEW, "VIEW_PLANE", 0, "View Plane", ""},
76 {MTEX_MAP_MODE_AREA, "AREA_PLANE", 0, "Area Plane", ""},
77 {MTEX_MAP_MODE_TILED, "TILED", 0, "Tiled", ""},
78 {MTEX_MAP_MODE_3D, "3D", 0, "3D", ""},
79 {MTEX_MAP_MODE_RANDOM, "RANDOM", 0, "Random", ""},
80 {MTEX_MAP_MODE_STENCIL, "STENCIL", 0, "Stencil", ""},
81 {0, nullptr, 0, nullptr, nullptr},
82};
83
84#ifdef RNA_RUNTIME
85static const EnumPropertyItem rna_enum_brush_texture_slot_map_texture_mode_items[] = {
86 {MTEX_MAP_MODE_VIEW, "VIEW_PLANE", 0, "View Plane", ""},
87 {MTEX_MAP_MODE_TILED, "TILED", 0, "Tiled", ""},
88 {MTEX_MAP_MODE_3D, "3D", 0, "3D", ""},
89 {MTEX_MAP_MODE_RANDOM, "RANDOM", 0, "Random", ""},
90 {MTEX_MAP_MODE_STENCIL, "STENCIL", 0, "Stencil", ""},
91 {0, nullptr, 0, nullptr, nullptr},
92};
93#endif
94
96 {BRUSH_CURVE_CUSTOM, "CUSTOM", ICON_RNDCURVE, "Custom", ""},
97 {BRUSH_CURVE_SMOOTH, "SMOOTH", ICON_SMOOTHCURVE, "Smooth", ""},
98 {BRUSH_CURVE_SMOOTHER, "SMOOTHER", ICON_SMOOTHCURVE, "Smoother", ""},
99 {BRUSH_CURVE_SPHERE, "SPHERE", ICON_SPHERECURVE, "Sphere", ""},
100 {BRUSH_CURVE_ROOT, "ROOT", ICON_ROOTCURVE, "Root", ""},
101 {BRUSH_CURVE_SHARP, "SHARP", ICON_SHARPCURVE, "Sharp", ""},
102 {BRUSH_CURVE_LIN, "LIN", ICON_LINCURVE, "Linear", ""},
103 {BRUSH_CURVE_POW4, "POW4", ICON_SHARPCURVE, "Sharper", ""},
104 {BRUSH_CURVE_INVSQUARE, "INVSQUARE", ICON_INVERSESQUARECURVE, "Inverse Square", ""},
105 {BRUSH_CURVE_CONSTANT, "CONSTANT", ICON_NOCURVE, "Constant", ""},
106 {0, nullptr, 0, nullptr, nullptr},
107};
108
109/* NOTE: we don't actually turn these into a single enum bit-mask property,
110 * instead we construct individual boolean properties. */
113 "use_automasking_topology",
114 0,
115 "Topology",
116 "Affect only vertices connected to the active vertex under the brush"},
118 "use_automasking_face_sets",
119 0,
120 "Face Sets",
121 "Affect only vertices that share Face Sets with the active vertex"},
123 "use_automasking_boundary_edges",
124 0,
125 "Mesh Boundary Auto-Masking",
126 "Do not affect non manifold boundary edges"},
128 "use_automasking_boundary_face_sets",
129 0,
130 "Face Sets Boundary Automasking",
131 "Do not affect vertices that belong to a Face Set boundary"},
133 "use_automasking_cavity",
134 0,
135 "Cavity Mask",
136 "Do not affect vertices on peaks, based on the surface curvature"},
138 "use_automasking_cavity_inverted",
139 0,
140 "Inverted Cavity Mask",
141 "Do not affect vertices within crevices, based on the surface curvature"},
143 "use_automasking_custom_cavity_curve",
144 0,
145 "Custom Cavity Curve",
146 "Use custom curve"},
147 {0, nullptr, 0, nullptr, nullptr}};
148
150 {SCULPT_BRUSH_TYPE_DRAW, "DRAW", 0, "Draw", ""},
151 {SCULPT_BRUSH_TYPE_DRAW_SHARP, "DRAW_SHARP", 0, "Draw Sharp", ""},
152 {SCULPT_BRUSH_TYPE_CLAY, "CLAY", 0, "Clay", ""},
153 {SCULPT_BRUSH_TYPE_CLAY_STRIPS, "CLAY_STRIPS", 0, "Clay Strips", ""},
154 {SCULPT_BRUSH_TYPE_CLAY_THUMB, "CLAY_THUMB", 0, "Clay Thumb", ""},
155 {SCULPT_BRUSH_TYPE_LAYER, "LAYER", 0, "Layer", ""},
156 {SCULPT_BRUSH_TYPE_INFLATE, "INFLATE", 0, "Inflate", ""},
157 {SCULPT_BRUSH_TYPE_BLOB, "BLOB", 0, "Blob", ""},
158 {SCULPT_BRUSH_TYPE_CREASE, "CREASE", 0, "Crease", ""},
160 {SCULPT_BRUSH_TYPE_SMOOTH, "SMOOTH", 0, "Smooth", ""},
161 {SCULPT_BRUSH_TYPE_PLANE, "PLANE", 0, "Plane", ""},
162 {SCULPT_BRUSH_TYPE_MULTIPLANE_SCRAPE, "MULTIPLANE_SCRAPE", 0, "Multi-plane Scrape", ""},
163 {SCULPT_BRUSH_TYPE_PINCH, "PINCH", 0, "Pinch", ""},
165 {SCULPT_BRUSH_TYPE_GRAB, "GRAB", 0, "Grab", ""},
166 {SCULPT_BRUSH_TYPE_ELASTIC_DEFORM, "ELASTIC_DEFORM", 0, "Elastic Deform", ""},
167 {SCULPT_BRUSH_TYPE_SNAKE_HOOK, "SNAKE_HOOK", 0, "Snake Hook", ""},
168 {SCULPT_BRUSH_TYPE_THUMB, "THUMB", 0, "Thumb", ""},
169 {SCULPT_BRUSH_TYPE_POSE, "POSE", 0, "Pose", ""},
170 {SCULPT_BRUSH_TYPE_NUDGE, "NUDGE", 0, "Nudge", ""},
171 {SCULPT_BRUSH_TYPE_ROTATE, "ROTATE", 0, "Rotate", ""},
172 {SCULPT_BRUSH_TYPE_SLIDE_RELAX, "TOPOLOGY", 0, "Slide Relax", ""},
173 {SCULPT_BRUSH_TYPE_BOUNDARY, "BOUNDARY", 0, "Boundary", ""},
175 {SCULPT_BRUSH_TYPE_CLOTH, "CLOTH", 0, "Cloth", ""},
176 {SCULPT_BRUSH_TYPE_SIMPLIFY, "SIMPLIFY", 0, "Simplify", ""},
177 {SCULPT_BRUSH_TYPE_MASK, "MASK", 0, "Mask", ""},
178 {SCULPT_BRUSH_TYPE_DRAW_FACE_SETS, "DRAW_FACE_SETS", 0, "Draw Face Sets", ""},
180 "DISPLACEMENT_ERASER",
181 0,
182 "Multires Displacement Eraser",
183 ""},
185 "DISPLACEMENT_SMEAR",
186 0,
187 "Multires Displacement Smear",
188 ""},
189 {SCULPT_BRUSH_TYPE_PAINT, "PAINT", 0, "Paint", ""},
190 {SCULPT_BRUSH_TYPE_SMEAR, "SMEAR", 0, "Smear", ""},
191 {0, nullptr, 0, nullptr, nullptr},
192};
193
195 {VPAINT_BRUSH_TYPE_DRAW, "DRAW", 0, "Draw", ""},
196 {VPAINT_BRUSH_TYPE_BLUR, "BLUR", 0, "Blur", ""},
197 {VPAINT_BRUSH_TYPE_AVERAGE, "AVERAGE", 0, "Average", ""},
198 {VPAINT_BRUSH_TYPE_SMEAR, "SMEAR", 0, "Smear", ""},
199 {0, nullptr, 0, nullptr, nullptr},
200};
201
203 {WPAINT_BRUSH_TYPE_DRAW, "DRAW", 0, "Draw", ""},
204 {WPAINT_BRUSH_TYPE_BLUR, "BLUR", 0, "Blur", ""},
205 {WPAINT_BRUSH_TYPE_AVERAGE, "AVERAGE", 0, "Average", ""},
206 {WPAINT_BRUSH_TYPE_SMEAR, "SMEAR", 0, "Smear", ""},
207 {0, nullptr, 0, nullptr, nullptr},
208};
209
211 {IMAGE_PAINT_BRUSH_TYPE_DRAW, "DRAW", 0, "Draw", ""},
212 {IMAGE_PAINT_BRUSH_TYPE_SOFTEN, "SOFTEN", 0, "Soften", ""},
213 {IMAGE_PAINT_BRUSH_TYPE_SMEAR, "SMEAR", 0, "Smear", ""},
214 {IMAGE_PAINT_BRUSH_TYPE_CLONE, "CLONE", 0, "Clone", ""},
215 {IMAGE_PAINT_BRUSH_TYPE_FILL, "FILL", 0, "Fill", ""},
216 {IMAGE_PAINT_BRUSH_TYPE_MASK, "MASK", 0, "Mask", ""},
217 {0, nullptr, 0, nullptr, nullptr},
218};
219
222 "DRAW",
223 ICON_STROKE,
224 "Draw",
225 "The brush is of type used for drawing strokes"},
227 "FILL",
228 ICON_COLOR,
229 "Fill",
230 "The brush is of type used for filling areas"},
232 "ERASE",
233 ICON_PANEL_CLOSE,
234 "Erase",
235 "The brush is used for erasing strokes"},
236 {GPAINT_BRUSH_TYPE_TINT, "TINT", 0, "Tint", "The brush is of type used for tinting strokes"},
237 {0, nullptr, 0, nullptr, nullptr},
238};
239
241 {GPVERTEX_BRUSH_TYPE_DRAW, "DRAW", 0, "Draw", "Paint a color on stroke points"},
243 "BLUR",
244 0,
245 "Blur",
246 "Smooth out the colors of adjacent stroke points"},
248 "AVERAGE",
249 0,
250 "Average",
251 "Smooth out colors with the average color under the brush"},
253 "SMEAR",
254 0,
255 "Smear",
256 "Smudge colors by grabbing and dragging them"},
258 "REPLACE",
259 0,
260 "Replace",
261 "Replace the color of stroke points that already have a color applied"},
262 {0, nullptr, 0, nullptr, nullptr},
263};
264
266 {GPSCULPT_BRUSH_TYPE_SMOOTH, "SMOOTH", 0, "Smooth", "Smooth stroke points"},
267 {GPSCULPT_BRUSH_TYPE_THICKNESS, "THICKNESS", 0, "Thickness", "Adjust thickness of strokes"},
268 {GPSCULPT_BRUSH_TYPE_STRENGTH, "STRENGTH", 0, "Strength", "Adjust color strength of strokes"},
270 "RANDOMIZE",
271 0,
272 "Randomize",
273 "Introduce jitter/randomness into strokes"},
275 "GRAB",
276 0,
277 "Grab",
278 "Translate the set of points initially within the brush circle"},
280 "PUSH",
281 0,
282 "Push",
283 "Move points out of the way, as if combing them"},
285 "TWIST",
286 0,
287 "Twist",
288 "Rotate points around the midpoint of the brush"},
290 "PINCH",
291 0,
292 "Pinch",
293 "Pull points towards the midpoint of the brush"},
295 "CLONE",
296 0,
297 "Clone",
298 "Paste copies of the strokes stored on the internal clipboard"},
299 {0, nullptr, 0, nullptr, nullptr}};
300
302 {GPWEIGHT_BRUSH_TYPE_DRAW, "WEIGHT", 0, "Weight", "Paint weight in active vertex group"},
303 {GPWEIGHT_BRUSH_TYPE_BLUR, "BLUR", 0, "Blur", "Blur weight in active vertex group"},
305 "AVERAGE",
306 0,
307 "Average",
308 "Average weight in active vertex group"},
309 {GPWEIGHT_BRUSH_TYPE_SMEAR, "SMEAR", 0, "Smear", "Smear weight in active vertex group"},
310 {0, nullptr, 0, nullptr, nullptr},
311};
312
314 {CURVES_SCULPT_BRUSH_TYPE_SELECTION_PAINT, "SELECTION_PAINT", 0, "Paint Selection", ""},
316 {CURVES_SCULPT_BRUSH_TYPE_ADD, "ADD", 0, "Add", ""},
317 {CURVES_SCULPT_BRUSH_TYPE_DELETE, "DELETE", 0, "Delete", ""},
318 {CURVES_SCULPT_BRUSH_TYPE_DENSITY, "DENSITY", 0, "Density", ""},
320 {CURVES_SCULPT_BRUSH_TYPE_COMB, "COMB", 0, "Comb", ""},
321 {CURVES_SCULPT_BRUSH_TYPE_SNAKE_HOOK, "SNAKE_HOOK", 0, "Snake Hook", ""},
322 {CURVES_SCULPT_BRUSH_TYPE_GROW_SHRINK, "GROW_SHRINK", 0, "Grow / Shrink", ""},
323 {CURVES_SCULPT_BRUSH_TYPE_PINCH, "PINCH", 0, "Pinch", ""},
324 {CURVES_SCULPT_BRUSH_TYPE_PUFF, "PUFF", 0, "Puff", ""},
325 {CURVES_SCULPT_BRUSH_TYPE_SMOOTH, "SMOOTH", 0, "Smooth", ""},
326 {CURVES_SCULPT_BRUSH_TYPE_SLIDE, "SLIDE", 0, "Slide", ""},
327 {0, nullptr, 0, nullptr, nullptr},
328};
329
330#ifndef RNA_RUNTIME
333 "SOFT",
334 0,
335 "Dissolve",
336 "Erase strokes, fading their points strength and thickness"},
337 {GP_BRUSH_ERASER_HARD, "HARD", 0, "Point", "Erase stroke points"},
338 {GP_BRUSH_ERASER_STROKE, "STROKE", 0, "Stroke", "Erase entire strokes"},
339 {0, nullptr, 0, nullptr, nullptr},
340};
341
344 "BOTH",
345 0,
346 "All",
347 "Use both visible strokes and edit lines as fill boundary limits"},
348 {GP_FILL_DMODE_STROKE, "STROKE", 0, "Strokes", "Use visible strokes as fill boundary limits"},
349 {GP_FILL_DMODE_CONTROL, "CONTROL", 0, "Edit Lines", "Use edit lines as fill boundary limits"},
350 {0, nullptr, 0, nullptr, nullptr}};
351
353 {GP_FILL_EMODE_EXTEND, "EXTEND", 0, "Extend", "Extend strokes in straight lines"},
354 {GP_FILL_EMODE_RADIUS, "RADIUS", 0, "Radius", "Connect endpoints that are close together"},
355 {0, nullptr, 0, nullptr, nullptr}};
356
358 {GP_FILL_GPLMODE_VISIBLE, "VISIBLE", 0, "Visible", "Visible layers"},
359 {GP_FILL_GPLMODE_ACTIVE, "ACTIVE", 0, "Active", "Only active layer"},
360 {GP_FILL_GPLMODE_ABOVE, "ABOVE", 0, "Layer Above", "Layer above active"},
361 {GP_FILL_GPLMODE_BELOW, "BELOW", 0, "Layer Below", "Layer below active"},
362 {GP_FILL_GPLMODE_ALL_ABOVE, "ALL_ABOVE", 0, "All Above", "All layers above active"},
363 {GP_FILL_GPLMODE_ALL_BELOW, "ALL_BELOW", 0, "All Below", "All layers below active"},
364 {0, nullptr, 0, nullptr, nullptr}};
365
367 {0, "NORMAL", ICON_ADD, "Normal", "Fill internal area"},
368 {BRUSH_DIR_IN, "INVERT", ICON_REMOVE, "Inverted", "Fill inverted area"},
369 {0, nullptr, 0, nullptr, nullptr},
370};
371
373 {GP_BRUSH_MODE_ACTIVE, "ACTIVE", 0, "Active", "Use current mode"},
374 {GP_BRUSH_MODE_MATERIAL, "MATERIAL", 0, "Material", "Use always material mode"},
375 {GP_BRUSH_MODE_VERTEXCOLOR, "VERTEXCOLOR", 0, "Vertex Color", "Use always Vertex Color mode"},
376 {0, nullptr, 0, nullptr, nullptr}};
377
378#endif
379
380#ifdef RNA_RUNTIME
381
382# include "RNA_access.hh"
383
384# include "BKE_brush.hh"
385# include "BKE_colorband.hh"
386# include "BKE_context.hh"
387# include "BKE_gpencil_legacy.h"
388# include "BKE_icons.h"
389# include "BKE_layer.hh"
390# include "BKE_material.hh"
391# include "BKE_paint.hh"
392# include "BKE_preview_image.hh"
393
394# include "WM_api.hh"
395
396static bool rna_TextureCapabilities_has_random_texture_angle_get(PointerRNA *ptr)
397{
398 MTex *mtex = (MTex *)ptr->data;
399 return ELEM(mtex->brush_map_mode, MTEX_MAP_MODE_VIEW, MTEX_MAP_MODE_AREA, MTEX_MAP_MODE_RANDOM);
400}
401
402static bool rna_TextureCapabilities_has_texture_angle_get(PointerRNA *ptr)
403{
404 MTex *mtex = (MTex *)ptr->data;
405 return mtex->brush_map_mode != MTEX_MAP_MODE_3D;
406}
407
408static bool rna_TextureCapabilities_has_texture_angle_source_get(PointerRNA *ptr)
409{
410 MTex *mtex = (MTex *)ptr->data;
411 return ELEM(mtex->brush_map_mode, MTEX_MAP_MODE_VIEW, MTEX_MAP_MODE_AREA, MTEX_MAP_MODE_RANDOM);
412}
413
414static bool rna_BrushCapabilities_has_overlay_get(PointerRNA *ptr)
415{
416 Brush *br = static_cast<Brush *>(ptr->data);
417 return ELEM(
419}
420
421static bool rna_BrushCapabilities_has_random_texture_angle_get(PointerRNA *ptr)
422{
423 Brush *br = static_cast<Brush *>(ptr->data);
424 return !(br->flag & BRUSH_ANCHORED);
425}
426
427static bool rna_BrushCapabilities_has_smooth_stroke_get(PointerRNA *ptr)
428{
429 Brush *br = static_cast<Brush *>(ptr->data);
430 return (!(br->flag & BRUSH_ANCHORED) && !(br->flag & BRUSH_DRAG_DOT) &&
431 !(br->flag & BRUSH_LINE) && !(br->flag & BRUSH_CURVE));
432}
433
434static bool rna_BrushCapabilities_has_spacing_get(PointerRNA *ptr)
435{
436 Brush *br = static_cast<Brush *>(ptr->data);
437 return (!(br->flag & BRUSH_ANCHORED));
438}
439
440static bool rna_BrushCapabilitiesSculpt_has_accumulate_get(PointerRNA *ptr)
441{
442 const Brush *br = static_cast<const Brush *>(ptr->data);
444}
445
446static bool rna_BrushCapabilitiesSculpt_has_topology_rake_get(PointerRNA *ptr)
447{
448 const Brush *br = static_cast<const Brush *>(ptr->data);
450}
451
452static bool rna_BrushCapabilitiesSculpt_has_auto_smooth_get(PointerRNA *ptr)
453{
454 const Brush *br = static_cast<const Brush *>(ptr->data);
456}
457
458static bool rna_BrushCapabilitiesSculpt_has_height_get(PointerRNA *ptr)
459{
460 const Brush *br = static_cast<const Brush *>(ptr->data);
462}
463
464static bool rna_BrushCapabilitiesSculpt_has_plane_height_get(PointerRNA *ptr)
465{
466 const Brush *br = static_cast<const Brush *>(ptr->data);
468}
469
470static bool rna_BrushCapabilitiesSculpt_has_plane_depth_get(PointerRNA *ptr)
471{
472 const Brush *br = static_cast<const Brush *>(ptr->data);
474}
475
476static bool rna_BrushCapabilitiesSculpt_has_jitter_get(PointerRNA *ptr)
477{
478 const Brush *br = static_cast<const Brush *>(ptr->data);
480}
481
482static bool rna_BrushCapabilitiesSculpt_has_normal_weight_get(PointerRNA *ptr)
483{
484 const Brush *br = static_cast<const Brush *>(ptr->data);
486}
487
488static bool rna_BrushCapabilitiesSculpt_has_rake_factor_get(PointerRNA *ptr)
489{
490 const Brush *br = static_cast<const Brush *>(ptr->data);
492}
493
494static bool rna_BrushCapabilitiesSculpt_has_persistence_get(PointerRNA *ptr)
495{
496 const Brush *br = static_cast<const Brush *>(ptr->data);
498}
499
500static bool rna_BrushCapabilitiesSculpt_has_pinch_factor_get(PointerRNA *ptr)
501{
502 const Brush *br = static_cast<const Brush *>(ptr->data);
504}
505
506static bool rna_BrushCapabilitiesSculpt_has_plane_offset_get(PointerRNA *ptr)
507{
508 const Brush *br = static_cast<const Brush *>(ptr->data);
510}
511
512static bool rna_BrushCapabilitiesSculpt_has_random_texture_angle_get(PointerRNA *ptr)
513{
514 const Brush *br = static_cast<const Brush *>(ptr->data);
516}
517
518static bool rna_BrushCapabilitiesSculpt_has_sculpt_plane_get(PointerRNA *ptr)
519{
520 const Brush *br = static_cast<const Brush *>(ptr->data);
522}
523
524static bool rna_BrushCapabilitiesSculpt_has_color_get(PointerRNA *ptr)
525{
526 const Brush *br = static_cast<const Brush *>(ptr->data);
528}
529
530static bool rna_BrushCapabilitiesSculpt_has_secondary_color_get(PointerRNA *ptr)
531{
532 const Brush *br = static_cast<const Brush *>(ptr->data);
534}
535
536static bool rna_BrushCapabilitiesSculpt_has_smooth_stroke_get(PointerRNA *ptr)
537{
538 const Brush *br = static_cast<const Brush *>(ptr->data);
540}
541
542static bool rna_BrushCapabilitiesSculpt_has_space_attenuation_get(PointerRNA *ptr)
543{
544 const Brush *br = static_cast<const Brush *>(ptr->data);
546}
547
548static bool rna_BrushCapabilitiesSculpt_has_strength_pressure_get(PointerRNA *ptr)
549{
550 const Brush *br = static_cast<const Brush *>(ptr->data);
552}
553
554static bool rna_BrushCapabilitiesSculpt_has_direction_get(PointerRNA *ptr)
555{
556 const Brush *br = static_cast<const Brush *>(ptr->data);
558}
559
560static bool rna_BrushCapabilitiesSculpt_has_gravity_get(PointerRNA *ptr)
561{
562 const Brush *br = static_cast<const Brush *>(ptr->data);
564}
565
566static bool rna_BrushCapabilitiesSculpt_has_tilt_get(PointerRNA *ptr)
567{
568 const Brush *br = static_cast<const Brush *>(ptr->data);
570}
571
572static bool rna_BrushCapabilitiesSculpt_has_dyntopo_get(PointerRNA *ptr)
573{
574 const Brush *br = static_cast<const Brush *>(ptr->data);
576}
577
578static bool rna_BrushCapabilitiesImagePaint_has_accumulate_get(PointerRNA *ptr)
579{
580 /* only support for draw brush */
581 Brush *br = static_cast<Brush *>(ptr->data);
582
583 return ((br->flag & BRUSH_AIRBRUSH) || (br->flag & BRUSH_DRAG_DOT) ||
587 (br->mtex.tex && !ELEM(br->mtex.brush_map_mode,
591 false :
592 true;
593}
594
595static bool rna_BrushCapabilitiesImagePaint_has_radius_get(PointerRNA *ptr)
596{
597 /* only support for draw brush */
598 Brush *br = static_cast<Brush *>(ptr->data);
599
601}
602
603static bool rna_BrushCapabilitiesImagePaint_has_space_attenuation_get(PointerRNA *ptr)
604{
605 Brush *br = static_cast<Brush *>(ptr->data);
606 return (br->flag & (BRUSH_SPACE | BRUSH_LINE | BRUSH_CURVE)) &&
608}
609
610static bool rna_BrushCapabilitiesImagePaint_has_color_get(PointerRNA *ptr)
611{
612 Brush *br = static_cast<Brush *>(ptr->data);
614}
615
616static bool rna_BrushCapabilitiesVertexPaint_has_color_get(PointerRNA *ptr)
617{
618 Brush *br = static_cast<Brush *>(ptr->data);
620}
621
622static bool rna_BrushCapabilitiesWeightPaint_has_weight_get(PointerRNA *ptr)
623{
624 Brush *br = static_cast<Brush *>(ptr->data);
626}
627
628static PointerRNA rna_Sculpt_brush_capabilities_get(PointerRNA *ptr)
629{
630 BLI_assert(ptr->owner_id == ptr->data);
631 return RNA_pointer_create_with_parent(*ptr, &RNA_BrushCapabilitiesSculpt, ptr->data);
632}
633
634static PointerRNA rna_Imapaint_brush_capabilities_get(PointerRNA *ptr)
635{
636 BLI_assert(ptr->owner_id == ptr->data);
637 return RNA_pointer_create_with_parent(*ptr, &RNA_BrushCapabilitiesImagePaint, ptr->data);
638}
639
640static PointerRNA rna_Vertexpaint_brush_capabilities_get(PointerRNA *ptr)
641{
642 BLI_assert(ptr->owner_id == ptr->data);
643 return RNA_pointer_create_with_parent(*ptr, &RNA_BrushCapabilitiesVertexPaint, ptr->data);
644}
645
646static PointerRNA rna_Weightpaint_brush_capabilities_get(PointerRNA *ptr)
647{
648 BLI_assert(ptr->owner_id == ptr->data);
649 return RNA_pointer_create_with_parent(*ptr, &RNA_BrushCapabilitiesWeightPaint, ptr->data);
650}
651
652static PointerRNA rna_Brush_capabilities_get(PointerRNA *ptr)
653{
654 BLI_assert(ptr->owner_id == ptr->data);
655 return RNA_pointer_create_with_parent(*ptr, &RNA_BrushCapabilities, ptr->data);
656}
657
658static void rna_Brush_reset_icon(Brush *br)
659{
660 ID *id = &br->id;
661
662 if (br->flag & BRUSH_CUSTOM_ICON) {
663 return;
664 }
665
666 if (id->icon_id >= BIFICONID_LAST_STATIC) {
669 }
670
671 id->icon_id = 0;
672}
673
674static void rna_Brush_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
675{
676 Brush *br = static_cast<Brush *>(ptr->data);
679 // WM_main_add_notifier(NC_SPACE | ND_SPACE_VIEW3D, nullptr);
680}
681
682static void rna_Brush_material_update(bContext * /*C*/, PointerRNA *ptr)
683{
684 Brush *br = static_cast<Brush *>(ptr->data);
686 /* number of material users changed */
688}
689
690static void rna_Brush_main_tex_update(bContext *C, PointerRNA *ptr)
691{
692 Main *bmain = CTX_data_main(C);
693 Scene *scene = CTX_data_scene(C);
694 ViewLayer *view_layer = CTX_data_view_layer(C);
695 Brush *br = static_cast<Brush *>(ptr->data);
696 BKE_paint_invalidate_overlay_tex(scene, view_layer, br->mtex.tex);
697 rna_Brush_update(bmain, scene, ptr);
698}
699
700static void rna_Brush_secondary_tex_update(bContext *C, PointerRNA *ptr)
701{
702 Main *bmain = CTX_data_main(C);
703 Scene *scene = CTX_data_scene(C);
704 ViewLayer *view_layer = CTX_data_view_layer(C);
705 Brush *br = static_cast<Brush *>(ptr->data);
706 BKE_paint_invalidate_overlay_tex(scene, view_layer, br->mask_mtex.tex);
707 rna_Brush_update(bmain, scene, ptr);
708}
709
710static void rna_Brush_size_update(Main *bmain, Scene *scene, PointerRNA *ptr)
711{
713 rna_Brush_update(bmain, scene, ptr);
714}
715
716static void rna_Brush_update_and_reset_icon(Main *bmain, Scene *scene, PointerRNA *ptr)
717{
718 Brush *br = static_cast<Brush *>(ptr->data);
719 rna_Brush_reset_icon(br);
720 rna_Brush_update(bmain, scene, ptr);
721}
722
723static void rna_Brush_stroke_update(Main *bmain, Scene *scene, PointerRNA *ptr)
724{
726 rna_Brush_update(bmain, scene, ptr);
727}
728
729static void rna_Brush_icon_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
730{
731 Brush *br = static_cast<Brush *>(ptr->data);
732
733 if (br->icon_imbuf) {
735 br->icon_imbuf = nullptr;
736 }
737
738 br->id.icon_id = 0;
739
740 if (br->flag & BRUSH_CUSTOM_ICON) {
742 }
743
745}
746
747static void rna_TextureSlot_brush_angle_update(bContext *C, PointerRNA *ptr)
748{
749 Scene *scene = CTX_data_scene(C);
750 MTex *mtex = static_cast<MTex *>(ptr->data);
751 /* skip invalidation of overlay for stencil mode */
752 if (mtex->mapping != MTEX_MAP_MODE_STENCIL) {
753 ViewLayer *view_layer = CTX_data_view_layer(C);
754 BKE_paint_invalidate_overlay_tex(scene, view_layer, mtex->tex);
755 }
756
758}
759
760static void rna_Brush_set_size(PointerRNA *ptr, int value)
761{
762 Brush *brush = static_cast<Brush *>(ptr->data);
763
764 /* scale unprojected radius so it stays consistent with brush size */
766 brush->size = value;
767}
768
769static void rna_Brush_use_gradient_set(PointerRNA *ptr, int value)
770{
771 Brush *br = static_cast<Brush *>(ptr->data);
772
773 if (value & BRUSH_USE_GRADIENT) {
775 }
776 else {
778 }
779
780 if ((br->flag & BRUSH_USE_GRADIENT) && br->gradient == nullptr) {
781 br->gradient = BKE_colorband_add(true);
782 }
783}
784
785static void rna_Brush_set_unprojected_radius(PointerRNA *ptr, float value)
786{
787 Brush *brush = static_cast<Brush *>(ptr->data);
788
789 /* scale brush size so it stays consistent with unprojected_radius */
790 BKE_brush_scale_size(&brush->size, value, brush->unprojected_radius);
791 brush->unprojected_radius = value;
792}
793
794static const EnumPropertyItem *rna_Brush_direction_itemf(bContext *C,
796 PropertyRNA * /*prop*/,
797 bool * /*r_free*/)
798{
800
801 /* sculpt mode */
802 static const EnumPropertyItem prop_pinch_magnify_items[] = {
803 {BRUSH_DIR_IN, "MAGNIFY", ICON_ADD, "Magnify", "Subtract effect of brush"},
804 {0, "PINCH", ICON_REMOVE, "Pinch", "Add effect of brush"},
805 {0, nullptr, 0, nullptr, nullptr},
806 };
807
808 static const EnumPropertyItem prop_inflate_deflate_items[] = {
809 {0, "INFLATE", ICON_ADD, "Inflate", "Add effect of brush"},
810 {BRUSH_DIR_IN, "DEFLATE", ICON_REMOVE, "Deflate", "Subtract effect of brush"},
811 {0, nullptr, 0, nullptr, nullptr},
812 };
813
814 /* texture paint mode */
815 static const EnumPropertyItem prop_soften_sharpen_items[] = {
816 {BRUSH_DIR_IN, "SHARPEN", ICON_ADD, "Sharpen", "Sharpen effect of brush"},
817 {0, "SOFTEN", ICON_REMOVE, "Soften", "Blur effect of brush"},
818 {0, nullptr, 0, nullptr, nullptr},
819 };
820
821 /* gpencil sculpt */
822 static const EnumPropertyItem prop_pinch_items[] = {
823 {0, "ADD", ICON_ADD, "Pinch", "Add effect of brush"},
824 {BRUSH_DIR_IN, "SUBTRACT", ICON_REMOVE, "Inflate", "Subtract effect of brush"},
825 {0, nullptr, 0, nullptr, nullptr},
826 };
827 static const EnumPropertyItem prop_twist_items[] = {
828 {0, "ADD", ICON_ADD, "Counter-Clockwise", "Add effect of brush"},
829 {BRUSH_DIR_IN, "SUBTRACT", ICON_REMOVE, "Clockwise", "Subtract effect of brush"},
830 {0, nullptr, 0, nullptr, nullptr},
831 };
832
833 Brush *me = static_cast<Brush *>(ptr->data);
834
835 switch (mode) {
837 switch (me->sculpt_brush_type) {
848 return prop_smooth_direction_items;
850 switch ((BrushMaskTool)me->mask_tool) {
851 case BRUSH_MASK_DRAW:
853
856
857 default:
859 }
860
862 return prop_pinch_magnify_items;
863
865 return prop_inflate_deflate_items;
866
867 default:
869 }
870
873 switch (me->image_brush_type) {
875 return prop_soften_sharpen_items;
876
877 default:
879 }
881 switch (me->curves_sculpt_brush_type) {
886 default:
888 }
890 switch (me->gpencil_sculpt_brush_type) {
895 return prop_twist_items;
897 return prop_pinch_items;
898 default:
900 }
902 switch (me->gpencil_weight_brush_type) {
905 default:
907 }
908 default:
910 }
911}
912
913static const EnumPropertyItem *rna_Brush_stroke_itemf(bContext *C,
914 PointerRNA * /*ptr*/,
915 PropertyRNA * /*prop*/,
916 bool * /*r_free*/)
917{
919
920 static const EnumPropertyItem brush_stroke_method_items[] = {
921 {0, "DOTS", 0, "Dots", "Apply paint on each mouse move step"},
923 "SPACE",
924 0,
925 "Space",
926 "Limit brush application to the distance specified by spacing"},
928 "AIRBRUSH",
929 0,
930 "Airbrush",
931 "Keep applying paint effect while holding mouse (spray)"},
932 {BRUSH_LINE, "LINE", 0, "Line", "Drag a line with dabs separated according to spacing"},
933 {int(BRUSH_CURVE),
934 "CURVE",
935 0,
936 "Curve",
937 "Define the stroke curve with a Bézier curve. Dabs are separated according to spacing."},
938 {0, nullptr, 0, nullptr, nullptr},
939 };
940
941 switch (mode) {
946
947 default:
948 return brush_stroke_method_items;
949 }
950}
951
952/* Grease Pencil Drawing Brushes Settings */
953static std::optional<std::string> rna_BrushGpencilSettings_path(const PointerRNA * /*ptr*/)
954{
955 return "gpencil_settings";
956}
957
958static void rna_BrushGpencilSettings_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
959{
960 Brush *br = reinterpret_cast<Brush *>(ptr->owner_id);
961 /* Synchronize the general randomization flag with the brush color jitter flag */
964 }
965 else {
967 }
969}
970
971static void rna_BrushGpencilSettings_use_material_pin_update(bContext *C, PointerRNA *ptr)
972{
973 const Scene *scene = CTX_data_scene(C);
974 ViewLayer *view_layer = CTX_data_view_layer(C);
975 BKE_view_layer_synced_ensure(scene, view_layer);
977 Brush *brush = reinterpret_cast<Brush *>(ptr->owner_id);
978
980 Material *material = BKE_object_material_get(ob, ob->actcol);
981 BKE_gpencil_brush_material_set(brush, material);
982 }
983 else {
984 BKE_gpencil_brush_material_set(brush, nullptr);
985 }
986
987 rna_BrushGpencilSettings_update(CTX_data_main(C), CTX_data_scene(C), ptr);
988 /* number of material users changed */
990}
991
992static bool rna_BrushGpencilSettings_material_poll(PointerRNA * /*ptr*/, PointerRNA value)
993{
994 Material *ma = (Material *)value.data;
995
996 /* GP materials only */
997 return (ma->gp_style != nullptr);
998}
999
1000static bool rna_GPencilBrush_pin_mode_get(PointerRNA *ptr)
1001{
1002 Brush *brush = reinterpret_cast<Brush *>(ptr->owner_id);
1003 if ((brush != nullptr) && (brush->gpencil_settings != nullptr)) {
1005 }
1006 return false;
1007}
1008
1009static void rna_GPencilBrush_pin_mode_set(PointerRNA * /*ptr*/, bool /*value*/)
1010{
1011 /* All data is set in update. Keep this function only to avoid RNA compilation errors. */
1012}
1013
1014static void rna_GPencilBrush_pin_mode_update(bContext *C, PointerRNA *ptr)
1015{
1016 Brush *brush = reinterpret_cast<Brush *>(ptr->owner_id);
1017 if ((brush != nullptr) && (brush->gpencil_settings != nullptr)) {
1019 /* If not active, means that must be set to off. */
1021 }
1022 else {
1027 }
1028 }
1029 rna_BrushGpencilSettings_update(CTX_data_main(C), CTX_data_scene(C), ptr);
1030}
1031
1032static void rna_BrushCurvesSculptSettings_update(Main * /*bmain*/,
1033 Scene * /*scene*/,
1034 PointerRNA *ptr)
1035{
1036 Brush *br = reinterpret_cast<Brush *>(ptr->owner_id);
1038}
1039
1040static const EnumPropertyItem *rna_BrushTextureSlot_map_mode_itemf(bContext *C,
1041 PointerRNA * /*ptr*/,
1042 PropertyRNA * /*prop*/,
1043 bool * /*r_free*/)
1044{
1045
1046 if (C == nullptr) {
1048 }
1049
1050# define rna_enum_brush_texture_slot_map_sculpt_mode_items \
1051 rna_enum_brush_texture_slot_map_all_mode_items;
1052
1054 if (mode == PaintMode::Sculpt) {
1055 return rna_enum_brush_texture_slot_map_sculpt_mode_items;
1056 }
1057 return rna_enum_brush_texture_slot_map_texture_mode_items;
1058
1059# undef rna_enum_brush_texture_slot_map_sculpt_mode_items
1060}
1061
1062static void rna_Brush_automasking_invert_cavity_set(PointerRNA *ptr, bool val)
1063{
1064 Brush *brush = static_cast<Brush *>(ptr->data);
1065
1066 if (val) {
1069 }
1070 else {
1072 }
1073}
1074
1075static void rna_Brush_automasking_cavity_set(PointerRNA *ptr, bool val)
1076{
1077 Brush *brush = static_cast<Brush *>(ptr->data);
1078
1079 if (val) {
1082 }
1083 else {
1085 }
1086}
1087
1088static std::optional<std::string> rna_BrushCurvesSculptSettings_path(const PointerRNA * /*ptr*/)
1089{
1090 return "curves_sculpt_settings";
1091}
1092
1093#else
1094
1096{
1097 StructRNA *srna;
1098 PropertyRNA *prop;
1099
1100 static const EnumPropertyItem prop_mask_paint_map_mode_items[] = {
1101 {MTEX_MAP_MODE_VIEW, "VIEW_PLANE", 0, "View Plane", ""},
1102 {MTEX_MAP_MODE_TILED, "TILED", 0, "Tiled", ""},
1103 {MTEX_MAP_MODE_RANDOM, "RANDOM", 0, "Random", ""},
1104 {MTEX_MAP_MODE_STENCIL, "STENCIL", 0, "Stencil", ""},
1105 {0, nullptr, 0, nullptr, nullptr},
1106 };
1107
1108# define TEXTURE_CAPABILITY(prop_name_, ui_name_) \
1109 prop = RNA_def_property(srna, #prop_name_, PROP_BOOLEAN, PROP_NONE); \
1110 RNA_def_property_clear_flag(prop, PROP_EDITABLE); \
1111 RNA_def_property_boolean_funcs(prop, "rna_TextureCapabilities_" #prop_name_ "_get", nullptr); \
1112 RNA_def_property_ui_text(prop, ui_name_, nullptr)
1113
1114 srna = RNA_def_struct(brna, "BrushTextureSlot", "TextureSlot");
1115 RNA_def_struct_sdna(srna, "MTex");
1117 srna, "Brush Texture Slot", "Texture slot for textures in a Brush data-block");
1118
1119 prop = RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE);
1120 RNA_def_property_float_sdna(prop, nullptr, "rot");
1121 RNA_def_property_range(prop, 0, M_PI * 2);
1122 RNA_def_property_ui_text(prop, "Angle", "Brush texture rotation");
1124 RNA_def_property_update(prop, 0, "rna_TextureSlot_brush_angle_update");
1125
1126 prop = RNA_def_property(srna, "map_mode", PROP_ENUM, PROP_NONE);
1127 RNA_def_property_enum_sdna(prop, nullptr, "brush_map_mode");
1129 RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_BrushTextureSlot_map_mode_itemf");
1130 RNA_def_property_ui_text(prop, "Mode", "");
1132 RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
1133
1134 prop = RNA_def_property(srna, "mask_map_mode", PROP_ENUM, PROP_NONE);
1135 RNA_def_property_enum_sdna(prop, nullptr, "brush_map_mode");
1136 RNA_def_property_enum_items(prop, prop_mask_paint_map_mode_items);
1137 RNA_def_property_ui_text(prop, "Mode", "");
1139 RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
1140
1141 prop = RNA_def_property(srna, "use_rake", PROP_BOOLEAN, PROP_NONE);
1142 RNA_def_property_boolean_sdna(prop, nullptr, "brush_angle_mode", MTEX_ANGLE_RAKE);
1143 RNA_def_property_ui_text(prop, "Rake", "");
1145 RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
1146
1147 prop = RNA_def_property(srna, "use_random", PROP_BOOLEAN, PROP_NONE);
1148 RNA_def_property_boolean_sdna(prop, nullptr, "brush_angle_mode", MTEX_ANGLE_RANDOM);
1149 RNA_def_property_ui_text(prop, "Random", "");
1151 RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
1152
1153 prop = RNA_def_property(srna, "random_angle", PROP_FLOAT, PROP_ANGLE);
1154 RNA_def_property_range(prop, 0, M_PI * 2);
1155 RNA_def_property_ui_text(prop, "Random Angle", "Brush texture random angle");
1157 RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
1158
1159 TEXTURE_CAPABILITY(has_texture_angle_source, "Has Texture Angle Source");
1160 TEXTURE_CAPABILITY(has_random_texture_angle, "Has Random Texture Angle");
1161 TEXTURE_CAPABILITY(has_texture_angle, "Has Texture Angle Source");
1162
1163# undef TEXTURE_CAPABILITY
1164}
1165
1167{
1168 StructRNA *srna;
1169 PropertyRNA *prop;
1170
1171 srna = RNA_def_struct(brna, "BrushCapabilitiesSculpt", nullptr);
1172 RNA_def_struct_sdna(srna, "Brush");
1173 RNA_def_struct_nested(brna, srna, "Brush");
1175 "Sculpt Capabilities",
1176 "Read-only indications of which brush operations "
1177 "are supported by the current sculpt tool");
1178
1179# define SCULPT_BRUSH_CAPABILITY(prop_name_, ui_name_) \
1180 prop = RNA_def_property(srna, #prop_name_, PROP_BOOLEAN, PROP_NONE); \
1181 RNA_def_property_clear_flag(prop, PROP_EDITABLE); \
1182 RNA_def_property_boolean_funcs( \
1183 prop, "rna_BrushCapabilitiesSculpt_" #prop_name_ "_get", nullptr); \
1184 RNA_def_property_ui_text(prop, ui_name_, nullptr)
1185
1186 SCULPT_BRUSH_CAPABILITY(has_accumulate, "Has Accumulate");
1187 SCULPT_BRUSH_CAPABILITY(has_auto_smooth, "Has Auto Smooth");
1188 SCULPT_BRUSH_CAPABILITY(has_topology_rake, "Has Topology Rake");
1189 SCULPT_BRUSH_CAPABILITY(has_height, "Has Height");
1190 SCULPT_BRUSH_CAPABILITY(has_plane_depth, "Has Plane Depth");
1191 SCULPT_BRUSH_CAPABILITY(has_plane_height, "Has Plane Height");
1192 SCULPT_BRUSH_CAPABILITY(has_jitter, "Has Jitter");
1193 SCULPT_BRUSH_CAPABILITY(has_normal_weight, "Has Crease/Pinch Factor");
1194 SCULPT_BRUSH_CAPABILITY(has_rake_factor, "Has Rake Factor");
1195 SCULPT_BRUSH_CAPABILITY(has_persistence, "Has Persistence");
1196 SCULPT_BRUSH_CAPABILITY(has_pinch_factor, "Has Pinch Factor");
1197 SCULPT_BRUSH_CAPABILITY(has_plane_offset, "Has Plane Offset");
1198 SCULPT_BRUSH_CAPABILITY(has_random_texture_angle, "Has Random Texture Angle");
1199 SCULPT_BRUSH_CAPABILITY(has_sculpt_plane, "Has Sculpt Plane");
1200 SCULPT_BRUSH_CAPABILITY(has_color, "Has Color");
1201 SCULPT_BRUSH_CAPABILITY(has_secondary_color, "Has Secondary Color");
1202 SCULPT_BRUSH_CAPABILITY(has_smooth_stroke, "Has Smooth Stroke");
1203 SCULPT_BRUSH_CAPABILITY(has_space_attenuation, "Has Space Attenuation");
1204 SCULPT_BRUSH_CAPABILITY(has_strength_pressure, "Has Strength Pressure");
1205 SCULPT_BRUSH_CAPABILITY(has_direction, "Has Direction");
1206 SCULPT_BRUSH_CAPABILITY(has_gravity, "Has Gravity");
1207 SCULPT_BRUSH_CAPABILITY(has_tilt, "Has Tilt");
1208 SCULPT_BRUSH_CAPABILITY(has_dyntopo, "Has Dyntopo");
1209
1210# undef SCULPT_CAPABILITY
1211}
1212
1214{
1215 StructRNA *srna;
1216 PropertyRNA *prop;
1217
1218 srna = RNA_def_struct(brna, "BrushCapabilities", nullptr);
1219 RNA_def_struct_sdna(srna, "Brush");
1220 RNA_def_struct_nested(brna, srna, "Brush");
1222 srna, "Brush Capabilities", "Read-only indications of supported operations");
1223
1224# define BRUSH_CAPABILITY(prop_name_, ui_name_) \
1225 prop = RNA_def_property(srna, #prop_name_, PROP_BOOLEAN, PROP_NONE); \
1226 RNA_def_property_clear_flag(prop, PROP_EDITABLE); \
1227 RNA_def_property_boolean_funcs(prop, "rna_BrushCapabilities_" #prop_name_ "_get", nullptr); \
1228 RNA_def_property_ui_text(prop, ui_name_, nullptr)
1229
1230 BRUSH_CAPABILITY(has_overlay, "Has Overlay");
1231 BRUSH_CAPABILITY(has_random_texture_angle, "Has Random Texture Angle");
1232 BRUSH_CAPABILITY(has_spacing, "Has Spacing");
1233 BRUSH_CAPABILITY(has_smooth_stroke, "Has Smooth Stroke");
1234
1235# undef BRUSH_CAPABILITY
1236}
1237
1239{
1240 StructRNA *srna;
1241 PropertyRNA *prop;
1242
1243 srna = RNA_def_struct(brna, "BrushCapabilitiesImagePaint", nullptr);
1244 RNA_def_struct_sdna(srna, "Brush");
1245 RNA_def_struct_nested(brna, srna, "Brush");
1247 srna, "Image Paint Capabilities", "Read-only indications of supported operations");
1248
1249# define IMAPAINT_BRUSH_CAPABILITY(prop_name_, ui_name_) \
1250 prop = RNA_def_property(srna, #prop_name_, PROP_BOOLEAN, PROP_NONE); \
1251 RNA_def_property_clear_flag(prop, PROP_EDITABLE); \
1252 RNA_def_property_boolean_funcs( \
1253 prop, "rna_BrushCapabilitiesImagePaint_" #prop_name_ "_get", nullptr); \
1254 RNA_def_property_ui_text(prop, ui_name_, nullptr)
1255
1256 IMAPAINT_BRUSH_CAPABILITY(has_accumulate, "Has Accumulate");
1257 IMAPAINT_BRUSH_CAPABILITY(has_space_attenuation, "Has Space Attenuation");
1258 IMAPAINT_BRUSH_CAPABILITY(has_radius, "Has Radius");
1259 IMAPAINT_BRUSH_CAPABILITY(has_color, "Has Color");
1260
1261# undef IMAPAINT_BRUSH_CAPABILITY
1262}
1263
1265{
1266 StructRNA *srna;
1267 PropertyRNA *prop;
1268
1269 srna = RNA_def_struct(brna, "BrushCapabilitiesVertexPaint", nullptr);
1270 RNA_def_struct_sdna(srna, "Brush");
1271 RNA_def_struct_nested(brna, srna, "Brush");
1273 srna, "Vertex Paint Capabilities", "Read-only indications of supported operations");
1274
1275# define VPAINT_BRUSH_CAPABILITY(prop_name_, ui_name_) \
1276 prop = RNA_def_property(srna, #prop_name_, PROP_BOOLEAN, PROP_NONE); \
1277 RNA_def_property_clear_flag(prop, PROP_EDITABLE); \
1278 RNA_def_property_boolean_funcs( \
1279 prop, "rna_BrushCapabilitiesVertexPaint_" #prop_name_ "_get", nullptr); \
1280 RNA_def_property_ui_text(prop, ui_name_, nullptr)
1281
1282 VPAINT_BRUSH_CAPABILITY(has_color, "Has Color");
1283
1284# undef VPAINT_BRUSH_CAPABILITY
1285}
1286
1288{
1289 StructRNA *srna;
1290 PropertyRNA *prop;
1291
1292 srna = RNA_def_struct(brna, "BrushCapabilitiesWeightPaint", nullptr);
1293 RNA_def_struct_sdna(srna, "Brush");
1294 RNA_def_struct_nested(brna, srna, "Brush");
1296 srna, "Weight Paint Capabilities", "Read-only indications of supported operations");
1297
1298# define WPAINT_BRUSH_CAPABILITY(prop_name_, ui_name_) \
1299 prop = RNA_def_property(srna, #prop_name_, PROP_BOOLEAN, PROP_NONE); \
1300 RNA_def_property_clear_flag(prop, PROP_EDITABLE); \
1301 RNA_def_property_boolean_funcs( \
1302 prop, "rna_BrushCapabilitiesWeightPaint_" #prop_name_ "_get", nullptr); \
1303 RNA_def_property_ui_text(prop, ui_name_, nullptr)
1304
1305 WPAINT_BRUSH_CAPABILITY(has_weight, "Has Weight");
1306
1307# undef WPAINT_BRUSH_CAPABILITY
1308}
1309
1311{
1312 StructRNA *srna;
1313 PropertyRNA *prop;
1314
1315 /* modes */
1316 static const EnumPropertyItem gppaint_mode_types_items[] = {
1317 {GPPAINT_MODE_STROKE, "STROKE", 0, "Stroke", "Vertex Color affects to Stroke only"},
1318 {GPPAINT_MODE_FILL, "FILL", 0, "Fill", "Vertex Color affects to Fill only"},
1319 {GPPAINT_MODE_BOTH, "BOTH", 0, "Stroke & Fill", "Vertex Color affects to Stroke and Fill"},
1320 {0, nullptr, 0, nullptr, nullptr},
1321 };
1322
1323 static const EnumPropertyItem rna_enum_gpencil_brush_caps_types_items[] = {
1324 {GP_STROKE_CAP_ROUND, "ROUND", ICON_GP_CAPS_ROUND, "Round", ""},
1325 {GP_STROKE_CAP_FLAT, "FLAT", ICON_GP_CAPS_FLAT, "Flat", ""},
1326 {0, nullptr, 0, nullptr, nullptr},
1327 };
1328
1329 srna = RNA_def_struct(brna, "BrushGpencilSettings", nullptr);
1330 RNA_def_struct_sdna(srna, "BrushGpencilSettings");
1331 RNA_def_struct_path_func(srna, "rna_BrushGpencilSettings_path");
1332 RNA_def_struct_ui_text(srna, "Grease Pencil Brush Settings", "Settings for Grease Pencil brush");
1333
1334 /* Strength factor for new strokes */
1335 prop = RNA_def_property(srna, "pen_strength", PROP_FLOAT, PROP_FACTOR);
1336 RNA_def_property_float_sdna(prop, nullptr, "draw_strength");
1337 RNA_def_property_range(prop, 0.0f, 1.0f);
1338 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
1340 prop, "Strength", "Color strength for new strokes (affect alpha factor of color)");
1343 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1344
1345 /* Jitter factor for new strokes */
1346 prop = RNA_def_property(srna, "pen_jitter", PROP_FLOAT, PROP_FACTOR);
1347 RNA_def_property_float_sdna(prop, nullptr, "draw_jitter");
1348 RNA_def_property_range(prop, 0.0f, 100.0f);
1349 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
1350 RNA_def_property_ui_text(prop, "Jitter", "Jitter factor of brush radius for new strokes");
1353 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1354
1355 /* Randomness factor for pressure */
1356 prop = RNA_def_property(srna, "random_pressure", PROP_FLOAT, PROP_FACTOR);
1357 RNA_def_property_float_sdna(prop, nullptr, "draw_random_press");
1358 RNA_def_property_range(prop, 0.0f, 1.0f);
1360 prop, "Pressure Randomness", "Randomness factor for pressure in new strokes");
1362 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1363
1364 /* Randomness factor for strength */
1365 prop = RNA_def_property(srna, "random_strength", PROP_FLOAT, PROP_FACTOR);
1366 RNA_def_property_float_sdna(prop, nullptr, "draw_random_strength");
1367 RNA_def_property_range(prop, 0.0f, 1.0f);
1369 prop, "Strength Randomness", "Randomness factor strength in new strokes");
1371 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1372
1373 /* Angle when brush is full size */
1374 prop = RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE);
1375 RNA_def_property_float_sdna(prop, nullptr, "draw_angle");
1378 "Angle",
1379 "Direction of the stroke at which brush gives maximal thickness "
1380 "(0" BLI_STR_UTF8_DEGREE_SIGN " for horizontal)");
1382 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1383
1384 /* Factor to change brush size depending of angle */
1385 prop = RNA_def_property(srna, "angle_factor", PROP_FLOAT, PROP_FACTOR);
1386 RNA_def_property_float_sdna(prop, nullptr, "draw_angle_factor");
1387 RNA_def_property_range(prop, 0.0f, 1.0f);
1389 prop,
1390 "Angle Factor",
1391 "Reduce brush thickness by this factor when stroke is perpendicular to 'Angle' direction");
1393 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1394
1395 /* Smoothing factor for new strokes */
1396 prop = RNA_def_property(srna, "pen_smooth_factor", PROP_FLOAT, PROP_NONE);
1397 RNA_def_property_float_sdna(prop, nullptr, "draw_smoothfac");
1398 RNA_def_property_range(prop, 0.0, 2.0);
1399 RNA_def_property_ui_range(prop, 0.0, 1.0, 10, 3);
1401 prop,
1402 "Smooth",
1403 "Amount of smoothing to apply after finish newly created strokes, to reduce jitter/noise");
1406 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1407
1408 /* Iterations of the Smoothing factor */
1409 prop = RNA_def_property(srna, "pen_smooth_steps", PROP_INT, PROP_NONE);
1410 RNA_def_property_int_sdna(prop, nullptr, "draw_smoothlvl");
1411 RNA_def_property_range(prop, 0, 100);
1412 RNA_def_property_ui_text(prop, "Iterations", "Number of times to smooth newly created strokes");
1414 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1415
1416 /* Subdivision level for new strokes */
1417 prop = RNA_def_property(srna, "pen_subdivision_steps", PROP_INT, PROP_NONE);
1418 RNA_def_property_int_sdna(prop, nullptr, "draw_subdivide");
1419 RNA_def_property_range(prop, 0, 3);
1421 prop,
1422 "Subdivision Steps",
1423 "Number of times to subdivide newly created strokes, for less jagged strokes");
1425 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1426
1427 /* Simplify factor */
1428 prop = RNA_def_property(srna, "simplify_factor", PROP_FLOAT, PROP_NONE);
1429 RNA_def_property_float_sdna(prop, nullptr, "simplify_f");
1430 RNA_def_property_range(prop, 0, 100.0);
1431 RNA_def_property_ui_range(prop, 0, 100.0, 1.0f, 3);
1432 RNA_def_property_ui_text(prop, "Simplify", "Factor of Simplify using adaptive algorithm");
1434 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1435
1436 prop = RNA_def_property(srna, "simplify_pixel_threshold", PROP_FLOAT, PROP_PIXEL);
1437 RNA_def_property_float_sdna(prop, nullptr, "simplify_px");
1438 RNA_def_property_range(prop, 0, 10.0);
1439 RNA_def_property_ui_range(prop, 0, 10.0, 1.0f, 1);
1441 prop,
1442 "Simplify",
1443 "Threshold in screen space used for the simplify algorithm. Points within this threshold "
1444 "are treated as if they were in a straight line.");
1446 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1447
1448 /* Curves for pressure */
1449 prop = RNA_def_property(srna, "curve_sensitivity", PROP_POINTER, PROP_NONE);
1450 RNA_def_property_pointer_sdna(prop, nullptr, "curve_sensitivity");
1451 RNA_def_property_struct_type(prop, "CurveMapping");
1452 RNA_def_property_ui_text(prop, "Curve Sensitivity", "Curve used for the sensitivity");
1454 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1455
1456 prop = RNA_def_property(srna, "curve_strength", PROP_POINTER, PROP_NONE);
1457 RNA_def_property_pointer_sdna(prop, nullptr, "curve_strength");
1458 RNA_def_property_struct_type(prop, "CurveMapping");
1459 RNA_def_property_ui_text(prop, "Curve Strength", "Curve used for the strength");
1461 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1462
1463 prop = RNA_def_property(srna, "curve_jitter", PROP_POINTER, PROP_NONE);
1464 RNA_def_property_pointer_sdna(prop, nullptr, "curve_jitter");
1465 RNA_def_property_struct_type(prop, "CurveMapping");
1466 RNA_def_property_ui_text(prop, "Curve Jitter", "Curve used for the jitter effect");
1468 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1469
1470 prop = RNA_def_property(srna, "curve_random_pressure", PROP_POINTER, PROP_NONE);
1471 RNA_def_property_pointer_sdna(prop, nullptr, "curve_rand_pressure");
1472 RNA_def_property_struct_type(prop, "CurveMapping");
1473 RNA_def_property_ui_text(prop, "Random Curve", "Curve used for modulating effect");
1475 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1476
1477 prop = RNA_def_property(srna, "curve_random_strength", PROP_POINTER, PROP_NONE);
1478 RNA_def_property_pointer_sdna(prop, nullptr, "curve_rand_strength");
1479 RNA_def_property_struct_type(prop, "CurveMapping");
1480 RNA_def_property_ui_text(prop, "Random Curve", "Curve used for modulating effect");
1482 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1483
1484 prop = RNA_def_property(srna, "curve_random_uv", PROP_POINTER, PROP_NONE);
1485 RNA_def_property_pointer_sdna(prop, nullptr, "curve_rand_uv");
1486 RNA_def_property_struct_type(prop, "CurveMapping");
1487 RNA_def_property_ui_text(prop, "Random Curve", "Curve used for modulating effect");
1489 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1490
1491 prop = RNA_def_property(srna, "curve_random_hue", PROP_POINTER, PROP_NONE);
1492 RNA_def_property_pointer_sdna(prop, nullptr, "curve_rand_hue");
1493 RNA_def_property_struct_type(prop, "CurveMapping");
1494 RNA_def_property_ui_text(prop, "Random Curve", "Curve used for modulating effect");
1496 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1497
1498 prop = RNA_def_property(srna, "curve_random_saturation", PROP_POINTER, PROP_NONE);
1499 RNA_def_property_pointer_sdna(prop, nullptr, "curve_rand_saturation");
1500 RNA_def_property_struct_type(prop, "CurveMapping");
1501 RNA_def_property_ui_text(prop, "Random Curve", "Curve used for modulating effect");
1503 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1504
1505 prop = RNA_def_property(srna, "curve_random_value", PROP_POINTER, PROP_NONE);
1506 RNA_def_property_pointer_sdna(prop, nullptr, "curve_rand_value");
1507 RNA_def_property_struct_type(prop, "CurveMapping");
1508 RNA_def_property_ui_text(prop, "Random Curve", "Curve used for modulating effect");
1510 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1511
1512 /* Fill threshold for transparency. */
1513 prop = RNA_def_property(srna, "fill_threshold", PROP_FLOAT, PROP_FACTOR);
1514 RNA_def_property_float_sdna(prop, nullptr, "fill_threshold");
1515 RNA_def_property_range(prop, 0.0f, 1.0f);
1517 prop, "Threshold", "Threshold to consider color transparent for filling");
1519 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1520
1521 /* fill factor size */
1522 prop = RNA_def_property(srna, "fill_factor", PROP_FLOAT, PROP_NONE);
1523 RNA_def_property_float_sdna(prop, nullptr, "fill_factor");
1526 prop,
1527 "Precision",
1528 "Factor for fill boundary accuracy, higher values are more accurate but slower");
1530 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1531
1532 /* fill simplify steps */
1533 prop = RNA_def_property(srna, "fill_simplify_level", PROP_INT, PROP_NONE);
1534 RNA_def_property_int_sdna(prop, nullptr, "fill_simplylvl");
1535 RNA_def_property_range(prop, 0, 10);
1537 prop, "Simplify", "Number of simplify steps (large values reduce fill accuracy)");
1539 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1540
1541 prop = RNA_def_property(srna, "uv_random", PROP_FLOAT, PROP_FACTOR);
1542 RNA_def_property_float_sdna(prop, nullptr, "uv_random");
1543 RNA_def_property_range(prop, 0.0, 1.0);
1544 RNA_def_property_ui_text(prop, "UV Random", "Random factor for auto-generated UV rotation");
1546 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1547
1548 /* gradient control */
1549 prop = RNA_def_property(srna, "hardness", PROP_FLOAT, PROP_FACTOR);
1550 RNA_def_property_float_sdna(prop, nullptr, "hardness");
1551 RNA_def_property_range(prop, 0.001f, 1.0f);
1554 prop,
1555 "Hardness",
1556 "Gradient from the center of Dot and Box strokes (set to 1 for a solid stroke)");
1558 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1559
1560 /* gradient shape ratio */
1561 prop = RNA_def_property(srna, "aspect", PROP_FLOAT, PROP_XYZ);
1562 RNA_def_property_float_sdna(prop, nullptr, "aspect_ratio");
1563 RNA_def_property_array(prop, 2);
1564 RNA_def_property_range(prop, 0.01f, 1.0f);
1566 RNA_def_property_ui_text(prop, "Aspect", "");
1568 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1569
1570 prop = RNA_def_property(srna, "input_samples", PROP_INT, PROP_NONE);
1571 RNA_def_property_int_sdna(prop, nullptr, "input_samples");
1574 prop,
1575 "Input Samples",
1576 "Generated intermediate points for very fast mouse movements (Set to 0 to disable)");
1578 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1579
1580 /* active smooth factor while drawing */
1581 prop = RNA_def_property(srna, "active_smooth_factor", PROP_FLOAT, PROP_FACTOR);
1582 RNA_def_property_float_sdna(prop, nullptr, "active_smooth");
1583 RNA_def_property_range(prop, 0.0f, 1.0f);
1584 RNA_def_property_ui_text(prop, "Active Smooth", "Amount of smoothing while drawing");
1586 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1587
1588 prop = RNA_def_property(srna, "eraser_strength_factor", PROP_FLOAT, PROP_PERCENTAGE);
1589 RNA_def_property_float_sdna(prop, nullptr, "era_strength_f");
1590 RNA_def_property_range(prop, 0.0, 100.0);
1591 RNA_def_property_ui_range(prop, 0.0, 100.0, 10, 1);
1592 RNA_def_property_ui_text(prop, "Affect Stroke Strength", "Amount of erasing for strength");
1594 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1595
1596 prop = RNA_def_property(srna, "eraser_thickness_factor", PROP_FLOAT, PROP_PERCENTAGE);
1597 RNA_def_property_float_sdna(prop, nullptr, "era_thickness_f");
1598 RNA_def_property_range(prop, 0.0, 100.0);
1599 RNA_def_property_ui_range(prop, 0.0, 100.0, 10, 1);
1600 RNA_def_property_ui_text(prop, "Affect Stroke Thickness", "Amount of erasing for thickness");
1602 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1603
1604 /* Mode type. */
1605 prop = RNA_def_property(srna, "vertex_mode", PROP_ENUM, PROP_NONE);
1606 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "vertex_mode");
1607 RNA_def_property_enum_items(prop, gppaint_mode_types_items);
1608 RNA_def_property_ui_text(prop, "Mode Type", "Defines how vertex color affect to the strokes");
1610 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1611
1612 /* Vertex Color mix factor. */
1613 prop = RNA_def_property(srna, "vertex_color_factor", PROP_FLOAT, PROP_FACTOR);
1614 RNA_def_property_float_sdna(prop, nullptr, "vertex_factor");
1615 RNA_def_property_range(prop, 0.0f, 1.0f);
1618 prop, "Vertex Color Factor", "Factor used to mix vertex color to get final color");
1619 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1620
1621 /* Hue randomness. */
1622 prop = RNA_def_property(srna, "random_hue_factor", PROP_FLOAT, PROP_FACTOR);
1623 RNA_def_property_float_sdna(prop, nullptr, "random_hue");
1624 RNA_def_property_range(prop, 0.0f, 1.0f);
1626 RNA_def_property_ui_text(prop, "Hue", "Random factor to modify original hue");
1628
1629 /* Saturation randomness. */
1630 prop = RNA_def_property(srna, "random_saturation_factor", PROP_FLOAT, PROP_FACTOR);
1631 RNA_def_property_float_sdna(prop, nullptr, "random_saturation");
1632 RNA_def_property_range(prop, 0.0f, 1.0f);
1634 RNA_def_property_ui_text(prop, "Saturation", "Random factor to modify original saturation");
1636 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1637
1638 /* Value randomness. */
1639 prop = RNA_def_property(srna, "random_value_factor", PROP_FLOAT, PROP_FACTOR);
1640 RNA_def_property_float_sdna(prop, nullptr, "random_value");
1641 RNA_def_property_range(prop, 0.0f, 1.0f);
1643 RNA_def_property_ui_text(prop, "Value", "Random factor to modify original value");
1645 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1646
1647 /* Factor to extend stroke extremes in Fill brush. */
1648 prop = RNA_def_property(srna, "extend_stroke_factor", PROP_FLOAT, PROP_NONE);
1649 RNA_def_property_float_sdna(prop, nullptr, "fill_extend_fac");
1650 RNA_def_property_range(prop, 0.0f, 10.0f);
1653 prop, "Closure Size", "Strokes end extension for closing gaps, use zero to disable");
1655 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1656
1657 prop = RNA_def_property(srna, "fill_extend_mode", PROP_ENUM, PROP_NONE);
1658 RNA_def_property_enum_sdna(prop, nullptr, "fill_extend_mode");
1661 prop, "Closure Mode", "Types of stroke extensions used for closing gaps");
1664 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1665
1666 /* Number of pixels to dilate fill area. Negative values contract the filled area. */
1667 prop = RNA_def_property(srna, "dilate", PROP_INT, PROP_PIXEL);
1668 RNA_def_property_int_sdna(prop, nullptr, "dilate_pixels");
1669 RNA_def_property_range(prop, -40, 40);
1672 prop, "Dilate/Contract", "Number of pixels to expand or contract fill area");
1674 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1675
1676 /* Factor to determine outline external perimeter thickness. */
1677 prop = RNA_def_property(srna, "outline_thickness_factor", PROP_FLOAT, PROP_FACTOR);
1678 RNA_def_property_float_sdna(prop, nullptr, "outline_fac");
1679 RNA_def_property_range(prop, 0.0f, 1.0f);
1682 prop, "Thickness", "Thickness of the outline stroke relative to current brush thickness");
1684 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1685
1686 /* Flags */
1687 prop = RNA_def_property(srna, "use_pressure", PROP_BOOLEAN, PROP_NONE);
1689 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
1690 RNA_def_property_ui_text(prop, "Use Pressure", "Use tablet pressure");
1692 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1693
1694 prop = RNA_def_property(srna, "use_strength_pressure", PROP_BOOLEAN, PROP_NONE);
1696 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
1698 prop, "Use Pressure Strength", "Use tablet pressure for color strength");
1700 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1701
1702 prop = RNA_def_property(srna, "use_jitter_pressure", PROP_BOOLEAN, PROP_NONE);
1704 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
1705 RNA_def_property_ui_text(prop, "Use Pressure Jitter", "Use tablet pressure for jitter");
1707 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1708
1709 prop = RNA_def_property(srna, "use_stroke_random_hue", PROP_BOOLEAN, PROP_NONE);
1711 RNA_def_property_ui_icon(prop, ICON_GP_SELECT_STROKES, 0);
1712 RNA_def_property_ui_text(prop, "Stroke Random", "Use randomness at stroke level");
1714 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1715
1716 prop = RNA_def_property(srna, "use_stroke_random_sat", PROP_BOOLEAN, PROP_NONE);
1718 RNA_def_property_ui_icon(prop, ICON_GP_SELECT_STROKES, 0);
1719 RNA_def_property_ui_text(prop, "Stroke Random", "Use randomness at stroke level");
1721 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1722
1723 prop = RNA_def_property(srna, "use_stroke_random_val", PROP_BOOLEAN, PROP_NONE);
1725 RNA_def_property_ui_icon(prop, ICON_GP_SELECT_STROKES, 0);
1726 RNA_def_property_ui_text(prop, "Stroke Random", "Use randomness at stroke level");
1728 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1729
1730 prop = RNA_def_property(srna, "use_stroke_random_radius", PROP_BOOLEAN, PROP_NONE);
1732 RNA_def_property_ui_icon(prop, ICON_GP_SELECT_STROKES, 0);
1733 RNA_def_property_ui_text(prop, "Stroke Random", "Use randomness at stroke level");
1735 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1736
1737 prop = RNA_def_property(srna, "use_stroke_random_strength", PROP_BOOLEAN, PROP_NONE);
1739 RNA_def_property_ui_icon(prop, ICON_GP_SELECT_STROKES, 0);
1740 RNA_def_property_ui_text(prop, "Stroke Random", "Use randomness at stroke level");
1742 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1743
1744 prop = RNA_def_property(srna, "use_stroke_random_uv", PROP_BOOLEAN, PROP_NONE);
1746 RNA_def_property_ui_icon(prop, ICON_GP_SELECT_STROKES, 0);
1747 RNA_def_property_ui_text(prop, "Stroke Random", "Use randomness at stroke level");
1749 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1750
1751 prop = RNA_def_property(srna, "use_random_press_hue", PROP_BOOLEAN, PROP_NONE);
1753 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
1754 RNA_def_property_ui_text(prop, "Use Pressure", "Use pressure to modulate randomness");
1756 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1757
1758 prop = RNA_def_property(srna, "use_random_press_sat", PROP_BOOLEAN, PROP_NONE);
1760 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
1761 RNA_def_property_ui_text(prop, "Use Pressure", "Use pressure to modulate randomness");
1763 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1764
1765 prop = RNA_def_property(srna, "use_random_press_val", PROP_BOOLEAN, PROP_NONE);
1767 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
1768 RNA_def_property_ui_text(prop, "Use Pressure", "Use pressure to modulate randomness");
1770 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1771
1772 prop = RNA_def_property(srna, "use_random_press_radius", PROP_BOOLEAN, PROP_NONE);
1774 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
1775 RNA_def_property_ui_text(prop, "Use Pressure", "Use pressure to modulate randomness");
1777 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1778
1779 prop = RNA_def_property(srna, "use_random_press_strength", PROP_BOOLEAN, PROP_NONE);
1781 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
1782 RNA_def_property_ui_text(prop, "Use Pressure", "Use pressure to modulate randomness");
1784 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1785
1786 prop = RNA_def_property(srna, "use_random_press_uv", PROP_BOOLEAN, PROP_NONE);
1788 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
1789 RNA_def_property_ui_text(prop, "Use Pressure", "Use pressure to modulate randomness");
1791 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1792
1793 prop = RNA_def_property(srna, "use_settings_stabilizer", PROP_BOOLEAN, PROP_NONE);
1797 "Use Stabilizer",
1798 "Draw lines with a delay to allow smooth strokes (press Shift key to "
1799 "override while drawing)");
1801 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1802
1803 prop = RNA_def_property(srna, "eraser_mode", PROP_ENUM, PROP_NONE);
1804 RNA_def_property_enum_sdna(prop, nullptr, "eraser_mode");
1806 RNA_def_property_ui_text(prop, "Mode", "Eraser Mode");
1809 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1810
1811 prop = RNA_def_property(srna, "caps_type", PROP_ENUM, PROP_NONE);
1812 RNA_def_property_enum_sdna(prop, nullptr, "caps_type");
1813 RNA_def_property_enum_items(prop, rna_enum_gpencil_brush_caps_types_items);
1814 RNA_def_property_ui_text(prop, "Caps Type", "The shape of the start and end of the stroke");
1817 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1818
1819 prop = RNA_def_property(srna, "fill_draw_mode", PROP_ENUM, PROP_NONE);
1820 RNA_def_property_enum_sdna(prop, nullptr, "fill_draw_mode");
1822 RNA_def_property_ui_text(prop, "Mode", "Mode to draw boundary limits");
1824 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1825
1826 prop = RNA_def_property(srna, "fill_layer_mode", PROP_ENUM, PROP_NONE);
1827 RNA_def_property_enum_sdna(prop, nullptr, "fill_layer_mode");
1829 RNA_def_property_ui_text(prop, "Layer Mode", "Layers used as boundaries");
1831 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1832
1833 prop = RNA_def_property(srna, "fill_direction", PROP_ENUM, PROP_NONE);
1834 RNA_def_property_enum_sdna(prop, nullptr, "fill_direction");
1836 RNA_def_property_ui_text(prop, "Direction", "Direction of the fill");
1839 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1840
1841 prop = RNA_def_property(srna, "pin_draw_mode", PROP_BOOLEAN, PROP_NONE);
1843 prop, "rna_GPencilBrush_pin_mode_get", "rna_GPencilBrush_pin_mode_set");
1844 RNA_def_property_ui_icon(prop, ICON_UNPINNED, 1);
1847 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencilBrush_pin_mode_update");
1848 RNA_def_property_ui_text(prop, "Pin Mode", "Pin the mode to the brush");
1849
1850 prop = RNA_def_property(srna, "brush_draw_mode", PROP_ENUM, PROP_NONE);
1851 RNA_def_property_enum_sdna(prop, nullptr, "brush_draw_mode");
1853 RNA_def_property_ui_text(prop, "Mode", "Preselected mode when using this brush");
1855 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1856
1857 prop = RNA_def_property(srna, "use_trim", PROP_BOOLEAN, PROP_NONE);
1860 RNA_def_property_ui_text(prop, "Trim Stroke Ends", "Trim intersecting stroke ends");
1862 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1863
1864 prop = RNA_def_property(srna, "use_settings_outline", PROP_BOOLEAN, PROP_NONE);
1867 RNA_def_property_ui_text(prop, "Outline", "Convert stroke to outline");
1869 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1870
1871 prop = RNA_def_property(srna, "use_edit_position", PROP_BOOLEAN, PROP_NONE);
1873 prop, nullptr, "sculpt_mode_flag", GP_SCULPT_FLAGMODE_APPLY_POSITION);
1874 RNA_def_property_ui_text(prop, "Affect Position", "The brush affects the position of the point");
1876 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_BrushGpencilSettings_update");
1877
1878 prop = RNA_def_property(srna, "use_edit_strength", PROP_BOOLEAN, PROP_NONE);
1880 prop, nullptr, "sculpt_mode_flag", GP_SCULPT_FLAGMODE_APPLY_STRENGTH);
1882 prop, "Affect Strength", "The brush affects the color strength of the point");
1884 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_BrushGpencilSettings_update");
1885
1886 prop = RNA_def_property(srna, "use_edit_thickness", PROP_BOOLEAN, PROP_NONE);
1888 prop, nullptr, "sculpt_mode_flag", GP_SCULPT_FLAGMODE_APPLY_THICKNESS);
1890 prop, "Affect Thickness", "The brush affects the thickness of the point");
1892 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_BrushGpencilSettings_update");
1893
1894 prop = RNA_def_property(srna, "use_edit_uv", PROP_BOOLEAN, PROP_NONE);
1895 RNA_def_property_boolean_sdna(prop, nullptr, "sculpt_mode_flag", GP_SCULPT_FLAGMODE_APPLY_UV);
1896 RNA_def_property_ui_text(prop, "Affect UV", "The brush affects the UV rotation of the point");
1898 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_BrushGpencilSettings_update");
1899
1900 /* Material */
1901 prop = RNA_def_property(srna, "material", PROP_POINTER, PROP_NONE);
1902 RNA_def_property_struct_type(prop, "Material");
1904 prop, nullptr, nullptr, nullptr, "rna_BrushGpencilSettings_material_poll");
1906 RNA_def_property_ui_text(prop, "Material", "Material used for strokes drawn using this brush");
1908 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_Brush_material_update");
1909
1910 /* Secondary Material */
1911 prop = RNA_def_property(srna, "material_alt", PROP_POINTER, PROP_NONE);
1912 RNA_def_property_struct_type(prop, "Material");
1914 prop, nullptr, nullptr, nullptr, "rna_BrushGpencilSettings_material_poll");
1916 RNA_def_property_ui_text(prop, "Material", "Material used for secondary uses for this brush");
1918 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_Brush_material_update");
1919
1920 prop = RNA_def_property(srna, "show_fill_boundary", PROP_BOOLEAN, PROP_NONE);
1923 RNA_def_property_ui_text(prop, "Show Lines", "Show help lines for filling to see boundaries");
1925 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1926
1927 prop = RNA_def_property(srna, "show_fill_extend", PROP_BOOLEAN, PROP_NONE);
1930 RNA_def_property_ui_text(prop, "Visual Aids", "Show help lines for stroke extension");
1932 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1933
1934 prop = RNA_def_property(srna, "use_collide_strokes", PROP_BOOLEAN, PROP_NONE);
1938 prop, "Strokes Collision", "Check if extend lines collide with strokes");
1940 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1941
1942 prop = RNA_def_property(srna, "show_fill", PROP_BOOLEAN, PROP_NONE);
1946 prop, "Show Fill", "Show transparent lines to use as boundary for filling");
1948 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1949
1950 prop = RNA_def_property(srna, "use_auto_remove_fill_guides", PROP_BOOLEAN, PROP_NONE);
1954 "Auto-Remove Fill Guides",
1955 "Automatically remove fill guide strokes after fill operation");
1957 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1958
1959 prop = RNA_def_property(srna, "use_fill_limit", PROP_BOOLEAN, PROP_NONE);
1962 RNA_def_property_ui_text(prop, "Limit to Viewport", "Fill only visible areas in viewport");
1964 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1965
1966 prop = RNA_def_property(srna, "use_settings_postprocess", PROP_BOOLEAN, PROP_NONE);
1969 prop, "Use Post-Process Settings", "Additional post processing options for new strokes");
1971 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1972
1973 prop = RNA_def_property(srna, "use_settings_random", PROP_BOOLEAN, PROP_NONE);
1975 RNA_def_property_ui_text(prop, "Random Settings", "Random brush settings");
1977 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1978
1979 prop = RNA_def_property(srna, "use_material_pin", PROP_BOOLEAN, PROP_NONE);
1982 RNA_def_property_ui_icon(prop, ICON_UNPINNED, 1);
1983 RNA_def_property_ui_text(prop, "Pin Material", "Keep material assigned to brush");
1986 prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_use_material_pin_update");
1987
1988 prop = RNA_def_property(srna, "show_lasso", PROP_BOOLEAN, PROP_NONE);
1991 prop, "Show Lasso", "Do not display fill color while drawing the stroke");
1993 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1994
1995 prop = RNA_def_property(srna, "use_occlude_eraser", PROP_BOOLEAN, PROP_NONE);
1997 RNA_def_property_ui_text(prop, "Occlude Eraser", "Erase only strokes visible and not occluded");
1999 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
2000
2001 prop = RNA_def_property(srna, "use_keep_caps_eraser", PROP_BOOLEAN, PROP_NONE);
2004 prop, "Keep Caps", "Keep the caps as they are and don't flatten them when erasing");
2006 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
2007
2008 prop = RNA_def_property(srna, "use_active_layer_only", PROP_BOOLEAN, PROP_NONE);
2010 RNA_def_property_ui_text(prop, "Active Layer", "Only edit the active layer of the object");
2012 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
2013}
2014
2016{
2017 StructRNA *srna;
2018 PropertyRNA *prop;
2019
2020 static const EnumPropertyItem density_mode_items[] = {
2022 "AUTO",
2023 ICON_AUTO,
2024 "Auto",
2025 "Either add or remove curves depending on the minimum distance of the curves under the "
2026 "cursor"},
2028 "ADD",
2029 ICON_ADD,
2030 "Add",
2031 "Add new curves between existing curves, taking the minimum distance into account"},
2033 "REMOVE",
2034 ICON_REMOVE,
2035 "Remove",
2036 "Remove curves whose root points are too close"},
2037 {0, nullptr, 0, nullptr, nullptr},
2038 };
2039
2040 srna = RNA_def_struct(brna, "BrushCurvesSculptSettings", nullptr);
2041 RNA_def_struct_path_func(srna, "rna_BrushCurvesSculptSettings_path");
2042 RNA_def_struct_sdna(srna, "BrushCurvesSculptSettings");
2043 RNA_def_struct_ui_text(srna, "Curves Sculpt Brush Settings", "");
2044
2045 prop = RNA_def_property(srna, "add_amount", PROP_INT, PROP_NONE);
2047 RNA_def_property_ui_text(prop, "Count", "Number of curves added by the Add brush");
2048 RNA_def_property_update(prop, 0, "rna_BrushCurvesSculptSettings_update");
2049
2050 prop = RNA_def_property(srna, "points_per_curve", PROP_INT, PROP_NONE);
2053 prop, "Points per Curve", "Number of control points in a newly added curve");
2054 RNA_def_property_update(prop, 0, "rna_BrushCurvesSculptSettings_update");
2055
2056 prop = RNA_def_property(srna, "use_uniform_scale", PROP_BOOLEAN, PROP_NONE);
2059 "Scale Uniform",
2060 "Grow or shrink curves by changing their size uniformly instead of "
2061 "using trimming or extrapolation");
2062 RNA_def_property_update(prop, 0, "rna_BrushCurvesSculptSettings_update");
2063
2064 prop = RNA_def_property(srna, "minimum_length", PROP_FLOAT, PROP_DISTANCE);
2065 RNA_def_property_range(prop, 0.0f, FLT_MAX);
2067 prop, "Minimum Length", "Avoid shrinking curves shorter than this length");
2068
2069 prop = RNA_def_property(srna, "use_length_interpolate", PROP_BOOLEAN, PROP_NONE);
2071 prop, nullptr, "flag", BRUSH_CURVES_SCULPT_FLAG_INTERPOLATE_LENGTH);
2073 prop, "Interpolate Length", "Use length of the curves in close proximity");
2074 RNA_def_property_update(prop, 0, "rna_BrushCurvesSculptSettings_update");
2075
2076 prop = RNA_def_property(srna, "use_radius_interpolate", PROP_BOOLEAN, PROP_NONE);
2078 prop, nullptr, "flag", BRUSH_CURVES_SCULPT_FLAG_INTERPOLATE_RADIUS);
2081 prop, "Interpolate Radius", "Use radius of the curves in close proximity");
2082 RNA_def_property_update(prop, 0, "rna_BrushCurvesSculptSettings_update");
2083
2084 prop = RNA_def_property(srna, "use_point_count_interpolate", PROP_BOOLEAN, PROP_NONE);
2088 "Interpolate Point Count",
2089 "Use the number of points from the curves in close proximity");
2090 RNA_def_property_update(prop, 0, "rna_BrushCurvesSculptSettings_update");
2091
2092 prop = RNA_def_property(srna, "use_shape_interpolate", PROP_BOOLEAN, PROP_NONE);
2095 prop, "Interpolate Shape", "Use shape of the curves in close proximity");
2096 RNA_def_property_update(prop, 0, "rna_BrushCurvesSculptSettings_update");
2097
2098 prop = RNA_def_property(srna, "curve_length", PROP_FLOAT, PROP_DISTANCE);
2099 RNA_def_property_range(prop, 0.0, FLT_MAX);
2101 prop,
2102 "Curve Length",
2103 "Length of newly added curves when it is not interpolated from other curves");
2104 RNA_def_property_update(prop, 0, "rna_BrushCurvesSculptSettings_update");
2105
2106 prop = RNA_def_property(srna, "minimum_distance", PROP_FLOAT, PROP_DISTANCE);
2107 RNA_def_property_range(prop, 0.0f, FLT_MAX);
2108 RNA_def_property_ui_range(prop, 0.0, 1000.0f, 0.001, 2);
2110 prop, "Minimum Distance", "Goal distance between curve roots for the Density brush");
2111 RNA_def_property_update(prop, 0, "rna_BrushCurvesSculptSettings_update");
2112
2113 prop = RNA_def_property(srna, "curve_radius", PROP_FLOAT, PROP_DISTANCE);
2114 RNA_def_property_range(prop, 0.0, FLT_MAX);
2115 RNA_def_property_float_default(prop, 0.01f);
2116 RNA_def_property_ui_range(prop, 0.0, 1000.0f, 0.001, 2);
2118 prop,
2119 "Curve Radius",
2120 "Radius of newly added curves when it is not interpolated from other curves");
2121 RNA_def_property_update(prop, 0, "rna_BrushCurvesSculptSettings_update");
2122
2123 prop = RNA_def_property(srna, "density_add_attempts", PROP_INT, PROP_NONE);
2126 prop, "Density Add Attempts", "How many times the Density brush tries to add a new curve");
2127 RNA_def_property_update(prop, 0, "rna_BrushCurvesSculptSettings_update");
2128
2129 prop = RNA_def_property(srna, "density_mode", PROP_ENUM, PROP_NONE);
2130 RNA_def_property_enum_items(prop, density_mode_items);
2132 prop, "Density Mode", "Determines whether the brush adds or removes curves");
2134 RNA_def_property_update(prop, 0, "rna_BrushCurvesSculptSettings_update");
2135
2136 prop = RNA_def_property(srna, "curve_parameter_falloff", PROP_POINTER, PROP_NONE);
2137 RNA_def_property_struct_type(prop, "CurveMapping");
2139 "Curve Parameter Falloff",
2140 "Falloff that is applied from the tip to the root of each curve");
2141 RNA_def_property_update(prop, 0, "rna_BrushCurvesSculptSettings_update");
2142}
2143
2144static void rna_def_brush(BlenderRNA *brna)
2145{
2146 StructRNA *srna;
2147 PropertyRNA *prop;
2148
2149 static const EnumPropertyItem prop_blend_items[] = {
2150 {IMB_BLEND_MIX, "MIX", 0, "Mix", "Use Mix blending mode while painting"},
2152 {IMB_BLEND_DARKEN, "DARKEN", 0, "Darken", "Use Darken blending mode while painting"},
2153 {IMB_BLEND_MUL, "MUL", 0, "Multiply", "Use Multiply blending mode while painting"},
2155 "COLORBURN",
2156 0,
2157 "Color Burn",
2158 "Use Color Burn blending mode while painting"},
2160 "LINEARBURN",
2161 0,
2162 "Linear Burn",
2163 "Use Linear Burn blending mode while painting"},
2165 {IMB_BLEND_LIGHTEN, "LIGHTEN", 0, "Lighten", "Use Lighten blending mode while painting"},
2166 {IMB_BLEND_SCREEN, "SCREEN", 0, "Screen", "Use Screen blending mode while painting"},
2168 "COLORDODGE",
2169 0,
2170 "Color Dodge",
2171 "Use Color Dodge blending mode while painting"},
2172 {IMB_BLEND_ADD, "ADD", 0, "Add", "Use Add blending mode while painting"},
2174 {IMB_BLEND_OVERLAY, "OVERLAY", 0, "Overlay", "Use Overlay blending mode while painting"},
2176 "SOFTLIGHT",
2177 0,
2178 "Soft Light",
2179 "Use Soft Light blending mode while painting"},
2181 "HARDLIGHT",
2182 0,
2183 "Hard Light",
2184 "Use Hard Light blending mode while painting"},
2186 "VIVIDLIGHT",
2187 0,
2188 "Vivid Light",
2189 "Use Vivid Light blending mode while painting"},
2191 "LINEARLIGHT",
2192 0,
2193 "Linear Light",
2194 "Use Linear Light blending mode while painting"},
2196 "PINLIGHT",
2197 0,
2198 "Pin Light",
2199 "Use Pin Light blending mode while painting"},
2202 "DIFFERENCE",
2203 0,
2204 "Difference",
2205 "Use Difference blending mode while painting"},
2207 "EXCLUSION",
2208 0,
2209 "Exclusion",
2210 "Use Exclusion blending mode while painting"},
2211 {IMB_BLEND_SUB, "SUB", 0, "Subtract", "Use Subtract blending mode while painting"},
2213 {IMB_BLEND_HUE, "HUE", 0, "Hue", "Use Hue blending mode while painting"},
2215 "SATURATION",
2216 0,
2217 "Saturation",
2218 "Use Saturation blending mode while painting"},
2219 {IMB_BLEND_COLOR, "COLOR", 0, "Color", "Use Color blending mode while painting"},
2220 {IMB_BLEND_LUMINOSITY, "LUMINOSITY", 0, "Value", "Use Value blending mode while painting"},
2222 {IMB_BLEND_ERASE_ALPHA, "ERASE_ALPHA", 0, "Erase Alpha", "Erase alpha while painting"},
2223 {IMB_BLEND_ADD_ALPHA, "ADD_ALPHA", 0, "Add Alpha", "Add alpha while painting"},
2224 {0, nullptr, 0, nullptr, nullptr},
2225 };
2226
2227 static const EnumPropertyItem brush_sculpt_plane_items[] = {
2228 {SCULPT_DISP_DIR_AREA, "AREA", 0, "Area Plane", ""},
2229 {SCULPT_DISP_DIR_VIEW, "VIEW", 0, "View Plane", ""},
2230 {SCULPT_DISP_DIR_X, "X", 0, "X Plane", ""},
2231 {SCULPT_DISP_DIR_Y, "Y", 0, "Y Plane", ""},
2232 {SCULPT_DISP_DIR_Z, "Z", 0, "Z Plane", ""},
2233 {0, nullptr, 0, nullptr, nullptr},
2234 };
2235
2236 static const EnumPropertyItem brush_mask_tool_items[] = {
2237 {BRUSH_MASK_DRAW, "DRAW", 0, "Draw", ""},
2238 {BRUSH_MASK_SMOOTH, "SMOOTH", 0, "Smooth", ""},
2239 {0, nullptr, 0, nullptr, nullptr},
2240 };
2241
2242 static const EnumPropertyItem brush_blur_mode_items[] = {
2243 {KERNEL_BOX, "BOX", 0, "Box", ""},
2244 {KERNEL_GAUSSIAN, "GAUSSIAN", 0, "Gaussian", ""},
2245 {0, nullptr, 0, nullptr, nullptr},
2246 };
2247
2248 static const EnumPropertyItem brush_gradient_items[] = {
2249 {BRUSH_GRADIENT_PRESSURE, "PRESSURE", 0, "Pressure", ""},
2250 {BRUSH_GRADIENT_SPACING_REPEAT, "SPACING_REPEAT", 0, "Repeat", ""},
2251 {BRUSH_GRADIENT_SPACING_CLAMP, "SPACING_CLAMP", 0, "Clamp", ""},
2252 {0, nullptr, 0, nullptr, nullptr},
2253 };
2254
2255 static const EnumPropertyItem brush_gradient_fill_items[] = {
2256 {BRUSH_GRADIENT_LINEAR, "LINEAR", 0, "Linear", ""},
2257 {BRUSH_GRADIENT_RADIAL, "RADIAL", 0, "Radial", ""},
2258 {0, nullptr, 0, nullptr, nullptr},
2259 };
2260
2261 static const EnumPropertyItem brush_mask_pressure_items[] = {
2262 {0, "NONE", 0, "Off", ""},
2263 {BRUSH_MASK_PRESSURE_RAMP, "RAMP", ICON_STYLUS_PRESSURE, "Ramp", ""},
2264 {BRUSH_MASK_PRESSURE_CUTOFF, "CUTOFF", ICON_STYLUS_PRESSURE, "Cutoff", ""},
2265 {0, nullptr, 0, nullptr, nullptr},
2266 };
2267
2268 static const EnumPropertyItem brush_size_unit_items[] = {
2269 {0, "VIEW", 0, "View", "Measure brush size relative to the view"},
2270 {BRUSH_LOCK_SIZE, "SCENE", 0, "Scene", "Measure brush size relative to the scene"},
2271 {0, nullptr, 0, nullptr, nullptr},
2272 };
2273
2274 static const EnumPropertyItem color_gradient_items[] = {
2275 {0, "COLOR", 0, "Color", "Paint with a single color"},
2276 {BRUSH_USE_GRADIENT, "GRADIENT", 0, "Gradient", "Paint with a gradient"},
2277 {0, nullptr, 0, nullptr, nullptr},
2278 };
2279
2280 static const EnumPropertyItem brush_spacing_unit_items[] = {
2281 {0, "VIEW", 0, "View", "Calculate brush spacing relative to the view"},
2283 "SCENE",
2284 0,
2285 "Scene",
2286 "Calculate brush spacing relative to the scene using the stroke location"},
2287 {0, nullptr, 0, nullptr, nullptr},
2288 };
2289
2290 static const EnumPropertyItem brush_jitter_unit_items[] = {
2291 {BRUSH_ABSOLUTE_JITTER, "VIEW", 0, "View", "Jittering happens in screen space, in pixels"},
2292 {0, "BRUSH", 0, "Brush", "Jittering happens relative to the brush size"},
2293 {0, nullptr, 0, nullptr, nullptr},
2294 };
2295
2296 static const EnumPropertyItem falloff_shape_unit_items[] = {
2297 {0, "SPHERE", 0, "Sphere", "Apply brush influence in a Sphere, outwards from the center"},
2299 "PROJECTED",
2300 0,
2301 "Projected",
2302 "Apply brush influence in a 2D circle, projected from the view"},
2303 {0, nullptr, 0, nullptr, nullptr},
2304 };
2305
2306 static const EnumPropertyItem brush_deformation_target_items[] = {
2308 "GEOMETRY",
2309 0,
2310 "Geometry",
2311 "Brush deformation displaces the vertices of the mesh"},
2313 "CLOTH_SIM",
2314 0,
2315 "Cloth Simulation",
2316 "Brush deforms the mesh by deforming the constraints of a cloth simulation"},
2317 {0, nullptr, 0, nullptr, nullptr},
2318 };
2319
2320 static const EnumPropertyItem brush_elastic_deform_type_items[] = {
2321 {BRUSH_ELASTIC_DEFORM_GRAB, "GRAB", 0, "Grab", ""},
2322 {BRUSH_ELASTIC_DEFORM_GRAB_BISCALE, "GRAB_BISCALE", 0, "Bi-Scale Grab", ""},
2323 {BRUSH_ELASTIC_DEFORM_GRAB_TRISCALE, "GRAB_TRISCALE", 0, "Tri-Scale Grab", ""},
2324 {BRUSH_ELASTIC_DEFORM_SCALE, "SCALE", 0, "Scale", ""},
2325 {BRUSH_ELASTIC_DEFORM_TWIST, "TWIST", 0, "Twist", ""},
2326 {0, nullptr, 0, nullptr, nullptr},
2327 };
2328
2329 static const EnumPropertyItem brush_snake_hook_deform_type_items[] = {
2331 "FALLOFF",
2332 0,
2333 "Radius Falloff",
2334 "Applies the brush falloff in the tip of the brush"},
2336 "ELASTIC",
2337 0,
2338 "Elastic",
2339 "Modifies the entire mesh using elastic deform"},
2340 {0, nullptr, 0, nullptr, nullptr},
2341 };
2342
2343 static const EnumPropertyItem brush_plane_inversion_mode_items[] = {
2345 "INVERT_DISPLACEMENT",
2346 0,
2347 "Invert Displacement",
2348 "Displace the vertices away from the plane."},
2350 "SWAP_DEPTH_AND_HEIGHT",
2351 0,
2352 "Swap Height and Depth",
2353 "Swap the roles of Height and Depth."},
2354 {0, nullptr, 0, nullptr, nullptr},
2355 };
2356
2357 static const EnumPropertyItem brush_cloth_deform_type_items[] = {
2358 {BRUSH_CLOTH_DEFORM_DRAG, "DRAG", 0, "Drag", ""},
2359 {BRUSH_CLOTH_DEFORM_PUSH, "PUSH", 0, "Push", ""},
2360 {BRUSH_CLOTH_DEFORM_PINCH_POINT, "PINCH_POINT", 0, "Pinch Point", ""},
2362 "PINCH_PERPENDICULAR",
2363 0,
2364 "Pinch Perpendicular",
2365 ""},
2366 {BRUSH_CLOTH_DEFORM_INFLATE, "INFLATE", 0, "Inflate", ""},
2367 {BRUSH_CLOTH_DEFORM_GRAB, "GRAB", 0, "Grab", ""},
2368 {BRUSH_CLOTH_DEFORM_EXPAND, "EXPAND", 0, "Expand", ""},
2369 {BRUSH_CLOTH_DEFORM_SNAKE_HOOK, "SNAKE_HOOK", 0, "Snake Hook", ""},
2370 {0, nullptr, 0, nullptr, nullptr},
2371 };
2372
2373 static const EnumPropertyItem brush_cloth_force_falloff_type_items[] = {
2374 {BRUSH_CLOTH_FORCE_FALLOFF_RADIAL, "RADIAL", 0, "Radial", ""},
2375 {BRUSH_CLOTH_FORCE_FALLOFF_PLANE, "PLANE", 0, "Plane", ""},
2376 {0, nullptr, 0, nullptr, nullptr},
2377 };
2378
2379 static const EnumPropertyItem brush_boundary_falloff_type_items[] = {
2381 "CONSTANT",
2382 0,
2383 "Constant",
2384 "Applies the same deformation in the entire boundary"},
2386 "RADIUS",
2387 0,
2388 "Brush Radius",
2389 "Applies the deformation in a localized area limited by the brush radius"},
2391 "LOOP",
2392 0,
2393 "Loop",
2394 "Applies the brush falloff in a loop pattern"},
2396 "LOOP_INVERT",
2397 0,
2398 "Loop and Invert",
2399 "Applies the falloff radius in a loop pattern, inverting the displacement direction in "
2400 "each pattern repetition"},
2401 {0, nullptr, 0, nullptr, nullptr},
2402 };
2403
2404 static const EnumPropertyItem brush_cloth_simulation_area_type_items[] = {
2406 "LOCAL",
2407 0,
2408 "Local",
2409 "Simulates only a specific area around the brush limited by a fixed radius"},
2410 {BRUSH_CLOTH_SIMULATION_AREA_GLOBAL, "GLOBAL", 0, "Global", "Simulates the entire mesh"},
2412 "DYNAMIC",
2413 0,
2414 "Dynamic",
2415 "The active simulation area moves with the brush"},
2416 {0, nullptr, 0, nullptr, nullptr},
2417 };
2418
2419 static const EnumPropertyItem brush_smooth_deform_type_items[] = {
2421 "LAPLACIAN",
2422 0,
2423 "Laplacian",
2424 "Smooths the surface and the volume"},
2426 "SURFACE",
2427 0,
2428 "Surface",
2429 "Smooths the surface of the mesh, preserving the volume"},
2430 {0, nullptr, 0, nullptr, nullptr},
2431 };
2432
2433 static const EnumPropertyItem brush_pose_deform_type_items[] = {
2434 {BRUSH_POSE_DEFORM_ROTATE_TWIST, "ROTATE_TWIST", 0, "Rotate/Twist", ""},
2435 {BRUSH_POSE_DEFORM_SCALE_TRASLATE, "SCALE_TRANSLATE", 0, "Scale/Translate", ""},
2436 {BRUSH_POSE_DEFORM_SQUASH_STRETCH, "SQUASH_STRETCH", 0, "Squash & Stretch", ""},
2437 {0, nullptr, 0, nullptr, nullptr},
2438 };
2439
2440 static const EnumPropertyItem brush_pose_origin_type_items[] = {
2442 "TOPOLOGY",
2443 0,
2444 "Topology",
2445 "Sets the rotation origin automatically using the topology and shape of the mesh as a "
2446 "guide"},
2448 "FACE_SETS",
2449 0,
2450 "Face Sets",
2451 "Creates a pose segment per face sets, starting from the active face set"},
2453 "FACE_SETS_FK",
2454 0,
2455 "Face Sets FK",
2456 "Simulates an FK deformation using the Face Set under the cursor as control"},
2457 {0, nullptr, 0, nullptr, nullptr},
2458 };
2459
2460 static const EnumPropertyItem brush_smear_deform_type_items[] = {
2461 {BRUSH_SMEAR_DEFORM_DRAG, "DRAG", 0, "Drag", ""},
2462 {BRUSH_SMEAR_DEFORM_PINCH, "PINCH", 0, "Pinch", ""},
2463 {BRUSH_SMEAR_DEFORM_EXPAND, "EXPAND", 0, "Expand", ""},
2464 {0, nullptr, 0, nullptr, nullptr},
2465 };
2466
2467 static const EnumPropertyItem brush_slide_deform_type_items[] = {
2468 {BRUSH_SLIDE_DEFORM_DRAG, "DRAG", 0, "Drag", ""},
2469 {BRUSH_SLIDE_DEFORM_PINCH, "PINCH", 0, "Pinch", ""},
2470 {BRUSH_SLIDE_DEFORM_EXPAND, "EXPAND", 0, "Expand", ""},
2471 {0, nullptr, 0, nullptr, nullptr},
2472 };
2473
2474 static const EnumPropertyItem brush_boundary_deform_type_items[] = {
2475 {BRUSH_BOUNDARY_DEFORM_BEND, "BEND", 0, "Bend", ""},
2476 {BRUSH_BOUNDARY_DEFORM_EXPAND, "EXPAND", 0, "Expand", ""},
2477 {BRUSH_BOUNDARY_DEFORM_INFLATE, "INFLATE", 0, "Inflate", ""},
2478 {BRUSH_BOUNDARY_DEFORM_GRAB, "GRAB", 0, "Grab", ""},
2479 {BRUSH_BOUNDARY_DEFORM_TWIST, "TWIST", 0, "Twist", ""},
2480 {BRUSH_BOUNDARY_DEFORM_SMOOTH, "SMOOTH", 0, "Smooth", ""},
2481 {0, nullptr, 0, nullptr, nullptr},
2482 };
2483
2484 srna = RNA_def_struct(brna, "Brush", "ID");
2486 srna, "Brush", "Brush data-block for storing brush settings for painting and sculpting");
2487 RNA_def_struct_ui_icon(srna, ICON_BRUSH_DATA);
2488
2489 prop = RNA_def_property(srna, "has_unsaved_changes", PROP_BOOLEAN, PROP_NONE);
2492 "Has unsaved changes",
2493 "Indicates that there are any user visible changes since the brush has "
2494 "been imported or read from the file");
2495
2496 /* enums */
2497 prop = RNA_def_property(srna, "blend", PROP_ENUM, PROP_NONE);
2498 RNA_def_property_enum_items(prop, prop_blend_items);
2499 RNA_def_property_ui_text(prop, "Blending Mode", "Brush blending mode");
2500 RNA_def_property_update(prop, 0, "rna_Brush_update");
2501
2507 prop = RNA_def_property(srna, "sculpt_tool", PROP_ENUM, PROP_NONE);
2508 RNA_def_property_enum_sdna(prop, nullptr, "sculpt_brush_type");
2510 RNA_def_property_ui_text(prop, "Brush Type", "");
2512 RNA_def_property_update(prop, 0, "rna_Brush_update_and_reset_icon");
2513
2514 prop = RNA_def_property(srna, "vertex_tool", PROP_ENUM, PROP_NONE);
2515 RNA_def_property_enum_sdna(prop, nullptr, "vertex_brush_type");
2517 RNA_def_property_ui_text(prop, "Brush Type", "");
2518 RNA_def_property_update(prop, 0, "rna_Brush_update_and_reset_icon");
2519
2520 prop = RNA_def_property(srna, "weight_tool", PROP_ENUM, PROP_NONE);
2521 RNA_def_property_enum_sdna(prop, nullptr, "weight_brush_type");
2523 RNA_def_property_ui_text(prop, "Brush Type", "");
2524 RNA_def_property_update(prop, 0, "rna_Brush_update_and_reset_icon");
2525
2526 prop = RNA_def_property(srna, "image_tool", PROP_ENUM, PROP_NONE);
2527 RNA_def_property_enum_sdna(prop, nullptr, "image_brush_type");
2529 RNA_def_property_ui_text(prop, "Brush Type", "");
2531 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, "rna_Brush_update_and_reset_icon");
2532
2533 prop = RNA_def_property(srna, "gpencil_tool", PROP_ENUM, PROP_NONE);
2534 RNA_def_property_enum_sdna(prop, nullptr, "gpencil_brush_type");
2536 RNA_def_property_ui_text(prop, "Brush Type", "");
2539 RNA_def_property_update(prop, 0, "rna_Brush_update");
2540
2541 prop = RNA_def_property(srna, "gpencil_vertex_tool", PROP_ENUM, PROP_NONE);
2542 RNA_def_property_enum_sdna(prop, nullptr, "gpencil_vertex_brush_type");
2544 RNA_def_property_ui_text(prop, "Brush Type", "");
2546 RNA_def_property_update(prop, 0, "rna_Brush_update");
2547
2548 prop = RNA_def_property(srna, "gpencil_sculpt_tool", PROP_ENUM, PROP_NONE);
2549 RNA_def_property_enum_sdna(prop, nullptr, "gpencil_sculpt_brush_type");
2551 RNA_def_property_ui_text(prop, "Brush Type", "");
2554 RNA_def_property_update(prop, 0, "rna_Brush_update");
2555
2556 prop = RNA_def_property(srna, "gpencil_weight_tool", PROP_ENUM, PROP_NONE);
2557 RNA_def_property_enum_sdna(prop, nullptr, "gpencil_weight_brush_type");
2559 RNA_def_property_ui_text(prop, "Brush Type", "");
2561 RNA_def_property_update(prop, 0, "rna_Brush_update");
2562
2563 prop = RNA_def_property(srna, "curves_sculpt_tool", PROP_ENUM, PROP_NONE);
2564 RNA_def_property_enum_sdna(prop, nullptr, "curves_sculpt_brush_type");
2566 RNA_def_property_ui_text(prop, "Brush Type", "");
2569 RNA_def_property_update(prop, 0, "rna_Brush_update");
2570
2572
2573 prop = RNA_def_property(srna, "direction", PROP_ENUM, PROP_NONE);
2574 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flag");
2576 RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_Brush_direction_itemf");
2577 RNA_def_property_ui_text(prop, "Direction", "");
2578 RNA_def_property_update(prop, 0, "rna_Brush_update");
2579
2580 prop = RNA_def_property(srna, "stroke_method", PROP_ENUM, PROP_NONE);
2581 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flag");
2583 RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_Brush_stroke_itemf");
2584 RNA_def_property_ui_text(prop, "Stroke Method", "");
2586 RNA_def_property_update(prop, 0, "rna_Brush_stroke_update");
2587
2588 prop = RNA_def_property(srna, "sculpt_plane", PROP_ENUM, PROP_NONE);
2589 RNA_def_property_enum_items(prop, brush_sculpt_plane_items);
2590 RNA_def_property_ui_text(prop, "Sculpt Plane", "");
2591 RNA_def_property_update(prop, 0, "rna_Brush_update");
2592
2593 prop = RNA_def_property(srna, "mask_tool", PROP_ENUM, PROP_NONE);
2594 RNA_def_property_enum_items(prop, brush_mask_tool_items);
2595 RNA_def_property_ui_text(prop, "Mask Tool", "");
2597 RNA_def_property_update(prop, 0, "rna_Brush_update");
2598
2599 prop = RNA_def_property(srna, "curve_preset", PROP_ENUM, PROP_NONE);
2601 RNA_def_property_ui_text(prop, "Curve Preset", "");
2603 BLT_I18NCONTEXT_ID_CURVE_LEGACY); /* Abusing id_curve :/ */
2604 RNA_def_property_update(prop, 0, "rna_Brush_update");
2605
2606 prop = RNA_def_property(srna, "deform_target", PROP_ENUM, PROP_NONE);
2607 RNA_def_property_enum_items(prop, brush_deformation_target_items);
2609 prop, "Deformation Target", "How the deformation of the brush will affect the object");
2610 RNA_def_property_update(prop, 0, "rna_Brush_update");
2611
2612 prop = RNA_def_property(srna, "elastic_deform_type", PROP_ENUM, PROP_NONE);
2613 RNA_def_property_enum_items(prop, brush_elastic_deform_type_items);
2614 RNA_def_property_ui_text(prop, "Deformation", "Deformation type that is used in the brush");
2616 RNA_def_property_update(prop, 0, "rna_Brush_update");
2617
2618 prop = RNA_def_property(srna, "snake_hook_deform_type", PROP_ENUM, PROP_NONE);
2619 RNA_def_property_enum_items(prop, brush_snake_hook_deform_type_items);
2620 RNA_def_property_ui_text(prop, "Deformation", "Deformation type that is used in the brush");
2621 RNA_def_property_update(prop, 0, "rna_Brush_update");
2622
2623 prop = RNA_def_property(srna, "plane_inversion_mode", PROP_ENUM, PROP_NONE);
2624 RNA_def_property_enum_items(prop, brush_plane_inversion_mode_items);
2625 RNA_def_property_ui_text(prop, "Inversion Mode", "Inversion Mode");
2626 RNA_def_property_update(prop, 0, "rna_Brush_update");
2627
2628 prop = RNA_def_property(srna, "cloth_deform_type", PROP_ENUM, PROP_NONE);
2629 RNA_def_property_enum_items(prop, brush_cloth_deform_type_items);
2630 RNA_def_property_ui_text(prop, "Deformation", "Deformation type that is used in the brush");
2632 RNA_def_property_update(prop, 0, "rna_Brush_update");
2633
2634 prop = RNA_def_property(srna, "cloth_force_falloff_type", PROP_ENUM, PROP_NONE);
2635 RNA_def_property_enum_items(prop, brush_cloth_force_falloff_type_items);
2637 prop, "Force Falloff", "Shape used in the brush to apply force to the cloth");
2638 RNA_def_property_update(prop, 0, "rna_Brush_update");
2639
2640 prop = RNA_def_property(srna, "cloth_simulation_area_type", PROP_ENUM, PROP_NONE);
2641 RNA_def_property_enum_items(prop, brush_cloth_simulation_area_type_items);
2643 prop,
2644 "Simulation Area",
2645 "Part of the mesh that is going to be simulated when the stroke is active");
2646 RNA_def_property_update(prop, 0, "rna_Brush_update");
2647
2648 prop = RNA_def_property(srna, "boundary_falloff_type", PROP_ENUM, PROP_NONE);
2649 RNA_def_property_enum_items(prop, brush_boundary_falloff_type_items);
2651 prop, "Boundary Falloff", "How the brush falloff is applied across the boundary");
2652 RNA_def_property_update(prop, 0, "rna_Brush_update");
2653
2654 prop = RNA_def_property(srna, "smooth_deform_type", PROP_ENUM, PROP_NONE);
2655 RNA_def_property_enum_items(prop, brush_smooth_deform_type_items);
2656 RNA_def_property_ui_text(prop, "Deformation", "Deformation type that is used in the brush");
2657 RNA_def_property_update(prop, 0, "rna_Brush_update");
2658
2659 prop = RNA_def_property(srna, "smear_deform_type", PROP_ENUM, PROP_NONE);
2660 RNA_def_property_enum_items(prop, brush_smear_deform_type_items);
2661 RNA_def_property_ui_text(prop, "Deformation", "Deformation type that is used in the brush");
2663 RNA_def_property_update(prop, 0, "rna_Brush_update");
2664
2665 prop = RNA_def_property(srna, "slide_deform_type", PROP_ENUM, PROP_NONE);
2666 RNA_def_property_enum_items(prop, brush_slide_deform_type_items);
2667 RNA_def_property_ui_text(prop, "Deformation", "Deformation type that is used in the brush");
2669 RNA_def_property_update(prop, 0, "rna_Brush_update");
2670
2671 prop = RNA_def_property(srna, "boundary_deform_type", PROP_ENUM, PROP_NONE);
2672 RNA_def_property_enum_items(prop, brush_boundary_deform_type_items);
2673 RNA_def_property_ui_text(prop, "Deformation", "Deformation type that is used in the brush");
2675 RNA_def_property_update(prop, 0, "rna_Brush_update");
2676
2677 prop = RNA_def_property(srna, "pose_deform_type", PROP_ENUM, PROP_NONE);
2678 RNA_def_property_enum_items(prop, brush_pose_deform_type_items);
2679 RNA_def_property_ui_text(prop, "Deformation", "Deformation type that is used in the brush");
2680 RNA_def_property_update(prop, 0, "rna_Brush_update");
2681
2682 prop = RNA_def_property(srna, "pose_origin_type", PROP_ENUM, PROP_NONE);
2683 RNA_def_property_enum_items(prop, brush_pose_origin_type_items);
2685 "Rotation Origins",
2686 "Method to set the rotation origins for the segments of the brush");
2687 RNA_def_property_update(prop, 0, "rna_Brush_update");
2688
2689 prop = RNA_def_property(srna, "jitter_unit", PROP_ENUM, PROP_NONE); /* as an enum */
2690 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flag");
2691 RNA_def_property_enum_items(prop, brush_jitter_unit_items);
2693 prop, "Jitter Unit", "Jitter in screen space or relative to brush size");
2694 RNA_def_property_update(prop, 0, "rna_Brush_update");
2695
2696 prop = RNA_def_property(srna, "falloff_shape", PROP_ENUM, PROP_NONE); /* as an enum */
2697 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "falloff_shape");
2698 RNA_def_property_enum_items(prop, falloff_shape_unit_items);
2699 RNA_def_property_ui_text(prop, "Falloff Shape", "Use projected or spherical falloff");
2700 RNA_def_property_update(prop, 0, "rna_Brush_update");
2701
2702 /* number values */
2703 prop = RNA_def_property(srna, "size", PROP_INT, PROP_PIXEL);
2704 RNA_def_property_int_funcs(prop, nullptr, "rna_Brush_set_size", nullptr);
2707 RNA_def_property_ui_text(prop, "Radius", "Radius of the brush in pixels");
2708 RNA_def_property_update(prop, 0, "rna_Brush_size_update");
2709
2710 prop = RNA_def_property(srna, "unprojected_radius", PROP_FLOAT, PROP_DISTANCE);
2711 RNA_def_property_float_funcs(prop, nullptr, "rna_Brush_set_unprojected_radius", nullptr);
2712 RNA_def_property_range(prop, 0.001, FLT_MAX);
2713 RNA_def_property_ui_range(prop, 0.001, 1, 1, -1);
2714 RNA_def_property_ui_text(prop, "Unprojected Radius", "Radius of brush in Blender units");
2715 RNA_def_property_update(prop, 0, "rna_Brush_size_update");
2716
2717 prop = RNA_def_property(srna, "input_samples", PROP_INT, PROP_UNSIGNED);
2718 RNA_def_property_int_sdna(prop, nullptr, "input_samples");
2722 prop,
2723 "Input Samples",
2724 "Number of input samples to average together to smooth the brush stroke");
2725 RNA_def_property_update(prop, 0, "rna_Brush_update");
2726
2727 prop = RNA_def_property(srna, "jitter", PROP_FLOAT, PROP_NONE);
2728 RNA_def_property_float_sdna(prop, nullptr, "jitter");
2729 RNA_def_property_range(prop, 0.0f, 1000.0f);
2730 RNA_def_property_ui_range(prop, 0.0f, 2.0f, 0.1, 4);
2731 RNA_def_property_ui_text(prop, "Jitter", "Jitter the position of the brush while painting");
2733 RNA_def_property_update(prop, 0, "rna_Brush_update");
2734
2735 prop = RNA_def_property(srna, "jitter_absolute", PROP_INT, PROP_PIXEL);
2736 RNA_def_property_int_sdna(prop, nullptr, "jitter_absolute");
2737 RNA_def_property_range(prop, 0, 1000000);
2739 prop, "Jitter", "Jitter the position of the brush in pixels while painting");
2741 RNA_def_property_update(prop, 0, "rna_Brush_update");
2742
2743 prop = RNA_def_property(srna, "spacing", PROP_INT, PROP_PERCENTAGE);
2744 RNA_def_property_int_sdna(prop, nullptr, "spacing");
2745 RNA_def_property_range(prop, 1, 1000);
2746 RNA_def_property_ui_range(prop, 1, 500, 5, -1);
2748 prop, "Spacing", "Spacing between brush daubs as a percentage of brush diameter");
2749 RNA_def_property_update(prop, 0, "rna_Brush_update");
2750
2751 prop = RNA_def_property(srna, "grad_spacing", PROP_INT, PROP_PIXEL);
2752 RNA_def_property_int_sdna(prop, nullptr, "gradient_spacing");
2753 RNA_def_property_range(prop, 1, 10000);
2754 RNA_def_property_ui_range(prop, 1, 10000, 5, -1);
2756 prop, "Gradient Spacing", "Spacing before brush gradient goes full circle");
2757 RNA_def_property_update(prop, 0, "rna_Brush_update");
2758
2759 prop = RNA_def_property(srna, "use_color_jitter", PROP_BOOLEAN, PROP_NONE);
2760 RNA_def_property_boolean_sdna(prop, nullptr, "flag2", BRUSH_JITTER_COLOR);
2761 RNA_def_property_ui_text(prop, "Use Color Jitter", "Jitter brush color");
2763 RNA_def_property_update(prop, 0, "rna_Brush_update");
2764
2765 prop = RNA_def_property(srna, "hue_jitter", PROP_FLOAT, PROP_NONE);
2766 RNA_def_property_float_sdna(prop, nullptr, "hsv_jitter[0]");
2767 RNA_def_property_range(prop, 0, 1.0f);
2768 RNA_def_property_ui_range(prop, 0, 1, 0.05, 2);
2769 RNA_def_property_ui_text(prop, "Hue Jitter", "Color jitter effect on hue");
2770 RNA_def_property_update(prop, 0, "rna_Brush_update");
2771
2772 prop = RNA_def_property(srna, "saturation_jitter", PROP_FLOAT, PROP_NONE);
2773 RNA_def_property_float_sdna(prop, nullptr, "hsv_jitter[1]");
2774 RNA_def_property_range(prop, 0, 1.0f);
2775 RNA_def_property_ui_range(prop, 0, 1, 0.05, 2);
2776 RNA_def_property_ui_text(prop, "Saturation Jitter", "Color jitter effect on saturation");
2777 RNA_def_property_update(prop, 0, "rna_Brush_update");
2778
2779 prop = RNA_def_property(srna, "value_jitter", PROP_FLOAT, PROP_NONE);
2780 RNA_def_property_float_sdna(prop, nullptr, "hsv_jitter[2]");
2781 RNA_def_property_range(prop, 0, 1.0f);
2782 RNA_def_property_ui_range(prop, 0, 1, 0.05, 2);
2783 RNA_def_property_ui_text(prop, "Value Jitter", "Color jitter effect on value");
2784 RNA_def_property_update(prop, 0, "rna_Brush_update");
2785
2786 prop = RNA_def_property(srna, "use_stroke_random_hue", PROP_BOOLEAN, PROP_NONE);
2788 prop, nullptr, "color_jitter_flag", BRUSH_COLOR_JITTER_USE_HUE_AT_STROKE);
2789 RNA_def_property_ui_icon(prop, ICON_GP_SELECT_STROKES, 0);
2790 RNA_def_property_ui_text(prop, "Stroke Random", "Use randomness at stroke level");
2792
2793 prop = RNA_def_property(srna, "use_stroke_random_sat", PROP_BOOLEAN, PROP_NONE);
2795 prop, nullptr, "color_jitter_flag", BRUSH_COLOR_JITTER_USE_SAT_AT_STROKE);
2796 RNA_def_property_ui_icon(prop, ICON_GP_SELECT_STROKES, 0);
2797 RNA_def_property_ui_text(prop, "Stroke Random", "Use randomness at stroke level");
2799
2800 prop = RNA_def_property(srna, "use_stroke_random_val", PROP_BOOLEAN, PROP_NONE);
2802 prop, nullptr, "color_jitter_flag", BRUSH_COLOR_JITTER_USE_VAL_AT_STROKE);
2803 RNA_def_property_ui_icon(prop, ICON_GP_SELECT_STROKES, 0);
2804 RNA_def_property_ui_text(prop, "Stroke Random", "Use randomness at stroke level");
2806
2807 prop = RNA_def_property(srna, "use_random_press_hue", PROP_BOOLEAN, PROP_NONE);
2809 prop, nullptr, "color_jitter_flag", BRUSH_COLOR_JITTER_USE_HUE_RAND_PRESS);
2810 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
2811 RNA_def_property_ui_text(prop, "Use Pressure", "Use pressure to modulate randomness");
2813
2814 prop = RNA_def_property(srna, "use_random_press_sat", PROP_BOOLEAN, PROP_NONE);
2816 prop, nullptr, "color_jitter_flag", BRUSH_COLOR_JITTER_USE_SAT_RAND_PRESS);
2817 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
2818 RNA_def_property_ui_text(prop, "Use Pressure", "Use pressure to modulate randomness");
2820
2821 prop = RNA_def_property(srna, "use_random_press_val", PROP_BOOLEAN, PROP_NONE);
2823 prop, nullptr, "color_jitter_flag", BRUSH_COLOR_JITTER_USE_VAL_RAND_PRESS);
2824 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
2825 RNA_def_property_ui_text(prop, "Use Pressure", "Use pressure to modulate randomness");
2827
2828 prop = RNA_def_property(srna, "curve_random_hue", PROP_POINTER, PROP_NONE);
2829 RNA_def_property_pointer_sdna(prop, nullptr, "curve_rand_hue");
2830 RNA_def_property_struct_type(prop, "CurveMapping");
2831 RNA_def_property_ui_text(prop, "Random Curve", "Curve used for modulating effect");
2833 RNA_def_property_update(prop, 0, "rna_Brush_update");
2834
2835 prop = RNA_def_property(srna, "curve_random_saturation", PROP_POINTER, PROP_NONE);
2836 RNA_def_property_pointer_sdna(prop, nullptr, "curve_rand_saturation");
2837 RNA_def_property_struct_type(prop, "CurveMapping");
2838 RNA_def_property_ui_text(prop, "Random Curve", "Curve used for modulating effect");
2840 RNA_def_property_update(prop, 0, "rna_Brush_update");
2841
2842 prop = RNA_def_property(srna, "curve_random_value", PROP_POINTER, PROP_NONE);
2843 RNA_def_property_pointer_sdna(prop, nullptr, "curve_rand_value");
2844 RNA_def_property_struct_type(prop, "CurveMapping");
2845 RNA_def_property_ui_text(prop, "Random Curve", "Curve used for modulating effect");
2847 RNA_def_property_update(prop, 0, "rna_Brush_update");
2848
2849 prop = RNA_def_property(srna, "smooth_stroke_radius", PROP_INT, PROP_PIXEL);
2850 RNA_def_property_range(prop, 10, 200);
2852 prop, "Smooth Stroke Radius", "Minimum distance from last point before stroke continues");
2853 RNA_def_property_update(prop, 0, "rna_Brush_update");
2854
2855 prop = RNA_def_property(srna, "smooth_stroke_factor", PROP_FLOAT, PROP_FACTOR);
2856 RNA_def_property_range(prop, 0.5, 0.99);
2857 RNA_def_property_ui_text(prop, "Smooth Stroke Factor", "Higher values give a smoother stroke");
2858 RNA_def_property_update(prop, 0, "rna_Brush_update");
2859
2860 prop = RNA_def_property(srna, "rate", PROP_FLOAT, PROP_NONE);
2861 RNA_def_property_float_sdna(prop, nullptr, "rate");
2862 RNA_def_property_range(prop, 0.0001f, 10000.0f);
2863 RNA_def_property_ui_range(prop, 0.01f, 1.0f, 1, 3);
2864 RNA_def_property_ui_text(prop, "Rate", "Interval between paints for Airbrush");
2865 RNA_def_property_update(prop, 0, "rna_Brush_update");
2866
2867 prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR_GAMMA);
2868 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
2869 RNA_def_property_float_sdna(prop, nullptr, "rgb");
2870 RNA_def_property_ui_text(prop, "Color", "");
2871 RNA_def_property_update(prop, 0, "rna_Brush_update");
2872
2873 prop = RNA_def_property(srna, "secondary_color", PROP_FLOAT, PROP_COLOR_GAMMA);
2874 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
2875 RNA_def_property_float_sdna(prop, nullptr, "secondary_rgb");
2876 RNA_def_property_ui_text(prop, "Secondary Color", "");
2877 RNA_def_property_update(prop, 0, "rna_Brush_update");
2878
2879 prop = RNA_def_property(srna, "weight", PROP_FLOAT, PROP_FACTOR);
2880 RNA_def_property_range(prop, 0.0f, 1.0f);
2881 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
2882 RNA_def_property_ui_text(prop, "Weight", "Vertex weight when brush is applied");
2883 RNA_def_property_update(prop, 0, "rna_Brush_update");
2884
2885 prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_FACTOR);
2886 RNA_def_property_float_sdna(prop, nullptr, "alpha");
2887 RNA_def_property_range(prop, 0.0f, 10.0f);
2888 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
2890 prop, "Strength", "How powerful the effect of the brush is when applied");
2891 RNA_def_property_update(prop, 0, "rna_Brush_update");
2892
2893 prop = RNA_def_property(srna, "flow", PROP_FLOAT, PROP_FACTOR);
2894 RNA_def_property_float_sdna(prop, nullptr, "flow");
2895 RNA_def_property_range(prop, 0.0f, 1.0f);
2896 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
2897 RNA_def_property_ui_text(prop, "Flow", "Amount of paint that is applied per stroke sample");
2898 RNA_def_property_update(prop, 0, "rna_Brush_update");
2899
2900 prop = RNA_def_property(srna, "wet_mix", PROP_FLOAT, PROP_FACTOR);
2901 RNA_def_property_float_sdna(prop, nullptr, "wet_mix");
2902 RNA_def_property_range(prop, 0.0f, 1.0f);
2903 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
2905 prop, "Wet Mix", "Amount of paint that is picked from the surface into the brush color");
2906 RNA_def_property_update(prop, 0, "rna_Brush_update");
2907
2908 prop = RNA_def_property(srna, "wet_persistence", PROP_FLOAT, PROP_FACTOR);
2909 RNA_def_property_float_sdna(prop, nullptr, "wet_persistence");
2910 RNA_def_property_range(prop, 0.0f, 1.0f);
2911 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
2913 prop,
2914 "Wet Persistence",
2915 "Amount of wet paint that stays in the brush after applying paint to the surface");
2916 RNA_def_property_update(prop, 0, "rna_Brush_update");
2917
2918 prop = RNA_def_property(srna, "density", PROP_FLOAT, PROP_FACTOR);
2919 RNA_def_property_float_sdna(prop, nullptr, "density");
2920 RNA_def_property_range(prop, 0.0f, 1.0f);
2921 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
2923 prop, "Density", "Amount of random elements that are going to be affected by the brush");
2924 RNA_def_property_update(prop, 0, "rna_Brush_update");
2925
2926 prop = RNA_def_property(srna, "tip_scale_x", PROP_FLOAT, PROP_FACTOR);
2927 RNA_def_property_float_sdna(prop, nullptr, "tip_scale_x");
2928 RNA_def_property_range(prop, 0.0001f, 1.0f);
2929 RNA_def_property_ui_range(prop, 0.0001f, 1.0f, 0.001, 3);
2930 RNA_def_property_ui_text(prop, "Tip Scale X", "Scale of the brush tip in the X axis");
2931 RNA_def_property_update(prop, 0, "rna_Brush_update");
2932
2933 prop = RNA_def_property(srna, "use_hardness_pressure", PROP_BOOLEAN, PROP_NONE);
2934 RNA_def_property_boolean_sdna(prop, nullptr, "paint_flags", BRUSH_PAINT_HARDNESS_PRESSURE);
2935 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
2936 RNA_def_property_ui_text(prop, "Use Pressure for Hardness", "Use pressure to modulate hardness");
2938 RNA_def_property_update(prop, 0, "rna_Brush_update");
2939
2940 prop = RNA_def_property(srna, "invert_hardness_pressure", PROP_BOOLEAN, PROP_NONE);
2942 prop, nullptr, "paint_flags", BRUSH_PAINT_HARDNESS_PRESSURE_INVERT);
2943 RNA_def_property_ui_icon(prop, ICON_ARROW_LEFTRIGHT, 0);
2945 prop, "Invert Pressure for Hardness", "Invert the modulation of pressure in hardness");
2947 RNA_def_property_update(prop, 0, "rna_Brush_update");
2948
2949 prop = RNA_def_property(srna, "use_flow_pressure", PROP_BOOLEAN, PROP_NONE);
2950 RNA_def_property_boolean_sdna(prop, nullptr, "paint_flags", BRUSH_PAINT_FLOW_PRESSURE);
2951 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
2952 RNA_def_property_ui_text(prop, "Use Pressure for Flow", "Use pressure to modulate flow");
2954 RNA_def_property_update(prop, 0, "rna_Brush_update");
2955
2956 prop = RNA_def_property(srna, "invert_flow_pressure", PROP_BOOLEAN, PROP_NONE);
2958 RNA_def_property_ui_icon(prop, ICON_ARROW_LEFTRIGHT, 0);
2960 prop, "Invert Pressure for Flow", "Invert the modulation of pressure in flow");
2962 RNA_def_property_update(prop, 0, "rna_Brush_update");
2963
2964 prop = RNA_def_property(srna, "use_wet_mix_pressure", PROP_BOOLEAN, PROP_NONE);
2965 RNA_def_property_boolean_sdna(prop, nullptr, "paint_flags", BRUSH_PAINT_WET_MIX_PRESSURE);
2966 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
2967 RNA_def_property_ui_text(prop, "Use Pressure for Wet Mix", "Use pressure to modulate wet mix");
2969 RNA_def_property_update(prop, 0, "rna_Brush_update");
2970
2971 prop = RNA_def_property(srna, "invert_wet_mix_pressure", PROP_BOOLEAN, PROP_NONE);
2973 RNA_def_property_ui_icon(prop, ICON_ARROW_LEFTRIGHT, 0);
2975 prop, "Invert Pressure for Wet Mix", "Invert the modulation of pressure in wet mix");
2977 RNA_def_property_update(prop, 0, "rna_Brush_update");
2978
2979 prop = RNA_def_property(srna, "use_wet_persistence_pressure", PROP_BOOLEAN, PROP_NONE);
2981 prop, nullptr, "paint_flags", BRUSH_PAINT_WET_PERSISTENCE_PRESSURE);
2982 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
2984 prop, "Use Pressure for Wet Persistence", "Use pressure to modulate wet persistence");
2986 RNA_def_property_update(prop, 0, "rna_Brush_update");
2987
2988 prop = RNA_def_property(srna, "invert_wet_persistence_pressure", PROP_BOOLEAN, PROP_NONE);
2990 prop, nullptr, "paint_flags", BRUSH_PAINT_WET_PERSISTENCE_PRESSURE_INVERT);
2991 RNA_def_property_ui_icon(prop, ICON_ARROW_LEFTRIGHT, 0);
2993 "Invert Pressure for Wet Persistence",
2994 "Invert the modulation of pressure in wet persistence");
2996 RNA_def_property_update(prop, 0, "rna_Brush_update");
2997
2998 prop = RNA_def_property(srna, "use_density_pressure", PROP_BOOLEAN, PROP_NONE);
2999 RNA_def_property_boolean_sdna(prop, nullptr, "paint_flags", BRUSH_PAINT_DENSITY_PRESSURE);
3000 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
3001 RNA_def_property_ui_text(prop, "Use Pressure for Density", "Use pressure to modulate density");
3003 RNA_def_property_update(prop, 0, "rna_Brush_update");
3004
3005 prop = RNA_def_property(srna, "invert_density_pressure", PROP_BOOLEAN, PROP_NONE);
3007 RNA_def_property_ui_icon(prop, ICON_ARROW_LEFTRIGHT, 0);
3009 prop, "Invert Pressure for Density", "Invert the modulation of pressure in density");
3011 RNA_def_property_update(prop, 0, "rna_Brush_update");
3012
3013 prop = RNA_def_property(srna, "dash_ratio", PROP_FLOAT, PROP_FACTOR);
3014 RNA_def_property_float_sdna(prop, nullptr, "dash_ratio");
3015 RNA_def_property_range(prop, 0.0f, 1.0f);
3016 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
3018 prop, "Dash Ratio", "Ratio of samples in a cycle that the brush is enabled");
3019 RNA_def_property_update(prop, 0, "rna_Brush_update");
3020
3021 prop = RNA_def_property(srna, "dash_samples", PROP_INT, PROP_UNSIGNED);
3022 RNA_def_property_int_sdna(prop, nullptr, "dash_samples");
3023 RNA_def_property_range(prop, 1, 10000);
3024 RNA_def_property_ui_range(prop, 1, 10000, 5, -1);
3026 prop, "Dash Length", "Length of a dash cycle measured in stroke samples");
3027 RNA_def_property_update(prop, 0, "rna_Brush_update");
3028
3029 prop = RNA_def_property(srna, "plane_offset", PROP_FLOAT, PROP_DISTANCE);
3030 RNA_def_property_float_sdna(prop, nullptr, "plane_offset");
3032 RNA_def_property_range(prop, -2.0f, 2.0f);
3033 RNA_def_property_ui_range(prop, -0.5f, 0.5f, 0.001, 3);
3035 prop,
3036 "Plane Offset",
3037 "Adjust plane on which the brush acts towards or away from the object surface");
3038 RNA_def_property_update(prop, 0, "rna_Brush_update");
3039
3040 prop = RNA_def_property(srna, "plane_trim", PROP_FLOAT, PROP_DISTANCE);
3041 RNA_def_property_float_sdna(prop, nullptr, "plane_trim");
3042 RNA_def_property_range(prop, 0, 1.0f);
3044 prop,
3045 "Plane Trim",
3046 "If a vertex is further away from offset plane than this, then it is not affected");
3047 RNA_def_property_update(prop, 0, "rna_Brush_update");
3048
3049 prop = RNA_def_property(srna, "height", PROP_FLOAT, PROP_DISTANCE);
3050 RNA_def_property_float_sdna(prop, nullptr, "height");
3052 RNA_def_property_range(prop, 0, 1.0f);
3053 RNA_def_property_ui_range(prop, 0, 0.2f, 1, 3);
3055 prop,
3056 "Brush Height",
3057 "Affectable height of brush (i.e. the layer height for the layer tool)");
3058 RNA_def_property_update(prop, 0, "rna_Brush_update");
3059
3060 prop = RNA_def_property(srna, "plane_depth", PROP_FLOAT, PROP_FACTOR);
3061 RNA_def_property_float_sdna(prop, nullptr, "plane_depth");
3063 RNA_def_property_range(prop, 0, 1.0f);
3064 RNA_def_property_ui_range(prop, 0, 1.0f, 1, 3);
3066 "Depth",
3067 "The maximum distance below the plane for affected vertices. "
3068 "Increasing the depth affects vertices farther below the plane.");
3069 RNA_def_property_update(prop, 0, "rna_Brush_update");
3070
3071 prop = RNA_def_property(srna, "plane_height", PROP_FLOAT, PROP_FACTOR);
3072 RNA_def_property_float_sdna(prop, nullptr, "plane_height");
3074 RNA_def_property_range(prop, 0, 1.0f);
3075 RNA_def_property_ui_range(prop, 0, 1.0f, 1, 3);
3077 "Height",
3078 "The maximum distance above the plane for affected vertices. "
3079 "Increasing the height affects vertices farther above the plane.");
3080 RNA_def_property_update(prop, 0, "rna_Brush_update");
3081
3082 prop = RNA_def_property(srna, "stabilize_normal", PROP_FLOAT, PROP_FACTOR);
3083 RNA_def_property_float_sdna(prop, nullptr, "stabilize_normal");
3085 RNA_def_property_range(prop, 0, 1.0f);
3086 RNA_def_property_ui_range(prop, 0, 1.0f, 1, 3);
3088 prop, "Stabilize Normal", "Stabilize the orientation of the brush plane.");
3089 RNA_def_property_update(prop, 0, "rna_Brush_update");
3090
3091 prop = RNA_def_property(srna, "stabilize_plane", PROP_FLOAT, PROP_FACTOR);
3092 RNA_def_property_float_sdna(prop, nullptr, "stabilize_plane");
3094 RNA_def_property_range(prop, 0, 1.0f);
3095 RNA_def_property_ui_range(prop, 0, 1.0f, 1, 3);
3096 RNA_def_property_ui_text(prop, "Stabilize Plane", "Stabilize the center of the brush plane.");
3097 RNA_def_property_update(prop, 0, "rna_Brush_update");
3098
3099 prop = RNA_def_property(srna, "texture_sample_bias", PROP_FLOAT, PROP_DISTANCE);
3100 RNA_def_property_float_sdna(prop, nullptr, "texture_sample_bias");
3102 RNA_def_property_range(prop, -1, 1);
3103 RNA_def_property_ui_text(prop, "Texture Sample Bias", "Value added to texture samples");
3104 RNA_def_property_update(prop, 0, "rna_Brush_update");
3105
3106 prop = RNA_def_property(srna, "use_color_as_displacement", PROP_BOOLEAN, PROP_NONE);
3109 prop,
3110 "Vector Displacement",
3111 "Handle each pixel color as individual vector for displacement (area plane mapping only)");
3112 RNA_def_property_update(prop, 0, "rna_Brush_update");
3113
3114 prop = RNA_def_property(srna, "normal_weight", PROP_FLOAT, PROP_FACTOR);
3115 RNA_def_property_float_sdna(prop, nullptr, "normal_weight");
3117 RNA_def_property_range(prop, 0.0f, 1.0f);
3119 prop, "Normal Weight", "How much grab will pull vertices out of surface during a grab");
3120 RNA_def_property_update(prop, 0, "rna_Brush_update");
3121
3122 prop = RNA_def_property(srna, "elastic_deform_volume_preservation", PROP_FLOAT, PROP_NONE);
3123 RNA_def_property_float_sdna(prop, nullptr, "elastic_deform_volume_preservation");
3124 RNA_def_property_range(prop, 0.0f, 0.9f);
3125 RNA_def_property_ui_range(prop, 0.0f, 0.9f, 0.01f, 3);
3127 "Volume Preservation",
3128 "Poisson ratio for elastic deformation. Higher values preserve volume "
3129 "more, but also lead to more bulging.");
3130 RNA_def_property_update(prop, 0, "rna_Brush_update");
3131
3132 prop = RNA_def_property(srna, "rake_factor", PROP_FLOAT, PROP_FACTOR);
3133 RNA_def_property_float_sdna(prop, nullptr, "rake_factor");
3135 RNA_def_property_range(prop, 0.0f, 10.0f);
3136 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
3137 RNA_def_property_ui_text(prop, "Rake", "How much grab will follow cursor rotation");
3138 RNA_def_property_update(prop, 0, "rna_Brush_update");
3139
3140 prop = RNA_def_property(srna, "crease_pinch_factor", PROP_FLOAT, PROP_FACTOR);
3141 RNA_def_property_float_sdna(prop, nullptr, "crease_pinch_factor");
3142 RNA_def_property_range(prop, 0.0f, 1.0f);
3143 RNA_def_property_ui_text(prop, "Crease Brush Pinch Factor", "How much the crease brush pinches");
3144 RNA_def_property_update(prop, 0, "rna_Brush_update");
3145
3146 prop = RNA_def_property(srna, "pose_offset", PROP_FLOAT, PROP_FACTOR);
3147 RNA_def_property_float_sdna(prop, nullptr, "pose_offset");
3148 RNA_def_property_range(prop, 0.0f, 2.0f);
3150 prop, "Pose Origin Offset", "Offset of the pose origin in relation to the brush radius");
3151 RNA_def_property_update(prop, 0, "rna_Brush_update");
3152
3153 prop = RNA_def_property(srna, "disconnected_distance_max", PROP_FLOAT, PROP_DISTANCE);
3154 RNA_def_property_float_sdna(prop, nullptr, "disconnected_distance_max");
3155 RNA_def_property_range(prop, 0.0f, 10.0f);
3157 "Max Element Distance",
3158 "Maximum distance to search for disconnected loose parts in the mesh");
3159 RNA_def_property_update(prop, 0, "rna_Brush_update");
3160
3161 prop = RNA_def_property(srna, "boundary_offset", PROP_FLOAT, PROP_FACTOR);
3162 RNA_def_property_float_sdna(prop, nullptr, "boundary_offset");
3163 RNA_def_property_range(prop, 0.0f, 30.0f);
3165 "Boundary Origin Offset",
3166 "Offset of the boundary origin in relation to the brush radius");
3167 RNA_def_property_update(prop, 0, "rna_Brush_update");
3168
3169 prop = RNA_def_property(srna, "surface_smooth_shape_preservation", PROP_FLOAT, PROP_FACTOR);
3170 RNA_def_property_float_sdna(prop, nullptr, "surface_smooth_shape_preservation");
3171 RNA_def_property_range(prop, 0.0f, 1.0f);
3173 prop, "Shape Preservation", "How much of the original shape is preserved when smoothing");
3174 RNA_def_property_update(prop, 0, "rna_Brush_update");
3175
3176 prop = RNA_def_property(srna, "surface_smooth_current_vertex", PROP_FLOAT, PROP_FACTOR);
3177 RNA_def_property_float_sdna(prop, nullptr, "surface_smooth_current_vertex");
3178 RNA_def_property_range(prop, 0.0f, 1.0f);
3180 prop,
3181 "Per Vertex Displacement",
3182 "How much the position of each individual vertex influences the final result");
3183 RNA_def_property_update(prop, 0, "rna_Brush_update");
3184
3185 prop = RNA_def_property(srna, "surface_smooth_iterations", PROP_INT, PROP_UNSIGNED);
3186 RNA_def_property_int_sdna(prop, nullptr, "surface_smooth_iterations");
3187 RNA_def_property_range(prop, 1, 10);
3188 RNA_def_property_ui_range(prop, 1, 10, 1, 3);
3189 RNA_def_property_ui_text(prop, "Iterations", "Number of smoothing iterations per brush step");
3190 RNA_def_property_update(prop, 0, "rna_Brush_update");
3191
3192 prop = RNA_def_property(srna, "multiplane_scrape_angle", PROP_FLOAT, PROP_FACTOR);
3193 RNA_def_property_float_sdna(prop, nullptr, "multiplane_scrape_angle");
3194 RNA_def_property_range(prop, 0.0f, 160.0f);
3195 RNA_def_property_ui_text(prop, "Plane Angle", "Angle between the planes of the crease");
3196 RNA_def_property_update(prop, 0, "rna_Brush_update");
3197
3198 prop = RNA_def_property(srna, "pose_smooth_iterations", PROP_INT, PROP_UNSIGNED);
3199 RNA_def_property_int_sdna(prop, nullptr, "pose_smooth_iterations");
3200 RNA_def_property_range(prop, 0, 100);
3202 prop,
3203 "Smooth Iterations",
3204 "Smooth iterations applied after calculating the pose factor of each vertex");
3205 RNA_def_property_update(prop, 0, "rna_Brush_update");
3206
3207 prop = RNA_def_property(srna, "pose_ik_segments", PROP_INT, PROP_UNSIGNED);
3208 RNA_def_property_int_sdna(prop, nullptr, "pose_ik_segments");
3209 RNA_def_property_range(prop, 1, 20);
3210 RNA_def_property_ui_range(prop, 1, 20, 1, 3);
3212 prop,
3213 "Pose IK Segments",
3214 "Number of segments of the inverse kinematics chain that will deform the mesh");
3215 RNA_def_property_update(prop, 0, "rna_Brush_update");
3216
3217 prop = RNA_def_property(srna, "tip_roundness", PROP_FLOAT, PROP_FACTOR);
3218 RNA_def_property_float_sdna(prop, nullptr, "tip_roundness");
3219 RNA_def_property_range(prop, 0.0f, 1.0f);
3220 RNA_def_property_ui_text(prop, "Tip Roundness", "Roundness of the brush tip");
3221 RNA_def_property_update(prop, 0, "rna_Brush_update");
3222
3223 prop = RNA_def_property(srna, "cloth_mass", PROP_FLOAT, PROP_FACTOR);
3224 RNA_def_property_float_sdna(prop, nullptr, "cloth_mass");
3225 RNA_def_property_range(prop, 0.01f, 2.0f);
3226 RNA_def_property_ui_text(prop, "Cloth Mass", "Mass of each simulation particle");
3227 RNA_def_property_update(prop, 0, "rna_Brush_update");
3228
3229 prop = RNA_def_property(srna, "cloth_damping", PROP_FLOAT, PROP_FACTOR);
3230 RNA_def_property_float_sdna(prop, nullptr, "cloth_damping");
3231 RNA_def_property_range(prop, 0.01f, 1.0f);
3233 prop, "Cloth Damping", "How much the applied forces are propagated through the cloth");
3234 RNA_def_property_update(prop, 0, "rna_Brush_update");
3235
3236 prop = RNA_def_property(srna, "cloth_sim_limit", PROP_FLOAT, PROP_FACTOR);
3237 RNA_def_property_float_sdna(prop, nullptr, "cloth_sim_limit");
3238 RNA_def_property_range(prop, 0.1f, 10.0f);
3240 prop,
3241 "Simulation Limit",
3242 "Factor added relative to the size of the radius to limit the cloth simulation effects");
3243 RNA_def_property_update(prop, 0, "rna_Brush_update");
3244
3245 prop = RNA_def_property(srna, "cloth_sim_falloff", PROP_FLOAT, PROP_FACTOR);
3246 RNA_def_property_float_sdna(prop, nullptr, "cloth_sim_falloff");
3247 RNA_def_property_range(prop, 0.0f, 1.0f);
3249 "Simulation Falloff",
3250 "Area to apply deformation falloff to the effects of the simulation");
3251 RNA_def_property_update(prop, 0, "rna_Brush_update");
3252
3253 prop = RNA_def_property(srna, "cloth_constraint_softbody_strength", PROP_FLOAT, PROP_FACTOR);
3254 RNA_def_property_float_sdna(prop, nullptr, "cloth_constraint_softbody_strength");
3255 RNA_def_property_range(prop, 0.0f, 1.0f);
3257 prop,
3258 "Soft Body Plasticity",
3259 "How much the cloth preserves the original shape, acting as a soft body");
3260 RNA_def_property_update(prop, 0, "rna_Brush_update");
3261
3262 prop = RNA_def_property(srna, "hardness", PROP_FLOAT, PROP_FACTOR);
3263 RNA_def_property_float_sdna(prop, nullptr, "hardness");
3264 RNA_def_property_range(prop, 0.0f, 1.0f);
3266 prop, "Hardness", "How close the brush falloff starts from the edge of the brush");
3267 RNA_def_property_update(prop, 0, "rna_Brush_update");
3268
3269 prop = RNA_def_property(
3270 srna, "automasking_boundary_edges_propagation_steps", PROP_INT, PROP_UNSIGNED);
3271 RNA_def_property_int_sdna(prop, nullptr, "automasking_boundary_edges_propagation_steps");
3275 "Propagation Steps",
3276 "Distance where boundary edge automasking is going to protect vertices "
3277 "from the fully masked edge");
3278 RNA_def_property_update(prop, 0, "rna_Brush_update");
3279
3280 prop = RNA_def_property(srna, "auto_smooth_factor", PROP_FLOAT, PROP_FACTOR);
3281 RNA_def_property_float_sdna(prop, nullptr, "autosmooth_factor");
3283 RNA_def_property_range(prop, 0.0f, 1.0f);
3284 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
3286 prop, "Auto-Smooth", "Amount of smoothing to automatically apply to each stroke");
3287 RNA_def_property_update(prop, 0, "rna_Brush_update");
3288
3289 prop = RNA_def_property(srna, "topology_rake_factor", PROP_FLOAT, PROP_FACTOR);
3290 RNA_def_property_float_sdna(prop, nullptr, "topology_rake_factor");
3292 RNA_def_property_range(prop, 0.0f, 1.0f);
3293 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
3295 "Topology Rake",
3296 "Automatically align edges to the brush direction to "
3297 "generate cleaner topology and define sharp features. "
3298 "Best used on low-poly meshes as it has a performance impact.");
3299 RNA_def_property_update(prop, 0, "rna_Brush_update");
3300
3301 prop = RNA_def_property(srna, "tilt_strength_factor", PROP_FLOAT, PROP_FACTOR);
3302 RNA_def_property_float_sdna(prop, nullptr, "tilt_strength_factor");
3304 RNA_def_property_range(prop, -1.0f, 1.0f);
3305 RNA_def_property_ui_range(prop, -1.0f, 1.0f, 0.001, 3);
3307 "Tilt Strength",
3308 "How much the tilt of the pen will affect the brush. Negative values "
3309 "indicate inverting the tilt directions.");
3310 RNA_def_property_update(prop, 0, "rna_Brush_update");
3311
3312 prop = RNA_def_property(srna, "normal_radius_factor", PROP_FLOAT, PROP_FACTOR);
3313 RNA_def_property_float_sdna(prop, nullptr, "normal_radius_factor");
3314 RNA_def_property_range(prop, 0.0f, 2.0f);
3315 RNA_def_property_ui_range(prop, 0.0f, 2.0f, 0.001, 3);
3317 "Normal Radius",
3318 "Ratio between the brush radius and the radius that is going to be "
3319 "used to sample the normal");
3320 RNA_def_property_update(prop, 0, "rna_Brush_update");
3321
3322 prop = RNA_def_property(srna, "area_radius_factor", PROP_FLOAT, PROP_FACTOR);
3323 RNA_def_property_float_sdna(prop, nullptr, "area_radius_factor");
3324 RNA_def_property_range(prop, 0.0f, 2.0f);
3325 RNA_def_property_ui_range(prop, 0.0f, 2.0f, 0.001, 3);
3327 "Area Radius",
3328 "Ratio between the brush radius and the radius that is going to be "
3329 "used to sample the area center");
3330 RNA_def_property_update(prop, 0, "rna_Brush_update");
3331
3332 prop = RNA_def_property(srna, "wet_paint_radius_factor", PROP_FLOAT, PROP_FACTOR);
3333 RNA_def_property_float_sdna(prop, nullptr, "wet_paint_radius_factor");
3334 RNA_def_property_range(prop, 0.0f, 2.0f);
3335 RNA_def_property_ui_range(prop, 0.0f, 2.0f, 0.001, 3);
3337 "Wet Paint Radius",
3338 "Ratio between the brush radius and the radius that is going to be "
3339 "used to sample the color to blend in wet paint");
3340 RNA_def_property_update(prop, 0, "rna_Brush_update");
3341
3342 prop = RNA_def_property(srna, "stencil_pos", PROP_FLOAT, PROP_XYZ);
3343 RNA_def_property_float_sdna(prop, nullptr, "stencil_pos");
3344 RNA_def_property_array(prop, 2);
3345 RNA_def_property_ui_text(prop, "Stencil Position", "Position of stencil in viewport");
3346 RNA_def_property_update(prop, 0, "rna_Brush_update");
3347
3348 prop = RNA_def_property(srna, "stencil_dimension", PROP_FLOAT, PROP_XYZ);
3349 RNA_def_property_float_sdna(prop, nullptr, "stencil_dimension");
3350 RNA_def_property_array(prop, 2);
3351 RNA_def_property_ui_text(prop, "Stencil Dimensions", "Dimensions of stencil in viewport");
3352 RNA_def_property_update(prop, 0, "rna_Brush_update");
3353
3354 prop = RNA_def_property(srna, "mask_stencil_pos", PROP_FLOAT, PROP_XYZ);
3355 RNA_def_property_float_sdna(prop, nullptr, "mask_stencil_pos");
3356 RNA_def_property_array(prop, 2);
3357 RNA_def_property_ui_text(prop, "Mask Stencil Position", "Position of mask stencil in viewport");
3358 RNA_def_property_update(prop, 0, "rna_Brush_update");
3359
3360 prop = RNA_def_property(srna, "mask_stencil_dimension", PROP_FLOAT, PROP_XYZ);
3361 RNA_def_property_float_sdna(prop, nullptr, "mask_stencil_dimension");
3362 RNA_def_property_array(prop, 2);
3364 prop, "Mask Stencil Dimensions", "Dimensions of mask stencil in viewport");
3365 RNA_def_property_update(prop, 0, "rna_Brush_update");
3366
3367 prop = RNA_def_property(srna, "sharp_threshold", PROP_FLOAT, PROP_NONE);
3368 RNA_def_property_range(prop, 0.0, 100.0);
3369 RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 3);
3370 RNA_def_property_float_sdna(prop, nullptr, "sharp_threshold");
3372 prop, "Sharp Threshold", "Threshold below which, no sharpening is done");
3373 RNA_def_property_update(prop, 0, "rna_Brush_update");
3374
3375 prop = RNA_def_property(srna, "fill_threshold", PROP_FLOAT, PROP_NONE);
3376 RNA_def_property_range(prop, 0.0, 100.0);
3377 RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 3);
3378 RNA_def_property_float_sdna(prop, nullptr, "fill_threshold");
3380 prop, "Fill Threshold", "Threshold above which filling is not propagated");
3381 RNA_def_property_update(prop, 0, "rna_Brush_update");
3382
3383 prop = RNA_def_property(srna, "blur_kernel_radius", PROP_INT, PROP_NONE);
3384 RNA_def_property_int_sdna(prop, nullptr, "blur_kernel_radius");
3385 RNA_def_property_range(prop, 1, 10000);
3386 RNA_def_property_ui_range(prop, 1, 50, 1, -1);
3388 prop, "Kernel Radius", "Radius of kernel used for soften and sharpen in pixels");
3389 RNA_def_property_update(prop, 0, "rna_Brush_update");
3390
3391 prop = RNA_def_property(srna, "blur_mode", PROP_ENUM, PROP_NONE);
3392 RNA_def_property_enum_items(prop, brush_blur_mode_items);
3393 RNA_def_property_ui_text(prop, "Blur Mode", "");
3394 RNA_def_property_update(prop, 0, "rna_Brush_update");
3395
3396 prop = RNA_def_property(srna, "falloff_angle", PROP_FLOAT, PROP_ANGLE);
3397 RNA_def_property_float_sdna(prop, nullptr, "falloff_angle");
3400 prop,
3401 "Falloff Angle",
3402 "Paint most on faces pointing towards the view according to this angle");
3403 RNA_def_property_update(prop, 0, "rna_Brush_update");
3404
3405 /* flag */
3406 prop = RNA_def_property(srna, "use_airbrush", PROP_BOOLEAN, PROP_NONE);
3407 RNA_def_property_boolean_sdna(prop, nullptr, "flag", BRUSH_AIRBRUSH);
3409 prop, "Airbrush", "Keep applying paint effect while holding mouse (spray)");
3410 RNA_def_property_update(prop, 0, "rna_Brush_update");
3411
3412 prop = RNA_def_property(srna, "use_original_normal", PROP_BOOLEAN, PROP_NONE);
3415 "Original Normal",
3416 "When locked keep using normal of surface where stroke was initiated");
3417 RNA_def_property_update(prop, 0, "rna_Brush_update");
3418
3419 prop = RNA_def_property(srna, "use_original_plane", PROP_BOOLEAN, PROP_NONE);
3422 prop,
3423 "Original Plane",
3424 "When locked keep using the plane origin of surface where stroke was initiated");
3425 RNA_def_property_update(prop, 0, "rna_Brush_update");
3426
3428 do {
3429 prop = RNA_def_property(srna, entry->identifier, PROP_BOOLEAN, PROP_NONE);
3430 RNA_def_property_boolean_sdna(prop, nullptr, "automasking_flags", entry->value);
3431 RNA_def_property_ui_text(prop, entry->name, entry->description);
3432
3433 if (entry->value == BRUSH_AUTOMASKING_CAVITY_NORMAL) {
3434 RNA_def_property_boolean_funcs(prop, nullptr, "rna_Brush_automasking_cavity_set");
3435 }
3436 else if (entry->value == BRUSH_AUTOMASKING_CAVITY_INVERTED) {
3437 RNA_def_property_boolean_funcs(prop, nullptr, "rna_Brush_automasking_invert_cavity_set");
3438 }
3439
3440 RNA_def_property_update(prop, 0, "rna_Brush_update");
3441 } while ((++entry)->identifier);
3442
3443 prop = RNA_def_property(srna, "automasking_cavity_factor", PROP_FLOAT, PROP_FACTOR);
3444 RNA_def_property_float_sdna(prop, nullptr, "automasking_cavity_factor");
3445 RNA_def_property_ui_text(prop, "Cavity Factor", "The contrast of the cavity mask");
3446 RNA_def_property_range(prop, 0.0f, 5.0f);
3447 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
3449 RNA_def_property_update(prop, 0, "rna_Brush_update");
3450
3451 prop = RNA_def_property(srna, "automasking_cavity_blur_steps", PROP_INT, PROP_NONE);
3452 RNA_def_property_int_sdna(prop, nullptr, "automasking_cavity_blur_steps");
3454 RNA_def_property_ui_text(prop, "Blur Steps", "The number of times the cavity mask is blurred");
3455 RNA_def_property_range(prop, 0, 25);
3456 RNA_def_property_ui_range(prop, 0, 10, 1, 1);
3458 RNA_def_property_update(prop, 0, "rna_Brush_update");
3459
3460 prop = RNA_def_property(srna, "automasking_cavity_curve", PROP_POINTER, PROP_NONE);
3461 RNA_def_property_pointer_sdna(prop, nullptr, "automasking_cavity_curve");
3462 RNA_def_property_struct_type(prop, "CurveMapping");
3463 RNA_def_property_ui_text(prop, "Cavity Curve", "Curve used for the sensitivity");
3466 RNA_def_property_update(prop, 0, "rna_Brush_update");
3467
3468 prop = RNA_def_property(srna, "use_automasking_start_normal", PROP_BOOLEAN, PROP_NONE);
3470 prop, nullptr, "automasking_flags", BRUSH_AUTOMASKING_BRUSH_NORMAL);
3472 prop,
3473 "Area Normal",
3474 "Affect only vertices with a similar normal to where the stroke starts");
3475 RNA_def_property_update(prop, 0, "rna_Brush_update");
3476
3477 prop = RNA_def_property(srna, "automasking_start_normal_limit", PROP_FLOAT, PROP_ANGLE);
3478 RNA_def_property_float_sdna(prop, nullptr, "automasking_start_normal_limit");
3479 RNA_def_property_range(prop, 0.0001f, M_PI);
3480 RNA_def_property_ui_text(prop, "Area Normal Limit", "The range of angles that will be affected");
3481 RNA_def_property_update(prop, 0, "rna_Brush_update");
3482
3483 prop = RNA_def_property(srna, "automasking_start_normal_falloff", PROP_FLOAT, PROP_FACTOR);
3484 RNA_def_property_float_sdna(prop, nullptr, "automasking_start_normal_falloff");
3485 RNA_def_property_range(prop, 0.0001f, 1.0f);
3487 prop, "Area Normal Falloff", "Extend the angular range with a falloff gradient");
3488 RNA_def_property_update(prop, 0, "rna_Brush_update");
3489
3490 prop = RNA_def_property(srna, "use_automasking_view_normal", PROP_BOOLEAN, PROP_NONE);
3491 RNA_def_property_boolean_sdna(prop, nullptr, "automasking_flags", BRUSH_AUTOMASKING_VIEW_NORMAL);
3493 prop, "View Normal", "Affect only vertices with a normal that faces the viewer");
3494 RNA_def_property_update(prop, 0, "rna_Brush_update");
3495
3496 prop = RNA_def_property(srna, "use_automasking_view_occlusion", PROP_BOOLEAN, PROP_NONE);
3498 prop, nullptr, "automasking_flags", BRUSH_AUTOMASKING_VIEW_OCCLUSION);
3500 prop,
3501 "Occlusion",
3502 "Only affect vertices that are not occluded by other faces (slower performance)");
3503 RNA_def_property_update(prop, 0, "rna_Brush_update");
3504
3505 prop = RNA_def_property(srna, "automasking_view_normal_limit", PROP_FLOAT, PROP_ANGLE);
3506 RNA_def_property_float_sdna(prop, nullptr, "automasking_view_normal_limit");
3507 RNA_def_property_range(prop, 0.0001f, M_PI);
3508 RNA_def_property_ui_text(prop, "View Normal Limit", "The range of angles that will be affected");
3509 RNA_def_property_update(prop, 0, "rna_Brush_update");
3510
3511 prop = RNA_def_property(srna, "automasking_view_normal_falloff", PROP_FLOAT, PROP_FACTOR);
3512 RNA_def_property_float_sdna(prop, nullptr, "automasking_view_normal_falloff");
3513 RNA_def_property_range(prop, 0.0001f, 1.0f);
3515 prop, "View Normal Falloff", "Extend the angular range with a falloff gradient");
3516 RNA_def_property_update(prop, 0, "rna_Brush_update");
3517
3518 prop = RNA_def_property(srna, "use_scene_spacing", PROP_ENUM, PROP_NONE);
3519 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flag");
3520 RNA_def_property_enum_items(prop, brush_spacing_unit_items);
3522 prop, "Spacing Distance", "Calculate the brush spacing using view or scene distance");
3523 RNA_def_property_update(prop, 0, "rna_Brush_update");
3524
3525 prop = RNA_def_property(srna, "use_grab_active_vertex", PROP_BOOLEAN, PROP_NONE);
3528 prop,
3529 "Grab Active Vertex",
3530 "Apply the maximum grab strength to the active vertex instead of the cursor location");
3531 RNA_def_property_update(prop, 0, "rna_Brush_update");
3532
3533 prop = RNA_def_property(srna, "use_grab_silhouette", PROP_BOOLEAN, PROP_NONE);
3536 prop, "Grab Silhouette", "Grabs trying to automask the silhouette of the object");
3537 RNA_def_property_update(prop, 0, "rna_Brush_update");
3538
3539 prop = RNA_def_property(srna, "use_paint_antialiasing", PROP_BOOLEAN, PROP_NONE);
3540 RNA_def_property_boolean_sdna(prop, nullptr, "sampling_flag", BRUSH_PAINT_ANTIALIASING);
3541 RNA_def_property_ui_text(prop, "Anti-Aliasing", "Smooths the edges of the strokes");
3542 RNA_def_property_update(prop, 0, "rna_Brush_update");
3543
3544 prop = RNA_def_property(srna, "use_multiplane_scrape_dynamic", PROP_BOOLEAN, PROP_NONE);
3547 "Dynamic Mode",
3548 "The angle between the planes changes during the stroke to fit the "
3549 "surface under the cursor");
3550 RNA_def_property_update(prop, 0, "rna_Brush_update");
3551
3552 prop = RNA_def_property(srna, "show_multiplane_scrape_planes_preview", PROP_BOOLEAN, PROP_NONE);
3555 prop, "Show Cursor Preview", "Preview the scrape planes in the cursor during the stroke");
3556 RNA_def_property_update(prop, 0, "rna_Brush_update");
3557
3558 prop = RNA_def_property(srna, "use_pose_ik_anchored", PROP_BOOLEAN, PROP_NONE);
3561 prop, "Keep Anchor Point", "Keep the position of the last segment in the IK chain fixed");
3562 RNA_def_property_update(prop, 0, "rna_Brush_update");
3563
3564 prop = RNA_def_property(srna, "use_pose_lock_rotation", PROP_BOOLEAN, PROP_NONE);
3567 "Lock Rotation When Scaling",
3568 "Do not rotate the segment when using the scale deform mode");
3569 RNA_def_property_update(prop, 0, "rna_Brush_update");
3570
3571 prop = RNA_def_property(srna, "use_connected_only", PROP_BOOLEAN, PROP_NONE);
3573 RNA_def_property_ui_text(prop, "Connected Only", "Affect only topologically connected elements");
3574 RNA_def_property_update(prop, 0, "rna_Brush_update");
3575
3576 prop = RNA_def_property(srna, "use_cloth_pin_simulation_boundary", PROP_BOOLEAN, PROP_NONE);
3579 prop,
3580 "Pin Simulation Boundary",
3581 "Lock the position of the vertices in the simulation falloff area to avoid artifacts and "
3582 "create a softer transition with unaffected areas");
3583 RNA_def_property_update(prop, 0, "rna_Brush_update");
3584
3585 prop = RNA_def_property(srna, "use_cloth_collision", PROP_BOOLEAN, PROP_NONE);
3587 RNA_def_property_ui_text(prop, "Enable Collision", "Collide with objects during the simulation");
3588 RNA_def_property_update(prop, 0, "rna_Brush_update");
3589
3590 prop = RNA_def_property(srna, "invert_to_scrape_fill", PROP_BOOLEAN, PROP_NONE);
3593 "Invert to Scrape or Fill",
3594 "Use Scrape or Fill brush when inverting this brush instead of "
3595 "inverting its displacement direction");
3596 RNA_def_property_update(prop, 0, "rna_Brush_update");
3597
3598 prop = RNA_def_property(srna, "use_pressure_strength", PROP_BOOLEAN, PROP_NONE);
3600 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
3602 prop, "Strength Pressure", "Enable tablet pressure sensitivity for strength");
3603 RNA_def_property_update(prop, 0, "rna_Brush_update");
3604
3605 prop = RNA_def_property(srna, "use_offset_pressure", PROP_BOOLEAN, PROP_NONE);
3607 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
3609 prop, "Plane Offset Pressure", "Enable tablet pressure sensitivity for offset");
3610 RNA_def_property_update(prop, 0, "rna_Brush_update");
3611
3612 prop = RNA_def_property(srna, "use_pressure_area_radius", PROP_BOOLEAN, PROP_NONE);
3614 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
3616 prop, "Area Radius Pressure", "Enable tablet pressure sensitivity for area radius");
3617 RNA_def_property_update(prop, 0, "rna_Brush_update");
3618
3619 prop = RNA_def_property(srna, "use_pressure_size", PROP_BOOLEAN, PROP_NONE);
3620 RNA_def_property_boolean_sdna(prop, nullptr, "flag", BRUSH_SIZE_PRESSURE);
3621 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
3622 RNA_def_property_ui_text(prop, "Size Pressure", "Enable tablet pressure sensitivity for size");
3623 RNA_def_property_update(prop, 0, "rna_Brush_update");
3624
3625 prop = RNA_def_property(srna, "use_pressure_jitter", PROP_BOOLEAN, PROP_NONE);
3627 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
3629 prop, "Jitter Pressure", "Enable tablet pressure sensitivity for jitter");
3630 RNA_def_property_update(prop, 0, "rna_Brush_update");
3631
3632 prop = RNA_def_property(srna, "use_pressure_spacing", PROP_BOOLEAN, PROP_NONE);
3634 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
3636 prop, "Spacing Pressure", "Enable tablet pressure sensitivity for spacing");
3637 RNA_def_property_update(prop, 0, "rna_Brush_update");
3638
3639 prop = RNA_def_property(srna, "use_pressure_masking", PROP_ENUM, PROP_NONE);
3640 RNA_def_property_enum_sdna(prop, nullptr, "mask_pressure");
3641 RNA_def_property_enum_items(prop, brush_mask_pressure_items);
3643 prop, "Mask Pressure Mode", "Pen pressure makes texture influence smaller");
3644 RNA_def_property_update(prop, 0, "rna_Brush_update");
3645
3646 prop = RNA_def_property(srna, "use_inverse_smooth_pressure", PROP_BOOLEAN, PROP_NONE);
3648 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
3650 prop, "Inverse Smooth Pressure", "Lighter pressure causes more smoothing to be applied");
3651 RNA_def_property_update(prop, 0, "rna_Brush_update");
3652
3653 prop = RNA_def_property(srna, "use_plane_trim", PROP_BOOLEAN, PROP_NONE);
3654 RNA_def_property_boolean_sdna(prop, nullptr, "flag", BRUSH_PLANE_TRIM);
3656 prop,
3657 "Use Plane Trim",
3658 "Limit the distance from the offset plane that a vertex can be affected");
3659 RNA_def_property_update(prop, 0, "rna_Brush_update");
3660
3661 prop = RNA_def_property(srna, "use_frontface", PROP_BOOLEAN, PROP_NONE);
3662 RNA_def_property_boolean_sdna(prop, nullptr, "flag", BRUSH_FRONTFACE);
3664 prop, "Use Front-Face", "Brush only affects vertices that face the viewer");
3665 RNA_def_property_update(prop, 0, "rna_Brush_update");
3666
3667 prop = RNA_def_property(srna, "use_frontface_falloff", PROP_BOOLEAN, PROP_NONE);
3670 prop, "Use Front-Face Falloff", "Blend brush influence by how much they face the front");
3671 RNA_def_property_update(prop, 0, "rna_Brush_update");
3672
3673 prop = RNA_def_property(srna, "use_anchor", PROP_BOOLEAN, PROP_NONE);
3674 RNA_def_property_boolean_sdna(prop, nullptr, "flag", BRUSH_ANCHORED);
3675 RNA_def_property_ui_text(prop, "Anchored", "Keep the brush anchored to the initial location");
3676 RNA_def_property_update(prop, 0, "rna_Brush_update");
3677
3678 prop = RNA_def_property(srna, "use_space", PROP_BOOLEAN, PROP_NONE);
3679 RNA_def_property_boolean_sdna(prop, nullptr, "flag", BRUSH_SPACE);
3681 prop, "Space", "Limit brush application to the distance specified by spacing");
3683 RNA_def_property_update(prop, 0, "rna_Brush_update");
3684
3685 prop = RNA_def_property(srna, "use_line", PROP_BOOLEAN, PROP_NONE);
3686 RNA_def_property_boolean_sdna(prop, nullptr, "flag", BRUSH_LINE);
3687 RNA_def_property_ui_text(prop, "Line", "Draw a line with dabs separated according to spacing");
3688 RNA_def_property_update(prop, 0, "rna_Brush_update");
3689
3690 prop = RNA_def_property(srna, "use_curve", PROP_BOOLEAN, PROP_NONE);
3691 RNA_def_property_boolean_sdna(prop, nullptr, "flag", BRUSH_CURVE);
3693 prop,
3694 "Curve",
3695 "Define the stroke curve with a Bézier curve. Dabs are separated according to spacing.");
3696 RNA_def_property_update(prop, 0, "rna_Brush_update");
3697
3698 prop = RNA_def_property(srna, "use_smooth_stroke", PROP_BOOLEAN, PROP_NONE);
3699 RNA_def_property_boolean_sdna(prop, nullptr, "flag", BRUSH_SMOOTH_STROKE);
3701 prop, "Smooth Stroke", "Brush lags behind mouse and follows a smoother path");
3702 RNA_def_property_update(prop, 0, "rna_Brush_update");
3703
3704 prop = RNA_def_property(srna, "use_persistent", PROP_BOOLEAN, PROP_NONE);
3705 RNA_def_property_boolean_sdna(prop, nullptr, "flag", BRUSH_PERSISTENT);
3706 RNA_def_property_ui_text(prop, "Persistent", "Sculpt on a persistent layer of the mesh");
3707 RNA_def_property_update(prop, 0, "rna_Brush_update");
3708
3709 prop = RNA_def_property(srna, "use_accumulate", PROP_BOOLEAN, PROP_NONE);
3710 RNA_def_property_boolean_sdna(prop, nullptr, "flag", BRUSH_ACCUMULATE);
3711 RNA_def_property_ui_text(prop, "Accumulate", "Accumulate stroke daubs on top of each other");
3712 RNA_def_property_update(prop, 0, "rna_Brush_update");
3713
3714 prop = RNA_def_property(srna, "use_space_attenuation", PROP_BOOLEAN, PROP_NONE);
3715 RNA_def_property_boolean_sdna(prop, nullptr, "flag", BRUSH_SPACE_ATTEN);
3717 prop,
3718 "Adjust Strength for Spacing",
3719 "Automatically adjust strength to give consistent results for different spacings");
3720 RNA_def_property_update(prop, 0, "rna_Brush_update");
3721
3722 /* adaptive space is not implemented yet */
3723 prop = RNA_def_property(srna, "use_adaptive_space", PROP_BOOLEAN, PROP_NONE);
3726 "Adaptive Spacing",
3727 "Space daubs according to surface orientation instead of screen space");
3728 RNA_def_property_update(prop, 0, "rna_Brush_update");
3729
3730 prop = RNA_def_property(srna, "use_locked_size", PROP_ENUM, PROP_NONE); /* as an enum */
3731 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flag");
3732 RNA_def_property_enum_items(prop, brush_size_unit_items);
3734 prop, "Radius Unit", "Measure brush size relative to the view or the scene");
3735 RNA_def_property_update(prop, 0, "rna_Brush_update");
3736
3737 prop = RNA_def_property(srna, "color_type", PROP_ENUM, PROP_NONE); /* as an enum */
3738 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flag");
3739 RNA_def_property_enum_items(prop, color_gradient_items);
3740 RNA_def_property_enum_funcs(prop, nullptr, "rna_Brush_use_gradient_set", nullptr);
3741 RNA_def_property_ui_text(prop, "Color Type", "Use single color or gradient when painting");
3742 RNA_def_property_update(prop, 0, "rna_Brush_update");
3743
3744 prop = RNA_def_property(srna, "use_edge_to_edge", PROP_BOOLEAN, PROP_NONE);
3745 RNA_def_property_boolean_sdna(prop, nullptr, "flag", BRUSH_EDGE_TO_EDGE);
3746 RNA_def_property_ui_text(prop, "Edge-to-Edge", "Drag anchor brush from edge-to-edge");
3747 RNA_def_property_update(prop, 0, "rna_Brush_update");
3748
3749 prop = RNA_def_property(srna, "use_restore_mesh", PROP_BOOLEAN, PROP_NONE);
3750 RNA_def_property_boolean_sdna(prop, nullptr, "flag", BRUSH_DRAG_DOT);
3751 RNA_def_property_ui_text(prop, "Restore Mesh", "Allow a single dot to be carefully positioned");
3752 RNA_def_property_update(prop, 0, "rna_Brush_update");
3753
3754 /* only for projection paint & vertex paint, TODO: other paint modes. */
3755 prop = RNA_def_property(srna, "use_alpha", PROP_BOOLEAN, PROP_NONE);
3758 prop, "Affect Alpha", "When this is disabled, lock alpha while painting");
3759 RNA_def_property_update(prop, 0, "rna_Brush_update");
3760
3761 prop = RNA_def_property(srna, "curve", PROP_POINTER, PROP_NONE);
3763 RNA_def_property_ui_text(prop, "Curve", "Editable falloff curve");
3764 RNA_def_property_update(prop, 0, "rna_Brush_update");
3765
3766 prop = RNA_def_property(srna, "paint_curve", PROP_POINTER, PROP_NONE);
3768 RNA_def_property_ui_text(prop, "Paint Curve", "Active paint curve");
3769 RNA_def_property_update(prop, 0, "rna_Brush_update");
3770
3771 prop = RNA_def_property(srna, "gradient", PROP_POINTER, PROP_NEVER_NULL);
3772 RNA_def_property_pointer_sdna(prop, nullptr, "gradient");
3773 RNA_def_property_struct_type(prop, "ColorRamp");
3774 RNA_def_property_ui_text(prop, "Gradient", "");
3775 RNA_def_property_update(prop, 0, "rna_Brush_update");
3776
3777 /* gradient source */
3778 prop = RNA_def_property(srna, "gradient_stroke_mode", PROP_ENUM, PROP_NONE);
3779 RNA_def_property_enum_items(prop, brush_gradient_items);
3780 RNA_def_property_ui_text(prop, "Gradient Stroke Mode", "");
3781 RNA_def_property_update(prop, 0, "rna_Brush_update");
3782
3783 prop = RNA_def_property(srna, "gradient_fill_mode", PROP_ENUM, PROP_NONE);
3784 RNA_def_property_enum_items(prop, brush_gradient_fill_items);
3785 RNA_def_property_ui_text(prop, "Gradient Fill Mode", "");
3786 RNA_def_property_update(prop, 0, "rna_Brush_update");
3787
3788 /* overlay flags */
3789 prop = RNA_def_property(srna, "use_primary_overlay", PROP_BOOLEAN, PROP_NONE);
3790 RNA_def_property_boolean_sdna(prop, nullptr, "overlay_flags", BRUSH_OVERLAY_PRIMARY);
3791 RNA_def_property_ui_text(prop, "Use Texture Overlay", "Show texture in viewport");
3792 RNA_def_property_update(prop, 0, "rna_Brush_update");
3793
3794 prop = RNA_def_property(srna, "use_secondary_overlay", PROP_BOOLEAN, PROP_NONE);
3795 RNA_def_property_boolean_sdna(prop, nullptr, "overlay_flags", BRUSH_OVERLAY_SECONDARY);
3796 RNA_def_property_ui_text(prop, "Use Texture Overlay", "Show texture in viewport");
3797 RNA_def_property_update(prop, 0, "rna_Brush_update");
3798
3799 prop = RNA_def_property(srna, "use_cursor_overlay", PROP_BOOLEAN, PROP_NONE);
3800 RNA_def_property_boolean_sdna(prop, nullptr, "overlay_flags", BRUSH_OVERLAY_CURSOR);
3801 RNA_def_property_ui_text(prop, "Use Cursor Overlay", "Show cursor in viewport");
3802 RNA_def_property_update(prop, 0, "rna_Brush_update");
3803
3804 prop = RNA_def_property(srna, "use_cursor_overlay_override", PROP_BOOLEAN, PROP_NONE);
3806 prop, nullptr, "overlay_flags", BRUSH_OVERLAY_CURSOR_OVERRIDE_ON_STROKE);
3807 RNA_def_property_ui_text(prop, "Override Overlay", "Don't show overlay during a stroke");
3808 RNA_def_property_update(prop, 0, "rna_Brush_update");
3809
3810 prop = RNA_def_property(srna, "use_primary_overlay_override", PROP_BOOLEAN, PROP_NONE);
3812 prop, nullptr, "overlay_flags", BRUSH_OVERLAY_PRIMARY_OVERRIDE_ON_STROKE);
3813 RNA_def_property_ui_text(prop, "Override Overlay", "Don't show overlay during a stroke");
3814 RNA_def_property_update(prop, 0, "rna_Brush_update");
3815
3816 prop = RNA_def_property(srna, "use_secondary_overlay_override", PROP_BOOLEAN, PROP_NONE);
3818 prop, nullptr, "overlay_flags", BRUSH_OVERLAY_SECONDARY_OVERRIDE_ON_STROKE);
3819 RNA_def_property_ui_text(prop, "Override Overlay", "Don't show overlay during a stroke");
3820 RNA_def_property_update(prop, 0, "rna_Brush_update");
3821
3822 /* paint mode flags */
3823 prop = RNA_def_property(srna, "use_paint_sculpt", PROP_BOOLEAN, PROP_NONE);
3824 RNA_def_property_boolean_sdna(prop, nullptr, "ob_mode", OB_MODE_SCULPT);
3825 RNA_def_property_ui_text(prop, "Use Sculpt", "Use this brush in sculpt mode");
3826 RNA_def_property_update(prop, 0, "rna_Brush_update");
3827
3828 prop = RNA_def_property(srna, "use_paint_uv_sculpt", PROP_BOOLEAN, PROP_NONE);
3829 RNA_def_property_boolean_sdna(prop, nullptr, "ob_mode", OB_MODE_EDIT);
3830 RNA_def_property_ui_text(prop, "Use UV Sculpt", "Use this brush in UV sculpt mode");
3831 RNA_def_property_update(prop, 0, "rna_Brush_update");
3832
3833 prop = RNA_def_property(srna, "use_paint_vertex", PROP_BOOLEAN, PROP_NONE);
3834 RNA_def_property_boolean_sdna(prop, nullptr, "ob_mode", OB_MODE_VERTEX_PAINT);
3835 RNA_def_property_ui_text(prop, "Use Vertex", "Use this brush in vertex paint mode");
3836 RNA_def_property_update(prop, 0, "rna_Brush_update");
3837
3838 prop = RNA_def_property(srna, "use_paint_weight", PROP_BOOLEAN, PROP_NONE);
3839 RNA_def_property_boolean_sdna(prop, nullptr, "ob_mode", OB_MODE_WEIGHT_PAINT);
3840 RNA_def_property_ui_text(prop, "Use Weight", "Use this brush in weight paint mode");
3841 RNA_def_property_update(prop, 0, "rna_Brush_update");
3842
3843 prop = RNA_def_property(srna, "use_paint_image", PROP_BOOLEAN, PROP_NONE);
3844 RNA_def_property_boolean_sdna(prop, nullptr, "ob_mode", OB_MODE_TEXTURE_PAINT);
3845 RNA_def_property_ui_text(prop, "Use Texture", "Use this brush in texture paint mode");
3846 RNA_def_property_update(prop, 0, "rna_Brush_update");
3847
3848 prop = RNA_def_property(srna, "use_paint_grease_pencil", PROP_BOOLEAN, PROP_NONE);
3850 RNA_def_property_ui_text(prop, "Use Paint", "Use this brush in Grease Pencil drawing mode");
3851 RNA_def_property_update(prop, 0, "rna_Brush_update");
3852
3853 prop = RNA_def_property(srna, "use_vertex_grease_pencil", PROP_BOOLEAN, PROP_NONE);
3856 prop, "Use Vertex", "Use this brush in Grease Pencil vertex color mode");
3857 RNA_def_property_update(prop, 0, "rna_Brush_update");
3858
3859 prop = RNA_def_property(srna, "use_paint_sculpt_curves", PROP_BOOLEAN, PROP_NONE);
3860 RNA_def_property_boolean_sdna(prop, nullptr, "ob_mode", OB_MODE_SCULPT_CURVES);
3861 RNA_def_property_ui_text(prop, "Use Sculpt", "Use this brush in sculpt curves mode");
3862 RNA_def_property_update(prop, 0, "rna_Brush_update");
3863
3864 /* texture */
3865 prop = RNA_def_property(srna, "texture_slot", PROP_POINTER, PROP_NONE);
3866 RNA_def_property_struct_type(prop, "BrushTextureSlot");
3867 RNA_def_property_pointer_sdna(prop, nullptr, "mtex");
3869 RNA_def_property_ui_text(prop, "Texture Slot", "");
3870
3871 prop = RNA_def_property(srna, "texture", PROP_POINTER, PROP_NONE);
3872 RNA_def_property_pointer_sdna(prop, nullptr, "mtex.tex");
3874 RNA_def_property_ui_text(prop, "Texture", "");
3875 RNA_def_property_update(prop, NC_TEXTURE, "rna_Brush_main_tex_update");
3876
3877 prop = RNA_def_property(srna, "mask_texture_slot", PROP_POINTER, PROP_NONE);
3878 RNA_def_property_struct_type(prop, "BrushTextureSlot");
3879 RNA_def_property_pointer_sdna(prop, nullptr, "mask_mtex");
3881 RNA_def_property_ui_text(prop, "Mask Texture Slot", "");
3882
3883 prop = RNA_def_property(srna, "mask_texture", PROP_POINTER, PROP_NONE);
3884 RNA_def_property_pointer_sdna(prop, nullptr, "mask_mtex.tex");
3886 RNA_def_property_ui_text(prop, "Mask Texture", "");
3887 RNA_def_property_update(prop, NC_TEXTURE, "rna_Brush_secondary_tex_update");
3888
3889 prop = RNA_def_property(srna, "texture_overlay_alpha", PROP_INT, PROP_PERCENTAGE);
3890 RNA_def_property_int_sdna(prop, nullptr, "texture_overlay_alpha");
3891 RNA_def_property_range(prop, 0, 100);
3892 RNA_def_property_ui_text(prop, "Texture Overlay Alpha", "");
3893 RNA_def_property_update(prop, 0, "rna_Brush_update");
3894
3895 prop = RNA_def_property(srna, "mask_overlay_alpha", PROP_INT, PROP_PERCENTAGE);
3896 RNA_def_property_int_sdna(prop, nullptr, "mask_overlay_alpha");
3897 RNA_def_property_range(prop, 0, 100);
3898 RNA_def_property_ui_text(prop, "Mask Texture Overlay Alpha", "");
3899 RNA_def_property_update(prop, 0, "rna_Brush_update");
3900
3901 prop = RNA_def_property(srna, "cursor_overlay_alpha", PROP_INT, PROP_PERCENTAGE);
3902 RNA_def_property_int_sdna(prop, nullptr, "cursor_overlay_alpha");
3903 RNA_def_property_range(prop, 0, 100);
3904 RNA_def_property_ui_text(prop, "Mask Texture Overlay Alpha", "");
3905 RNA_def_property_update(prop, 0, "rna_Brush_update");
3906
3907 prop = RNA_def_property(srna, "cursor_color_add", PROP_FLOAT, PROP_COLOR_GAMMA);
3908 RNA_def_property_float_sdna(prop, nullptr, "add_col");
3909 RNA_def_property_array(prop, 4);
3910 RNA_def_property_ui_text(prop, "Add Color", "Color of cursor when adding");
3911 RNA_def_property_update(prop, 0, "rna_Brush_update");
3912
3913 prop = RNA_def_property(srna, "cursor_color_subtract", PROP_FLOAT, PROP_COLOR_GAMMA);
3914 RNA_def_property_float_sdna(prop, nullptr, "sub_col");
3915 RNA_def_property_array(prop, 4);
3916 RNA_def_property_ui_text(prop, "Subtract Color", "Color of cursor when subtracting");
3917 RNA_def_property_update(prop, 0, "rna_Brush_update");
3918
3919 prop = RNA_def_property(srna, "use_custom_icon", PROP_BOOLEAN, PROP_NONE);
3920 RNA_def_property_boolean_sdna(prop, nullptr, "flag", BRUSH_CUSTOM_ICON);
3921 RNA_def_property_ui_text(prop, "Custom Icon", "Set the brush icon from an image file");
3922 RNA_def_property_update(prop, 0, "rna_Brush_icon_update");
3923
3924 prop = RNA_def_property(srna, "icon_filepath", PROP_STRING, PROP_FILEPATH);
3926 RNA_def_property_string_sdna(prop, nullptr, "icon_filepath");
3927 RNA_def_property_ui_text(prop, "Brush Icon Filepath", "File path to brush icon");
3928 RNA_def_property_update(prop, 0, "rna_Brush_icon_update");
3929
3930 prop = RNA_def_property(srna, "brush_capabilities", PROP_POINTER, PROP_NONE);
3932 RNA_def_property_struct_type(prop, "BrushCapabilities");
3933 RNA_def_property_pointer_funcs(prop, "rna_Brush_capabilities_get", nullptr, nullptr, nullptr);
3934 RNA_def_property_ui_text(prop, "Brush Capabilities", "Brush's capabilities");
3935
3936 /* brush capabilities (mode-dependent) */
3937 prop = RNA_def_property(srna, "sculpt_capabilities", PROP_POINTER, PROP_NONE);
3939 RNA_def_property_struct_type(prop, "BrushCapabilitiesSculpt");
3941 prop, "rna_Sculpt_brush_capabilities_get", nullptr, nullptr, nullptr);
3942 RNA_def_property_ui_text(prop, "Sculpt Capabilities", "");
3943
3944 prop = RNA_def_property(srna, "image_paint_capabilities", PROP_POINTER, PROP_NONE);
3946 RNA_def_property_struct_type(prop, "BrushCapabilitiesImagePaint");
3948 prop, "rna_Imapaint_brush_capabilities_get", nullptr, nullptr, nullptr);
3949 RNA_def_property_ui_text(prop, "Image Paint Capabilities", "");
3950
3951 prop = RNA_def_property(srna, "vertex_paint_capabilities", PROP_POINTER, PROP_NONE);
3953 RNA_def_property_struct_type(prop, "BrushCapabilitiesVertexPaint");
3955 prop, "rna_Vertexpaint_brush_capabilities_get", nullptr, nullptr, nullptr);
3956 RNA_def_property_ui_text(prop, "Vertex Paint Capabilities", "");
3957
3958 prop = RNA_def_property(srna, "weight_paint_capabilities", PROP_POINTER, PROP_NONE);
3960 RNA_def_property_struct_type(prop, "BrushCapabilitiesWeightPaint");
3962 prop, "rna_Weightpaint_brush_capabilities_get", nullptr, nullptr, nullptr);
3963 RNA_def_property_ui_text(prop, "Weight Paint Capabilities", "");
3964
3965 prop = RNA_def_property(srna, "gpencil_settings", PROP_POINTER, PROP_NONE);
3966 RNA_def_property_struct_type(prop, "BrushGpencilSettings");
3967 RNA_def_property_pointer_sdna(prop, nullptr, "gpencil_settings");
3969 RNA_def_property_ui_text(prop, "Gpencil Settings", "");
3970
3971 prop = RNA_def_property(srna, "curves_sculpt_settings", PROP_POINTER, PROP_NONE);
3972 RNA_def_property_struct_type(prop, "BrushCurvesSculptSettings");
3974 RNA_def_property_ui_text(prop, "Curves Sculpt Settings", "");
3975}
3976
3988{
3989 StructRNA *srna;
3990 PropertyRNA *prop;
3991
3992 srna = RNA_def_struct(brna, "OperatorStrokeElement", "PropertyGroup");
3993 RNA_def_struct_ui_text(srna, "Operator Stroke Element", "");
3994
3995 prop = RNA_def_property(srna, "location", PROP_FLOAT, PROP_XYZ);
3997 RNA_def_property_array(prop, 3);
3998 RNA_def_property_ui_text(prop, "Location", "");
3999
4000 prop = RNA_def_property(srna, "mouse", PROP_FLOAT, PROP_XYZ);
4002 RNA_def_property_array(prop, 2);
4003 RNA_def_property_ui_text(prop, "Mouse", "");
4004
4005 prop = RNA_def_property(srna, "mouse_event", PROP_FLOAT, PROP_XYZ);
4007 RNA_def_property_array(prop, 2);
4008 RNA_def_property_ui_text(prop, "Mouse Event", "");
4009
4010 prop = RNA_def_property(srna, "pressure", PROP_FLOAT, PROP_FACTOR);
4012 RNA_def_property_range(prop, 0.0f, 1.0f);
4013 RNA_def_property_ui_text(prop, "Pressure", "Tablet pressure");
4014
4015 prop = RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE);
4017 RNA_def_property_range(prop, 0.0f, FLT_MAX);
4018 RNA_def_property_ui_text(prop, "Brush Size", "Brush size in screen space");
4019
4020 prop = RNA_def_property(srna, "x_tilt", PROP_FLOAT, PROP_FACTOR);
4022 RNA_def_property_range(prop, -1.0f, 1.0f);
4023 RNA_def_property_ui_text(prop, "Tilt X", "Pen tilt from left (-1.0) to right (+1.0)");
4024
4025 prop = RNA_def_property(srna, "y_tilt", PROP_FLOAT, PROP_FACTOR);
4027 RNA_def_property_range(prop, -1.0f, 1.0f);
4028 RNA_def_property_ui_text(prop, "Tilt Y", "Pen tilt from backward (-1.0) to forward (+1.0)");
4029
4030 /* used in uv painting */
4031 prop = RNA_def_property(srna, "time", PROP_FLOAT, PROP_UNSIGNED);
4033 RNA_def_property_ui_text(prop, "Time", "");
4034
4035 /* used for Grease Pencil sketching sessions */
4036 prop = RNA_def_property(srna, "is_start", PROP_BOOLEAN, PROP_NONE);
4038 RNA_def_property_ui_text(prop, "Is Stroke Start", "");
4039
4040 /* XXX: Tool (this will be for pressing a modifier key for a different brush,
4041 * e.g. switching to a Smooth brush in the middle of the stroke */
4042
4043 /* XXX: i don't think blender currently supports the ability to properly do a remappable modifier
4044 * in the middle of a stroke */
4045}
4046
4060
4061#endif
void BKE_brush_scale_size(int *r_brush_size, float new_unprojected_radius, float old_unprojected_radius)
Definition brush.cc:1328
void BKE_brush_scale_unprojected_radius(float *unprojected_radius, int new_brush_size, int old_brush_size)
Definition brush.cc:1316
void BKE_brush_tag_unsaved_changes(Brush *brush)
Definition brush.cc:720
ColorBand * BKE_colorband_add(bool rangetype)
Definition colorband.cc:297
Scene * CTX_data_scene(const bContext *C)
Main * CTX_data_main(const bContext *C)
ToolSettings * CTX_data_tool_settings(const bContext *C)
ViewLayer * CTX_data_view_layer(const bContext *C)
#define GPENCIL_USE_VERTEX_COLOR(toolsettings)
void BKE_gpencil_brush_material_set(struct Brush *brush, struct Material *material)
void BKE_icon_id_delete(struct ID *id)
Definition icons.cc:437
void BKE_icon_changed(int icon_id)
Definition icons.cc:204
int BKE_icon_id_ensure(struct ID *id)
Definition icons.cc:267
void BKE_view_layer_synced_ensure(const Scene *scene, ViewLayer *view_layer)
Object * BKE_view_layer_active_object_get(const ViewLayer *view_layer)
General operations, lookup, etc. for materials.
Material * BKE_object_material_get(Object *ob, short act)
void BKE_paint_invalidate_overlay_tex(Scene *scene, ViewLayer *view_layer, const Tex *tex)
Definition paint.cc:250
PaintMode
Definition BKE_paint.hh:93
PaintMode BKE_paintmode_get_active_from_context(const bContext *C)
Definition paint.cc:496
void BKE_paint_invalidate_overlay_all()
Definition paint.cc:283
void BKE_previewimg_id_free(ID *id)
#define BLI_assert(a)
Definition BLI_assert.h:46
#define M_PI_2
#define M_PI
#define BLI_STR_UTF8_DEGREE_SIGN
#define ELEM(...)
#define BLT_I18NCONTEXT_AMOUNT
#define BLT_I18NCONTEXT_ID_BRUSH
#define BLT_I18NCONTEXT_ID_CURVES
#define BLT_I18NCONTEXT_ID_CURVE_LEGACY
#define BLT_I18NCONTEXT_ID_GPENCIL
#define BLT_I18NCONTEXT_OPERATOR_DEFAULT
#define BLT_I18NCONTEXT_ID_MASK
@ GPVERTEX_BRUSH_TYPE_BLUR
@ GPVERTEX_BRUSH_TYPE_DRAW
@ GPVERTEX_BRUSH_TYPE_REPLACE
@ GPVERTEX_BRUSH_TYPE_AVERAGE
@ GPVERTEX_BRUSH_TYPE_SMEAR
@ 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
@ GPAINT_BRUSH_TYPE_TINT
@ GPAINT_BRUSH_TYPE_FILL
@ GPAINT_BRUSH_TYPE_DRAW
@ GPAINT_BRUSH_TYPE_ERASE
@ BRUSH_PLANE_INVERT_DISPLACEMENT
@ BRUSH_PLANE_SWAP_HEIGHT_AND_DEPTH
@ KERNEL_BOX
@ KERNEL_GAUSSIAN
@ SCULPT_DISP_DIR_VIEW
@ SCULPT_DISP_DIR_X
@ SCULPT_DISP_DIR_Z
@ SCULPT_DISP_DIR_Y
@ SCULPT_DISP_DIR_AREA
@ GP_FILL_DMODE_STROKE
@ GP_FILL_DMODE_CONTROL
@ GP_FILL_DMODE_BOTH
@ WPAINT_BRUSH_TYPE_BLUR
@ WPAINT_BRUSH_TYPE_AVERAGE
@ WPAINT_BRUSH_TYPE_DRAW
@ WPAINT_BRUSH_TYPE_SMEAR
@ GP_SCULPT_FLAGMODE_APPLY_UV
@ GP_SCULPT_FLAGMODE_APPLY_POSITION
@ GP_SCULPT_FLAGMODE_APPLY_THICKNESS
@ GP_SCULPT_FLAGMODE_APPLY_STRENGTH
@ BRUSH_CURVE_CUSTOM
@ BRUSH_CURVE_SHARP
@ BRUSH_CURVE_INVSQUARE
@ BRUSH_CURVE_SPHERE
@ BRUSH_CURVE_CONSTANT
@ BRUSH_CURVE_POW4
@ BRUSH_CURVE_ROOT
@ BRUSH_CURVE_SMOOTH
@ BRUSH_CURVE_SMOOTHER
@ BRUSH_CURVE_LIN
@ BRUSH_AUTOMASKING_BRUSH_NORMAL
@ BRUSH_AUTOMASKING_CAVITY_NORMAL
@ BRUSH_AUTOMASKING_VIEW_OCCLUSION
@ BRUSH_AUTOMASKING_BOUNDARY_EDGES
@ BRUSH_AUTOMASKING_CAVITY_USE_CURVE
@ BRUSH_AUTOMASKING_BOUNDARY_FACE_SETS
@ BRUSH_AUTOMASKING_FACE_SETS
@ BRUSH_AUTOMASKING_VIEW_NORMAL
@ BRUSH_AUTOMASKING_TOPOLOGY
@ BRUSH_AUTOMASKING_CAVITY_INVERTED
@ BRUSH_DEFORM_TARGET_CLOTH_SIM
@ BRUSH_DEFORM_TARGET_GEOMETRY
@ BRUSH_POSE_DEFORM_SQUASH_STRETCH
@ BRUSH_POSE_DEFORM_ROTATE_TWIST
@ BRUSH_POSE_DEFORM_SCALE_TRASLATE
@ BRUSH_SMEAR_DEFORM_PINCH
@ BRUSH_SMEAR_DEFORM_EXPAND
@ BRUSH_SMEAR_DEFORM_DRAG
@ GP_FILL_EMODE_RADIUS
@ GP_FILL_EMODE_EXTEND
@ SCULPT_BRUSH_TYPE_DRAW_SHARP
@ SCULPT_BRUSH_TYPE_THUMB
@ SCULPT_BRUSH_TYPE_GRAB
@ SCULPT_BRUSH_TYPE_BOUNDARY
@ SCULPT_BRUSH_TYPE_DISPLACEMENT_SMEAR
@ SCULPT_BRUSH_TYPE_MASK
@ SCULPT_BRUSH_TYPE_DRAW_FACE_SETS
@ SCULPT_BRUSH_TYPE_DRAW
@ SCULPT_BRUSH_TYPE_NUDGE
@ SCULPT_BRUSH_TYPE_CLAY
@ SCULPT_BRUSH_TYPE_CLOTH
@ SCULPT_BRUSH_TYPE_PINCH
@ SCULPT_BRUSH_TYPE_SMEAR
@ SCULPT_BRUSH_TYPE_POSE
@ SCULPT_BRUSH_TYPE_CLAY_THUMB
@ SCULPT_BRUSH_TYPE_MULTIPLANE_SCRAPE
@ SCULPT_BRUSH_TYPE_SIMPLIFY
@ SCULPT_BRUSH_TYPE_SNAKE_HOOK
@ SCULPT_BRUSH_TYPE_CREASE
@ SCULPT_BRUSH_TYPE_LAYER
@ SCULPT_BRUSH_TYPE_SLIDE_RELAX
@ SCULPT_BRUSH_TYPE_ELASTIC_DEFORM
@ SCULPT_BRUSH_TYPE_SMOOTH
@ SCULPT_BRUSH_TYPE_PAINT
@ SCULPT_BRUSH_TYPE_DISPLACEMENT_ERASER
@ SCULPT_BRUSH_TYPE_PLANE
@ SCULPT_BRUSH_TYPE_INFLATE
@ SCULPT_BRUSH_TYPE_BLOB
@ SCULPT_BRUSH_TYPE_ROTATE
@ SCULPT_BRUSH_TYPE_CLAY_STRIPS
@ GP_BRUSH_MODE_VERTEXCOLOR
@ GP_BRUSH_MODE_MATERIAL
@ GP_BRUSH_MODE_ACTIVE
@ GP_BRUSH_FILL_SHOW_HELPLINES
@ GP_BRUSH_ERASER_KEEP_CAPS
@ GP_BRUSH_STABILIZE_MOUSE
@ GP_BRUSH_GROUP_RANDOM
@ GP_BRUSH_DISSABLE_LASSO
@ GP_BRUSH_OUTLINE_STROKE
@ GP_BRUSH_FILL_HIDE
@ GP_BRUSH_TRIM_STROKE
@ GP_BRUSH_ACTIVE_LAYER_ONLY
@ GP_BRUSH_FILL_AUTO_REMOVE_FILL_GUIDES
@ GP_BRUSH_OCCLUDE_ERASER
@ GP_BRUSH_USE_STRENGTH_PRESSURE
@ GP_BRUSH_GROUP_SETTINGS
@ GP_BRUSH_FILL_STROKE_COLLIDE
@ 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
@ IMAGE_PAINT_BRUSH_TYPE_MASK
@ IMAGE_PAINT_BRUSH_TYPE_FILL
@ IMAGE_PAINT_BRUSH_TYPE_DRAW
@ IMAGE_PAINT_BRUSH_TYPE_CLONE
@ IMAGE_PAINT_BRUSH_TYPE_SOFTEN
@ IMAGE_PAINT_BRUSH_TYPE_SMEAR
@ 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_COLOR_JITTER_USE_VAL_AT_STROKE
@ BRUSH_COLOR_JITTER_USE_HUE_AT_STROKE
@ BRUSH_COLOR_JITTER_USE_SAT_AT_STROKE
@ BRUSH_COLOR_JITTER_USE_SAT_RAND_PRESS
@ BRUSH_COLOR_JITTER_USE_VAL_RAND_PRESS
@ BRUSH_COLOR_JITTER_USE_HUE_RAND_PRESS
@ VPAINT_BRUSH_TYPE_AVERAGE
@ VPAINT_BRUSH_TYPE_DRAW
@ VPAINT_BRUSH_TYPE_SMEAR
@ VPAINT_BRUSH_TYPE_BLUR
@ BRUSH_SNAKE_HOOK_DEFORM_ELASTIC
@ BRUSH_SNAKE_HOOK_DEFORM_FALLOFF
@ BRUSH_MASK_PRESSURE_RAMP
@ BRUSH_MASK_PRESSURE_CUTOFF
@ GP_BRUSH_ERASER_SOFT
@ GP_BRUSH_ERASER_STROKE
@ GP_BRUSH_ERASER_HARD
@ 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
@ BRUSH_SMOOTH_DEFORM_SURFACE
@ BRUSH_SMOOTH_DEFORM_LAPLACIAN
@ 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_RADIUS
@ 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
@ 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_USE_COLOR_AS_DISPLACEMENT
@ 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_JITTER_COLOR
@ 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
@ GPWEIGHT_BRUSH_TYPE_AVERAGE
@ GPWEIGHT_BRUSH_TYPE_DRAW
@ GPWEIGHT_BRUSH_TYPE_SMEAR
@ GPWEIGHT_BRUSH_TYPE_BLUR
@ GPSCULPT_BRUSH_TYPE_SMOOTH
@ GPSCULPT_BRUSH_TYPE_PUSH
@ GPSCULPT_BRUSH_TYPE_CLONE
@ GPSCULPT_BRUSH_TYPE_TWIST
@ GPSCULPT_BRUSH_TYPE_RANDOMIZE
@ GPSCULPT_BRUSH_TYPE_GRAB
@ GPSCULPT_BRUSH_TYPE_PINCH
@ GPSCULPT_BRUSH_TYPE_THICKNESS
@ GPSCULPT_BRUSH_TYPE_STRENGTH
@ 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
@ 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
@ CURVES_SCULPT_BRUSH_TYPE_SMOOTH
@ CURVES_SCULPT_BRUSH_TYPE_PUFF
@ CURVES_SCULPT_BRUSH_TYPE_GROW_SHRINK
@ CURVES_SCULPT_BRUSH_TYPE_PINCH
@ CURVES_SCULPT_BRUSH_TYPE_SNAKE_HOOK
@ CURVES_SCULPT_BRUSH_TYPE_ADD
@ CURVES_SCULPT_BRUSH_TYPE_COMB
@ CURVES_SCULPT_BRUSH_TYPE_DENSITY
@ CURVES_SCULPT_BRUSH_TYPE_DELETE
@ CURVES_SCULPT_BRUSH_TYPE_SLIDE
@ CURVES_SCULPT_BRUSH_TYPE_SELECTION_PAINT
#define AUTOMASKING_BOUNDARY_EDGES_MAX_PROPAGATION_STEPS
#define GPENCIL_MIN_FILL_FAC
#define GP_MAX_INPUT_SAMPLES
#define GPENCIL_MAX_FILL_FAC
@ OB_MODE_VERTEX_GREASE_PENCIL
@ OB_MODE_EDIT
@ OB_MODE_WEIGHT_PAINT
@ OB_MODE_SCULPT
@ OB_MODE_SCULPT_CURVES
@ OB_MODE_PAINT_GREASE_PENCIL
@ OB_MODE_TEXTURE_PAINT
@ OB_MODE_VERTEX_PAINT
#define PAINT_MAX_INPUT_SAMPLES
@ MTEX_MAP_MODE_AREA
@ MTEX_MAP_MODE_3D
@ MTEX_MAP_MODE_STENCIL
@ MTEX_MAP_MODE_TILED
@ MTEX_MAP_MODE_RANDOM
@ MTEX_MAP_MODE_VIEW
@ MTEX_ANGLE_RANDOM
@ MTEX_ANGLE_RAKE
@ IMB_BLEND_EXCLUSION
Definition IMB_imbuf.hh:205
@ IMB_BLEND_DIFFERENCE
Definition IMB_imbuf.hh:204
@ IMB_BLEND_HARDLIGHT
Definition IMB_imbuf.hh:195
@ IMB_BLEND_COLORBURN
Definition IMB_imbuf.hh:196
@ IMB_BLEND_COLORDODGE
Definition IMB_imbuf.hh:198
@ IMB_BLEND_ERASE_ALPHA
Definition IMB_imbuf.hh:192
@ IMB_BLEND_SCREEN
Definition IMB_imbuf.hh:199
@ IMB_BLEND_HUE
Definition IMB_imbuf.hh:206
@ IMB_BLEND_MUL
Definition IMB_imbuf.hh:189
@ IMB_BLEND_ADD_ALPHA
Definition IMB_imbuf.hh:193
@ IMB_BLEND_DARKEN
Definition IMB_imbuf.hh:191
@ IMB_BLEND_OVERLAY
Definition IMB_imbuf.hh:194
@ IMB_BLEND_SATURATION
Definition IMB_imbuf.hh:207
@ IMB_BLEND_VIVIDLIGHT
Definition IMB_imbuf.hh:202
@ IMB_BLEND_LUMINOSITY
Definition IMB_imbuf.hh:208
@ IMB_BLEND_LIGHTEN
Definition IMB_imbuf.hh:190
@ IMB_BLEND_SOFTLIGHT
Definition IMB_imbuf.hh:200
@ IMB_BLEND_COLOR
Definition IMB_imbuf.hh:209
@ IMB_BLEND_LINEARLIGHT
Definition IMB_imbuf.hh:203
@ IMB_BLEND_PINLIGHT
Definition IMB_imbuf.hh:201
@ IMB_BLEND_MIX
Definition IMB_imbuf.hh:186
@ IMB_BLEND_ADD
Definition IMB_imbuf.hh:187
@ IMB_BLEND_SUB
Definition IMB_imbuf.hh:188
@ IMB_BLEND_LINEARBURN
Definition IMB_imbuf.hh:197
void IMB_freeImBuf(ImBuf *ibuf)
ParameterFlag
Definition RNA_types.hh:510
@ PROP_FLOAT
Definition RNA_types.hh:152
@ PROP_BOOLEAN
Definition RNA_types.hh:150
@ PROP_ENUM
Definition RNA_types.hh:154
@ PROP_INT
Definition RNA_types.hh:151
@ PROP_STRING
Definition RNA_types.hh:153
@ PROP_POINTER
Definition RNA_types.hh:155
#define RNA_ENUM_ITEM_SEPR
Definition RNA_types.hh:645
@ PROPOVERRIDE_OVERRIDABLE_LIBRARY
Definition RNA_types.hh:469
@ PROP_CONTEXT_UPDATE
Definition RNA_types.hh:381
@ PROP_ANIMATABLE
Definition RNA_types.hh:305
@ PROP_PATH_SUPPORTS_BLEND_RELATIVE
Definition RNA_types.hh:430
@ PROP_EDITABLE
Definition RNA_types.hh:292
@ PROP_NEVER_NULL
Definition RNA_types.hh:351
@ PROP_ID_SELF_CHECK
Definition RNA_types.hh:344
@ PROP_IDPROPERTY
Definition RNA_types.hh:400
@ PROP_XYZ
Definition RNA_types.hh:257
@ PROP_DISTANCE
Definition RNA_types.hh:244
@ PROP_PIXEL
Definition RNA_types.hh:236
@ PROP_ANGLE
Definition RNA_types.hh:240
@ PROP_NONE
Definition RNA_types.hh:221
@ PROP_PERCENTAGE
Definition RNA_types.hh:238
@ PROP_FACTOR
Definition RNA_types.hh:239
@ PROP_COLOR_GAMMA
Definition RNA_types.hh:260
@ PROP_UNSIGNED
Definition RNA_types.hh:237
@ PROP_FILEPATH
Definition RNA_types.hh:224
#define C
Definition RandGen.cpp:29
@ BIFICONID_LAST_STATIC
#define NC_BRUSH
Definition WM_types.hh:382
#define ND_DATA
Definition WM_types.hh:506
#define ND_SPACE_PROPERTIES
Definition WM_types.hh:526
#define NC_SCENE
Definition WM_types.hh:375
#define ND_TOOLSETTINGS
Definition WM_types.hh:446
#define ND_SPACE_IMAGE
Definition WM_types.hh:519
#define NA_EDITED
Definition WM_types.hh:581
#define NC_GPENCIL
Definition WM_types.hh:396
#define NC_TEXTURE
Definition WM_types.hh:378
#define NC_SPACE
Definition WM_types.hh:389
#define INT32_MAX
bool supports_sculpt_plane(const Brush &brush)
Definition brush.cc:1783
bool supports_secondary_cursor_color(const Brush &brush)
Definition brush.cc:1796
bool supports_auto_smooth(const Brush &brush)
Definition brush.cc:1715
bool supports_jitter(const Brush &brush)
Definition brush.cc:1736
bool supports_space_attenuation(const Brush &brush)
Definition brush.cc:1821
bool supports_persistence(const Brush &brush)
Definition brush.cc:1756
bool supports_tilt(const Brush &brush)
Definition brush.cc:1864
bool supports_inverted_direction(const Brush &brush)
Definition brush.cc:1834
bool supports_rake_factor(const Brush &brush)
Definition brush.cc:1752
bool supports_plane_depth(const Brush &brush)
Definition brush.cc:1732
bool supports_accumulate(const Brush &brush)
Definition brush.cc:1689
bool supports_gravity(const Brush &brush)
Definition brush.cc:1851
bool supports_smooth_stroke(const Brush &brush)
Definition brush.cc:1811
bool supports_plane_offset(const Brush &brush)
Definition brush.cc:1767
bool supports_pinch_factor(const Brush &brush)
Definition brush.cc:1760
bool supports_color(const Brush &brush)
Definition brush.cc:1792
bool supports_random_texture_angle(const Brush &brush)
Definition brush.cc:1775
bool supports_strength_pressure(const Brush &brush)
Definition brush.cc:1830
bool supports_dyntopo(const Brush &brush)
Definition brush.cc:1665
bool supports_height(const Brush &brush)
Definition brush.cc:1724
bool supports_topology_rake(const Brush &brush)
Definition brush.cc:1704
bool supports_plane_height(const Brush &brush)
Definition brush.cc:1728
bool supports_normal_weight(const Brush &brush)
Definition brush.cc:1745
PointerRNA RNA_pointer_create_with_parent(const PointerRNA &parent, StructRNA *type, void *data)
#define TEXTURE_CAPABILITY(prop_name_, ui_name_)
static EnumPropertyItem rna_enum_gpencil_brush_eraser_modes_items[]
Definition rna_brush.cc:331
static void rna_def_gpencil_options(BlenderRNA *brna)
#define IMAPAINT_BRUSH_CAPABILITY(prop_name_, ui_name_)
#define SCULPT_BRUSH_CAPABILITY(prop_name_, ui_name_)
static void rna_def_sculpt_capabilities(BlenderRNA *brna)
static void rna_def_operator_stroke_element(BlenderRNA *brna)
static EnumPropertyItem rna_enum_gpencil_fill_direction_items[]
Definition rna_brush.cc:366
static const EnumPropertyItem sculpt_stroke_method_items[]
Definition rna_brush.cc:51
const EnumPropertyItem rna_enum_brush_weight_brush_type_items[]
Definition rna_brush.cc:202
static void rna_def_curves_sculpt_options(BlenderRNA *brna)
static EnumPropertyItem rna_enum_gpencil_fill_layers_modes_items[]
Definition rna_brush.cc:357
#define VPAINT_BRUSH_CAPABILITY(prop_name_, ui_name_)
const EnumPropertyItem rna_enum_brush_gpencil_sculpt_types_items[]
Definition rna_brush.cc:265
#define BRUSH_CAPABILITY(prop_name_, ui_name_)
static EnumPropertyItem rna_enum_gpencil_fill_draw_modes_items[]
Definition rna_brush.cc:342
void RNA_def_brush(BlenderRNA *brna)
const EnumPropertyItem rna_enum_brush_image_brush_type_items[]
Definition rna_brush.cc:210
const EnumPropertyItem rna_enum_brush_automasking_flag_items[]
Definition rna_brush.cc:111
static void rna_def_brush(BlenderRNA *brna)
const EnumPropertyItem rna_enum_brush_sculpt_brush_type_items[]
Definition rna_brush.cc:149
static const EnumPropertyItem rna_enum_brush_texture_slot_map_all_mode_items[]
Definition rna_brush.cc:74
const EnumPropertyItem rna_enum_brush_gpencil_vertex_types_items[]
Definition rna_brush.cc:240
static EnumPropertyItem rna_enum_gpencil_brush_modes_items[]
Definition rna_brush.cc:372
static void rna_def_image_paint_capabilities(BlenderRNA *brna)
static void rna_def_vertex_paint_capabilities(BlenderRNA *brna)
#define WPAINT_BRUSH_CAPABILITY(prop_name_, ui_name_)
const EnumPropertyItem rna_enum_brush_gpencil_weight_types_items[]
Definition rna_brush.cc:301
const EnumPropertyItem rna_enum_brush_curve_preset_items[]
Definition rna_brush.cc:95
const EnumPropertyItem rna_enum_brush_vertex_brush_type_items[]
Definition rna_brush.cc:194
static void rna_def_brush_texture_slot(BlenderRNA *brna)
const EnumPropertyItem rna_enum_brush_gpencil_types_items[]
Definition rna_brush.cc:220
static void rna_def_weight_paint_capabilities(BlenderRNA *brna)
static EnumPropertyItem rna_enum_gpencil_fill_extend_modes_items[]
Definition rna_brush.cc:352
static void rna_def_brush_capabilities(BlenderRNA *brna)
const EnumPropertyItem rna_enum_brush_curves_sculpt_brush_type_items[]
Definition rna_brush.cc:313
void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
void RNA_def_property_pointer_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_struct_path_func(StructRNA *srna, const char *path)
void RNA_def_parameter_clear_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
void RNA_def_property_float_default(PropertyRNA *prop, float value)
void RNA_def_property_float_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
void RNA_def_property_string_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_ui_icon(PropertyRNA *prop, int icon, int consecutive)
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
void RNA_def_property_boolean_default(PropertyRNA *prop, bool value)
void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const char *set)
void RNA_def_property_int_default(PropertyRNA *prop, int value)
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
void RNA_def_property_array(PropertyRNA *prop, int length)
void RNA_def_property_range(PropertyRNA *prop, double min, double max)
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *func)
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier, int type, int subtype)
void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char *set, const char *item)
void RNA_def_property_enum_bitflag_sdna(PropertyRNA *prop, const char *structname, const char *propname)
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_property_pointer_funcs(PropertyRNA *prop, const char *get, const char *set, const char *type_fn, const char *poll)
void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_int_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
void RNA_def_struct_ui_icon(StructRNA *srna, int icon)
void RNA_def_property_translation_context(PropertyRNA *prop, const char *context)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double step, int precision)
void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_boolean_negative_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
void RNA_def_struct_nested(BlenderRNA *brna, StructRNA *srna, const char *structname)
void RNA_def_property_override_flag(PropertyRNA *prop, PropertyOverrideFlag flag)
void rna_TextureSlot_update(bContext *C, PointerRNA *ptr)
const EnumPropertyItem rna_enum_dummy_DEFAULT_items[]
Definition rna_rna.cc:32
static const EnumPropertyItem prop_direction_items[]
#define FLT_MAX
Definition stdcycles.h:14
char sculpt_brush_type
struct ImBuf * icon_imbuf
struct ColorBand * gradient
int automasking_flags
struct MTex mtex
float unprojected_radius
char gpencil_sculpt_brush_type
char image_brush_type
char gpencil_weight_brush_type
struct BrushGpencilSettings * gpencil_settings
char curves_sculpt_brush_type
char mask_tool
struct MTex mask_mtex
char weight_brush_type
char vertex_brush_type
const char * identifier
Definition RNA_types.hh:623
const char * name
Definition RNA_types.hh:627
const char * description
Definition RNA_types.hh:629
Definition DNA_ID.h:404
int icon_id
Definition DNA_ID.h:426
char brush_map_mode
struct Tex * tex
void * data
Definition RNA_types.hh:53
void WM_main_add_notifier(uint type, void *reference)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
PointerRNA * ptr
Definition wm_files.cc:4226