Blender V5.0
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
37 {0, "DOTS", 0, "Dots", "Apply paint on each mouse move step"},
38 {BRUSH_DRAG_DOT, "DRAG_DOT", 0, "Drag Dot", "Allows a single dot to be carefully positioned"},
40 "SPACE",
41 0,
42 "Space",
43 "Limit brush application to the distance specified by spacing"},
45 "AIRBRUSH",
46 0,
47 "Airbrush",
48 "Keep applying paint effect while holding mouse (spray)"},
49 {BRUSH_ANCHORED, "ANCHORED", 0, "Anchored", "Keep the brush anchored to the initial location"},
50 {BRUSH_LINE, "LINE", 0, "Line", "Draw a line with dabs separated according to spacing"},
51 {int(BRUSH_CURVE),
52 "CURVE",
53 0,
54 "Curve",
55 "Define the stroke curve with a Bézier curve (dabs are separated according to spacing)"},
56 {0, nullptr, 0, nullptr, nullptr},
57};
58
60 {MTEX_MAP_MODE_VIEW, "VIEW_PLANE", 0, "View Plane", ""},
61 {MTEX_MAP_MODE_AREA, "AREA_PLANE", 0, "Area Plane", ""},
62 {MTEX_MAP_MODE_TILED, "TILED", 0, "Tiled", ""},
63 {MTEX_MAP_MODE_3D, "3D", 0, "3D", ""},
64 {MTEX_MAP_MODE_RANDOM, "RANDOM", 0, "Random", ""},
65 {MTEX_MAP_MODE_STENCIL, "STENCIL", 0, "Stencil", ""},
66 {0, nullptr, 0, nullptr, nullptr},
67};
68
69#ifdef RNA_RUNTIME
70static const EnumPropertyItem rna_enum_brush_texture_slot_map_texture_mode_items[] = {
71 {MTEX_MAP_MODE_VIEW, "VIEW_PLANE", 0, "View Plane", ""},
72 {MTEX_MAP_MODE_TILED, "TILED", 0, "Tiled", ""},
73 {MTEX_MAP_MODE_3D, "3D", 0, "3D", ""},
74 {MTEX_MAP_MODE_RANDOM, "RANDOM", 0, "Random", ""},
75 {MTEX_MAP_MODE_STENCIL, "STENCIL", 0, "Stencil", ""},
76 {0, nullptr, 0, nullptr, nullptr},
77};
78#endif
79
81 {BRUSH_CURVE_CUSTOM, "CUSTOM", ICON_RNDCURVE, "Custom", ""},
82 {BRUSH_CURVE_SMOOTH, "SMOOTH", ICON_SMOOTHCURVE, "Smooth", ""},
83 {BRUSH_CURVE_SMOOTHER, "SMOOTHER", ICON_SMOOTHCURVE, "Smoother", ""},
84 {BRUSH_CURVE_SPHERE, "SPHERE", ICON_SPHERECURVE, "Sphere", ""},
85 {BRUSH_CURVE_ROOT, "ROOT", ICON_ROOTCURVE, "Root", ""},
86 {BRUSH_CURVE_SHARP, "SHARP", ICON_SHARPCURVE, "Sharp", ""},
87 {BRUSH_CURVE_LIN, "LIN", ICON_LINCURVE, "Linear", ""},
88 {BRUSH_CURVE_POW4, "POW4", ICON_SHARPCURVE, "Sharper", ""},
89 {BRUSH_CURVE_INVSQUARE, "INVSQUARE", ICON_INVERSESQUARECURVE, "Inverse Square", ""},
90 {BRUSH_CURVE_CONSTANT, "CONSTANT", ICON_NOCURVE, "Constant", ""},
91 {0, nullptr, 0, nullptr, nullptr},
92};
93
94/* NOTE: we don't actually turn these into a single enum bit-mask property,
95 * instead we construct individual boolean properties. */
98 "use_automasking_topology",
99 0,
100 "Topology",
101 "Affect only vertices connected to the active vertex under the brush"},
103 "use_automasking_face_sets",
104 0,
105 "Face Sets",
106 "Affect only vertices that share Face Sets with the active vertex"},
108 "use_automasking_boundary_edges",
109 0,
110 "Mesh Boundary Auto-Masking",
111 "Do not affect non manifold boundary edges"},
113 "use_automasking_boundary_face_sets",
114 0,
115 "Face Sets Boundary Automasking",
116 "Do not affect vertices that belong to a Face Set boundary"},
118 "use_automasking_cavity",
119 0,
120 "Cavity Mask",
121 "Do not affect vertices on peaks, based on the surface curvature"},
123 "use_automasking_cavity_inverted",
124 0,
125 "Inverted Cavity Mask",
126 "Do not affect vertices within crevices, based on the surface curvature"},
128 "use_automasking_custom_cavity_curve",
129 0,
130 "Custom Cavity Curve",
131 "Use custom curve"},
132 {0, nullptr, 0, nullptr, nullptr}};
133
135 {SCULPT_BRUSH_TYPE_DRAW, "DRAW", 0, "Draw", ""},
136 {SCULPT_BRUSH_TYPE_DRAW_SHARP, "DRAW_SHARP", 0, "Draw Sharp", ""},
137 {SCULPT_BRUSH_TYPE_CLAY, "CLAY", 0, "Clay", ""},
138 {SCULPT_BRUSH_TYPE_CLAY_STRIPS, "CLAY_STRIPS", 0, "Clay Strips", ""},
139 {SCULPT_BRUSH_TYPE_CLAY_THUMB, "CLAY_THUMB", 0, "Clay Thumb", ""},
140 {SCULPT_BRUSH_TYPE_LAYER, "LAYER", 0, "Layer", ""},
141 {SCULPT_BRUSH_TYPE_INFLATE, "INFLATE", 0, "Inflate", ""},
142 {SCULPT_BRUSH_TYPE_BLOB, "BLOB", 0, "Blob", ""},
143 {SCULPT_BRUSH_TYPE_CREASE, "CREASE", 0, "Crease", ""},
145 {SCULPT_BRUSH_TYPE_SMOOTH, "SMOOTH", 0, "Smooth", ""},
146 {SCULPT_BRUSH_TYPE_PLANE, "PLANE", 0, "Plane", ""},
147 {SCULPT_BRUSH_TYPE_MULTIPLANE_SCRAPE, "MULTIPLANE_SCRAPE", 0, "Multi-plane Scrape", ""},
148 {SCULPT_BRUSH_TYPE_PINCH, "PINCH", 0, "Pinch", ""},
150 {SCULPT_BRUSH_TYPE_GRAB, "GRAB", 0, "Grab", ""},
151 {SCULPT_BRUSH_TYPE_ELASTIC_DEFORM, "ELASTIC_DEFORM", 0, "Elastic Deform", ""},
152 {SCULPT_BRUSH_TYPE_SNAKE_HOOK, "SNAKE_HOOK", 0, "Snake Hook", ""},
153 {SCULPT_BRUSH_TYPE_THUMB, "THUMB", 0, "Thumb", ""},
154 {SCULPT_BRUSH_TYPE_POSE, "POSE", 0, "Pose", ""},
155 {SCULPT_BRUSH_TYPE_NUDGE, "NUDGE", 0, "Nudge", ""},
156 {SCULPT_BRUSH_TYPE_ROTATE, "ROTATE", 0, "Rotate", ""},
157 {SCULPT_BRUSH_TYPE_SLIDE_RELAX, "TOPOLOGY", 0, "Slide Relax", ""},
158 {SCULPT_BRUSH_TYPE_BOUNDARY, "BOUNDARY", 0, "Boundary", ""},
160 {SCULPT_BRUSH_TYPE_CLOTH, "CLOTH", 0, "Cloth", ""},
161 {SCULPT_BRUSH_TYPE_SIMPLIFY, "SIMPLIFY", 0, "Simplify", ""},
162 {SCULPT_BRUSH_TYPE_MASK, "MASK", 0, "Mask", ""},
163 {SCULPT_BRUSH_TYPE_DRAW_FACE_SETS, "DRAW_FACE_SETS", 0, "Draw Face Sets", ""},
165 "DISPLACEMENT_ERASER",
166 0,
167 "Multires Displacement Eraser",
168 ""},
170 "DISPLACEMENT_SMEAR",
171 0,
172 "Multires Displacement Smear",
173 ""},
174 {SCULPT_BRUSH_TYPE_PAINT, "PAINT", 0, "Paint", ""},
175 {SCULPT_BRUSH_TYPE_SMEAR, "SMEAR", 0, "Smear", ""},
176 {0, nullptr, 0, nullptr, nullptr},
177};
178
180 {VPAINT_BRUSH_TYPE_DRAW, "DRAW", 0, "Draw", ""},
181 {VPAINT_BRUSH_TYPE_BLUR, "BLUR", 0, "Blur", ""},
182 {VPAINT_BRUSH_TYPE_AVERAGE, "AVERAGE", 0, "Average", ""},
183 {VPAINT_BRUSH_TYPE_SMEAR, "SMEAR", 0, "Smear", ""},
184 {0, nullptr, 0, nullptr, nullptr},
185};
186
188 {WPAINT_BRUSH_TYPE_DRAW, "DRAW", 0, "Draw", ""},
189 {WPAINT_BRUSH_TYPE_BLUR, "BLUR", 0, "Blur", ""},
190 {WPAINT_BRUSH_TYPE_AVERAGE, "AVERAGE", 0, "Average", ""},
191 {WPAINT_BRUSH_TYPE_SMEAR, "SMEAR", 0, "Smear", ""},
192 {0, nullptr, 0, nullptr, nullptr},
193};
194
196 {IMAGE_PAINT_BRUSH_TYPE_DRAW, "DRAW", 0, "Draw", ""},
197 {IMAGE_PAINT_BRUSH_TYPE_SOFTEN, "SOFTEN", 0, "Soften", ""},
198 {IMAGE_PAINT_BRUSH_TYPE_SMEAR, "SMEAR", 0, "Smear", ""},
199 {IMAGE_PAINT_BRUSH_TYPE_CLONE, "CLONE", 0, "Clone", ""},
200 {IMAGE_PAINT_BRUSH_TYPE_FILL, "FILL", 0, "Fill", ""},
201 {IMAGE_PAINT_BRUSH_TYPE_MASK, "MASK", 0, "Mask", ""},
202 {0, nullptr, 0, nullptr, nullptr},
203};
204
207 "DRAW",
208 ICON_STROKE,
209 "Draw",
210 "The brush is of type used for drawing strokes"},
212 "FILL",
213 ICON_COLOR,
214 "Fill",
215 "The brush is of type used for filling areas"},
217 "ERASE",
218 ICON_PANEL_CLOSE,
219 "Erase",
220 "The brush is used for erasing strokes"},
221 {GPAINT_BRUSH_TYPE_TINT, "TINT", 0, "Tint", "The brush is of type used for tinting strokes"},
222 {0, nullptr, 0, nullptr, nullptr},
223};
224
226 {GPVERTEX_BRUSH_TYPE_DRAW, "DRAW", 0, "Draw", "Paint a color on stroke points"},
228 "BLUR",
229 0,
230 "Blur",
231 "Smooth out the colors of adjacent stroke points"},
233 "AVERAGE",
234 0,
235 "Average",
236 "Smooth out colors with the average color under the brush"},
238 "SMEAR",
239 0,
240 "Smear",
241 "Smudge colors by grabbing and dragging them"},
243 "REPLACE",
244 0,
245 "Replace",
246 "Replace the color of stroke points that already have a color applied"},
247 {0, nullptr, 0, nullptr, nullptr},
248};
249
251 {GPSCULPT_BRUSH_TYPE_SMOOTH, "SMOOTH", 0, "Smooth", "Smooth stroke points"},
252 {GPSCULPT_BRUSH_TYPE_THICKNESS, "THICKNESS", 0, "Thickness", "Adjust thickness of strokes"},
253 {GPSCULPT_BRUSH_TYPE_STRENGTH, "STRENGTH", 0, "Strength", "Adjust color strength of strokes"},
255 "RANDOMIZE",
256 0,
257 "Randomize",
258 "Introduce jitter/randomness into strokes"},
260 "GRAB",
261 0,
262 "Grab",
263 "Translate the set of points initially within the brush circle"},
265 "PUSH",
266 0,
267 "Push",
268 "Move points out of the way, as if combing them"},
270 "TWIST",
271 0,
272 "Twist",
273 "Rotate points around the midpoint of the brush"},
275 "PINCH",
276 0,
277 "Pinch",
278 "Pull points towards the midpoint of the brush"},
280 "CLONE",
281 0,
282 "Clone",
283 "Paste copies of the strokes stored on the internal clipboard"},
284 {0, nullptr, 0, nullptr, nullptr}};
285
287 {GPWEIGHT_BRUSH_TYPE_DRAW, "WEIGHT", 0, "Weight", "Paint weight in active vertex group"},
288 {GPWEIGHT_BRUSH_TYPE_BLUR, "BLUR", 0, "Blur", "Blur weight in active vertex group"},
290 "AVERAGE",
291 0,
292 "Average",
293 "Average weight in active vertex group"},
294 {GPWEIGHT_BRUSH_TYPE_SMEAR, "SMEAR", 0, "Smear", "Smear weight in active vertex group"},
295 {0, nullptr, 0, nullptr, nullptr},
296};
297
299 {CURVES_SCULPT_BRUSH_TYPE_SELECTION_PAINT, "SELECTION_PAINT", 0, "Paint Selection", ""},
301 {CURVES_SCULPT_BRUSH_TYPE_ADD, "ADD", 0, "Add", ""},
302 {CURVES_SCULPT_BRUSH_TYPE_DELETE, "DELETE", 0, "Delete", ""},
303 {CURVES_SCULPT_BRUSH_TYPE_DENSITY, "DENSITY", 0, "Density", ""},
305 {CURVES_SCULPT_BRUSH_TYPE_COMB, "COMB", 0, "Comb", ""},
306 {CURVES_SCULPT_BRUSH_TYPE_SNAKE_HOOK, "SNAKE_HOOK", 0, "Snake Hook", ""},
307 {CURVES_SCULPT_BRUSH_TYPE_GROW_SHRINK, "GROW_SHRINK", 0, "Grow / Shrink", ""},
308 {CURVES_SCULPT_BRUSH_TYPE_PINCH, "PINCH", 0, "Pinch", ""},
309 {CURVES_SCULPT_BRUSH_TYPE_PUFF, "PUFF", 0, "Puff", ""},
310 {CURVES_SCULPT_BRUSH_TYPE_SMOOTH, "SMOOTH", 0, "Smooth", ""},
311 {CURVES_SCULPT_BRUSH_TYPE_SLIDE, "SLIDE", 0, "Slide", ""},
312 {0, nullptr, 0, nullptr, nullptr},
313};
314
315#ifndef RNA_RUNTIME
318 "SOFT",
319 0,
320 "Dissolve",
321 "Erase strokes, fading their points strength and thickness"},
322 {GP_BRUSH_ERASER_HARD, "HARD", 0, "Point", "Erase stroke points"},
323 {GP_BRUSH_ERASER_STROKE, "STROKE", 0, "Stroke", "Erase entire strokes"},
324 {0, nullptr, 0, nullptr, nullptr},
325};
326
329 "BOTH",
330 0,
331 "All",
332 "Use both visible strokes and edit lines as fill boundary limits"},
333 {GP_FILL_DMODE_STROKE, "STROKE", 0, "Strokes", "Use visible strokes as fill boundary limits"},
334 {GP_FILL_DMODE_CONTROL, "CONTROL", 0, "Edit Lines", "Use edit lines as fill boundary limits"},
335 {0, nullptr, 0, nullptr, nullptr}};
336
338 {GP_FILL_EMODE_EXTEND, "EXTEND", 0, "Extend", "Extend strokes in straight lines"},
339 {GP_FILL_EMODE_RADIUS, "RADIUS", 0, "Radius", "Connect endpoints that are close together"},
340 {0, nullptr, 0, nullptr, nullptr}};
341
343 {GP_FILL_GPLMODE_VISIBLE, "VISIBLE", 0, "Visible", "Visible layers"},
344 {GP_FILL_GPLMODE_ACTIVE, "ACTIVE", 0, "Active", "Only active layer"},
345 {GP_FILL_GPLMODE_ABOVE, "ABOVE", 0, "Layer Above", "Layer above active"},
346 {GP_FILL_GPLMODE_BELOW, "BELOW", 0, "Layer Below", "Layer below active"},
347 {GP_FILL_GPLMODE_ALL_ABOVE, "ALL_ABOVE", 0, "All Above", "All layers above active"},
348 {GP_FILL_GPLMODE_ALL_BELOW, "ALL_BELOW", 0, "All Below", "All layers below active"},
349 {0, nullptr, 0, nullptr, nullptr}};
350
352 {0, "NORMAL", ICON_ADD, "Normal", "Fill internal area"},
353 {BRUSH_DIR_IN, "INVERT", ICON_REMOVE, "Inverted", "Fill inverted area"},
354 {0, nullptr, 0, nullptr, nullptr},
355};
356
358 {GP_BRUSH_MODE_ACTIVE, "ACTIVE", 0, "Active", "Use current mode"},
359 {GP_BRUSH_MODE_MATERIAL, "MATERIAL", 0, "Material", "Use always material mode"},
360 {GP_BRUSH_MODE_VERTEXCOLOR, "VERTEXCOLOR", 0, "Vertex Color", "Use always Vertex Color mode"},
361 {0, nullptr, 0, nullptr, nullptr}};
362
363#endif
364
365#ifdef RNA_RUNTIME
366
367# include "DNA_material_types.h"
368
369# include "RNA_access.hh"
370
371# include "BKE_brush.hh"
372# include "BKE_colorband.hh"
373# include "BKE_context.hh"
374# include "BKE_gpencil_legacy.h"
375# include "BKE_icons.h"
376# include "BKE_layer.hh"
377# include "BKE_material.hh"
378# include "BKE_paint.hh"
379# include "BKE_paint_types.hh"
380# include "BKE_preview_image.hh"
381
382# include "WM_api.hh"
383
384static bool rna_TextureCapabilities_has_random_texture_angle_get(PointerRNA *ptr)
385{
386 MTex *mtex = (MTex *)ptr->data;
387 return ELEM(mtex->brush_map_mode, MTEX_MAP_MODE_VIEW, MTEX_MAP_MODE_AREA, MTEX_MAP_MODE_RANDOM);
388}
389
390static bool rna_TextureCapabilities_has_texture_angle_get(PointerRNA *ptr)
391{
392 MTex *mtex = (MTex *)ptr->data;
393 return mtex->brush_map_mode != MTEX_MAP_MODE_3D;
394}
395
396static bool rna_TextureCapabilities_has_texture_angle_source_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_BrushCapabilities_has_overlay_get(PointerRNA *ptr)
403{
404 Brush *br = static_cast<Brush *>(ptr->data);
405 return ELEM(
407}
408
409static bool rna_BrushCapabilities_has_random_texture_angle_get(PointerRNA *ptr)
410{
411 Brush *br = static_cast<Brush *>(ptr->data);
412 return !(br->flag & BRUSH_ANCHORED);
413}
414
415static bool rna_BrushCapabilities_has_smooth_stroke_get(PointerRNA *ptr)
416{
417 Brush *br = static_cast<Brush *>(ptr->data);
418 return (!(br->flag & BRUSH_ANCHORED) && !(br->flag & BRUSH_DRAG_DOT) &&
419 !(br->flag & BRUSH_LINE) && !(br->flag & BRUSH_CURVE));
420}
421
422static bool rna_BrushCapabilities_has_spacing_get(PointerRNA *ptr)
423{
424 Brush *br = static_cast<Brush *>(ptr->data);
425 return (!(br->flag & BRUSH_ANCHORED));
426}
427
428static bool rna_BrushCapabilitiesSculpt_has_accumulate_get(PointerRNA *ptr)
429{
430 const Brush *br = static_cast<const Brush *>(ptr->data);
432}
433
434static bool rna_BrushCapabilitiesSculpt_has_topology_rake_get(PointerRNA *ptr)
435{
436 const Brush *br = static_cast<const Brush *>(ptr->data);
438}
439
440static bool rna_BrushCapabilitiesSculpt_has_auto_smooth_get(PointerRNA *ptr)
441{
442 const Brush *br = static_cast<const Brush *>(ptr->data);
444}
445
446static bool rna_BrushCapabilitiesSculpt_has_height_get(PointerRNA *ptr)
447{
448 const Brush *br = static_cast<const Brush *>(ptr->data);
450}
451
452static bool rna_BrushCapabilitiesSculpt_has_plane_height_get(PointerRNA *ptr)
453{
454 const Brush *br = static_cast<const Brush *>(ptr->data);
456}
457
458static bool rna_BrushCapabilitiesSculpt_has_plane_depth_get(PointerRNA *ptr)
459{
460 const Brush *br = static_cast<const Brush *>(ptr->data);
462}
463
464static bool rna_BrushCapabilitiesSculpt_has_jitter_get(PointerRNA *ptr)
465{
466 const Brush *br = static_cast<const Brush *>(ptr->data);
468}
469
470static bool rna_BrushCapabilitiesSculpt_has_normal_weight_get(PointerRNA *ptr)
471{
472 const Brush *br = static_cast<const Brush *>(ptr->data);
474}
475
476static bool rna_BrushCapabilitiesSculpt_has_rake_factor_get(PointerRNA *ptr)
477{
478 const Brush *br = static_cast<const Brush *>(ptr->data);
480}
481
482static bool rna_BrushCapabilitiesSculpt_has_persistence_get(PointerRNA *ptr)
483{
484 const Brush *br = static_cast<const Brush *>(ptr->data);
486}
487
488static bool rna_BrushCapabilitiesSculpt_has_pinch_factor_get(PointerRNA *ptr)
489{
490 const Brush *br = static_cast<const Brush *>(ptr->data);
492}
493
494static bool rna_BrushCapabilitiesSculpt_has_plane_offset_get(PointerRNA *ptr)
495{
496 const Brush *br = static_cast<const Brush *>(ptr->data);
498}
499
500static bool rna_BrushCapabilitiesSculpt_has_random_texture_angle_get(PointerRNA *ptr)
501{
502 const Brush *br = static_cast<const Brush *>(ptr->data);
504}
505
506static bool rna_BrushCapabilitiesSculpt_has_sculpt_plane_get(PointerRNA *ptr)
507{
508 const Brush *br = static_cast<const Brush *>(ptr->data);
510}
511
512static bool rna_BrushCapabilitiesSculpt_has_color_get(PointerRNA *ptr)
513{
514 const Brush *br = static_cast<const Brush *>(ptr->data);
516}
517
518static bool rna_BrushCapabilitiesSculpt_has_secondary_color_get(PointerRNA *ptr)
519{
520 const Brush *br = static_cast<const Brush *>(ptr->data);
522}
523
524static bool rna_BrushCapabilitiesSculpt_has_smooth_stroke_get(PointerRNA *ptr)
525{
526 const Brush *br = static_cast<const Brush *>(ptr->data);
528}
529
530static bool rna_BrushCapabilitiesSculpt_has_space_attenuation_get(PointerRNA *ptr)
531{
532 const Brush *br = static_cast<const Brush *>(ptr->data);
534}
535
536static bool rna_BrushCapabilitiesSculpt_has_strength_pressure_get(PointerRNA *ptr)
537{
538 const Brush *br = static_cast<const Brush *>(ptr->data);
540}
541
542static bool rna_BrushCapabilitiesSculpt_has_size_pressure_get(PointerRNA *ptr)
543{
544 const Brush *br = static_cast<const Brush *>(ptr->data);
546}
547
548static bool rna_BrushCapabilitiesSculpt_has_auto_smooth_pressure_get(PointerRNA *ptr)
549{
550 const Brush *br = static_cast<const Brush *>(ptr->data);
552}
553
554static bool rna_BrushCapabilitiesSculpt_has_hardness_pressure_get(PointerRNA *ptr)
555{
556 const Brush *br = static_cast<const Brush *>(ptr->data);
558}
559
560static bool rna_BrushCapabilitiesSculpt_has_direction_get(PointerRNA *ptr)
561{
562 const Brush *br = static_cast<const Brush *>(ptr->data);
564}
565
566static bool rna_BrushCapabilitiesSculpt_has_gravity_get(PointerRNA *ptr)
567{
568 const Brush *br = static_cast<const Brush *>(ptr->data);
570}
571
572static bool rna_BrushCapabilitiesSculpt_has_tilt_get(PointerRNA *ptr)
573{
574 const Brush *br = static_cast<const Brush *>(ptr->data);
576}
577
578static bool rna_BrushCapabilitiesSculpt_has_dyntopo_get(PointerRNA *ptr)
579{
580 const Brush *br = static_cast<const Brush *>(ptr->data);
582}
583
584static bool rna_BrushCapabilitiesImagePaint_has_accumulate_get(PointerRNA *ptr)
585{
586 /* only support for draw brush */
587 Brush *br = static_cast<Brush *>(ptr->data);
588
589 return ((br->flag & BRUSH_AIRBRUSH) || (br->flag & BRUSH_DRAG_DOT) ||
593 (br->mtex.tex && !ELEM(br->mtex.brush_map_mode,
597 false :
598 true;
599}
600
601static bool rna_BrushCapabilitiesImagePaint_has_radius_get(PointerRNA *ptr)
602{
603 /* only support for draw brush */
604 Brush *br = static_cast<Brush *>(ptr->data);
605
607}
608
609static bool rna_BrushCapabilitiesImagePaint_has_space_attenuation_get(PointerRNA *ptr)
610{
611 Brush *br = static_cast<Brush *>(ptr->data);
612 return (br->flag & (BRUSH_SPACE | BRUSH_LINE | BRUSH_CURVE)) &&
614}
615
616static bool rna_BrushCapabilitiesImagePaint_has_color_get(PointerRNA *ptr)
617{
618 Brush *br = static_cast<Brush *>(ptr->data);
620}
621
622static bool rna_BrushCapabilitiesVertexPaint_has_color_get(PointerRNA *ptr)
623{
624 Brush *br = static_cast<Brush *>(ptr->data);
626}
627
628static bool rna_BrushCapabilitiesWeightPaint_has_weight_get(PointerRNA *ptr)
629{
630 Brush *br = static_cast<Brush *>(ptr->data);
632}
633
634static PointerRNA rna_Sculpt_brush_capabilities_get(PointerRNA *ptr)
635{
636 BLI_assert(ptr->owner_id == ptr->data);
637 return RNA_pointer_create_with_parent(*ptr, &RNA_BrushCapabilitiesSculpt, ptr->data);
638}
639
640static PointerRNA rna_Imapaint_brush_capabilities_get(PointerRNA *ptr)
641{
642 BLI_assert(ptr->owner_id == ptr->data);
643 return RNA_pointer_create_with_parent(*ptr, &RNA_BrushCapabilitiesImagePaint, ptr->data);
644}
645
646static PointerRNA rna_Vertexpaint_brush_capabilities_get(PointerRNA *ptr)
647{
648 BLI_assert(ptr->owner_id == ptr->data);
649 return RNA_pointer_create_with_parent(*ptr, &RNA_BrushCapabilitiesVertexPaint, ptr->data);
650}
651
652static PointerRNA rna_Weightpaint_brush_capabilities_get(PointerRNA *ptr)
653{
654 BLI_assert(ptr->owner_id == ptr->data);
655 return RNA_pointer_create_with_parent(*ptr, &RNA_BrushCapabilitiesWeightPaint, ptr->data);
656}
657
658static PointerRNA rna_Brush_capabilities_get(PointerRNA *ptr)
659{
660 BLI_assert(ptr->owner_id == ptr->data);
661 return RNA_pointer_create_with_parent(*ptr, &RNA_BrushCapabilities, ptr->data);
662}
663
664static void rna_Brush_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
665{
666 Brush *br = static_cast<Brush *>(ptr->data);
669 // WM_main_add_notifier(NC_SPACE | ND_SPACE_VIEW3D, nullptr);
670}
671
672static void rna_Brush_color_update(Main *bmain, Scene *scene, PointerRNA *ptr)
673{
674 Brush *br = static_cast<Brush *>(ptr->data);
675 rna_Brush_update(bmain, scene, ptr);
677}
678
679static void rna_Brush_material_update(bContext * /*C*/, PointerRNA *ptr)
680{
681 Brush *br = static_cast<Brush *>(ptr->data);
683 /* number of material users changed */
685}
686
687static void rna_Brush_main_tex_update(bContext *C, PointerRNA *ptr)
688{
689 Main *bmain = CTX_data_main(C);
690 Scene *scene = CTX_data_scene(C);
691 ViewLayer *view_layer = CTX_data_view_layer(C);
692 Brush *br = static_cast<Brush *>(ptr->data);
693 BKE_paint_invalidate_overlay_tex(scene, view_layer, br->mtex.tex);
694 rna_Brush_update(bmain, scene, ptr);
695}
696
697static void rna_Brush_secondary_tex_update(bContext *C, PointerRNA *ptr)
698{
699 Main *bmain = CTX_data_main(C);
700 Scene *scene = CTX_data_scene(C);
701 ViewLayer *view_layer = CTX_data_view_layer(C);
702 Brush *br = static_cast<Brush *>(ptr->data);
703 BKE_paint_invalidate_overlay_tex(scene, view_layer, br->mask_mtex.tex);
704 rna_Brush_update(bmain, scene, ptr);
705}
706
707static void rna_Brush_size_update(Main *bmain, Scene *scene, PointerRNA *ptr)
708{
710 rna_Brush_update(bmain, scene, ptr);
711}
712
713static void rna_Brush_stroke_update(Main *bmain, Scene *scene, PointerRNA *ptr)
714{
716 rna_Brush_update(bmain, scene, ptr);
717}
718
719static void rna_TextureSlot_brush_angle_update(bContext *C, PointerRNA *ptr)
720{
721 Scene *scene = CTX_data_scene(C);
722 MTex *mtex = static_cast<MTex *>(ptr->data);
723 /* skip invalidation of overlay for stencil mode */
724 if (mtex->mapping != MTEX_MAP_MODE_STENCIL) {
725 ViewLayer *view_layer = CTX_data_view_layer(C);
726 BKE_paint_invalidate_overlay_tex(scene, view_layer, mtex->tex);
727 }
728
730}
731
732static void rna_Brush_set_size(PointerRNA *ptr, int value)
733{
734 Brush *brush = static_cast<Brush *>(ptr->data);
735
736 /* scale unprojected size so it stays consistent with brush size */
738 brush->size = value;
739}
740
741static void rna_Brush_use_gradient_set(PointerRNA *ptr, int value)
742{
743 Brush *br = static_cast<Brush *>(ptr->data);
744
745 if (value & BRUSH_USE_GRADIENT) {
747 }
748 else {
750 }
751
752 if ((br->flag & BRUSH_USE_GRADIENT) && br->gradient == nullptr) {
753 br->gradient = BKE_colorband_add(true);
754 }
755}
756
757static void rna_Brush_set_unprojected_size(PointerRNA *ptr, float value)
758{
759 Brush *brush = static_cast<Brush *>(ptr->data);
760
761 /* scale brush size so it stays consistent with unprojected_size */
762 BKE_brush_scale_size(&brush->size, value, brush->unprojected_size);
763 brush->unprojected_size = value;
764}
765
766static const EnumPropertyItem *rna_Brush_direction_itemf(bContext *C,
768 PropertyRNA * /*prop*/,
769 bool * /*r_free*/)
770{
772
773 /* sculpt mode */
774 static const EnumPropertyItem prop_smooth_direction_items[] = {
775 {0,
776 "SMOOTH",
777 ICON_ADD,
779 N_("Smooth the surface")},
781 "ENHANCE_DETAILS",
782 ICON_REMOVE,
783 CTX_N_(BLT_I18NCONTEXT_ID_BRUSH, "Enhance Details"),
784 N_("Enhance the surface detail")},
785 {0, nullptr, 0, nullptr, nullptr},
786 };
787
788 static const EnumPropertyItem prop_pinch_magnify_items[] = {
790 "MAGNIFY",
791 ICON_ADD,
793 N_("Subtract effect of brush")},
794 {0,
795 "PINCH",
796 ICON_REMOVE,
798 N_("Add effect of brush")},
799 {0, nullptr, 0, nullptr, nullptr},
800 };
801
802 static const EnumPropertyItem prop_inflate_deflate_items[] = {
803 {0,
804 "INFLATE",
805 ICON_ADD,
807 N_("Add effect of brush")},
809 "DEFLATE",
810 ICON_REMOVE,
812 N_("Subtract effect of brush")},
813 {0, nullptr, 0, nullptr, nullptr},
814 };
815
816 /* texture paint mode */
817 static const EnumPropertyItem prop_soften_sharpen_items[] = {
819 "SHARPEN",
820 ICON_ADD,
822 N_("Sharpen effect of brush")},
823 {0,
824 "SOFTEN",
825 ICON_REMOVE,
827 N_("Blur effect of brush")},
828 {0, nullptr, 0, nullptr, nullptr},
829 };
830
831 /* gpencil sculpt */
832 static const EnumPropertyItem prop_pinch_items[] = {
833 {0, "ADD", ICON_ADD, CTX_N_(BLT_I18NCONTEXT_ID_BRUSH, "Pinch"), N_("Add effect of brush")},
835 "SUBTRACT",
836 ICON_REMOVE,
838 N_("Subtract effect of brush")},
839 {0, nullptr, 0, nullptr, nullptr},
840 };
841 static const EnumPropertyItem prop_twist_items[] = {
842 {0,
843 "ADD",
844 ICON_ADD,
845 CTX_N_(BLT_I18NCONTEXT_ID_BRUSH, "Counter-Clockwise"),
846 N_("Add effect of brush")},
848 "SUBTRACT",
849 ICON_REMOVE,
850 CTX_N_(BLT_I18NCONTEXT_ID_BRUSH, "Clockwise"),
851 N_("Subtract effect of brush")},
852 {0, nullptr, 0, nullptr, nullptr},
853 };
854
855 Brush *me = static_cast<Brush *>(ptr->data);
856
857 switch (mode) {
859 switch (me->sculpt_brush_type) {
870 return prop_smooth_direction_items;
872 switch ((BrushMaskTool)me->mask_tool) {
873 case BRUSH_MASK_DRAW:
875
878
879 default:
881 }
882
884 return prop_pinch_magnify_items;
885
887 return prop_inflate_deflate_items;
888
889 default:
891 }
892
895 switch (me->image_brush_type) {
897 return prop_soften_sharpen_items;
898
899 default:
901 }
903 switch (me->curves_sculpt_brush_type) {
908 default:
910 }
912 switch (me->gpencil_sculpt_brush_type) {
917 return prop_twist_items;
919 return prop_pinch_items;
920 default:
922 }
924 switch (me->gpencil_weight_brush_type) {
927 default:
929 }
930 default:
932 }
933}
934
935static const EnumPropertyItem *rna_Brush_stroke_itemf(bContext *C,
936 PointerRNA * /*ptr*/,
937 PropertyRNA * /*prop*/,
938 bool * /*r_free*/)
939{
941
942 static const EnumPropertyItem brush_stroke_method_items[] = {
943 {0, "DOTS", 0, "Dots", "Apply paint on each mouse move step"},
945 "SPACE",
946 0,
947 "Space",
948 "Limit brush application to the distance specified by spacing"},
950 "AIRBRUSH",
951 0,
952 "Airbrush",
953 "Keep applying paint effect while holding mouse (spray)"},
954 {BRUSH_LINE, "LINE", 0, "Line", "Drag a line with dabs separated according to spacing"},
955 {int(BRUSH_CURVE),
956 "CURVE",
957 0,
958 "Curve",
959 "Define the stroke curve with a Bézier curve. Dabs are separated according to spacing."},
960 {0, nullptr, 0, nullptr, nullptr},
961 };
962
963 switch (mode) {
968
969 default:
970 return brush_stroke_method_items;
971 }
972}
973
974/* Grease Pencil Drawing Brushes Settings */
975static std::optional<std::string> rna_BrushGpencilSettings_path(const PointerRNA * /*ptr*/)
976{
977 return "gpencil_settings";
978}
979
980static void rna_BrushGpencilSettings_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
981{
982 Brush *br = reinterpret_cast<Brush *>(ptr->owner_id);
983 /* Synchronize the general randomization flag with the brush color jitter flag */
986 }
987 else {
989 }
991}
992
993static void rna_BrushGpencilSettings_use_material_pin_update(bContext *C, PointerRNA *ptr)
994{
995 const Scene *scene = CTX_data_scene(C);
996 ViewLayer *view_layer = CTX_data_view_layer(C);
997 BKE_view_layer_synced_ensure(scene, view_layer);
999 Brush *brush = reinterpret_cast<Brush *>(ptr->owner_id);
1000
1002 Material *material = BKE_object_material_get(ob, ob->actcol);
1003 BKE_gpencil_brush_material_set(brush, material);
1004 }
1005 else {
1006 BKE_gpencil_brush_material_set(brush, nullptr);
1007 }
1008
1009 rna_BrushGpencilSettings_update(CTX_data_main(C), CTX_data_scene(C), ptr);
1010 /* number of material users changed */
1012}
1013
1014static bool rna_BrushGpencilSettings_material_poll(PointerRNA * /*ptr*/, PointerRNA value)
1015{
1016 Material *ma = (Material *)value.data;
1017
1018 /* GP materials only */
1019 return (ma->gp_style != nullptr);
1020}
1021
1022static bool rna_GPencilBrush_pin_mode_get(PointerRNA *ptr)
1023{
1024 Brush *brush = reinterpret_cast<Brush *>(ptr->owner_id);
1025 if ((brush != nullptr) && (brush->gpencil_settings != nullptr)) {
1027 }
1028 return false;
1029}
1030
1031static void rna_GPencilBrush_pin_mode_set(PointerRNA * /*ptr*/, bool /*value*/)
1032{
1033 /* All data is set in update. Keep this function only to avoid RNA compilation errors. */
1034}
1035
1036static void rna_GPencilBrush_pin_mode_update(bContext *C, PointerRNA *ptr)
1037{
1038 Brush *brush = reinterpret_cast<Brush *>(ptr->owner_id);
1039 if ((brush != nullptr) && (brush->gpencil_settings != nullptr)) {
1041 /* If not active, means that must be set to off. */
1043 }
1044 else {
1049 }
1050 }
1051 rna_BrushGpencilSettings_update(CTX_data_main(C), CTX_data_scene(C), ptr);
1052}
1053
1054static void rna_BrushCurvesSculptSettings_update(Main * /*bmain*/,
1055 Scene * /*scene*/,
1056 PointerRNA *ptr)
1057{
1058 Brush *br = reinterpret_cast<Brush *>(ptr->owner_id);
1060}
1061
1062static const EnumPropertyItem *rna_BrushTextureSlot_map_mode_itemf(bContext *C,
1063 PointerRNA * /*ptr*/,
1064 PropertyRNA * /*prop*/,
1065 bool * /*r_free*/)
1066{
1067
1068 if (C == nullptr) {
1070 }
1071
1072# define rna_enum_brush_texture_slot_map_sculpt_mode_items \
1073 rna_enum_brush_texture_slot_map_all_mode_items;
1074
1076 if (mode == PaintMode::Sculpt) {
1077 return rna_enum_brush_texture_slot_map_sculpt_mode_items;
1078 }
1079 return rna_enum_brush_texture_slot_map_texture_mode_items;
1080
1081# undef rna_enum_brush_texture_slot_map_sculpt_mode_items
1082}
1083
1084static void rna_Brush_automasking_invert_cavity_set(PointerRNA *ptr, bool val)
1085{
1086 Brush *brush = static_cast<Brush *>(ptr->data);
1087
1088 if (val) {
1091 }
1092 else {
1094 }
1095}
1096
1097static void rna_Brush_automasking_cavity_set(PointerRNA *ptr, bool val)
1098{
1099 Brush *brush = static_cast<Brush *>(ptr->data);
1100
1101 if (val) {
1104 }
1105 else {
1107 }
1108}
1109
1110static std::optional<std::string> rna_BrushCurvesSculptSettings_path(const PointerRNA * /*ptr*/)
1111{
1112 return "curves_sculpt_settings";
1113}
1114
1115#else
1116
1118{
1119 StructRNA *srna;
1120 PropertyRNA *prop;
1121
1122 static const EnumPropertyItem prop_mask_paint_map_mode_items[] = {
1123 {MTEX_MAP_MODE_VIEW, "VIEW_PLANE", 0, "View Plane", ""},
1124 {MTEX_MAP_MODE_TILED, "TILED", 0, "Tiled", ""},
1125 {MTEX_MAP_MODE_RANDOM, "RANDOM", 0, "Random", ""},
1126 {MTEX_MAP_MODE_STENCIL, "STENCIL", 0, "Stencil", ""},
1127 {0, nullptr, 0, nullptr, nullptr},
1128 };
1129
1130# define TEXTURE_CAPABILITY(prop_name_, ui_name_) \
1131 prop = RNA_def_property(srna, #prop_name_, PROP_BOOLEAN, PROP_NONE); \
1132 RNA_def_property_clear_flag(prop, PROP_EDITABLE); \
1133 RNA_def_property_boolean_funcs(prop, "rna_TextureCapabilities_" #prop_name_ "_get", nullptr); \
1134 RNA_def_property_ui_text(prop, ui_name_, nullptr)
1135
1136 srna = RNA_def_struct(brna, "BrushTextureSlot", "TextureSlot");
1137 RNA_def_struct_sdna(srna, "MTex");
1139 srna, "Brush Texture Slot", "Texture slot for textures in a Brush data-block");
1140
1141 prop = RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE);
1142 RNA_def_property_float_sdna(prop, nullptr, "rot");
1143 RNA_def_property_range(prop, 0, M_PI * 2);
1144 RNA_def_property_ui_text(prop, "Angle", "Brush texture rotation");
1146 RNA_def_property_update(prop, 0, "rna_TextureSlot_brush_angle_update");
1147
1148 prop = RNA_def_property(srna, "map_mode", PROP_ENUM, PROP_NONE);
1149 RNA_def_property_enum_sdna(prop, nullptr, "brush_map_mode");
1151 RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_BrushTextureSlot_map_mode_itemf");
1152 RNA_def_property_ui_text(prop, "Mode", "");
1154 RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
1155
1156 prop = RNA_def_property(srna, "mask_map_mode", PROP_ENUM, PROP_NONE);
1157 RNA_def_property_enum_sdna(prop, nullptr, "brush_map_mode");
1158 RNA_def_property_enum_items(prop, prop_mask_paint_map_mode_items);
1159 RNA_def_property_ui_text(prop, "Mode", "");
1161 RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
1162
1163 prop = RNA_def_property(srna, "use_rake", PROP_BOOLEAN, PROP_NONE);
1164 RNA_def_property_boolean_sdna(prop, nullptr, "brush_angle_mode", MTEX_ANGLE_RAKE);
1165 RNA_def_property_ui_text(prop, "Rake", "");
1167 RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
1168
1169 prop = RNA_def_property(srna, "use_random", PROP_BOOLEAN, PROP_NONE);
1170 RNA_def_property_boolean_sdna(prop, nullptr, "brush_angle_mode", MTEX_ANGLE_RANDOM);
1171 RNA_def_property_ui_text(prop, "Random", "");
1173 RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
1174
1175 prop = RNA_def_property(srna, "random_angle", PROP_FLOAT, PROP_ANGLE);
1176 RNA_def_property_range(prop, 0, M_PI * 2);
1177 RNA_def_property_ui_text(prop, "Random Angle", "Brush texture random angle");
1179 RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
1180
1181 TEXTURE_CAPABILITY(has_texture_angle_source, "Has Texture Angle Source");
1182 TEXTURE_CAPABILITY(has_random_texture_angle, "Has Random Texture Angle");
1183 TEXTURE_CAPABILITY(has_texture_angle, "Has Texture Angle Source");
1184
1185# undef TEXTURE_CAPABILITY
1186}
1187
1189{
1190 StructRNA *srna;
1191 PropertyRNA *prop;
1192
1193 srna = RNA_def_struct(brna, "BrushCapabilitiesSculpt", nullptr);
1194 RNA_def_struct_sdna(srna, "Brush");
1195 RNA_def_struct_nested(brna, srna, "Brush");
1197 "Sculpt Capabilities",
1198 "Read-only indications of which brush operations "
1199 "are supported by the current sculpt tool");
1200
1201# define SCULPT_BRUSH_CAPABILITY(prop_name_, ui_name_) \
1202 prop = RNA_def_property(srna, #prop_name_, PROP_BOOLEAN, PROP_NONE); \
1203 RNA_def_property_clear_flag(prop, PROP_EDITABLE); \
1204 RNA_def_property_boolean_funcs( \
1205 prop, "rna_BrushCapabilitiesSculpt_" #prop_name_ "_get", nullptr); \
1206 RNA_def_property_ui_text(prop, ui_name_, nullptr)
1207
1208 SCULPT_BRUSH_CAPABILITY(has_accumulate, "Has Accumulate");
1209 SCULPT_BRUSH_CAPABILITY(has_auto_smooth, "Has Auto Smooth");
1210 SCULPT_BRUSH_CAPABILITY(has_topology_rake, "Has Topology Rake");
1211 SCULPT_BRUSH_CAPABILITY(has_height, "Has Height");
1212 SCULPT_BRUSH_CAPABILITY(has_plane_depth, "Has Plane Depth");
1213 SCULPT_BRUSH_CAPABILITY(has_plane_height, "Has Plane Height");
1214 SCULPT_BRUSH_CAPABILITY(has_jitter, "Has Jitter");
1215 SCULPT_BRUSH_CAPABILITY(has_normal_weight, "Has Crease/Pinch Factor");
1216 SCULPT_BRUSH_CAPABILITY(has_rake_factor, "Has Rake Factor");
1217 SCULPT_BRUSH_CAPABILITY(has_persistence, "Has Persistence");
1218 SCULPT_BRUSH_CAPABILITY(has_pinch_factor, "Has Pinch Factor");
1219 SCULPT_BRUSH_CAPABILITY(has_plane_offset, "Has Plane Offset");
1220 SCULPT_BRUSH_CAPABILITY(has_random_texture_angle, "Has Random Texture Angle");
1221 SCULPT_BRUSH_CAPABILITY(has_sculpt_plane, "Has Sculpt Plane");
1222 SCULPT_BRUSH_CAPABILITY(has_color, "Has Color");
1223 SCULPT_BRUSH_CAPABILITY(has_secondary_color, "Has Secondary Color");
1224 SCULPT_BRUSH_CAPABILITY(has_smooth_stroke, "Has Smooth Stroke");
1225 SCULPT_BRUSH_CAPABILITY(has_space_attenuation, "Has Space Attenuation");
1226 SCULPT_BRUSH_CAPABILITY(has_strength_pressure, "Has Strength Pressure");
1227 SCULPT_BRUSH_CAPABILITY(has_size_pressure, "Has Size Pressure");
1228 SCULPT_BRUSH_CAPABILITY(has_auto_smooth_pressure, "Has Auto-Smooth Pressure");
1229 SCULPT_BRUSH_CAPABILITY(has_hardness_pressure, "Has Hardness Pressure");
1230 SCULPT_BRUSH_CAPABILITY(has_direction, "Has Direction");
1231 SCULPT_BRUSH_CAPABILITY(has_gravity, "Has Gravity");
1232 SCULPT_BRUSH_CAPABILITY(has_tilt, "Has Tilt");
1233 SCULPT_BRUSH_CAPABILITY(has_dyntopo, "Has Dyntopo");
1234
1235# undef SCULPT_CAPABILITY
1236}
1237
1239{
1240 StructRNA *srna;
1241 PropertyRNA *prop;
1242
1243 srna = RNA_def_struct(brna, "BrushCapabilities", nullptr);
1244 RNA_def_struct_sdna(srna, "Brush");
1245 RNA_def_struct_nested(brna, srna, "Brush");
1247 srna, "Brush Capabilities", "Read-only indications of supported operations");
1248
1249# define 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(prop, "rna_BrushCapabilities_" #prop_name_ "_get", nullptr); \
1253 RNA_def_property_ui_text(prop, ui_name_, nullptr)
1254
1255 BRUSH_CAPABILITY(has_overlay, "Has Overlay");
1256 BRUSH_CAPABILITY(has_random_texture_angle, "Has Random Texture Angle");
1257 BRUSH_CAPABILITY(has_spacing, "Has Spacing");
1258 BRUSH_CAPABILITY(has_smooth_stroke, "Has Smooth Stroke");
1259
1260# undef BRUSH_CAPABILITY
1261}
1262
1264{
1265 StructRNA *srna;
1266 PropertyRNA *prop;
1267
1268 srna = RNA_def_struct(brna, "BrushCapabilitiesImagePaint", nullptr);
1269 RNA_def_struct_sdna(srna, "Brush");
1270 RNA_def_struct_nested(brna, srna, "Brush");
1272 srna, "Image Paint Capabilities", "Read-only indications of supported operations");
1273
1274# define IMAPAINT_BRUSH_CAPABILITY(prop_name_, ui_name_) \
1275 prop = RNA_def_property(srna, #prop_name_, PROP_BOOLEAN, PROP_NONE); \
1276 RNA_def_property_clear_flag(prop, PROP_EDITABLE); \
1277 RNA_def_property_boolean_funcs( \
1278 prop, "rna_BrushCapabilitiesImagePaint_" #prop_name_ "_get", nullptr); \
1279 RNA_def_property_ui_text(prop, ui_name_, nullptr)
1280
1281 IMAPAINT_BRUSH_CAPABILITY(has_accumulate, "Has Accumulate");
1282 IMAPAINT_BRUSH_CAPABILITY(has_space_attenuation, "Has Space Attenuation");
1283 IMAPAINT_BRUSH_CAPABILITY(has_radius, "Has Radius");
1284 IMAPAINT_BRUSH_CAPABILITY(has_color, "Has Color");
1285
1286# undef IMAPAINT_BRUSH_CAPABILITY
1287}
1288
1290{
1291 StructRNA *srna;
1292 PropertyRNA *prop;
1293
1294 srna = RNA_def_struct(brna, "BrushCapabilitiesVertexPaint", nullptr);
1295 RNA_def_struct_sdna(srna, "Brush");
1296 RNA_def_struct_nested(brna, srna, "Brush");
1298 srna, "Vertex Paint Capabilities", "Read-only indications of supported operations");
1299
1300# define VPAINT_BRUSH_CAPABILITY(prop_name_, ui_name_) \
1301 prop = RNA_def_property(srna, #prop_name_, PROP_BOOLEAN, PROP_NONE); \
1302 RNA_def_property_clear_flag(prop, PROP_EDITABLE); \
1303 RNA_def_property_boolean_funcs( \
1304 prop, "rna_BrushCapabilitiesVertexPaint_" #prop_name_ "_get", nullptr); \
1305 RNA_def_property_ui_text(prop, ui_name_, nullptr)
1306
1307 VPAINT_BRUSH_CAPABILITY(has_color, "Has Color");
1308
1309# undef VPAINT_BRUSH_CAPABILITY
1310}
1311
1313{
1314 StructRNA *srna;
1315 PropertyRNA *prop;
1316
1317 srna = RNA_def_struct(brna, "BrushCapabilitiesWeightPaint", nullptr);
1318 RNA_def_struct_sdna(srna, "Brush");
1319 RNA_def_struct_nested(brna, srna, "Brush");
1321 srna, "Weight Paint Capabilities", "Read-only indications of supported operations");
1322
1323# define WPAINT_BRUSH_CAPABILITY(prop_name_, ui_name_) \
1324 prop = RNA_def_property(srna, #prop_name_, PROP_BOOLEAN, PROP_NONE); \
1325 RNA_def_property_clear_flag(prop, PROP_EDITABLE); \
1326 RNA_def_property_boolean_funcs( \
1327 prop, "rna_BrushCapabilitiesWeightPaint_" #prop_name_ "_get", nullptr); \
1328 RNA_def_property_ui_text(prop, ui_name_, nullptr)
1329
1330 WPAINT_BRUSH_CAPABILITY(has_weight, "Has Weight");
1331
1332# undef WPAINT_BRUSH_CAPABILITY
1333}
1334
1336{
1337 StructRNA *srna;
1338 PropertyRNA *prop;
1339
1340 /* modes */
1341 static const EnumPropertyItem gppaint_mode_types_items[] = {
1342 {GPPAINT_MODE_STROKE, "STROKE", 0, "Stroke", "Vertex Color affects to Stroke only"},
1343 {GPPAINT_MODE_FILL, "FILL", 0, "Fill", "Vertex Color affects to Fill only"},
1344 {GPPAINT_MODE_BOTH, "BOTH", 0, "Stroke & Fill", "Vertex Color affects to Stroke and Fill"},
1345 {0, nullptr, 0, nullptr, nullptr},
1346 };
1347
1348 static const EnumPropertyItem rna_enum_gpencil_brush_caps_types_items[] = {
1349 {GP_STROKE_CAP_ROUND, "ROUND", ICON_GP_CAPS_ROUND, "Round", ""},
1350 {GP_STROKE_CAP_FLAT, "FLAT", ICON_GP_CAPS_FLAT, "Flat", ""},
1351 {0, nullptr, 0, nullptr, nullptr},
1352 };
1353
1354 srna = RNA_def_struct(brna, "BrushGpencilSettings", nullptr);
1355 RNA_def_struct_sdna(srna, "BrushGpencilSettings");
1356 RNA_def_struct_path_func(srna, "rna_BrushGpencilSettings_path");
1357 RNA_def_struct_ui_text(srna, "Grease Pencil Brush Settings", "Settings for Grease Pencil brush");
1358
1359 /* Strength factor for new strokes */
1360 prop = RNA_def_property(srna, "pen_strength", PROP_FLOAT, PROP_FACTOR);
1361 RNA_def_property_float_sdna(prop, nullptr, "draw_strength");
1362 RNA_def_property_range(prop, 0.0f, 1.0f);
1363 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
1365 prop, "Strength", "Color strength for new strokes (affect alpha factor of color)");
1368 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1369
1370 /* Jitter factor for new strokes */
1371 prop = RNA_def_property(srna, "pen_jitter", PROP_FLOAT, PROP_FACTOR);
1372 RNA_def_property_float_sdna(prop, nullptr, "draw_jitter");
1373 RNA_def_property_range(prop, 0.0f, 100.0f);
1374 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
1375 RNA_def_property_ui_text(prop, "Jitter", "Jitter factor of brush radius for new strokes");
1378 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1379
1380 /* Randomness factor for pressure */
1381 prop = RNA_def_property(srna, "random_pressure", PROP_FLOAT, PROP_FACTOR);
1382 RNA_def_property_float_sdna(prop, nullptr, "draw_random_press");
1383 RNA_def_property_range(prop, 0.0f, 1.0f);
1385 prop, "Pressure Randomness", "Randomness factor for pressure in new strokes");
1387 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1388
1389 /* Randomness factor for strength */
1390 prop = RNA_def_property(srna, "random_strength", PROP_FLOAT, PROP_FACTOR);
1391 RNA_def_property_float_sdna(prop, nullptr, "draw_random_strength");
1392 RNA_def_property_range(prop, 0.0f, 1.0f);
1394 prop, "Strength Randomness", "Randomness factor strength in new strokes");
1396 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1397
1398 /* Angle when brush is full size */
1399 prop = RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE);
1400 RNA_def_property_float_sdna(prop, nullptr, "draw_angle");
1403 "Angle",
1404 "Direction of the stroke at which brush gives maximal thickness "
1405 "(0" BLI_STR_UTF8_DEGREE_SIGN " for horizontal)");
1407 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1408
1409 /* Factor to change brush size depending of angle */
1410 prop = RNA_def_property(srna, "angle_factor", PROP_FLOAT, PROP_FACTOR);
1411 RNA_def_property_float_sdna(prop, nullptr, "draw_angle_factor");
1412 RNA_def_property_range(prop, 0.0f, 1.0f);
1414 prop,
1415 "Angle Factor",
1416 "Reduce brush thickness by this factor when stroke is perpendicular to 'Angle' direction");
1418 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1419
1420 /* Smoothing factor for new strokes */
1421 prop = RNA_def_property(srna, "pen_smooth_factor", PROP_FLOAT, PROP_NONE);
1422 RNA_def_property_float_sdna(prop, nullptr, "draw_smoothfac");
1423 RNA_def_property_range(prop, 0.0, 2.0);
1424 RNA_def_property_ui_range(prop, 0.0, 1.0, 10, 3);
1426 prop,
1427 "Smooth",
1428 "Amount of smoothing to apply after finish newly created strokes, to reduce jitter/noise");
1431 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1432
1433 /* Iterations of the Smoothing factor */
1434 prop = RNA_def_property(srna, "pen_smooth_steps", PROP_INT, PROP_NONE);
1435 RNA_def_property_int_sdna(prop, nullptr, "draw_smoothlvl");
1436 RNA_def_property_range(prop, 0, 100);
1437 RNA_def_property_ui_text(prop, "Iterations", "Number of times to smooth newly created strokes");
1439 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1440
1441 /* Subdivision level for new strokes */
1442 prop = RNA_def_property(srna, "pen_subdivision_steps", PROP_INT, PROP_NONE);
1443 RNA_def_property_int_sdna(prop, nullptr, "draw_subdivide");
1444 RNA_def_property_range(prop, 0, 3);
1446 prop,
1447 "Subdivision Steps",
1448 "Number of times to subdivide newly created strokes, for less jagged strokes");
1450 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1451
1452 /* Simplify factor */
1453 prop = RNA_def_property(srna, "simplify_factor", PROP_FLOAT, PROP_NONE);
1454 RNA_def_property_float_sdna(prop, nullptr, "simplify_f");
1455 RNA_def_property_range(prop, 0, 100.0);
1456 RNA_def_property_ui_range(prop, 0, 100.0, 1.0f, 3);
1457 RNA_def_property_ui_text(prop, "Simplify", "Factor of Simplify using adaptive algorithm");
1459 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1460
1461 prop = RNA_def_property(srna, "simplify_pixel_threshold", PROP_FLOAT, PROP_PIXEL);
1462 RNA_def_property_float_sdna(prop, nullptr, "simplify_px");
1463 RNA_def_property_range(prop, 0, 10.0);
1464 RNA_def_property_ui_range(prop, 0, 10.0, 1.0f, 1);
1466 prop,
1467 "Simplify",
1468 "Threshold in screen space used for the simplify algorithm. Points within this threshold "
1469 "are treated as if they were in a straight line.");
1471 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1472
1473 /* Curves for pressure */
1474 prop = RNA_def_property(srna, "curve_sensitivity", PROP_POINTER, PROP_NONE);
1475 RNA_def_property_pointer_sdna(prop, nullptr, "curve_sensitivity");
1476 RNA_def_property_struct_type(prop, "CurveMapping");
1477 RNA_def_property_ui_text(prop, "Curve Sensitivity", "Curve used for the sensitivity");
1479 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1480
1481 prop = RNA_def_property(srna, "curve_strength", PROP_POINTER, PROP_NONE);
1482 RNA_def_property_pointer_sdna(prop, nullptr, "curve_strength");
1483 RNA_def_property_struct_type(prop, "CurveMapping");
1484 RNA_def_property_ui_text(prop, "Curve Strength", "Curve used for the strength");
1486 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1487
1488 prop = RNA_def_property(srna, "curve_jitter", PROP_POINTER, PROP_NONE);
1489 RNA_def_property_pointer_sdna(prop, nullptr, "curve_jitter");
1490 RNA_def_property_struct_type(prop, "CurveMapping");
1491 RNA_def_property_ui_text(prop, "Curve Jitter", "Curve used for the jitter effect");
1493 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1494
1495 prop = RNA_def_property(srna, "curve_random_pressure", PROP_POINTER, PROP_NONE);
1496 RNA_def_property_pointer_sdna(prop, nullptr, "curve_rand_pressure");
1497 RNA_def_property_struct_type(prop, "CurveMapping");
1498 RNA_def_property_ui_text(prop, "Random Curve", "Curve used for modulating effect");
1500 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1501
1502 prop = RNA_def_property(srna, "curve_random_strength", PROP_POINTER, PROP_NONE);
1503 RNA_def_property_pointer_sdna(prop, nullptr, "curve_rand_strength");
1504 RNA_def_property_struct_type(prop, "CurveMapping");
1505 RNA_def_property_ui_text(prop, "Random Curve", "Curve used for modulating effect");
1507 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1508
1509 prop = RNA_def_property(srna, "curve_random_uv", PROP_POINTER, PROP_NONE);
1510 RNA_def_property_pointer_sdna(prop, nullptr, "curve_rand_uv");
1511 RNA_def_property_struct_type(prop, "CurveMapping");
1512 RNA_def_property_ui_text(prop, "Random Curve", "Curve used for modulating effect");
1514 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1515
1516 prop = RNA_def_property(srna, "curve_random_hue", PROP_POINTER, PROP_NONE);
1517 RNA_def_property_pointer_sdna(prop, nullptr, "curve_rand_hue");
1518 RNA_def_property_struct_type(prop, "CurveMapping");
1519 RNA_def_property_ui_text(prop, "Random Curve", "Curve used for modulating effect");
1521 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1522
1523 prop = RNA_def_property(srna, "curve_random_saturation", PROP_POINTER, PROP_NONE);
1524 RNA_def_property_pointer_sdna(prop, nullptr, "curve_rand_saturation");
1525 RNA_def_property_struct_type(prop, "CurveMapping");
1526 RNA_def_property_ui_text(prop, "Random Curve", "Curve used for modulating effect");
1528 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1529
1530 prop = RNA_def_property(srna, "curve_random_value", PROP_POINTER, PROP_NONE);
1531 RNA_def_property_pointer_sdna(prop, nullptr, "curve_rand_value");
1532 RNA_def_property_struct_type(prop, "CurveMapping");
1533 RNA_def_property_ui_text(prop, "Random Curve", "Curve used for modulating effect");
1535 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1536
1537 /* Fill threshold for transparency. */
1538 prop = RNA_def_property(srna, "fill_threshold", PROP_FLOAT, PROP_FACTOR);
1539 RNA_def_property_float_sdna(prop, nullptr, "fill_threshold");
1540 RNA_def_property_range(prop, 0.0f, 1.0f);
1542 prop, "Threshold", "Threshold to consider color transparent for filling");
1544 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1545
1546 /* fill factor size */
1547 prop = RNA_def_property(srna, "fill_factor", PROP_FLOAT, PROP_NONE);
1548 RNA_def_property_float_sdna(prop, nullptr, "fill_factor");
1551 prop,
1552 "Precision",
1553 "Factor for fill boundary accuracy, higher values are more accurate but slower");
1555 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1556
1557 /* fill simplify steps */
1558 prop = RNA_def_property(srna, "fill_simplify_level", PROP_INT, PROP_NONE);
1559 RNA_def_property_int_sdna(prop, nullptr, "fill_simplylvl");
1560 RNA_def_property_range(prop, 0, 10);
1562 prop, "Simplify", "Number of simplify steps (large values reduce fill accuracy)");
1564 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1565
1566 prop = RNA_def_property(srna, "uv_random", PROP_FLOAT, PROP_FACTOR);
1567 RNA_def_property_float_sdna(prop, nullptr, "uv_random");
1568 RNA_def_property_range(prop, 0.0, 1.0);
1569 RNA_def_property_ui_text(prop, "UV Random", "Random factor for auto-generated UV rotation");
1571 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1572
1573 /* gradient control */
1574 prop = RNA_def_property(srna, "hardness", PROP_FLOAT, PROP_FACTOR);
1575 RNA_def_property_float_sdna(prop, nullptr, "hardness");
1576 RNA_def_property_range(prop, 0.001f, 1.0f);
1579 prop,
1580 "Hardness",
1581 "Gradient from the center of Dot and Box strokes (set to 1 for a solid stroke)");
1583 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1584
1585 /* gradient shape ratio */
1586 prop = RNA_def_property(srna, "aspect", PROP_FLOAT, PROP_XYZ);
1587 RNA_def_property_float_sdna(prop, nullptr, "aspect_ratio");
1588 RNA_def_property_array(prop, 2);
1589 RNA_def_property_range(prop, 0.01f, 1.0f);
1591 RNA_def_property_ui_text(prop, "Aspect", "");
1593 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1594
1595 prop = RNA_def_property(srna, "input_samples", PROP_INT, PROP_NONE);
1596 RNA_def_property_int_sdna(prop, nullptr, "input_samples");
1599 prop,
1600 "Input Samples",
1601 "Generated intermediate points for very fast mouse movements (Set to 0 to disable)");
1603 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1604
1605 /* active smooth factor while drawing */
1606 prop = RNA_def_property(srna, "active_smooth_factor", PROP_FLOAT, PROP_FACTOR);
1607 RNA_def_property_float_sdna(prop, nullptr, "active_smooth");
1608 RNA_def_property_range(prop, 0.0f, 1.0f);
1609 RNA_def_property_ui_text(prop, "Active Smooth", "Amount of smoothing while drawing");
1611 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1612
1613 prop = RNA_def_property(srna, "eraser_strength_factor", PROP_FLOAT, PROP_PERCENTAGE);
1614 RNA_def_property_float_sdna(prop, nullptr, "era_strength_f");
1615 RNA_def_property_range(prop, 0.0, 100.0);
1616 RNA_def_property_ui_range(prop, 0.0, 100.0, 10, 1);
1617 RNA_def_property_ui_text(prop, "Affect Stroke Strength", "Amount of erasing for strength");
1619 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1620
1621 prop = RNA_def_property(srna, "eraser_thickness_factor", PROP_FLOAT, PROP_PERCENTAGE);
1622 RNA_def_property_float_sdna(prop, nullptr, "era_thickness_f");
1623 RNA_def_property_range(prop, 0.0, 100.0);
1624 RNA_def_property_ui_range(prop, 0.0, 100.0, 10, 1);
1625 RNA_def_property_ui_text(prop, "Affect Stroke Thickness", "Amount of erasing for thickness");
1627 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1628
1629 /* Mode type. */
1630 prop = RNA_def_property(srna, "vertex_mode", PROP_ENUM, PROP_NONE);
1631 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "vertex_mode");
1632 RNA_def_property_enum_items(prop, gppaint_mode_types_items);
1633 RNA_def_property_ui_text(prop, "Mode Type", "Defines how vertex color affect to the strokes");
1635 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1636
1637 /* Vertex Color mix factor. */
1638 prop = RNA_def_property(srna, "vertex_color_factor", PROP_FLOAT, PROP_FACTOR);
1639 RNA_def_property_float_sdna(prop, nullptr, "vertex_factor");
1640 RNA_def_property_range(prop, 0.0f, 1.0f);
1643 prop, "Vertex Color Factor", "Factor used to mix vertex color to get final color");
1644 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1645
1646 /* Hue randomness. */
1647 prop = RNA_def_property(srna, "random_hue_factor", PROP_FLOAT, PROP_FACTOR);
1648 RNA_def_property_float_sdna(prop, nullptr, "random_hue");
1649 RNA_def_property_range(prop, 0.0f, 1.0f);
1651 RNA_def_property_ui_text(prop, "Hue", "Random factor to modify original hue");
1653
1654 /* Saturation randomness. */
1655 prop = RNA_def_property(srna, "random_saturation_factor", PROP_FLOAT, PROP_FACTOR);
1656 RNA_def_property_float_sdna(prop, nullptr, "random_saturation");
1657 RNA_def_property_range(prop, 0.0f, 1.0f);
1659 RNA_def_property_ui_text(prop, "Saturation", "Random factor to modify original saturation");
1661 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1662
1663 /* Value randomness. */
1664 prop = RNA_def_property(srna, "random_value_factor", PROP_FLOAT, PROP_FACTOR);
1665 RNA_def_property_float_sdna(prop, nullptr, "random_value");
1666 RNA_def_property_range(prop, 0.0f, 1.0f);
1668 RNA_def_property_ui_text(prop, "Value", "Random factor to modify original value");
1670 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1671
1672 /* Factor to extend stroke extremes in Fill brush. */
1673 prop = RNA_def_property(srna, "extend_stroke_factor", PROP_FLOAT, PROP_NONE);
1674 RNA_def_property_float_sdna(prop, nullptr, "fill_extend_fac");
1675 RNA_def_property_range(prop, 0.0f, 10.0f);
1678 prop, "Closure Size", "Strokes end extension for closing gaps, use zero to disable");
1680 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1681
1682 prop = RNA_def_property(srna, "fill_extend_mode", PROP_ENUM, PROP_NONE);
1683 RNA_def_property_enum_sdna(prop, nullptr, "fill_extend_mode");
1686 prop, "Closure Mode", "Types of stroke extensions used for closing gaps");
1689 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1690
1691 /* Number of pixels to dilate fill area. Negative values contract the filled area. */
1692 prop = RNA_def_property(srna, "dilate", PROP_INT, PROP_PIXEL);
1693 RNA_def_property_int_sdna(prop, nullptr, "dilate_pixels");
1694 RNA_def_property_range(prop, -40, 40);
1697 prop, "Dilate/Contract", "Number of pixels to expand or contract fill area");
1699 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1700
1701 /* Factor to determine outline external perimeter thickness. */
1702 prop = RNA_def_property(srna, "outline_thickness_factor", PROP_FLOAT, PROP_FACTOR);
1703 RNA_def_property_float_sdna(prop, nullptr, "outline_fac");
1704 RNA_def_property_range(prop, 0.0f, 1.0f);
1707 prop, "Thickness", "Thickness of the outline stroke relative to current brush thickness");
1709 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1710
1711 /* Flags */
1712 prop = RNA_def_property(srna, "use_pressure", PROP_BOOLEAN, PROP_NONE);
1714 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
1715 RNA_def_property_ui_text(prop, "Use Pressure", "Use tablet pressure");
1717 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1718
1719 prop = RNA_def_property(srna, "use_strength_pressure", PROP_BOOLEAN, PROP_NONE);
1721 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
1723 prop, "Use Pressure Strength", "Use tablet pressure for color strength");
1725 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1726
1727 prop = RNA_def_property(srna, "use_jitter_pressure", PROP_BOOLEAN, PROP_NONE);
1729 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
1730 RNA_def_property_ui_text(prop, "Use Pressure Jitter", "Use tablet pressure for jitter");
1732 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1733
1734 prop = RNA_def_property(srna, "use_stroke_random_hue", PROP_BOOLEAN, PROP_NONE);
1736 RNA_def_property_ui_icon(prop, ICON_GP_SELECT_STROKES, 0);
1737 RNA_def_property_ui_text(prop, "Stroke Random", "Use randomness at stroke level");
1739 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1740
1741 prop = RNA_def_property(srna, "use_stroke_random_sat", PROP_BOOLEAN, PROP_NONE);
1743 RNA_def_property_ui_icon(prop, ICON_GP_SELECT_STROKES, 0);
1744 RNA_def_property_ui_text(prop, "Stroke Random", "Use randomness at stroke level");
1746 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1747
1748 prop = RNA_def_property(srna, "use_stroke_random_val", PROP_BOOLEAN, PROP_NONE);
1750 RNA_def_property_ui_icon(prop, ICON_GP_SELECT_STROKES, 0);
1751 RNA_def_property_ui_text(prop, "Stroke Random", "Use randomness at stroke level");
1753 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1754
1755 prop = RNA_def_property(srna, "use_stroke_random_radius", PROP_BOOLEAN, PROP_NONE);
1757 RNA_def_property_ui_icon(prop, ICON_GP_SELECT_STROKES, 0);
1758 RNA_def_property_ui_text(prop, "Stroke Random", "Use randomness at stroke level");
1760 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1761
1762 prop = RNA_def_property(srna, "use_stroke_random_strength", PROP_BOOLEAN, PROP_NONE);
1764 RNA_def_property_ui_icon(prop, ICON_GP_SELECT_STROKES, 0);
1765 RNA_def_property_ui_text(prop, "Stroke Random", "Use randomness at stroke level");
1767 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1768
1769 prop = RNA_def_property(srna, "use_stroke_random_uv", PROP_BOOLEAN, PROP_NONE);
1771 RNA_def_property_ui_icon(prop, ICON_GP_SELECT_STROKES, 0);
1772 RNA_def_property_ui_text(prop, "Stroke Random", "Use randomness at stroke level");
1774 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1775
1776 prop = RNA_def_property(srna, "use_random_press_hue", PROP_BOOLEAN, PROP_NONE);
1778 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
1779 RNA_def_property_ui_text(prop, "Use Pressure", "Use pressure to modulate randomness");
1781 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1782
1783 prop = RNA_def_property(srna, "use_random_press_sat", PROP_BOOLEAN, PROP_NONE);
1785 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
1786 RNA_def_property_ui_text(prop, "Use Pressure", "Use pressure to modulate randomness");
1788 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1789
1790 prop = RNA_def_property(srna, "use_random_press_val", PROP_BOOLEAN, PROP_NONE);
1792 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
1793 RNA_def_property_ui_text(prop, "Use Pressure", "Use pressure to modulate randomness");
1795 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1796
1797 prop = RNA_def_property(srna, "use_random_press_radius", PROP_BOOLEAN, PROP_NONE);
1799 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
1800 RNA_def_property_ui_text(prop, "Use Pressure", "Use pressure to modulate randomness");
1802 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1803
1804 prop = RNA_def_property(srna, "use_random_press_strength", PROP_BOOLEAN, PROP_NONE);
1806 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
1807 RNA_def_property_ui_text(prop, "Use Pressure", "Use pressure to modulate randomness");
1809 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1810
1811 prop = RNA_def_property(srna, "use_random_press_uv", PROP_BOOLEAN, PROP_NONE);
1813 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
1814 RNA_def_property_ui_text(prop, "Use Pressure", "Use pressure to modulate randomness");
1816 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1817
1818 prop = RNA_def_property(srna, "use_settings_stabilizer", PROP_BOOLEAN, PROP_NONE);
1822 "Use Stabilizer",
1823 "Draw lines with a delay to allow smooth strokes (press Shift key to "
1824 "override while drawing)");
1826 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1827
1828 prop = RNA_def_property(srna, "eraser_mode", PROP_ENUM, PROP_NONE);
1829 RNA_def_property_enum_sdna(prop, nullptr, "eraser_mode");
1831 RNA_def_property_ui_text(prop, "Mode", "Eraser Mode");
1834 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1835
1836 prop = RNA_def_property(srna, "caps_type", PROP_ENUM, PROP_NONE);
1837 RNA_def_property_enum_sdna(prop, nullptr, "caps_type");
1838 RNA_def_property_enum_items(prop, rna_enum_gpencil_brush_caps_types_items);
1839 RNA_def_property_ui_text(prop, "Caps Type", "The shape of the start and end of the stroke");
1842 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1843
1844 prop = RNA_def_property(srna, "fill_draw_mode", PROP_ENUM, PROP_NONE);
1845 RNA_def_property_enum_sdna(prop, nullptr, "fill_draw_mode");
1847 RNA_def_property_ui_text(prop, "Mode", "Mode to draw boundary limits");
1849 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1850
1851 prop = RNA_def_property(srna, "fill_layer_mode", PROP_ENUM, PROP_NONE);
1852 RNA_def_property_enum_sdna(prop, nullptr, "fill_layer_mode");
1854 RNA_def_property_ui_text(prop, "Layer Mode", "Layers used as boundaries");
1856 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1857
1858 prop = RNA_def_property(srna, "fill_direction", PROP_ENUM, PROP_NONE);
1859 RNA_def_property_enum_sdna(prop, nullptr, "fill_direction");
1861 RNA_def_property_ui_text(prop, "Direction", "Direction of the fill");
1864 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1865
1866 prop = RNA_def_property(srna, "pin_draw_mode", PROP_BOOLEAN, PROP_NONE);
1868 prop, "rna_GPencilBrush_pin_mode_get", "rna_GPencilBrush_pin_mode_set");
1869 RNA_def_property_ui_icon(prop, ICON_UNPINNED, 1);
1872 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencilBrush_pin_mode_update");
1873 RNA_def_property_ui_text(prop, "Pin Mode", "Pin the mode to the brush");
1874
1875 prop = RNA_def_property(srna, "brush_draw_mode", PROP_ENUM, PROP_NONE);
1876 RNA_def_property_enum_sdna(prop, nullptr, "brush_draw_mode");
1878 RNA_def_property_ui_text(prop, "Mode", "Preselected mode when using this brush");
1880 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1881
1882 prop = RNA_def_property(srna, "use_trim", PROP_BOOLEAN, PROP_NONE);
1885 RNA_def_property_ui_text(prop, "Trim Stroke Ends", "Trim intersecting stroke ends");
1887 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1888
1889 prop = RNA_def_property(srna, "use_settings_outline", PROP_BOOLEAN, PROP_NONE);
1892 RNA_def_property_ui_text(prop, "Outline", "Convert stroke to outline");
1894 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1895
1896 prop = RNA_def_property(srna, "use_edit_position", PROP_BOOLEAN, PROP_NONE);
1898 prop, nullptr, "sculpt_mode_flag", GP_SCULPT_FLAGMODE_APPLY_POSITION);
1899 RNA_def_property_ui_text(prop, "Affect Position", "The brush affects the position of the point");
1901 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_BrushGpencilSettings_update");
1902
1903 prop = RNA_def_property(srna, "use_edit_strength", PROP_BOOLEAN, PROP_NONE);
1905 prop, nullptr, "sculpt_mode_flag", GP_SCULPT_FLAGMODE_APPLY_STRENGTH);
1907 prop, "Affect Strength", "The brush affects the color strength of the point");
1909 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_BrushGpencilSettings_update");
1910
1911 prop = RNA_def_property(srna, "use_edit_thickness", PROP_BOOLEAN, PROP_NONE);
1913 prop, nullptr, "sculpt_mode_flag", GP_SCULPT_FLAGMODE_APPLY_THICKNESS);
1915 prop, "Affect Thickness", "The brush affects the thickness of the point");
1917 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_BrushGpencilSettings_update");
1918
1919 prop = RNA_def_property(srna, "use_edit_uv", PROP_BOOLEAN, PROP_NONE);
1920 RNA_def_property_boolean_sdna(prop, nullptr, "sculpt_mode_flag", GP_SCULPT_FLAGMODE_APPLY_UV);
1921 RNA_def_property_ui_text(prop, "Affect UV", "The brush affects the UV rotation of the point");
1923 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_BrushGpencilSettings_update");
1924
1925 /* Material */
1926 prop = RNA_def_property(srna, "material", PROP_POINTER, PROP_NONE);
1927 RNA_def_property_struct_type(prop, "Material");
1929 prop, nullptr, nullptr, nullptr, "rna_BrushGpencilSettings_material_poll");
1931 RNA_def_property_ui_text(prop, "Material", "Material used for strokes drawn using this brush");
1933 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_Brush_material_update");
1934
1935 /* Secondary Material */
1936 prop = RNA_def_property(srna, "material_alt", PROP_POINTER, PROP_NONE);
1937 RNA_def_property_struct_type(prop, "Material");
1939 prop, nullptr, nullptr, nullptr, "rna_BrushGpencilSettings_material_poll");
1941 RNA_def_property_ui_text(prop, "Material", "Material used for secondary uses for this brush");
1943 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_Brush_material_update");
1944
1945 prop = RNA_def_property(srna, "show_fill_boundary", PROP_BOOLEAN, PROP_NONE);
1948 RNA_def_property_ui_text(prop, "Show Lines", "Show help lines for filling to see boundaries");
1950 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1951
1952 prop = RNA_def_property(srna, "show_fill_extend", PROP_BOOLEAN, PROP_NONE);
1955 RNA_def_property_ui_text(prop, "Visual Aids", "Show help lines for stroke extension");
1957 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1958
1959 prop = RNA_def_property(srna, "use_collide_strokes", PROP_BOOLEAN, PROP_NONE);
1963 prop, "Strokes Collision", "Check if extend lines collide with strokes");
1965 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1966
1967 prop = RNA_def_property(srna, "show_fill", PROP_BOOLEAN, PROP_NONE);
1971 prop, "Show Fill", "Show transparent lines to use as boundary for filling");
1973 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1974
1975 prop = RNA_def_property(srna, "use_auto_remove_fill_guides", PROP_BOOLEAN, PROP_NONE);
1979 "Auto-Remove Fill Guides",
1980 "Automatically remove fill guide strokes after fill operation");
1982 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1983
1984 prop = RNA_def_property(srna, "use_fill_limit", PROP_BOOLEAN, PROP_NONE);
1987 RNA_def_property_ui_text(prop, "Limit to Viewport", "Fill only visible areas in viewport");
1989 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1990
1991 prop = RNA_def_property(srna, "use_settings_postprocess", PROP_BOOLEAN, PROP_NONE);
1994 prop, "Use Post-Process Settings", "Additional post processing options for new strokes");
1996 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1997
1998 prop = RNA_def_property(srna, "use_settings_random", PROP_BOOLEAN, PROP_NONE);
2000 RNA_def_property_ui_text(prop, "Random Settings", "Random brush settings");
2002 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
2003
2004 prop = RNA_def_property(srna, "use_material_pin", PROP_BOOLEAN, PROP_NONE);
2007 RNA_def_property_ui_icon(prop, ICON_UNPINNED, 1);
2008 RNA_def_property_ui_text(prop, "Pin Material", "Keep material assigned to brush");
2011 prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_use_material_pin_update");
2012
2013 prop = RNA_def_property(srna, "show_lasso", PROP_BOOLEAN, PROP_NONE);
2016 prop, "Show Lasso", "Do not display fill color while drawing the stroke");
2018 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
2019
2020 prop = RNA_def_property(srna, "use_occlude_eraser", PROP_BOOLEAN, PROP_NONE);
2022 RNA_def_property_ui_text(prop, "Occlude Eraser", "Erase only strokes visible and not occluded");
2024 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
2025
2026 prop = RNA_def_property(srna, "use_keep_caps_eraser", PROP_BOOLEAN, PROP_NONE);
2029 prop, "Keep Caps", "Keep the caps as they are and don't flatten them when erasing");
2031 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
2032
2033 prop = RNA_def_property(srna, "use_active_layer_only", PROP_BOOLEAN, PROP_NONE);
2035 RNA_def_property_ui_text(prop, "Active Layer", "Only edit the active layer of the object");
2037 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
2038}
2039
2041{
2042 StructRNA *srna;
2043 PropertyRNA *prop;
2044
2045 static const EnumPropertyItem density_mode_items[] = {
2047 "AUTO",
2048 ICON_AUTO,
2049 "Auto",
2050 "Either add or remove curves depending on the minimum distance of the curves under the "
2051 "cursor"},
2053 "ADD",
2054 ICON_ADD,
2055 "Add",
2056 "Add new curves between existing curves, taking the minimum distance into account"},
2058 "REMOVE",
2059 ICON_REMOVE,
2060 "Remove",
2061 "Remove curves whose root points are too close"},
2062 {0, nullptr, 0, nullptr, nullptr},
2063 };
2064
2065 srna = RNA_def_struct(brna, "BrushCurvesSculptSettings", nullptr);
2066 RNA_def_struct_path_func(srna, "rna_BrushCurvesSculptSettings_path");
2067 RNA_def_struct_sdna(srna, "BrushCurvesSculptSettings");
2068 RNA_def_struct_ui_text(srna, "Curves Sculpt Brush Settings", "");
2069
2070 prop = RNA_def_property(srna, "add_amount", PROP_INT, PROP_NONE);
2072 RNA_def_property_ui_text(prop, "Count", "Number of curves added by the Add brush");
2073 RNA_def_property_update(prop, 0, "rna_BrushCurvesSculptSettings_update");
2074
2075 prop = RNA_def_property(srna, "points_per_curve", PROP_INT, PROP_NONE);
2078 prop, "Points per Curve", "Number of control points in a newly added curve");
2079 RNA_def_property_update(prop, 0, "rna_BrushCurvesSculptSettings_update");
2080
2081 prop = RNA_def_property(srna, "use_uniform_scale", PROP_BOOLEAN, PROP_NONE);
2084 "Scale Uniform",
2085 "Grow or shrink curves by changing their size uniformly instead of "
2086 "using trimming or extrapolation");
2087 RNA_def_property_update(prop, 0, "rna_BrushCurvesSculptSettings_update");
2088
2089 prop = RNA_def_property(srna, "minimum_length", PROP_FLOAT, PROP_DISTANCE);
2090 RNA_def_property_range(prop, 0.0f, FLT_MAX);
2092 prop, "Minimum Length", "Avoid shrinking curves shorter than this length");
2093
2094 prop = RNA_def_property(srna, "use_length_interpolate", PROP_BOOLEAN, PROP_NONE);
2096 prop, nullptr, "flag", BRUSH_CURVES_SCULPT_FLAG_INTERPOLATE_LENGTH);
2098 prop, "Interpolate Length", "Use length of the curves in close proximity");
2099 RNA_def_property_update(prop, 0, "rna_BrushCurvesSculptSettings_update");
2100
2101 prop = RNA_def_property(srna, "use_radius_interpolate", PROP_BOOLEAN, PROP_NONE);
2103 prop, nullptr, "flag", BRUSH_CURVES_SCULPT_FLAG_INTERPOLATE_RADIUS);
2106 prop, "Interpolate Radius", "Use radius of the curves in close proximity");
2107 RNA_def_property_update(prop, 0, "rna_BrushCurvesSculptSettings_update");
2108
2109 prop = RNA_def_property(srna, "use_point_count_interpolate", PROP_BOOLEAN, PROP_NONE);
2113 "Interpolate Point Count",
2114 "Use the number of points from the curves in close proximity");
2115 RNA_def_property_update(prop, 0, "rna_BrushCurvesSculptSettings_update");
2116
2117 prop = RNA_def_property(srna, "use_shape_interpolate", PROP_BOOLEAN, PROP_NONE);
2120 prop, "Interpolate Shape", "Use shape of the curves in close proximity");
2121 RNA_def_property_update(prop, 0, "rna_BrushCurvesSculptSettings_update");
2122
2123 prop = RNA_def_property(srna, "curve_length", PROP_FLOAT, PROP_DISTANCE);
2124 RNA_def_property_range(prop, 0.0, FLT_MAX);
2126 prop,
2127 "Curve Length",
2128 "Length of newly added curves when it is not interpolated from other curves");
2129 RNA_def_property_update(prop, 0, "rna_BrushCurvesSculptSettings_update");
2130
2131 prop = RNA_def_property(srna, "minimum_distance", PROP_FLOAT, PROP_DISTANCE);
2132 RNA_def_property_range(prop, 0.0f, FLT_MAX);
2133 RNA_def_property_ui_range(prop, 0.0, 1000.0f, 0.001, 2);
2135 prop, "Minimum Distance", "Goal distance between curve roots for the Density brush");
2136 RNA_def_property_update(prop, 0, "rna_BrushCurvesSculptSettings_update");
2137
2138 prop = RNA_def_property(srna, "curve_radius", PROP_FLOAT, PROP_DISTANCE);
2139 RNA_def_property_range(prop, 0.0, FLT_MAX);
2140 RNA_def_property_float_default(prop, 0.01f);
2141 RNA_def_property_ui_range(prop, 0.0, 1000.0f, 0.001, 2);
2143 prop,
2144 "Curve Radius",
2145 "Radius of newly added curves when it is not interpolated from other curves");
2146 RNA_def_property_update(prop, 0, "rna_BrushCurvesSculptSettings_update");
2147
2148 prop = RNA_def_property(srna, "density_add_attempts", PROP_INT, PROP_NONE);
2151 prop, "Density Add Attempts", "How many times the Density brush tries to add a new curve");
2152 RNA_def_property_update(prop, 0, "rna_BrushCurvesSculptSettings_update");
2153
2154 prop = RNA_def_property(srna, "density_mode", PROP_ENUM, PROP_NONE);
2155 RNA_def_property_enum_items(prop, density_mode_items);
2157 prop, "Density Mode", "Determines whether the brush adds or removes curves");
2159 RNA_def_property_update(prop, 0, "rna_BrushCurvesSculptSettings_update");
2160
2161 prop = RNA_def_property(srna, "curve_parameter_falloff", PROP_POINTER, PROP_NONE);
2162 RNA_def_property_struct_type(prop, "CurveMapping");
2164 "Curve Parameter Falloff",
2165 "Falloff that is applied from the tip to the root of each curve");
2166 RNA_def_property_update(prop, 0, "rna_BrushCurvesSculptSettings_update");
2167}
2168
2169static void rna_def_brush(BlenderRNA *brna)
2170{
2171 StructRNA *srna;
2172 PropertyRNA *prop;
2173
2174 static const EnumPropertyItem prop_blend_items[] = {
2175 {IMB_BLEND_MIX, "MIX", 0, "Mix", "Use Mix blending mode while painting"},
2177 {IMB_BLEND_DARKEN, "DARKEN", 0, "Darken", "Use Darken blending mode while painting"},
2178 {IMB_BLEND_MUL, "MUL", 0, "Multiply", "Use Multiply blending mode while painting"},
2180 "COLORBURN",
2181 0,
2182 "Color Burn",
2183 "Use Color Burn blending mode while painting"},
2185 "LINEARBURN",
2186 0,
2187 "Linear Burn",
2188 "Use Linear Burn blending mode while painting"},
2190 {IMB_BLEND_LIGHTEN, "LIGHTEN", 0, "Lighten", "Use Lighten blending mode while painting"},
2191 {IMB_BLEND_SCREEN, "SCREEN", 0, "Screen", "Use Screen blending mode while painting"},
2193 "COLORDODGE",
2194 0,
2195 "Color Dodge",
2196 "Use Color Dodge blending mode while painting"},
2197 {IMB_BLEND_ADD, "ADD", 0, "Add", "Use Add blending mode while painting"},
2199 {IMB_BLEND_OVERLAY, "OVERLAY", 0, "Overlay", "Use Overlay blending mode while painting"},
2201 "SOFTLIGHT",
2202 0,
2203 "Soft Light",
2204 "Use Soft Light blending mode while painting"},
2206 "HARDLIGHT",
2207 0,
2208 "Hard Light",
2209 "Use Hard Light blending mode while painting"},
2211 "VIVIDLIGHT",
2212 0,
2213 "Vivid Light",
2214 "Use Vivid Light blending mode while painting"},
2216 "LINEARLIGHT",
2217 0,
2218 "Linear Light",
2219 "Use Linear Light blending mode while painting"},
2221 "PINLIGHT",
2222 0,
2223 "Pin Light",
2224 "Use Pin Light blending mode while painting"},
2227 "DIFFERENCE",
2228 0,
2229 "Difference",
2230 "Use Difference blending mode while painting"},
2232 "EXCLUSION",
2233 0,
2234 "Exclusion",
2235 "Use Exclusion blending mode while painting"},
2236 {IMB_BLEND_SUB, "SUB", 0, "Subtract", "Use Subtract blending mode while painting"},
2238 {IMB_BLEND_HUE, "HUE", 0, "Hue", "Use Hue blending mode while painting"},
2240 "SATURATION",
2241 0,
2242 "Saturation",
2243 "Use Saturation blending mode while painting"},
2244 {IMB_BLEND_COLOR, "COLOR", 0, "Color", "Use Color blending mode while painting"},
2245 {IMB_BLEND_LUMINOSITY, "LUMINOSITY", 0, "Value", "Use Value blending mode while painting"},
2247 {IMB_BLEND_ERASE_ALPHA, "ERASE_ALPHA", 0, "Erase Alpha", "Erase alpha while painting"},
2248 {IMB_BLEND_ADD_ALPHA, "ADD_ALPHA", 0, "Add Alpha", "Add alpha while painting"},
2249 {0, nullptr, 0, nullptr, nullptr},
2250 };
2251
2252 static const EnumPropertyItem brush_sculpt_plane_items[] = {
2253 {SCULPT_DISP_DIR_AREA, "AREA", 0, "Area Plane", ""},
2254 {SCULPT_DISP_DIR_VIEW, "VIEW", 0, "View Plane", ""},
2255 {SCULPT_DISP_DIR_X, "X", 0, "X Plane", ""},
2256 {SCULPT_DISP_DIR_Y, "Y", 0, "Y Plane", ""},
2257 {SCULPT_DISP_DIR_Z, "Z", 0, "Z Plane", ""},
2258 {0, nullptr, 0, nullptr, nullptr},
2259 };
2260
2261 static const EnumPropertyItem brush_mask_tool_items[] = {
2262 {BRUSH_MASK_DRAW, "DRAW", 0, "Draw", ""},
2263 {BRUSH_MASK_SMOOTH, "SMOOTH", 0, "Smooth", ""},
2264 {0, nullptr, 0, nullptr, nullptr},
2265 };
2266
2267 static const EnumPropertyItem brush_blur_mode_items[] = {
2268 {KERNEL_BOX, "BOX", 0, "Box", ""},
2269 {KERNEL_GAUSSIAN, "GAUSSIAN", 0, "Gaussian", ""},
2270 {0, nullptr, 0, nullptr, nullptr},
2271 };
2272
2273 static const EnumPropertyItem brush_gradient_items[] = {
2274 {BRUSH_GRADIENT_PRESSURE, "PRESSURE", 0, "Pressure", ""},
2275 {BRUSH_GRADIENT_SPACING_REPEAT, "SPACING_REPEAT", 0, "Repeat", ""},
2276 {BRUSH_GRADIENT_SPACING_CLAMP, "SPACING_CLAMP", 0, "Clamp", ""},
2277 {0, nullptr, 0, nullptr, nullptr},
2278 };
2279
2280 static const EnumPropertyItem brush_gradient_fill_items[] = {
2281 {BRUSH_GRADIENT_LINEAR, "LINEAR", 0, "Linear", ""},
2282 {BRUSH_GRADIENT_RADIAL, "RADIAL", 0, "Radial", ""},
2283 {0, nullptr, 0, nullptr, nullptr},
2284 };
2285
2286 static const EnumPropertyItem brush_mask_pressure_items[] = {
2287 {0, "NONE", 0, "Off", ""},
2288 {BRUSH_MASK_PRESSURE_RAMP, "RAMP", ICON_STYLUS_PRESSURE, "Ramp", ""},
2289 {BRUSH_MASK_PRESSURE_CUTOFF, "CUTOFF", ICON_STYLUS_PRESSURE, "Cutoff", ""},
2290 {0, nullptr, 0, nullptr, nullptr},
2291 };
2292
2293 static const EnumPropertyItem brush_size_unit_items[] = {
2294 {0, "VIEW", 0, "View", "Measure brush size relative to the view"},
2295 {BRUSH_LOCK_SIZE, "SCENE", 0, "Scene", "Measure brush size relative to the scene"},
2296 {0, nullptr, 0, nullptr, nullptr},
2297 };
2298
2299 static const EnumPropertyItem color_gradient_items[] = {
2300 {0, "COLOR", 0, "Color", "Paint with a single color"},
2301 {BRUSH_USE_GRADIENT, "GRADIENT", 0, "Gradient", "Paint with a gradient"},
2302 {0, nullptr, 0, nullptr, nullptr},
2303 };
2304
2305 static const EnumPropertyItem brush_spacing_unit_items[] = {
2306 {0, "VIEW", 0, "View", "Calculate brush spacing relative to the view"},
2308 "SCENE",
2309 0,
2310 "Scene",
2311 "Calculate brush spacing relative to the scene using the stroke location"},
2312 {0, nullptr, 0, nullptr, nullptr},
2313 };
2314
2315 static const EnumPropertyItem brush_jitter_unit_items[] = {
2316 {BRUSH_ABSOLUTE_JITTER, "VIEW", 0, "View", "Jittering happens in screen space, in pixels"},
2317 {0, "BRUSH", 0, "Brush", "Jittering happens relative to the brush size"},
2318 {0, nullptr, 0, nullptr, nullptr},
2319 };
2320
2321 static const EnumPropertyItem falloff_shape_unit_items[] = {
2322 {0, "SPHERE", 0, "Sphere", "Apply brush influence in a Sphere, outwards from the center"},
2324 "PROJECTED",
2325 0,
2326 "Projected",
2327 "Apply brush influence in a 2D circle, projected from the view"},
2328 {0, nullptr, 0, nullptr, nullptr},
2329 };
2330
2331 static const EnumPropertyItem brush_deformation_target_items[] = {
2333 "GEOMETRY",
2334 0,
2335 "Geometry",
2336 "Brush deformation displaces the vertices of the mesh"},
2338 "CLOTH_SIM",
2339 0,
2340 "Cloth Simulation",
2341 "Brush deforms the mesh by deforming the constraints of a cloth simulation"},
2342 {0, nullptr, 0, nullptr, nullptr},
2343 };
2344
2345 static const EnumPropertyItem brush_elastic_deform_type_items[] = {
2346 {BRUSH_ELASTIC_DEFORM_GRAB, "GRAB", 0, "Grab", ""},
2347 {BRUSH_ELASTIC_DEFORM_GRAB_BISCALE, "GRAB_BISCALE", 0, "Bi-Scale Grab", ""},
2348 {BRUSH_ELASTIC_DEFORM_GRAB_TRISCALE, "GRAB_TRISCALE", 0, "Tri-Scale Grab", ""},
2349 {BRUSH_ELASTIC_DEFORM_SCALE, "SCALE", 0, "Scale", ""},
2350 {BRUSH_ELASTIC_DEFORM_TWIST, "TWIST", 0, "Twist", ""},
2351 {0, nullptr, 0, nullptr, nullptr},
2352 };
2353
2354 static const EnumPropertyItem brush_snake_hook_deform_type_items[] = {
2356 "FALLOFF",
2357 0,
2358 "Radius Falloff",
2359 "Applies the brush falloff in the tip of the brush"},
2361 "ELASTIC",
2362 0,
2363 "Elastic",
2364 "Modifies the entire mesh using elastic deform"},
2365 {0, nullptr, 0, nullptr, nullptr},
2366 };
2367
2368 static const EnumPropertyItem brush_plane_inversion_mode_items[] = {
2370 "INVERT_DISPLACEMENT",
2371 0,
2372 "Invert Displacement",
2373 "Displace the vertices away from the plane."},
2375 "SWAP_DEPTH_AND_HEIGHT",
2376 0,
2377 "Swap Height and Depth",
2378 "Swap the roles of Height and Depth."},
2379 {0, nullptr, 0, nullptr, nullptr},
2380 };
2381
2382 static const EnumPropertyItem brush_cloth_deform_type_items[] = {
2383 {BRUSH_CLOTH_DEFORM_DRAG, "DRAG", 0, "Drag", ""},
2384 {BRUSH_CLOTH_DEFORM_PUSH, "PUSH", 0, "Push", ""},
2385 {BRUSH_CLOTH_DEFORM_PINCH_POINT, "PINCH_POINT", 0, "Pinch Point", ""},
2387 "PINCH_PERPENDICULAR",
2388 0,
2389 "Pinch Perpendicular",
2390 ""},
2391 {BRUSH_CLOTH_DEFORM_INFLATE, "INFLATE", 0, "Inflate", ""},
2392 {BRUSH_CLOTH_DEFORM_GRAB, "GRAB", 0, "Grab", ""},
2393 {BRUSH_CLOTH_DEFORM_EXPAND, "EXPAND", 0, "Expand", ""},
2394 {BRUSH_CLOTH_DEFORM_SNAKE_HOOK, "SNAKE_HOOK", 0, "Snake Hook", ""},
2395 {0, nullptr, 0, nullptr, nullptr},
2396 };
2397
2398 static const EnumPropertyItem brush_cloth_force_falloff_type_items[] = {
2399 {BRUSH_CLOTH_FORCE_FALLOFF_RADIAL, "RADIAL", 0, "Radial", ""},
2400 {BRUSH_CLOTH_FORCE_FALLOFF_PLANE, "PLANE", 0, "Plane", ""},
2401 {0, nullptr, 0, nullptr, nullptr},
2402 };
2403
2404 static const EnumPropertyItem brush_boundary_falloff_type_items[] = {
2406 "CONSTANT",
2407 0,
2408 "Constant",
2409 "Applies the same deformation in the entire boundary"},
2411 "RADIUS",
2412 0,
2413 "Brush Radius",
2414 "Applies the deformation in a localized area limited by the brush radius"},
2416 "LOOP",
2417 0,
2418 "Loop",
2419 "Applies the brush falloff in a loop pattern"},
2421 "LOOP_INVERT",
2422 0,
2423 "Loop and Invert",
2424 "Applies the falloff radius in a loop pattern, inverting the displacement direction in "
2425 "each pattern repetition"},
2426 {0, nullptr, 0, nullptr, nullptr},
2427 };
2428
2429 static const EnumPropertyItem brush_cloth_simulation_area_type_items[] = {
2431 "LOCAL",
2432 0,
2433 "Local",
2434 "Simulates only a specific area around the brush limited by a fixed radius"},
2435 {BRUSH_CLOTH_SIMULATION_AREA_GLOBAL, "GLOBAL", 0, "Global", "Simulates the entire mesh"},
2437 "DYNAMIC",
2438 0,
2439 "Dynamic",
2440 "The active simulation area moves with the brush"},
2441 {0, nullptr, 0, nullptr, nullptr},
2442 };
2443
2444 static const EnumPropertyItem brush_smooth_deform_type_items[] = {
2446 "LAPLACIAN",
2447 0,
2448 "Laplacian",
2449 "Smooths the surface and the volume"},
2451 "SURFACE",
2452 0,
2453 "Surface",
2454 "Smooths the surface of the mesh, preserving the volume"},
2455 {0, nullptr, 0, nullptr, nullptr},
2456 };
2457
2458 static const EnumPropertyItem brush_pose_deform_type_items[] = {
2459 {BRUSH_POSE_DEFORM_ROTATE_TWIST, "ROTATE_TWIST", 0, "Rotate/Twist", ""},
2460 {BRUSH_POSE_DEFORM_SCALE_TRASLATE, "SCALE_TRANSLATE", 0, "Scale/Translate", ""},
2461 {BRUSH_POSE_DEFORM_SQUASH_STRETCH, "SQUASH_STRETCH", 0, "Squash & Stretch", ""},
2462 {0, nullptr, 0, nullptr, nullptr},
2463 };
2464
2465 static const EnumPropertyItem brush_pose_origin_type_items[] = {
2467 "TOPOLOGY",
2468 0,
2469 "Topology",
2470 "Sets the rotation origin automatically using the topology and shape of the mesh as a "
2471 "guide"},
2473 "FACE_SETS",
2474 0,
2475 "Face Sets",
2476 "Creates a pose segment per face sets, starting from the active face set"},
2478 "FACE_SETS_FK",
2479 0,
2480 "Face Sets FK",
2481 "Simulates an FK deformation using the Face Set under the cursor as control"},
2482 {0, nullptr, 0, nullptr, nullptr},
2483 };
2484
2485 static const EnumPropertyItem brush_smear_deform_type_items[] = {
2486 {BRUSH_SMEAR_DEFORM_DRAG, "DRAG", 0, "Drag", ""},
2487 {BRUSH_SMEAR_DEFORM_PINCH, "PINCH", 0, "Pinch", ""},
2488 {BRUSH_SMEAR_DEFORM_EXPAND, "EXPAND", 0, "Expand", ""},
2489 {0, nullptr, 0, nullptr, nullptr},
2490 };
2491
2492 static const EnumPropertyItem brush_slide_deform_type_items[] = {
2493 {BRUSH_SLIDE_DEFORM_DRAG, "DRAG", 0, "Drag", ""},
2494 {BRUSH_SLIDE_DEFORM_PINCH, "PINCH", 0, "Pinch", ""},
2495 {BRUSH_SLIDE_DEFORM_EXPAND, "EXPAND", 0, "Expand", ""},
2496 {0, nullptr, 0, nullptr, nullptr},
2497 };
2498
2499 static const EnumPropertyItem brush_boundary_deform_type_items[] = {
2500 {BRUSH_BOUNDARY_DEFORM_BEND, "BEND", 0, "Bend", ""},
2501 {BRUSH_BOUNDARY_DEFORM_EXPAND, "EXPAND", 0, "Expand", ""},
2502 {BRUSH_BOUNDARY_DEFORM_INFLATE, "INFLATE", 0, "Inflate", ""},
2503 {BRUSH_BOUNDARY_DEFORM_GRAB, "GRAB", 0, "Grab", ""},
2504 {BRUSH_BOUNDARY_DEFORM_TWIST, "TWIST", 0, "Twist", ""},
2505 {BRUSH_BOUNDARY_DEFORM_SMOOTH, "SMOOTH", 0, "Smooth", ""},
2506 {0, nullptr, 0, nullptr, nullptr},
2507 };
2508
2509 srna = RNA_def_struct(brna, "Brush", "ID");
2511 srna, "Brush", "Brush data-block for storing brush settings for painting and sculpting");
2512 RNA_def_struct_ui_icon(srna, ICON_BRUSH_DATA);
2513
2514 prop = RNA_def_property(srna, "has_unsaved_changes", PROP_BOOLEAN, PROP_NONE);
2517 "Has unsaved changes",
2518 "Indicates that there are any user visible changes since the brush has "
2519 "been imported or read from the file");
2520
2521 /* enums */
2522 prop = RNA_def_property(srna, "blend", PROP_ENUM, PROP_NONE);
2523 RNA_def_property_enum_items(prop, prop_blend_items);
2524 RNA_def_property_ui_text(prop, "Blending Mode", "Brush blending mode");
2525 RNA_def_property_update(prop, 0, "rna_Brush_update");
2526
2532 prop = RNA_def_property(srna, "sculpt_brush_type", PROP_ENUM, PROP_NONE);
2533 RNA_def_property_enum_sdna(prop, nullptr, "sculpt_brush_type");
2535 RNA_def_property_ui_text(prop, "Brush Type", "");
2537 RNA_def_property_update(prop, 0, "rna_Brush_update");
2538
2539 prop = RNA_def_property(srna, "vertex_brush_type", PROP_ENUM, PROP_NONE);
2540 RNA_def_property_enum_sdna(prop, nullptr, "vertex_brush_type");
2542 RNA_def_property_ui_text(prop, "Brush Type", "");
2543 RNA_def_property_update(prop, 0, "rna_Brush_update");
2544
2545 prop = RNA_def_property(srna, "weight_brush_type", PROP_ENUM, PROP_NONE);
2546 RNA_def_property_enum_sdna(prop, nullptr, "weight_brush_type");
2548 RNA_def_property_ui_text(prop, "Brush Type", "");
2549 RNA_def_property_update(prop, 0, "rna_Brush_update");
2550
2551 prop = RNA_def_property(srna, "image_brush_type", PROP_ENUM, PROP_NONE);
2552 RNA_def_property_enum_sdna(prop, nullptr, "image_brush_type");
2554 RNA_def_property_ui_text(prop, "Brush Type", "");
2556 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, "rna_Brush_update");
2557
2558 prop = RNA_def_property(srna, "gpencil_brush_type", PROP_ENUM, PROP_NONE);
2559 RNA_def_property_enum_sdna(prop, nullptr, "gpencil_brush_type");
2561 RNA_def_property_ui_text(prop, "Brush Type", "");
2564 RNA_def_property_update(prop, 0, "rna_Brush_update");
2565
2566 prop = RNA_def_property(srna, "gpencil_vertex_brush_type", PROP_ENUM, PROP_NONE);
2567 RNA_def_property_enum_sdna(prop, nullptr, "gpencil_vertex_brush_type");
2569 RNA_def_property_ui_text(prop, "Brush Type", "");
2571 RNA_def_property_update(prop, 0, "rna_Brush_update");
2572
2573 prop = RNA_def_property(srna, "gpencil_sculpt_brush_type", PROP_ENUM, PROP_NONE);
2574 RNA_def_property_enum_sdna(prop, nullptr, "gpencil_sculpt_brush_type");
2576 RNA_def_property_ui_text(prop, "Brush Type", "");
2579 RNA_def_property_update(prop, 0, "rna_Brush_update");
2580
2581 prop = RNA_def_property(srna, "gpencil_weight_brush_type", PROP_ENUM, PROP_NONE);
2582 RNA_def_property_enum_sdna(prop, nullptr, "gpencil_weight_brush_type");
2584 RNA_def_property_ui_text(prop, "Brush Type", "");
2586 RNA_def_property_update(prop, 0, "rna_Brush_update");
2587
2588 prop = RNA_def_property(srna, "curves_sculpt_brush_type", PROP_ENUM, PROP_NONE);
2589 RNA_def_property_enum_sdna(prop, nullptr, "curves_sculpt_brush_type");
2591 RNA_def_property_ui_text(prop, "Brush Type", "");
2594 RNA_def_property_update(prop, 0, "rna_Brush_update");
2595
2597
2598 prop = RNA_def_property(srna, "direction", PROP_ENUM, PROP_NONE);
2599 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flag");
2601 RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_Brush_direction_itemf");
2602 RNA_def_property_ui_text(prop, "Direction", "");
2604 RNA_def_property_update(prop, 0, "rna_Brush_update");
2605
2606 prop = RNA_def_property(srna, "stroke_method", PROP_ENUM, PROP_NONE);
2607 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flag");
2609 RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_Brush_stroke_itemf");
2610 RNA_def_property_ui_text(prop, "Stroke Method", "");
2612 RNA_def_property_update(prop, 0, "rna_Brush_stroke_update");
2613
2614 prop = RNA_def_property(srna, "sculpt_plane", PROP_ENUM, PROP_NONE);
2615 RNA_def_property_enum_items(prop, brush_sculpt_plane_items);
2616 RNA_def_property_ui_text(prop, "Sculpt Plane", "");
2617 RNA_def_property_update(prop, 0, "rna_Brush_update");
2618
2619 prop = RNA_def_property(srna, "mask_tool", PROP_ENUM, PROP_NONE);
2620 RNA_def_property_enum_items(prop, brush_mask_tool_items);
2621 RNA_def_property_ui_text(prop, "Mask Tool", "");
2623 RNA_def_property_update(prop, 0, "rna_Brush_update");
2624
2625 prop = RNA_def_property(srna, "curve_distance_falloff_preset", PROP_ENUM, PROP_NONE);
2627 RNA_def_property_ui_text(prop, "Falloff Curve Preset", "");
2629 BLT_I18NCONTEXT_ID_CURVE_LEGACY); /* Abusing id_curve :/ */
2630 RNA_def_property_update(prop, 0, "rna_Brush_update");
2631
2632 prop = RNA_def_property(srna, "deform_target", PROP_ENUM, PROP_NONE);
2633 RNA_def_property_enum_items(prop, brush_deformation_target_items);
2635 prop, "Deformation Target", "How the deformation of the brush will affect the object");
2636 RNA_def_property_update(prop, 0, "rna_Brush_update");
2637
2638 prop = RNA_def_property(srna, "elastic_deform_type", PROP_ENUM, PROP_NONE);
2639 RNA_def_property_enum_items(prop, brush_elastic_deform_type_items);
2640 RNA_def_property_ui_text(prop, "Deformation", "Deformation type that is used in the brush");
2642 RNA_def_property_update(prop, 0, "rna_Brush_update");
2643
2644 prop = RNA_def_property(srna, "snake_hook_deform_type", PROP_ENUM, PROP_NONE);
2645 RNA_def_property_enum_items(prop, brush_snake_hook_deform_type_items);
2646 RNA_def_property_ui_text(prop, "Deformation", "Deformation type that is used in the brush");
2647 RNA_def_property_update(prop, 0, "rna_Brush_update");
2648
2649 prop = RNA_def_property(srna, "plane_inversion_mode", PROP_ENUM, PROP_NONE);
2650 RNA_def_property_enum_items(prop, brush_plane_inversion_mode_items);
2651 RNA_def_property_ui_text(prop, "Inversion Mode", "Inversion Mode");
2652 RNA_def_property_update(prop, 0, "rna_Brush_update");
2653
2654 prop = RNA_def_property(srna, "cloth_deform_type", PROP_ENUM, PROP_NONE);
2655 RNA_def_property_enum_items(prop, brush_cloth_deform_type_items);
2656 RNA_def_property_ui_text(prop, "Deformation", "Deformation type that is used in the brush");
2658 RNA_def_property_update(prop, 0, "rna_Brush_update");
2659
2660 prop = RNA_def_property(srna, "cloth_force_falloff_type", PROP_ENUM, PROP_NONE);
2661 RNA_def_property_enum_items(prop, brush_cloth_force_falloff_type_items);
2663 prop, "Force Falloff", "Shape used in the brush to apply force to the cloth");
2664 RNA_def_property_update(prop, 0, "rna_Brush_update");
2665
2666 prop = RNA_def_property(srna, "cloth_simulation_area_type", PROP_ENUM, PROP_NONE);
2667 RNA_def_property_enum_items(prop, brush_cloth_simulation_area_type_items);
2669 prop,
2670 "Simulation Area",
2671 "Part of the mesh that is going to be simulated when the stroke is active");
2672 RNA_def_property_update(prop, 0, "rna_Brush_update");
2673
2674 prop = RNA_def_property(srna, "boundary_falloff_type", PROP_ENUM, PROP_NONE);
2675 RNA_def_property_enum_items(prop, brush_boundary_falloff_type_items);
2677 prop, "Boundary Falloff", "How the brush falloff is applied across the boundary");
2678 RNA_def_property_update(prop, 0, "rna_Brush_update");
2679
2680 prop = RNA_def_property(srna, "smooth_deform_type", PROP_ENUM, PROP_NONE);
2681 RNA_def_property_enum_items(prop, brush_smooth_deform_type_items);
2682 RNA_def_property_ui_text(prop, "Deformation", "Deformation type that is used in the brush");
2683 RNA_def_property_update(prop, 0, "rna_Brush_update");
2684
2685 prop = RNA_def_property(srna, "smear_deform_type", PROP_ENUM, PROP_NONE);
2686 RNA_def_property_enum_items(prop, brush_smear_deform_type_items);
2687 RNA_def_property_ui_text(prop, "Deformation", "Deformation type that is used in the brush");
2689 RNA_def_property_update(prop, 0, "rna_Brush_update");
2690
2691 prop = RNA_def_property(srna, "slide_deform_type", PROP_ENUM, PROP_NONE);
2692 RNA_def_property_enum_items(prop, brush_slide_deform_type_items);
2693 RNA_def_property_ui_text(prop, "Deformation", "Deformation type that is used in the brush");
2695 RNA_def_property_update(prop, 0, "rna_Brush_update");
2696
2697 prop = RNA_def_property(srna, "boundary_deform_type", PROP_ENUM, PROP_NONE);
2698 RNA_def_property_enum_items(prop, brush_boundary_deform_type_items);
2699 RNA_def_property_ui_text(prop, "Deformation", "Deformation type that is used in the brush");
2701 RNA_def_property_update(prop, 0, "rna_Brush_update");
2702
2703 prop = RNA_def_property(srna, "pose_deform_type", PROP_ENUM, PROP_NONE);
2704 RNA_def_property_enum_items(prop, brush_pose_deform_type_items);
2705 RNA_def_property_ui_text(prop, "Deformation", "Deformation type that is used in the brush");
2706 RNA_def_property_update(prop, 0, "rna_Brush_update");
2707
2708 prop = RNA_def_property(srna, "pose_origin_type", PROP_ENUM, PROP_NONE);
2709 RNA_def_property_enum_items(prop, brush_pose_origin_type_items);
2711 "Rotation Origins",
2712 "Method to set the rotation origins for the segments of the brush");
2713 RNA_def_property_update(prop, 0, "rna_Brush_update");
2714
2715 prop = RNA_def_property(srna, "jitter_unit", PROP_ENUM, PROP_NONE); /* as an enum */
2716 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flag");
2717 RNA_def_property_enum_items(prop, brush_jitter_unit_items);
2719 prop, "Jitter Unit", "Jitter in screen space or relative to brush size");
2720 RNA_def_property_update(prop, 0, "rna_Brush_update");
2721
2722 prop = RNA_def_property(srna, "falloff_shape", PROP_ENUM, PROP_NONE); /* as an enum */
2723 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "falloff_shape");
2724 RNA_def_property_enum_items(prop, falloff_shape_unit_items);
2725 RNA_def_property_ui_text(prop, "Falloff Shape", "Use projected or spherical falloff");
2726 RNA_def_property_update(prop, 0, "rna_Brush_update");
2727
2728 /* number values */
2729 prop = RNA_def_property(srna, "size", PROP_INT, PROP_PIXEL_DIAMETER);
2730 RNA_def_property_int_funcs(prop, nullptr, "rna_Brush_set_size", nullptr);
2733 RNA_def_property_ui_text(prop, "Size", "Diameter of the brush in pixels");
2734 RNA_def_property_update(prop, 0, "rna_Brush_size_update");
2735
2736 prop = RNA_def_property(srna, "unprojected_size", PROP_FLOAT, PROP_DISTANCE_DIAMETER);
2737 RNA_def_property_float_funcs(prop, nullptr, "rna_Brush_set_unprojected_size", nullptr);
2738 RNA_def_property_range(prop, 0.001, FLT_MAX);
2739 RNA_def_property_ui_range(prop, 0.001, 1, 1, -1);
2740 RNA_def_property_ui_text(prop, "Unprojected Size", "Diameter of brush in Blender units");
2741 RNA_def_property_update(prop, 0, "rna_Brush_size_update");
2742
2743 prop = RNA_def_property(srna, "input_samples", PROP_INT, PROP_UNSIGNED);
2744 RNA_def_property_int_sdna(prop, nullptr, "input_samples");
2748 prop,
2749 "Input Samples",
2750 "Number of input samples to average together to smooth the brush stroke");
2751 RNA_def_property_update(prop, 0, "rna_Brush_update");
2752
2753 prop = RNA_def_property(srna, "jitter", PROP_FLOAT, PROP_NONE);
2754 RNA_def_property_float_sdna(prop, nullptr, "jitter");
2755 RNA_def_property_range(prop, 0.0f, 1000.0f);
2756 RNA_def_property_ui_range(prop, 0.0f, 2.0f, 0.1, 4);
2757 RNA_def_property_ui_text(prop, "Jitter", "Jitter the position of the brush while painting");
2759 RNA_def_property_update(prop, 0, "rna_Brush_update");
2760
2761 prop = RNA_def_property(srna, "jitter_absolute", PROP_INT, PROP_PIXEL);
2762 RNA_def_property_int_sdna(prop, nullptr, "jitter_absolute");
2763 RNA_def_property_range(prop, 0, 1000000);
2765 prop, "Jitter", "Jitter the position of the brush in pixels while painting");
2767 RNA_def_property_update(prop, 0, "rna_Brush_update");
2768
2769 prop = RNA_def_property(srna, "spacing", PROP_INT, PROP_PERCENTAGE);
2770 RNA_def_property_int_sdna(prop, nullptr, "spacing");
2771 RNA_def_property_range(prop, 1, 1000);
2772 RNA_def_property_ui_range(prop, 1, 500, 5, -1);
2774 prop, "Spacing", "Spacing between brush daubs as a percentage of brush diameter");
2775 RNA_def_property_update(prop, 0, "rna_Brush_update");
2776
2777 prop = RNA_def_property(srna, "grad_spacing", PROP_INT, PROP_PIXEL);
2778 RNA_def_property_int_sdna(prop, nullptr, "gradient_spacing");
2779 RNA_def_property_range(prop, 1, 10000);
2780 RNA_def_property_ui_range(prop, 1, 10000, 5, -1);
2782 prop, "Gradient Spacing", "Spacing before brush gradient goes full circle");
2783 RNA_def_property_update(prop, 0, "rna_Brush_update");
2784
2785 prop = RNA_def_property(srna, "use_color_jitter", PROP_BOOLEAN, PROP_NONE);
2786 RNA_def_property_boolean_sdna(prop, nullptr, "flag2", BRUSH_JITTER_COLOR);
2787 RNA_def_property_ui_text(prop, "Use Color Jitter", "Jitter brush color");
2789 RNA_def_property_update(prop, 0, "rna_Brush_update");
2790
2791 prop = RNA_def_property(srna, "hue_jitter", PROP_FLOAT, PROP_NONE);
2792 RNA_def_property_float_sdna(prop, nullptr, "hsv_jitter[0]");
2793 RNA_def_property_range(prop, 0, 1.0f);
2794 RNA_def_property_ui_range(prop, 0, 1, 0.05, 2);
2795 RNA_def_property_ui_text(prop, "Hue Jitter", "Color jitter effect on hue");
2796 RNA_def_property_update(prop, 0, "rna_Brush_update");
2797
2798 prop = RNA_def_property(srna, "saturation_jitter", PROP_FLOAT, PROP_NONE);
2799 RNA_def_property_float_sdna(prop, nullptr, "hsv_jitter[1]");
2800 RNA_def_property_range(prop, 0, 1.0f);
2801 RNA_def_property_ui_range(prop, 0, 1, 0.05, 2);
2802 RNA_def_property_ui_text(prop, "Saturation Jitter", "Color jitter effect on saturation");
2803 RNA_def_property_update(prop, 0, "rna_Brush_update");
2804
2805 prop = RNA_def_property(srna, "value_jitter", PROP_FLOAT, PROP_NONE);
2806 RNA_def_property_float_sdna(prop, nullptr, "hsv_jitter[2]");
2807 RNA_def_property_range(prop, 0, 1.0f);
2808 RNA_def_property_ui_range(prop, 0, 1, 0.05, 2);
2809 RNA_def_property_ui_text(prop, "Value Jitter", "Color jitter effect on value");
2810 RNA_def_property_update(prop, 0, "rna_Brush_update");
2811
2812 prop = RNA_def_property(srna, "use_stroke_random_hue", PROP_BOOLEAN, PROP_NONE);
2814 prop, nullptr, "color_jitter_flag", BRUSH_COLOR_JITTER_USE_HUE_AT_STROKE);
2815 RNA_def_property_ui_icon(prop, ICON_GP_SELECT_STROKES, 0);
2816 RNA_def_property_ui_text(prop, "Stroke Random", "Use randomness at stroke level");
2818
2819 prop = RNA_def_property(srna, "use_stroke_random_sat", PROP_BOOLEAN, PROP_NONE);
2821 prop, nullptr, "color_jitter_flag", BRUSH_COLOR_JITTER_USE_SAT_AT_STROKE);
2822 RNA_def_property_ui_icon(prop, ICON_GP_SELECT_STROKES, 0);
2823 RNA_def_property_ui_text(prop, "Stroke Random", "Use randomness at stroke level");
2825
2826 prop = RNA_def_property(srna, "use_stroke_random_val", PROP_BOOLEAN, PROP_NONE);
2828 prop, nullptr, "color_jitter_flag", BRUSH_COLOR_JITTER_USE_VAL_AT_STROKE);
2829 RNA_def_property_ui_icon(prop, ICON_GP_SELECT_STROKES, 0);
2830 RNA_def_property_ui_text(prop, "Stroke Random", "Use randomness at stroke level");
2832
2833 prop = RNA_def_property(srna, "use_random_press_hue", PROP_BOOLEAN, PROP_NONE);
2835 prop, nullptr, "color_jitter_flag", BRUSH_COLOR_JITTER_USE_HUE_RAND_PRESS);
2836 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
2837 RNA_def_property_ui_text(prop, "Use Pressure", "Use pressure to modulate randomness");
2839
2840 prop = RNA_def_property(srna, "use_random_press_sat", PROP_BOOLEAN, PROP_NONE);
2842 prop, nullptr, "color_jitter_flag", BRUSH_COLOR_JITTER_USE_SAT_RAND_PRESS);
2843 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
2844 RNA_def_property_ui_text(prop, "Use Pressure", "Use pressure to modulate randomness");
2846
2847 prop = RNA_def_property(srna, "use_random_press_val", PROP_BOOLEAN, PROP_NONE);
2849 prop, nullptr, "color_jitter_flag", BRUSH_COLOR_JITTER_USE_VAL_RAND_PRESS);
2850 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
2851 RNA_def_property_ui_text(prop, "Use Pressure", "Use pressure to modulate randomness");
2853
2854 prop = RNA_def_property(srna, "curve_random_hue", PROP_POINTER, PROP_NONE);
2855 RNA_def_property_pointer_sdna(prop, nullptr, "curve_rand_hue");
2856 RNA_def_property_struct_type(prop, "CurveMapping");
2857 RNA_def_property_ui_text(prop, "Random Curve", "Curve used for modulating effect");
2859 RNA_def_property_update(prop, 0, "rna_Brush_update");
2860
2861 prop = RNA_def_property(srna, "curve_random_saturation", PROP_POINTER, PROP_NONE);
2862 RNA_def_property_pointer_sdna(prop, nullptr, "curve_rand_saturation");
2863 RNA_def_property_struct_type(prop, "CurveMapping");
2864 RNA_def_property_ui_text(prop, "Random Curve", "Curve used for modulating effect");
2866 RNA_def_property_update(prop, 0, "rna_Brush_update");
2867
2868 prop = RNA_def_property(srna, "curve_random_value", PROP_POINTER, PROP_NONE);
2869 RNA_def_property_pointer_sdna(prop, nullptr, "curve_rand_value");
2870 RNA_def_property_struct_type(prop, "CurveMapping");
2871 RNA_def_property_ui_text(prop, "Random Curve", "Curve used for modulating effect");
2873 RNA_def_property_update(prop, 0, "rna_Brush_update");
2874
2875 prop = RNA_def_property(srna, "curve_size", PROP_POINTER, PROP_NONE);
2876 RNA_def_property_pointer_sdna(prop, nullptr, "curve_size");
2877 RNA_def_property_struct_type(prop, "CurveMapping");
2879 prop, "Pressure Size Mapping", "Curve used to map pressure to brush size");
2881 RNA_def_property_update(prop, 0, "rna_Brush_update");
2882
2883 prop = RNA_def_property(srna, "curve_strength", PROP_POINTER, PROP_NONE);
2884 RNA_def_property_pointer_sdna(prop, nullptr, "curve_strength");
2885 RNA_def_property_struct_type(prop, "CurveMapping");
2887 prop, "Pressure Strength Mapping", "Curve used to map pressure to brush strength");
2889 RNA_def_property_update(prop, 0, "rna_Brush_update");
2890
2891 prop = RNA_def_property(srna, "curve_jitter", PROP_POINTER, PROP_NONE);
2892 RNA_def_property_pointer_sdna(prop, nullptr, "curve_jitter");
2893 RNA_def_property_struct_type(prop, "CurveMapping");
2895 prop, "Pressure Jitter Mapping", "Curve used to map pressure to brush jitter");
2897 RNA_def_property_update(prop, 0, "rna_Brush_update");
2898
2899 prop = RNA_def_property(srna, "smooth_stroke_radius", PROP_INT, PROP_PIXEL);
2900 RNA_def_property_range(prop, 10, 200);
2902 prop, "Smooth Stroke Radius", "Minimum distance from last point before stroke continues");
2903 RNA_def_property_update(prop, 0, "rna_Brush_update");
2904
2905 prop = RNA_def_property(srna, "smooth_stroke_factor", PROP_FLOAT, PROP_FACTOR);
2906 RNA_def_property_range(prop, 0.5, 0.99);
2907 RNA_def_property_ui_text(prop, "Smooth Stroke Factor", "Higher values give a smoother stroke");
2908 RNA_def_property_update(prop, 0, "rna_Brush_update");
2909
2910 prop = RNA_def_property(srna, "rate", PROP_FLOAT, PROP_NONE);
2911 RNA_def_property_float_sdna(prop, nullptr, "rate");
2912 RNA_def_property_range(prop, 0.0001f, 10000.0f);
2913 RNA_def_property_ui_range(prop, 0.01f, 1.0f, 1, 3);
2914 RNA_def_property_ui_text(prop, "Rate", "Interval between paints for Airbrush");
2915 RNA_def_property_update(prop, 0, "rna_Brush_update");
2916
2917 prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
2918 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
2919 RNA_def_property_float_sdna(prop, nullptr, "color");
2920 RNA_def_property_ui_text(prop, "Color", "");
2921 RNA_def_property_update(prop, 0, "rna_Brush_color_update");
2922
2923 prop = RNA_def_property(srna, "secondary_color", PROP_FLOAT, PROP_COLOR);
2924 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
2925 RNA_def_property_float_sdna(prop, nullptr, "secondary_color");
2926 RNA_def_property_ui_text(prop, "Secondary Color", "");
2927 RNA_def_property_update(prop, 0, "rna_Brush_color_update");
2928
2929 prop = RNA_def_property(srna, "weight", PROP_FLOAT, PROP_FACTOR);
2930 RNA_def_property_range(prop, 0.0f, 1.0f);
2931 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
2932 RNA_def_property_ui_text(prop, "Weight", "Vertex weight when brush is applied");
2933 RNA_def_property_update(prop, 0, "rna_Brush_update");
2934
2935 prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_FACTOR);
2936 RNA_def_property_float_sdna(prop, nullptr, "alpha");
2937 RNA_def_property_range(prop, 0.0f, 10.0f);
2938 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
2940 prop, "Strength", "How powerful the effect of the brush is when applied");
2941 RNA_def_property_update(prop, 0, "rna_Brush_update");
2942
2943 prop = RNA_def_property(srna, "flow", PROP_FLOAT, PROP_FACTOR);
2944 RNA_def_property_float_sdna(prop, nullptr, "flow");
2945 RNA_def_property_range(prop, 0.0f, 1.0f);
2946 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
2947 RNA_def_property_ui_text(prop, "Flow", "Amount of paint that is applied per stroke sample");
2948 RNA_def_property_update(prop, 0, "rna_Brush_update");
2949
2950 prop = RNA_def_property(srna, "wet_mix", PROP_FLOAT, PROP_FACTOR);
2951 RNA_def_property_float_sdna(prop, nullptr, "wet_mix");
2952 RNA_def_property_range(prop, 0.0f, 1.0f);
2953 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
2955 prop, "Wet Mix", "Amount of paint that is picked from the surface into the brush color");
2956 RNA_def_property_update(prop, 0, "rna_Brush_update");
2957
2958 prop = RNA_def_property(srna, "wet_persistence", PROP_FLOAT, PROP_FACTOR);
2959 RNA_def_property_float_sdna(prop, nullptr, "wet_persistence");
2960 RNA_def_property_range(prop, 0.0f, 1.0f);
2961 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
2963 prop,
2964 "Wet Persistence",
2965 "Amount of wet paint that stays in the brush after applying paint to the surface");
2966 RNA_def_property_update(prop, 0, "rna_Brush_update");
2967
2968 prop = RNA_def_property(srna, "density", PROP_FLOAT, PROP_FACTOR);
2969 RNA_def_property_float_sdna(prop, nullptr, "density");
2970 RNA_def_property_range(prop, 0.0f, 1.0f);
2971 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
2973 prop, "Density", "Amount of random elements that are going to be affected by the brush");
2974 RNA_def_property_update(prop, 0, "rna_Brush_update");
2975
2976 prop = RNA_def_property(srna, "tip_scale_x", PROP_FLOAT, PROP_FACTOR);
2977 RNA_def_property_float_sdna(prop, nullptr, "tip_scale_x");
2978 RNA_def_property_range(prop, 0.0001f, 1.0f);
2979 RNA_def_property_ui_range(prop, 0.0001f, 1.0f, 0.001, 3);
2980 RNA_def_property_ui_text(prop, "Tip Scale X", "Scale of the brush tip in the X axis");
2981 RNA_def_property_update(prop, 0, "rna_Brush_update");
2982
2983 prop = RNA_def_property(srna, "use_hardness_pressure", PROP_BOOLEAN, PROP_NONE);
2984 RNA_def_property_boolean_sdna(prop, nullptr, "paint_flags", BRUSH_PAINT_HARDNESS_PRESSURE);
2985 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
2986 RNA_def_property_ui_text(prop, "Use Pressure for Hardness", "Use pressure to modulate hardness");
2988 RNA_def_property_update(prop, 0, "rna_Brush_update");
2989
2990 prop = RNA_def_property(srna, "invert_hardness_pressure", PROP_BOOLEAN, PROP_NONE);
2992 prop, nullptr, "paint_flags", BRUSH_PAINT_HARDNESS_PRESSURE_INVERT);
2993 RNA_def_property_ui_icon(prop, ICON_ARROW_LEFTRIGHT, 0);
2995 prop, "Invert Pressure for Hardness", "Invert the modulation of pressure in hardness");
2997 RNA_def_property_update(prop, 0, "rna_Brush_update");
2998
2999 prop = RNA_def_property(srna, "use_flow_pressure", PROP_BOOLEAN, PROP_NONE);
3000 RNA_def_property_boolean_sdna(prop, nullptr, "paint_flags", BRUSH_PAINT_FLOW_PRESSURE);
3001 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
3002 RNA_def_property_ui_text(prop, "Use Pressure for Flow", "Use pressure to modulate flow");
3004 RNA_def_property_update(prop, 0, "rna_Brush_update");
3005
3006 prop = RNA_def_property(srna, "invert_flow_pressure", PROP_BOOLEAN, PROP_NONE);
3008 RNA_def_property_ui_icon(prop, ICON_ARROW_LEFTRIGHT, 0);
3010 prop, "Invert Pressure for Flow", "Invert the modulation of pressure in flow");
3012 RNA_def_property_update(prop, 0, "rna_Brush_update");
3013
3014 prop = RNA_def_property(srna, "use_wet_mix_pressure", PROP_BOOLEAN, PROP_NONE);
3015 RNA_def_property_boolean_sdna(prop, nullptr, "paint_flags", BRUSH_PAINT_WET_MIX_PRESSURE);
3016 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
3017 RNA_def_property_ui_text(prop, "Use Pressure for Wet Mix", "Use pressure to modulate wet mix");
3019 RNA_def_property_update(prop, 0, "rna_Brush_update");
3020
3021 prop = RNA_def_property(srna, "invert_wet_mix_pressure", PROP_BOOLEAN, PROP_NONE);
3023 RNA_def_property_ui_icon(prop, ICON_ARROW_LEFTRIGHT, 0);
3025 prop, "Invert Pressure for Wet Mix", "Invert the modulation of pressure in wet mix");
3027 RNA_def_property_update(prop, 0, "rna_Brush_update");
3028
3029 prop = RNA_def_property(srna, "use_wet_persistence_pressure", PROP_BOOLEAN, PROP_NONE);
3031 prop, nullptr, "paint_flags", BRUSH_PAINT_WET_PERSISTENCE_PRESSURE);
3032 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
3034 prop, "Use Pressure for Wet Persistence", "Use pressure to modulate wet persistence");
3036 RNA_def_property_update(prop, 0, "rna_Brush_update");
3037
3038 prop = RNA_def_property(srna, "invert_wet_persistence_pressure", PROP_BOOLEAN, PROP_NONE);
3040 prop, nullptr, "paint_flags", BRUSH_PAINT_WET_PERSISTENCE_PRESSURE_INVERT);
3041 RNA_def_property_ui_icon(prop, ICON_ARROW_LEFTRIGHT, 0);
3043 "Invert Pressure for Wet Persistence",
3044 "Invert the modulation of pressure in wet persistence");
3046 RNA_def_property_update(prop, 0, "rna_Brush_update");
3047
3048 prop = RNA_def_property(srna, "use_density_pressure", PROP_BOOLEAN, PROP_NONE);
3049 RNA_def_property_boolean_sdna(prop, nullptr, "paint_flags", BRUSH_PAINT_DENSITY_PRESSURE);
3050 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
3051 RNA_def_property_ui_text(prop, "Use Pressure for Density", "Use pressure to modulate density");
3053 RNA_def_property_update(prop, 0, "rna_Brush_update");
3054
3055 prop = RNA_def_property(srna, "invert_density_pressure", PROP_BOOLEAN, PROP_NONE);
3057 RNA_def_property_ui_icon(prop, ICON_ARROW_LEFTRIGHT, 0);
3059 prop, "Invert Pressure for Density", "Invert the modulation of pressure in density");
3061 RNA_def_property_update(prop, 0, "rna_Brush_update");
3062
3063 prop = RNA_def_property(srna, "dash_ratio", PROP_FLOAT, PROP_FACTOR);
3064 RNA_def_property_float_sdna(prop, nullptr, "dash_ratio");
3065 RNA_def_property_range(prop, 0.0f, 1.0f);
3066 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
3068 prop, "Dash Ratio", "Ratio of samples in a cycle that the brush is enabled");
3069 RNA_def_property_update(prop, 0, "rna_Brush_update");
3070
3071 prop = RNA_def_property(srna, "dash_samples", PROP_INT, PROP_UNSIGNED);
3072 RNA_def_property_int_sdna(prop, nullptr, "dash_samples");
3073 RNA_def_property_range(prop, 1, 10000);
3074 RNA_def_property_ui_range(prop, 1, 10000, 5, -1);
3076 prop, "Dash Length", "Length of a dash cycle measured in stroke samples");
3077 RNA_def_property_update(prop, 0, "rna_Brush_update");
3078
3079 prop = RNA_def_property(srna, "plane_offset", PROP_FLOAT, PROP_DISTANCE);
3080 RNA_def_property_float_sdna(prop, nullptr, "plane_offset");
3082 RNA_def_property_range(prop, -2.0f, 2.0f);
3083 RNA_def_property_ui_range(prop, -0.5f, 0.5f, 0.001, 3);
3085 prop,
3086 "Plane Offset",
3087 "Adjust plane on which the brush acts towards or away from the object surface");
3088 RNA_def_property_update(prop, 0, "rna_Brush_update");
3089
3090 prop = RNA_def_property(srna, "plane_trim", PROP_FLOAT, PROP_DISTANCE);
3091 RNA_def_property_float_sdna(prop, nullptr, "plane_trim");
3092 RNA_def_property_range(prop, 0, 1.0f);
3094 prop,
3095 "Plane Trim",
3096 "If a vertex is further away from offset plane than this, then it is not affected");
3097 RNA_def_property_update(prop, 0, "rna_Brush_update");
3098
3099 prop = RNA_def_property(srna, "height", PROP_FLOAT, PROP_DISTANCE);
3100 RNA_def_property_float_sdna(prop, nullptr, "height");
3102 RNA_def_property_range(prop, 0, 1.0f);
3103 RNA_def_property_ui_range(prop, 0, 0.2f, 1, 3);
3105 prop,
3106 "Brush Height",
3107 "Affectable height of brush (i.e. the layer height for the layer tool)");
3108 RNA_def_property_update(prop, 0, "rna_Brush_update");
3109
3110 prop = RNA_def_property(srna, "plane_depth", PROP_FLOAT, PROP_FACTOR);
3111 RNA_def_property_float_sdna(prop, nullptr, "plane_depth");
3113 RNA_def_property_range(prop, 0, 1.0f);
3114 RNA_def_property_ui_range(prop, 0, 1.0f, 1, 3);
3116 "Depth",
3117 "The maximum distance below the plane for affected vertices. "
3118 "Increasing the depth affects vertices farther below the plane.");
3119 RNA_def_property_update(prop, 0, "rna_Brush_update");
3120
3121 prop = RNA_def_property(srna, "plane_height", PROP_FLOAT, PROP_FACTOR);
3122 RNA_def_property_float_sdna(prop, nullptr, "plane_height");
3124 RNA_def_property_range(prop, 0, 1.0f);
3125 RNA_def_property_ui_range(prop, 0, 1.0f, 1, 3);
3127 "Height",
3128 "The maximum distance above the plane for affected vertices. "
3129 "Increasing the height affects vertices farther above the plane.");
3130 RNA_def_property_update(prop, 0, "rna_Brush_update");
3131
3132 prop = RNA_def_property(srna, "stabilize_normal", PROP_FLOAT, PROP_FACTOR);
3133 RNA_def_property_float_sdna(prop, nullptr, "stabilize_normal");
3135 RNA_def_property_range(prop, 0, 1.0f);
3136 RNA_def_property_ui_range(prop, 0, 1.0f, 1, 3);
3138 prop, "Stabilize Normal", "Stabilize the orientation of the brush plane.");
3139 RNA_def_property_update(prop, 0, "rna_Brush_update");
3140
3141 prop = RNA_def_property(srna, "stabilize_plane", PROP_FLOAT, PROP_FACTOR);
3142 RNA_def_property_float_sdna(prop, nullptr, "stabilize_plane");
3144 RNA_def_property_range(prop, 0, 1.0f);
3145 RNA_def_property_ui_range(prop, 0, 1.0f, 1, 3);
3146 RNA_def_property_ui_text(prop, "Stabilize Plane", "Stabilize the center of the brush plane.");
3147 RNA_def_property_update(prop, 0, "rna_Brush_update");
3148
3149 prop = RNA_def_property(srna, "texture_sample_bias", PROP_FLOAT, PROP_DISTANCE);
3150 RNA_def_property_float_sdna(prop, nullptr, "texture_sample_bias");
3152 RNA_def_property_range(prop, -1, 1);
3153 RNA_def_property_ui_text(prop, "Texture Sample Bias", "Value added to texture samples");
3154 RNA_def_property_update(prop, 0, "rna_Brush_update");
3155
3156 prop = RNA_def_property(srna, "use_color_as_displacement", PROP_BOOLEAN, PROP_NONE);
3159 prop,
3160 "Vector Displacement",
3161 "Handle each pixel color as individual vector for displacement (area plane mapping only)");
3162 RNA_def_property_update(prop, 0, "rna_Brush_update");
3163
3164 prop = RNA_def_property(srna, "normal_weight", PROP_FLOAT, PROP_FACTOR);
3165 RNA_def_property_float_sdna(prop, nullptr, "normal_weight");
3167 RNA_def_property_range(prop, 0.0f, 1.0f);
3169 prop, "Normal Weight", "How much grab will pull vertices out of surface during a grab");
3170 RNA_def_property_update(prop, 0, "rna_Brush_update");
3171
3172 prop = RNA_def_property(srna, "elastic_deform_volume_preservation", PROP_FLOAT, PROP_NONE);
3173 RNA_def_property_float_sdna(prop, nullptr, "elastic_deform_volume_preservation");
3174 RNA_def_property_range(prop, 0.0f, 0.9f);
3175 RNA_def_property_ui_range(prop, 0.0f, 0.9f, 0.01f, 3);
3177 "Volume Preservation",
3178 "Poisson ratio for elastic deformation. Higher values preserve volume "
3179 "more, but also lead to more bulging.");
3180 RNA_def_property_update(prop, 0, "rna_Brush_update");
3181
3182 prop = RNA_def_property(srna, "rake_factor", PROP_FLOAT, PROP_FACTOR);
3183 RNA_def_property_float_sdna(prop, nullptr, "rake_factor");
3185 RNA_def_property_range(prop, 0.0f, 10.0f);
3186 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
3187 RNA_def_property_ui_text(prop, "Rake", "How much grab will follow cursor rotation");
3188 RNA_def_property_update(prop, 0, "rna_Brush_update");
3189
3190 prop = RNA_def_property(srna, "crease_pinch_factor", PROP_FLOAT, PROP_FACTOR);
3191 RNA_def_property_float_sdna(prop, nullptr, "crease_pinch_factor");
3192 RNA_def_property_range(prop, 0.0f, 1.0f);
3193 RNA_def_property_ui_text(prop, "Crease Brush Pinch Factor", "How much the crease brush pinches");
3194 RNA_def_property_update(prop, 0, "rna_Brush_update");
3195
3196 prop = RNA_def_property(srna, "pose_offset", PROP_FLOAT, PROP_FACTOR);
3197 RNA_def_property_float_sdna(prop, nullptr, "pose_offset");
3198 RNA_def_property_range(prop, 0.0f, 2.0f);
3200 prop, "Pose Origin Offset", "Offset of the pose origin in relation to the brush radius");
3201 RNA_def_property_update(prop, 0, "rna_Brush_update");
3202
3203 prop = RNA_def_property(srna, "disconnected_distance_max", PROP_FLOAT, PROP_DISTANCE);
3204 RNA_def_property_float_sdna(prop, nullptr, "disconnected_distance_max");
3205 RNA_def_property_range(prop, 0.0f, 10.0f);
3207 "Max Element Distance",
3208 "Maximum distance to search for disconnected loose parts in the mesh");
3209 RNA_def_property_update(prop, 0, "rna_Brush_update");
3210
3211 prop = RNA_def_property(srna, "boundary_offset", PROP_FLOAT, PROP_FACTOR);
3212 RNA_def_property_float_sdna(prop, nullptr, "boundary_offset");
3213 RNA_def_property_range(prop, 0.0f, 30.0f);
3215 "Boundary Origin Offset",
3216 "Offset of the boundary origin in relation to the brush radius");
3217 RNA_def_property_update(prop, 0, "rna_Brush_update");
3218
3219 prop = RNA_def_property(srna, "surface_smooth_shape_preservation", PROP_FLOAT, PROP_FACTOR);
3220 RNA_def_property_float_sdna(prop, nullptr, "surface_smooth_shape_preservation");
3221 RNA_def_property_range(prop, 0.0f, 1.0f);
3223 prop, "Shape Preservation", "How much of the original shape is preserved when smoothing");
3224 RNA_def_property_update(prop, 0, "rna_Brush_update");
3225
3226 prop = RNA_def_property(srna, "surface_smooth_current_vertex", PROP_FLOAT, PROP_FACTOR);
3227 RNA_def_property_float_sdna(prop, nullptr, "surface_smooth_current_vertex");
3228 RNA_def_property_range(prop, 0.0f, 1.0f);
3230 prop,
3231 "Per Vertex Displacement",
3232 "How much the position of each individual vertex influences the final result");
3233 RNA_def_property_update(prop, 0, "rna_Brush_update");
3234
3235 prop = RNA_def_property(srna, "surface_smooth_iterations", PROP_INT, PROP_UNSIGNED);
3236 RNA_def_property_int_sdna(prop, nullptr, "surface_smooth_iterations");
3237 RNA_def_property_range(prop, 1, 10);
3238 RNA_def_property_ui_range(prop, 1, 10, 1, 3);
3239 RNA_def_property_ui_text(prop, "Iterations", "Number of smoothing iterations per brush step");
3240 RNA_def_property_update(prop, 0, "rna_Brush_update");
3241
3242 prop = RNA_def_property(srna, "multiplane_scrape_angle", PROP_FLOAT, PROP_FACTOR);
3243 RNA_def_property_float_sdna(prop, nullptr, "multiplane_scrape_angle");
3244 RNA_def_property_range(prop, 0.0f, 160.0f);
3245 RNA_def_property_ui_text(prop, "Plane Angle", "Angle between the planes of the crease");
3246 RNA_def_property_update(prop, 0, "rna_Brush_update");
3247
3248 prop = RNA_def_property(srna, "pose_smooth_iterations", PROP_INT, PROP_UNSIGNED);
3249 RNA_def_property_int_sdna(prop, nullptr, "pose_smooth_iterations");
3250 RNA_def_property_range(prop, 0, 100);
3252 prop,
3253 "Smooth Iterations",
3254 "Smooth iterations applied after calculating the pose factor of each vertex");
3255 RNA_def_property_update(prop, 0, "rna_Brush_update");
3256
3257 prop = RNA_def_property(srna, "pose_ik_segments", PROP_INT, PROP_UNSIGNED);
3258 RNA_def_property_int_sdna(prop, nullptr, "pose_ik_segments");
3259 RNA_def_property_range(prop, 1, 20);
3260 RNA_def_property_ui_range(prop, 1, 20, 1, 3);
3262 prop,
3263 "Pose IK Segments",
3264 "Number of segments of the inverse kinematics chain that will deform the mesh");
3265 RNA_def_property_update(prop, 0, "rna_Brush_update");
3266
3267 prop = RNA_def_property(srna, "tip_roundness", PROP_FLOAT, PROP_FACTOR);
3268 RNA_def_property_float_sdna(prop, nullptr, "tip_roundness");
3269 RNA_def_property_range(prop, 0.0f, 1.0f);
3270 RNA_def_property_ui_text(prop, "Tip Roundness", "Roundness of the brush tip");
3271 RNA_def_property_update(prop, 0, "rna_Brush_update");
3272
3273 prop = RNA_def_property(srna, "cloth_mass", PROP_FLOAT, PROP_FACTOR);
3274 RNA_def_property_float_sdna(prop, nullptr, "cloth_mass");
3275 RNA_def_property_range(prop, 0.01f, 2.0f);
3276 RNA_def_property_ui_text(prop, "Cloth Mass", "Mass of each simulation particle");
3277 RNA_def_property_update(prop, 0, "rna_Brush_update");
3278
3279 prop = RNA_def_property(srna, "cloth_damping", PROP_FLOAT, PROP_FACTOR);
3280 RNA_def_property_float_sdna(prop, nullptr, "cloth_damping");
3281 RNA_def_property_range(prop, 0.01f, 1.0f);
3283 prop, "Cloth Damping", "How much the applied forces are propagated through the cloth");
3284 RNA_def_property_update(prop, 0, "rna_Brush_update");
3285
3286 prop = RNA_def_property(srna, "cloth_sim_limit", PROP_FLOAT, PROP_FACTOR);
3287 RNA_def_property_float_sdna(prop, nullptr, "cloth_sim_limit");
3288 RNA_def_property_range(prop, 0.1f, 10.0f);
3290 prop,
3291 "Simulation Limit",
3292 "Factor added relative to the size of the radius to limit the cloth simulation effects");
3293 RNA_def_property_update(prop, 0, "rna_Brush_update");
3294
3295 prop = RNA_def_property(srna, "cloth_sim_falloff", PROP_FLOAT, PROP_FACTOR);
3296 RNA_def_property_float_sdna(prop, nullptr, "cloth_sim_falloff");
3297 RNA_def_property_range(prop, 0.0f, 1.0f);
3299 "Simulation Falloff",
3300 "Area to apply deformation falloff to the effects of the simulation");
3301 RNA_def_property_update(prop, 0, "rna_Brush_update");
3302
3303 prop = RNA_def_property(srna, "cloth_constraint_softbody_strength", PROP_FLOAT, PROP_FACTOR);
3304 RNA_def_property_float_sdna(prop, nullptr, "cloth_constraint_softbody_strength");
3305 RNA_def_property_range(prop, 0.0f, 1.0f);
3307 prop,
3308 "Soft Body Plasticity",
3309 "How much the cloth preserves the original shape, acting as a soft body");
3310 RNA_def_property_update(prop, 0, "rna_Brush_update");
3311
3312 prop = RNA_def_property(srna, "hardness", PROP_FLOAT, PROP_FACTOR);
3313 RNA_def_property_float_sdna(prop, nullptr, "hardness");
3314 RNA_def_property_range(prop, 0.0f, 1.0f);
3316 prop, "Hardness", "How close the brush falloff starts from the edge of the brush");
3317 RNA_def_property_update(prop, 0, "rna_Brush_update");
3318
3319 prop = RNA_def_property(
3320 srna, "automasking_boundary_edges_propagation_steps", PROP_INT, PROP_UNSIGNED);
3321 RNA_def_property_int_sdna(prop, nullptr, "automasking_boundary_edges_propagation_steps");
3325 "Propagation Steps",
3326 "Distance where boundary edge automasking is going to protect vertices "
3327 "from the fully masked edge");
3328 RNA_def_property_update(prop, 0, "rna_Brush_update");
3329
3330 prop = RNA_def_property(srna, "auto_smooth_factor", PROP_FLOAT, PROP_FACTOR);
3331 RNA_def_property_float_sdna(prop, nullptr, "autosmooth_factor");
3333 RNA_def_property_range(prop, 0.0f, 1.0f);
3334 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
3336 prop, "Auto-Smooth", "Amount of smoothing to automatically apply to each stroke");
3337 RNA_def_property_update(prop, 0, "rna_Brush_update");
3338
3339 prop = RNA_def_property(srna, "topology_rake_factor", PROP_FLOAT, PROP_FACTOR);
3340 RNA_def_property_float_sdna(prop, nullptr, "topology_rake_factor");
3342 RNA_def_property_range(prop, 0.0f, 1.0f);
3343 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
3345 "Topology Rake",
3346 "Automatically align edges to the brush direction to "
3347 "generate cleaner topology and define sharp features. "
3348 "Best used on low-poly meshes as it has a performance impact.");
3349 RNA_def_property_update(prop, 0, "rna_Brush_update");
3350
3351 prop = RNA_def_property(srna, "tilt_strength_factor", PROP_FLOAT, PROP_FACTOR);
3352 RNA_def_property_float_sdna(prop, nullptr, "tilt_strength_factor");
3354 RNA_def_property_range(prop, -1.0f, 1.0f);
3355 RNA_def_property_ui_range(prop, -1.0f, 1.0f, 0.001, 3);
3357 "Tilt Strength",
3358 "How much the tilt of the pen will affect the brush. Negative values "
3359 "indicate inverting the tilt directions.");
3360 RNA_def_property_update(prop, 0, "rna_Brush_update");
3361
3362 prop = RNA_def_property(srna, "normal_radius_factor", PROP_FLOAT, PROP_FACTOR);
3363 RNA_def_property_float_sdna(prop, nullptr, "normal_radius_factor");
3364 RNA_def_property_range(prop, 0.0f, 2.0f);
3365 RNA_def_property_ui_range(prop, 0.0f, 2.0f, 0.001, 3);
3367 "Normal Radius",
3368 "Ratio between the brush radius and the radius that is going to be "
3369 "used to sample the normal");
3370 RNA_def_property_update(prop, 0, "rna_Brush_update");
3371
3372 prop = RNA_def_property(srna, "area_radius_factor", PROP_FLOAT, PROP_FACTOR);
3373 RNA_def_property_float_sdna(prop, nullptr, "area_radius_factor");
3374 RNA_def_property_range(prop, 0.0f, 2.0f);
3375 RNA_def_property_ui_range(prop, 0.0f, 2.0f, 0.001, 3);
3377 "Area Radius",
3378 "Ratio between the brush radius and the radius that is going to be "
3379 "used to sample the area center");
3380 RNA_def_property_update(prop, 0, "rna_Brush_update");
3381
3382 prop = RNA_def_property(srna, "wet_paint_radius_factor", PROP_FLOAT, PROP_FACTOR);
3383 RNA_def_property_float_sdna(prop, nullptr, "wet_paint_radius_factor");
3384 RNA_def_property_range(prop, 0.0f, 2.0f);
3385 RNA_def_property_ui_range(prop, 0.0f, 2.0f, 0.001, 3);
3387 "Wet Paint Radius",
3388 "Ratio between the brush radius and the radius that is going to be "
3389 "used to sample the color to blend in wet paint");
3390 RNA_def_property_update(prop, 0, "rna_Brush_update");
3391
3392 prop = RNA_def_property(srna, "stencil_pos", PROP_FLOAT, PROP_XYZ);
3393 RNA_def_property_float_sdna(prop, nullptr, "stencil_pos");
3394 RNA_def_property_array(prop, 2);
3395 RNA_def_property_ui_text(prop, "Stencil Position", "Position of stencil in viewport");
3396 RNA_def_property_update(prop, 0, "rna_Brush_update");
3397
3398 prop = RNA_def_property(srna, "stencil_dimension", PROP_FLOAT, PROP_XYZ);
3399 RNA_def_property_float_sdna(prop, nullptr, "stencil_dimension");
3400 RNA_def_property_array(prop, 2);
3401 RNA_def_property_ui_text(prop, "Stencil Dimensions", "Dimensions of stencil in viewport");
3402 RNA_def_property_update(prop, 0, "rna_Brush_update");
3403
3404 prop = RNA_def_property(srna, "mask_stencil_pos", PROP_FLOAT, PROP_XYZ);
3405 RNA_def_property_float_sdna(prop, nullptr, "mask_stencil_pos");
3406 RNA_def_property_array(prop, 2);
3407 RNA_def_property_ui_text(prop, "Mask Stencil Position", "Position of mask stencil in viewport");
3408 RNA_def_property_update(prop, 0, "rna_Brush_update");
3409
3410 prop = RNA_def_property(srna, "mask_stencil_dimension", PROP_FLOAT, PROP_XYZ);
3411 RNA_def_property_float_sdna(prop, nullptr, "mask_stencil_dimension");
3412 RNA_def_property_array(prop, 2);
3414 prop, "Mask Stencil Dimensions", "Dimensions of mask stencil in viewport");
3415 RNA_def_property_update(prop, 0, "rna_Brush_update");
3416
3417 prop = RNA_def_property(srna, "sharp_threshold", PROP_FLOAT, PROP_NONE);
3418 RNA_def_property_range(prop, 0.0, 100.0);
3419 RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 3);
3420 RNA_def_property_float_sdna(prop, nullptr, "sharp_threshold");
3422 prop, "Sharp Threshold", "Threshold below which, no sharpening is done");
3423 RNA_def_property_update(prop, 0, "rna_Brush_update");
3424
3425 prop = RNA_def_property(srna, "fill_threshold", PROP_FLOAT, PROP_NONE);
3426 RNA_def_property_range(prop, 0.0, 100.0);
3427 RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 3);
3428 RNA_def_property_float_sdna(prop, nullptr, "fill_threshold");
3430 prop, "Fill Threshold", "Threshold above which filling is not propagated");
3431 RNA_def_property_update(prop, 0, "rna_Brush_update");
3432
3433 prop = RNA_def_property(srna, "blur_kernel_radius", PROP_INT, PROP_NONE);
3434 RNA_def_property_int_sdna(prop, nullptr, "blur_kernel_radius");
3435 RNA_def_property_range(prop, 1, 10000);
3436 RNA_def_property_ui_range(prop, 1, 50, 1, -1);
3438 prop, "Kernel Radius", "Radius of kernel used for soften and sharpen in pixels");
3439 RNA_def_property_update(prop, 0, "rna_Brush_update");
3440
3441 prop = RNA_def_property(srna, "blur_mode", PROP_ENUM, PROP_NONE);
3442 RNA_def_property_enum_items(prop, brush_blur_mode_items);
3443 RNA_def_property_ui_text(prop, "Blur Mode", "");
3444 RNA_def_property_update(prop, 0, "rna_Brush_update");
3445
3446 prop = RNA_def_property(srna, "falloff_angle", PROP_FLOAT, PROP_ANGLE);
3447 RNA_def_property_float_sdna(prop, nullptr, "falloff_angle");
3450 prop,
3451 "Falloff Angle",
3452 "Paint most on faces pointing towards the view according to this angle");
3453 RNA_def_property_update(prop, 0, "rna_Brush_update");
3454
3455 /* flag */
3456 prop = RNA_def_property(srna, "use_airbrush", PROP_BOOLEAN, PROP_NONE);
3457 RNA_def_property_boolean_sdna(prop, nullptr, "flag", BRUSH_AIRBRUSH);
3459 prop, "Airbrush", "Keep applying paint effect while holding mouse (spray)");
3460 RNA_def_property_update(prop, 0, "rna_Brush_update");
3461
3462 prop = RNA_def_property(srna, "use_original_normal", PROP_BOOLEAN, PROP_NONE);
3465 "Original Normal",
3466 "When locked keep using normal of surface where stroke was initiated");
3467 RNA_def_property_update(prop, 0, "rna_Brush_update");
3468
3469 prop = RNA_def_property(srna, "use_original_plane", PROP_BOOLEAN, PROP_NONE);
3472 prop,
3473 "Original Plane",
3474 "When locked keep using the plane origin of surface where stroke was initiated");
3475 RNA_def_property_update(prop, 0, "rna_Brush_update");
3476
3478 do {
3479 prop = RNA_def_property(srna, entry->identifier, PROP_BOOLEAN, PROP_NONE);
3480 RNA_def_property_boolean_sdna(prop, nullptr, "automasking_flags", entry->value);
3481 RNA_def_property_ui_text(prop, entry->name, entry->description);
3482
3483 if (entry->value == BRUSH_AUTOMASKING_CAVITY_NORMAL) {
3484 RNA_def_property_boolean_funcs(prop, nullptr, "rna_Brush_automasking_cavity_set");
3485 }
3486 else if (entry->value == BRUSH_AUTOMASKING_CAVITY_INVERTED) {
3487 RNA_def_property_boolean_funcs(prop, nullptr, "rna_Brush_automasking_invert_cavity_set");
3488 }
3489
3490 RNA_def_property_update(prop, 0, "rna_Brush_update");
3491 } while ((++entry)->identifier);
3492
3493 prop = RNA_def_property(srna, "automasking_cavity_factor", PROP_FLOAT, PROP_FACTOR);
3494 RNA_def_property_float_sdna(prop, nullptr, "automasking_cavity_factor");
3495 RNA_def_property_ui_text(prop, "Cavity Factor", "The contrast of the cavity mask");
3496 RNA_def_property_range(prop, 0.0f, 5.0f);
3497 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
3499 RNA_def_property_update(prop, 0, "rna_Brush_update");
3500
3501 prop = RNA_def_property(srna, "automasking_cavity_blur_steps", PROP_INT, PROP_NONE);
3502 RNA_def_property_int_sdna(prop, nullptr, "automasking_cavity_blur_steps");
3504 RNA_def_property_ui_text(prop, "Blur Steps", "The number of times the cavity mask is blurred");
3505 RNA_def_property_range(prop, 0, 25);
3506 RNA_def_property_ui_range(prop, 0, 10, 1, 1);
3508 RNA_def_property_update(prop, 0, "rna_Brush_update");
3509
3510 prop = RNA_def_property(srna, "automasking_cavity_curve", PROP_POINTER, PROP_NONE);
3511 RNA_def_property_pointer_sdna(prop, nullptr, "automasking_cavity_curve");
3512 RNA_def_property_struct_type(prop, "CurveMapping");
3513 RNA_def_property_ui_text(prop, "Cavity Curve", "Curve used for the sensitivity");
3516 RNA_def_property_update(prop, 0, "rna_Brush_update");
3517
3518 prop = RNA_def_property(srna, "use_automasking_start_normal", PROP_BOOLEAN, PROP_NONE);
3520 prop, nullptr, "automasking_flags", BRUSH_AUTOMASKING_BRUSH_NORMAL);
3522 prop,
3523 "Area Normal",
3524 "Affect only vertices with a similar normal to where the stroke starts");
3525 RNA_def_property_update(prop, 0, "rna_Brush_update");
3526
3527 prop = RNA_def_property(srna, "automasking_start_normal_limit", PROP_FLOAT, PROP_ANGLE);
3528 RNA_def_property_float_sdna(prop, nullptr, "automasking_start_normal_limit");
3529 RNA_def_property_range(prop, 0.0001f, M_PI);
3530 RNA_def_property_ui_text(prop, "Area Normal Limit", "The range of angles that will be affected");
3531 RNA_def_property_update(prop, 0, "rna_Brush_update");
3532
3533 prop = RNA_def_property(srna, "automasking_start_normal_falloff", PROP_FLOAT, PROP_FACTOR);
3534 RNA_def_property_float_sdna(prop, nullptr, "automasking_start_normal_falloff");
3535 RNA_def_property_range(prop, 0.0001f, 1.0f);
3537 prop, "Area Normal Falloff", "Extend the angular range with a falloff gradient");
3538 RNA_def_property_update(prop, 0, "rna_Brush_update");
3539
3540 prop = RNA_def_property(srna, "use_automasking_view_normal", PROP_BOOLEAN, PROP_NONE);
3541 RNA_def_property_boolean_sdna(prop, nullptr, "automasking_flags", BRUSH_AUTOMASKING_VIEW_NORMAL);
3543 prop, "View Normal", "Affect only vertices with a normal that faces the viewer");
3544 RNA_def_property_update(prop, 0, "rna_Brush_update");
3545
3546 prop = RNA_def_property(srna, "use_automasking_view_occlusion", PROP_BOOLEAN, PROP_NONE);
3548 prop, nullptr, "automasking_flags", BRUSH_AUTOMASKING_VIEW_OCCLUSION);
3550 prop,
3551 "Occlusion",
3552 "Only affect vertices that are not occluded by other faces (slower performance)");
3553 RNA_def_property_update(prop, 0, "rna_Brush_update");
3554
3555 prop = RNA_def_property(srna, "automasking_view_normal_limit", PROP_FLOAT, PROP_ANGLE);
3556 RNA_def_property_float_sdna(prop, nullptr, "automasking_view_normal_limit");
3557 RNA_def_property_range(prop, 0.0001f, M_PI);
3558 RNA_def_property_ui_text(prop, "View Normal Limit", "The range of angles that will be affected");
3559 RNA_def_property_update(prop, 0, "rna_Brush_update");
3560
3561 prop = RNA_def_property(srna, "automasking_view_normal_falloff", PROP_FLOAT, PROP_FACTOR);
3562 RNA_def_property_float_sdna(prop, nullptr, "automasking_view_normal_falloff");
3563 RNA_def_property_range(prop, 0.0001f, 1.0f);
3565 prop, "View Normal Falloff", "Extend the angular range with a falloff gradient");
3566 RNA_def_property_update(prop, 0, "rna_Brush_update");
3567
3568 prop = RNA_def_property(srna, "use_scene_spacing", PROP_ENUM, PROP_NONE);
3569 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flag");
3570 RNA_def_property_enum_items(prop, brush_spacing_unit_items);
3572 prop, "Spacing Distance", "Calculate the brush spacing using view or scene distance");
3573 RNA_def_property_update(prop, 0, "rna_Brush_update");
3574
3575 prop = RNA_def_property(srna, "use_grab_active_vertex", PROP_BOOLEAN, PROP_NONE);
3578 prop,
3579 "Grab Active Vertex",
3580 "Apply the maximum grab strength to the active vertex instead of the cursor location");
3581 RNA_def_property_update(prop, 0, "rna_Brush_update");
3582
3583 prop = RNA_def_property(srna, "use_grab_silhouette", PROP_BOOLEAN, PROP_NONE);
3586 prop, "Grab Silhouette", "Grabs trying to automask the silhouette of the object");
3587 RNA_def_property_update(prop, 0, "rna_Brush_update");
3588
3589 prop = RNA_def_property(srna, "use_paint_antialiasing", PROP_BOOLEAN, PROP_NONE);
3590 RNA_def_property_boolean_sdna(prop, nullptr, "sampling_flag", BRUSH_PAINT_ANTIALIASING);
3591 RNA_def_property_ui_text(prop, "Anti-Aliasing", "Smooths the edges of the strokes");
3592 RNA_def_property_update(prop, 0, "rna_Brush_update");
3593
3594 prop = RNA_def_property(srna, "use_multiplane_scrape_dynamic", PROP_BOOLEAN, PROP_NONE);
3597 "Dynamic Mode",
3598 "The angle between the planes changes during the stroke to fit the "
3599 "surface under the cursor");
3600 RNA_def_property_update(prop, 0, "rna_Brush_update");
3601
3602 prop = RNA_def_property(srna, "show_multiplane_scrape_planes_preview", PROP_BOOLEAN, PROP_NONE);
3605 prop, "Show Cursor Preview", "Preview the scrape planes in the cursor during the stroke");
3606 RNA_def_property_update(prop, 0, "rna_Brush_update");
3607
3608 prop = RNA_def_property(srna, "use_pose_ik_anchored", PROP_BOOLEAN, PROP_NONE);
3611 prop, "Keep Anchor Point", "Keep the position of the last segment in the IK chain fixed");
3612 RNA_def_property_update(prop, 0, "rna_Brush_update");
3613
3614 prop = RNA_def_property(srna, "use_pose_lock_rotation", PROP_BOOLEAN, PROP_NONE);
3617 "Lock Rotation When Scaling",
3618 "Do not rotate the segment when using the scale deform mode");
3619 RNA_def_property_update(prop, 0, "rna_Brush_update");
3620
3621 prop = RNA_def_property(srna, "use_connected_only", PROP_BOOLEAN, PROP_NONE);
3623 RNA_def_property_ui_text(prop, "Connected Only", "Affect only topologically connected elements");
3624 RNA_def_property_update(prop, 0, "rna_Brush_update");
3625
3626 prop = RNA_def_property(srna, "use_cloth_pin_simulation_boundary", PROP_BOOLEAN, PROP_NONE);
3629 prop,
3630 "Pin Simulation Boundary",
3631 "Lock the position of the vertices in the simulation falloff area to avoid artifacts and "
3632 "create a softer transition with unaffected areas");
3633 RNA_def_property_update(prop, 0, "rna_Brush_update");
3634
3635 prop = RNA_def_property(srna, "use_cloth_collision", PROP_BOOLEAN, PROP_NONE);
3637 RNA_def_property_ui_text(prop, "Enable Collision", "Collide with objects during the simulation");
3638 RNA_def_property_update(prop, 0, "rna_Brush_update");
3639
3640 prop = RNA_def_property(srna, "invert_to_scrape_fill", PROP_BOOLEAN, PROP_NONE);
3643 "Invert to Scrape or Fill",
3644 "Use Scrape or Fill brush when inverting this brush instead of "
3645 "inverting its displacement direction");
3646 RNA_def_property_update(prop, 0, "rna_Brush_update");
3647
3648 prop = RNA_def_property(srna, "use_pressure_strength", PROP_BOOLEAN, PROP_NONE);
3650 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
3652 prop, "Strength Pressure", "Enable tablet pressure sensitivity for strength");
3653 RNA_def_property_update(prop, 0, "rna_Brush_update");
3654
3655 prop = RNA_def_property(srna, "use_offset_pressure", PROP_BOOLEAN, PROP_NONE);
3657 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
3659 prop, "Plane Offset Pressure", "Enable tablet pressure sensitivity for offset");
3660 RNA_def_property_update(prop, 0, "rna_Brush_update");
3661
3662 prop = RNA_def_property(srna, "use_pressure_area_radius", PROP_BOOLEAN, PROP_NONE);
3664 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
3666 prop, "Area Radius Pressure", "Enable tablet pressure sensitivity for area radius");
3667 RNA_def_property_update(prop, 0, "rna_Brush_update");
3668
3669 prop = RNA_def_property(srna, "use_pressure_size", PROP_BOOLEAN, PROP_NONE);
3670 RNA_def_property_boolean_sdna(prop, nullptr, "flag", BRUSH_SIZE_PRESSURE);
3671 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
3672 RNA_def_property_ui_text(prop, "Size Pressure", "Enable tablet pressure sensitivity for size");
3673 RNA_def_property_update(prop, 0, "rna_Brush_update");
3674
3675 prop = RNA_def_property(srna, "use_pressure_jitter", PROP_BOOLEAN, PROP_NONE);
3677 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
3679 prop, "Jitter Pressure", "Enable tablet pressure sensitivity for jitter");
3680 RNA_def_property_update(prop, 0, "rna_Brush_update");
3681
3682 prop = RNA_def_property(srna, "use_pressure_spacing", PROP_BOOLEAN, PROP_NONE);
3684 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
3686 prop, "Spacing Pressure", "Enable tablet pressure sensitivity for spacing");
3687 RNA_def_property_update(prop, 0, "rna_Brush_update");
3688
3689 prop = RNA_def_property(srna, "use_pressure_masking", PROP_ENUM, PROP_NONE);
3690 RNA_def_property_enum_sdna(prop, nullptr, "mask_pressure");
3691 RNA_def_property_enum_items(prop, brush_mask_pressure_items);
3693 prop, "Mask Pressure Mode", "Pen pressure makes texture influence smaller");
3694 RNA_def_property_update(prop, 0, "rna_Brush_update");
3695
3696 prop = RNA_def_property(srna, "use_inverse_smooth_pressure", PROP_BOOLEAN, PROP_NONE);
3698 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
3700 prop, "Inverse Smooth Pressure", "Lighter pressure causes more smoothing to be applied");
3701 RNA_def_property_update(prop, 0, "rna_Brush_update");
3702
3703 prop = RNA_def_property(srna, "use_plane_trim", PROP_BOOLEAN, PROP_NONE);
3704 RNA_def_property_boolean_sdna(prop, nullptr, "flag", BRUSH_PLANE_TRIM);
3706 prop,
3707 "Use Plane Trim",
3708 "Limit the distance from the offset plane that a vertex can be affected");
3709 RNA_def_property_update(prop, 0, "rna_Brush_update");
3710
3711 prop = RNA_def_property(srna, "use_frontface", PROP_BOOLEAN, PROP_NONE);
3712 RNA_def_property_boolean_sdna(prop, nullptr, "flag", BRUSH_FRONTFACE);
3714 prop, "Use Front-Face", "Brush only affects vertices that face the viewer");
3715 RNA_def_property_update(prop, 0, "rna_Brush_update");
3716
3717 prop = RNA_def_property(srna, "use_frontface_falloff", PROP_BOOLEAN, PROP_NONE);
3720 prop, "Use Front-Face Falloff", "Blend brush influence by how much they face the front");
3721 RNA_def_property_update(prop, 0, "rna_Brush_update");
3722
3723 prop = RNA_def_property(srna, "use_anchor", PROP_BOOLEAN, PROP_NONE);
3724 RNA_def_property_boolean_sdna(prop, nullptr, "flag", BRUSH_ANCHORED);
3725 RNA_def_property_ui_text(prop, "Anchored", "Keep the brush anchored to the initial location");
3726 RNA_def_property_update(prop, 0, "rna_Brush_update");
3727
3728 prop = RNA_def_property(srna, "use_space", PROP_BOOLEAN, PROP_NONE);
3729 RNA_def_property_boolean_sdna(prop, nullptr, "flag", BRUSH_SPACE);
3731 prop, "Space", "Limit brush application to the distance specified by spacing");
3733 RNA_def_property_update(prop, 0, "rna_Brush_update");
3734
3735 prop = RNA_def_property(srna, "use_line", PROP_BOOLEAN, PROP_NONE);
3736 RNA_def_property_boolean_sdna(prop, nullptr, "flag", BRUSH_LINE);
3737 RNA_def_property_ui_text(prop, "Line", "Draw a line with dabs separated according to spacing");
3738 RNA_def_property_update(prop, 0, "rna_Brush_update");
3739
3740 prop = RNA_def_property(srna, "use_curve", PROP_BOOLEAN, PROP_NONE);
3741 RNA_def_property_boolean_sdna(prop, nullptr, "flag", BRUSH_CURVE);
3743 prop,
3744 "Curve",
3745 "Define the stroke curve with a Bézier curve. Dabs are separated according to spacing.");
3746 RNA_def_property_update(prop, 0, "rna_Brush_update");
3747
3748 prop = RNA_def_property(srna, "use_smooth_stroke", PROP_BOOLEAN, PROP_NONE);
3749 RNA_def_property_boolean_sdna(prop, nullptr, "flag", BRUSH_SMOOTH_STROKE);
3751 prop, "Smooth Stroke", "Brush lags behind mouse and follows a smoother path");
3752 RNA_def_property_update(prop, 0, "rna_Brush_update");
3753
3754 prop = RNA_def_property(srna, "use_persistent", PROP_BOOLEAN, PROP_NONE);
3755 RNA_def_property_boolean_sdna(prop, nullptr, "flag", BRUSH_PERSISTENT);
3756 RNA_def_property_ui_text(prop, "Persistent", "Sculpt on a persistent layer of the mesh");
3757 RNA_def_property_update(prop, 0, "rna_Brush_update");
3758
3759 prop = RNA_def_property(srna, "use_accumulate", PROP_BOOLEAN, PROP_NONE);
3760 RNA_def_property_boolean_sdna(prop, nullptr, "flag", BRUSH_ACCUMULATE);
3761 RNA_def_property_ui_text(prop, "Accumulate", "Accumulate stroke daubs on top of each other");
3762 RNA_def_property_update(prop, 0, "rna_Brush_update");
3763
3764 prop = RNA_def_property(srna, "use_space_attenuation", PROP_BOOLEAN, PROP_NONE);
3765 RNA_def_property_boolean_sdna(prop, nullptr, "flag", BRUSH_SPACE_ATTEN);
3767 prop,
3768 "Adjust Strength for Spacing",
3769 "Automatically adjust strength to give consistent results for different spacings");
3770 RNA_def_property_update(prop, 0, "rna_Brush_update");
3771
3772 /* adaptive space is not implemented yet */
3773 prop = RNA_def_property(srna, "use_adaptive_space", PROP_BOOLEAN, PROP_NONE);
3776 "Adaptive Spacing",
3777 "Space daubs according to surface orientation instead of screen space");
3778 RNA_def_property_update(prop, 0, "rna_Brush_update");
3779
3780 prop = RNA_def_property(srna, "use_locked_size", PROP_ENUM, PROP_NONE); /* as an enum */
3781 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flag");
3782 RNA_def_property_enum_items(prop, brush_size_unit_items);
3784 prop, "Size Unit", "Measure brush size relative to the view or the scene");
3785 RNA_def_property_update(prop, 0, "rna_Brush_update");
3786
3787 prop = RNA_def_property(srna, "color_type", PROP_ENUM, PROP_NONE); /* as an enum */
3788 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flag");
3789 RNA_def_property_enum_items(prop, color_gradient_items);
3790 RNA_def_property_enum_funcs(prop, nullptr, "rna_Brush_use_gradient_set", nullptr);
3791 RNA_def_property_ui_text(prop, "Color Type", "Use single color or gradient when painting");
3792 RNA_def_property_update(prop, 0, "rna_Brush_update");
3793
3794 prop = RNA_def_property(srna, "use_edge_to_edge", PROP_BOOLEAN, PROP_NONE);
3795 RNA_def_property_boolean_sdna(prop, nullptr, "flag", BRUSH_EDGE_TO_EDGE);
3796 RNA_def_property_ui_text(prop, "Edge-to-Edge", "Drag anchor brush from edge-to-edge");
3797 RNA_def_property_update(prop, 0, "rna_Brush_update");
3798
3799 prop = RNA_def_property(srna, "use_restore_mesh", PROP_BOOLEAN, PROP_NONE);
3800 RNA_def_property_boolean_sdna(prop, nullptr, "flag", BRUSH_DRAG_DOT);
3801 RNA_def_property_ui_text(prop, "Restore Mesh", "Allow a single dot to be carefully positioned");
3802 RNA_def_property_update(prop, 0, "rna_Brush_update");
3803
3804 /* only for projection paint & vertex paint, TODO: other paint modes. */
3805 prop = RNA_def_property(srna, "use_alpha", PROP_BOOLEAN, PROP_NONE);
3808 prop, "Affect Alpha", "When this is disabled, lock alpha while painting");
3809 RNA_def_property_update(prop, 0, "rna_Brush_update");
3810
3811 prop = RNA_def_property(srna, "curve_distance_falloff", PROP_POINTER, PROP_NONE);
3813 RNA_def_property_ui_text(prop, "Falloff Curve", "Editable falloff curve");
3814 RNA_def_property_update(prop, 0, "rna_Brush_update");
3815
3816 prop = RNA_def_property(srna, "paint_curve", PROP_POINTER, PROP_NONE);
3818 RNA_def_property_ui_text(prop, "Paint Curve", "Active paint curve");
3819 RNA_def_property_update(prop, 0, "rna_Brush_update");
3820
3821 prop = RNA_def_property(srna, "gradient", PROP_POINTER, PROP_NEVER_NULL);
3822 RNA_def_property_pointer_sdna(prop, nullptr, "gradient");
3823 RNA_def_property_struct_type(prop, "ColorRamp");
3824 RNA_def_property_ui_text(prop, "Gradient", "");
3825 RNA_def_property_update(prop, 0, "rna_Brush_update");
3826
3827 /* gradient source */
3828 prop = RNA_def_property(srna, "gradient_stroke_mode", PROP_ENUM, PROP_NONE);
3829 RNA_def_property_enum_items(prop, brush_gradient_items);
3830 RNA_def_property_ui_text(prop, "Gradient Stroke Mode", "");
3831 RNA_def_property_update(prop, 0, "rna_Brush_update");
3832
3833 prop = RNA_def_property(srna, "gradient_fill_mode", PROP_ENUM, PROP_NONE);
3834 RNA_def_property_enum_items(prop, brush_gradient_fill_items);
3835 RNA_def_property_ui_text(prop, "Gradient Fill Mode", "");
3836 RNA_def_property_update(prop, 0, "rna_Brush_update");
3837
3838 /* overlay flags */
3839 prop = RNA_def_property(srna, "use_primary_overlay", PROP_BOOLEAN, PROP_NONE);
3840 RNA_def_property_boolean_sdna(prop, nullptr, "overlay_flags", BRUSH_OVERLAY_PRIMARY);
3841 RNA_def_property_ui_text(prop, "Use Texture Overlay", "Show texture in viewport");
3842 RNA_def_property_update(prop, 0, "rna_Brush_update");
3843
3844 prop = RNA_def_property(srna, "use_secondary_overlay", PROP_BOOLEAN, PROP_NONE);
3845 RNA_def_property_boolean_sdna(prop, nullptr, "overlay_flags", BRUSH_OVERLAY_SECONDARY);
3846 RNA_def_property_ui_text(prop, "Use Texture Overlay", "Show texture in viewport");
3847 RNA_def_property_update(prop, 0, "rna_Brush_update");
3848
3849 prop = RNA_def_property(srna, "use_cursor_overlay", PROP_BOOLEAN, PROP_NONE);
3850 RNA_def_property_boolean_sdna(prop, nullptr, "overlay_flags", BRUSH_OVERLAY_CURSOR);
3851 RNA_def_property_ui_text(prop, "Use Cursor Overlay", "Show cursor in viewport");
3852 RNA_def_property_update(prop, 0, "rna_Brush_update");
3853
3854 prop = RNA_def_property(srna, "use_cursor_overlay_override", PROP_BOOLEAN, PROP_NONE);
3856 prop, nullptr, "overlay_flags", BRUSH_OVERLAY_CURSOR_OVERRIDE_ON_STROKE);
3857 RNA_def_property_ui_text(prop, "Override Overlay", "Don't show overlay during a stroke");
3858 RNA_def_property_update(prop, 0, "rna_Brush_update");
3859
3860 prop = RNA_def_property(srna, "use_primary_overlay_override", PROP_BOOLEAN, PROP_NONE);
3862 prop, nullptr, "overlay_flags", BRUSH_OVERLAY_PRIMARY_OVERRIDE_ON_STROKE);
3863 RNA_def_property_ui_text(prop, "Override Overlay", "Don't show overlay during a stroke");
3864 RNA_def_property_update(prop, 0, "rna_Brush_update");
3865
3866 prop = RNA_def_property(srna, "use_secondary_overlay_override", PROP_BOOLEAN, PROP_NONE);
3868 prop, nullptr, "overlay_flags", BRUSH_OVERLAY_SECONDARY_OVERRIDE_ON_STROKE);
3869 RNA_def_property_ui_text(prop, "Override Overlay", "Don't show overlay during a stroke");
3870 RNA_def_property_update(prop, 0, "rna_Brush_update");
3871
3872 /* paint mode flags */
3873 prop = RNA_def_property(srna, "use_paint_sculpt", PROP_BOOLEAN, PROP_NONE);
3874 RNA_def_property_boolean_sdna(prop, nullptr, "ob_mode", OB_MODE_SCULPT);
3875 RNA_def_property_ui_text(prop, "Use Sculpt", "Use this brush in sculpt mode");
3876 RNA_def_property_update(prop, 0, "rna_Brush_update");
3877
3878 prop = RNA_def_property(srna, "use_paint_uv_sculpt", PROP_BOOLEAN, PROP_NONE);
3879 RNA_def_property_boolean_sdna(prop, nullptr, "ob_mode", OB_MODE_EDIT);
3880 RNA_def_property_ui_text(prop, "Use UV Sculpt", "Use this brush in UV sculpt mode");
3881 RNA_def_property_update(prop, 0, "rna_Brush_update");
3882
3883 prop = RNA_def_property(srna, "use_paint_vertex", PROP_BOOLEAN, PROP_NONE);
3884 RNA_def_property_boolean_sdna(prop, nullptr, "ob_mode", OB_MODE_VERTEX_PAINT);
3885 RNA_def_property_ui_text(prop, "Use Vertex", "Use this brush in vertex paint mode");
3886 RNA_def_property_update(prop, 0, "rna_Brush_update");
3887
3888 prop = RNA_def_property(srna, "use_paint_weight", PROP_BOOLEAN, PROP_NONE);
3889 RNA_def_property_boolean_sdna(prop, nullptr, "ob_mode", OB_MODE_WEIGHT_PAINT);
3890 RNA_def_property_ui_text(prop, "Use Weight", "Use this brush in weight paint mode");
3891 RNA_def_property_update(prop, 0, "rna_Brush_update");
3892
3893 prop = RNA_def_property(srna, "use_paint_image", PROP_BOOLEAN, PROP_NONE);
3894 RNA_def_property_boolean_sdna(prop, nullptr, "ob_mode", OB_MODE_TEXTURE_PAINT);
3895 RNA_def_property_ui_text(prop, "Use Texture", "Use this brush in texture paint mode");
3896 RNA_def_property_update(prop, 0, "rna_Brush_update");
3897
3898 prop = RNA_def_property(srna, "use_paint_grease_pencil", PROP_BOOLEAN, PROP_NONE);
3900 RNA_def_property_ui_text(prop, "Use Paint", "Use this brush in Grease Pencil drawing mode");
3901 RNA_def_property_update(prop, 0, "rna_Brush_update");
3902
3903 prop = RNA_def_property(srna, "use_vertex_grease_pencil", PROP_BOOLEAN, PROP_NONE);
3906 prop, "Use Vertex", "Use this brush in Grease Pencil vertex color mode");
3907 RNA_def_property_update(prop, 0, "rna_Brush_update");
3908
3909 prop = RNA_def_property(srna, "use_paint_sculpt_curves", PROP_BOOLEAN, PROP_NONE);
3910 RNA_def_property_boolean_sdna(prop, nullptr, "ob_mode", OB_MODE_SCULPT_CURVES);
3911 RNA_def_property_ui_text(prop, "Use Sculpt", "Use this brush in sculpt curves mode");
3912 RNA_def_property_update(prop, 0, "rna_Brush_update");
3913
3914 /* texture */
3915 prop = RNA_def_property(srna, "texture_slot", PROP_POINTER, PROP_NONE);
3916 RNA_def_property_struct_type(prop, "BrushTextureSlot");
3917 RNA_def_property_pointer_sdna(prop, nullptr, "mtex");
3919 RNA_def_property_ui_text(prop, "Texture Slot", "");
3920
3921 prop = RNA_def_property(srna, "texture", PROP_POINTER, PROP_NONE);
3922 RNA_def_property_pointer_sdna(prop, nullptr, "mtex.tex");
3924 RNA_def_property_ui_text(prop, "Texture", "");
3925 RNA_def_property_update(prop, NC_TEXTURE, "rna_Brush_main_tex_update");
3926
3927 prop = RNA_def_property(srna, "mask_texture_slot", PROP_POINTER, PROP_NONE);
3928 RNA_def_property_struct_type(prop, "BrushTextureSlot");
3929 RNA_def_property_pointer_sdna(prop, nullptr, "mask_mtex");
3931 RNA_def_property_ui_text(prop, "Mask Texture Slot", "");
3932
3933 prop = RNA_def_property(srna, "mask_texture", PROP_POINTER, PROP_NONE);
3934 RNA_def_property_pointer_sdna(prop, nullptr, "mask_mtex.tex");
3936 RNA_def_property_ui_text(prop, "Mask Texture", "");
3937 RNA_def_property_update(prop, NC_TEXTURE, "rna_Brush_secondary_tex_update");
3938
3939 prop = RNA_def_property(srna, "texture_overlay_alpha", PROP_INT, PROP_PERCENTAGE);
3940 RNA_def_property_int_sdna(prop, nullptr, "texture_overlay_alpha");
3941 RNA_def_property_range(prop, 0, 100);
3942 RNA_def_property_ui_text(prop, "Texture Overlay Alpha", "");
3943 RNA_def_property_update(prop, 0, "rna_Brush_update");
3944
3945 prop = RNA_def_property(srna, "mask_overlay_alpha", PROP_INT, PROP_PERCENTAGE);
3946 RNA_def_property_int_sdna(prop, nullptr, "mask_overlay_alpha");
3947 RNA_def_property_range(prop, 0, 100);
3948 RNA_def_property_ui_text(prop, "Mask Texture Overlay Alpha", "");
3949 RNA_def_property_update(prop, 0, "rna_Brush_update");
3950
3951 prop = RNA_def_property(srna, "cursor_overlay_alpha", PROP_INT, PROP_PERCENTAGE);
3952 RNA_def_property_int_sdna(prop, nullptr, "cursor_overlay_alpha");
3953 RNA_def_property_range(prop, 0, 100);
3954 RNA_def_property_ui_text(prop, "Mask Texture Overlay Alpha", "");
3955 RNA_def_property_update(prop, 0, "rna_Brush_update");
3956
3957 prop = RNA_def_property(srna, "cursor_color_add", PROP_FLOAT, PROP_COLOR_GAMMA);
3958 RNA_def_property_float_sdna(prop, nullptr, "add_col");
3959 RNA_def_property_array(prop, 4);
3960 RNA_def_property_ui_text(prop, "Add Color", "Color of cursor when adding");
3961 RNA_def_property_update(prop, 0, "rna_Brush_update");
3962
3963 prop = RNA_def_property(srna, "cursor_color_subtract", PROP_FLOAT, PROP_COLOR_GAMMA);
3964 RNA_def_property_float_sdna(prop, nullptr, "sub_col");
3965 RNA_def_property_array(prop, 4);
3966 RNA_def_property_ui_text(prop, "Subtract Color", "Color of cursor when subtracting");
3967 RNA_def_property_update(prop, 0, "rna_Brush_update");
3968
3969 prop = RNA_def_property(srna, "brush_capabilities", PROP_POINTER, PROP_NONE);
3971 RNA_def_property_struct_type(prop, "BrushCapabilities");
3972 RNA_def_property_pointer_funcs(prop, "rna_Brush_capabilities_get", nullptr, nullptr, nullptr);
3973 RNA_def_property_ui_text(prop, "Brush Capabilities", "Brush's capabilities");
3974
3975 /* brush capabilities (mode-dependent) */
3976 prop = RNA_def_property(srna, "sculpt_capabilities", PROP_POINTER, PROP_NONE);
3978 RNA_def_property_struct_type(prop, "BrushCapabilitiesSculpt");
3980 prop, "rna_Sculpt_brush_capabilities_get", nullptr, nullptr, nullptr);
3981 RNA_def_property_ui_text(prop, "Sculpt Capabilities", "");
3982
3983 prop = RNA_def_property(srna, "image_paint_capabilities", PROP_POINTER, PROP_NONE);
3985 RNA_def_property_struct_type(prop, "BrushCapabilitiesImagePaint");
3987 prop, "rna_Imapaint_brush_capabilities_get", nullptr, nullptr, nullptr);
3988 RNA_def_property_ui_text(prop, "Image Paint Capabilities", "");
3989
3990 prop = RNA_def_property(srna, "vertex_paint_capabilities", PROP_POINTER, PROP_NONE);
3992 RNA_def_property_struct_type(prop, "BrushCapabilitiesVertexPaint");
3994 prop, "rna_Vertexpaint_brush_capabilities_get", nullptr, nullptr, nullptr);
3995 RNA_def_property_ui_text(prop, "Vertex Paint Capabilities", "");
3996
3997 prop = RNA_def_property(srna, "weight_paint_capabilities", PROP_POINTER, PROP_NONE);
3999 RNA_def_property_struct_type(prop, "BrushCapabilitiesWeightPaint");
4001 prop, "rna_Weightpaint_brush_capabilities_get", nullptr, nullptr, nullptr);
4002 RNA_def_property_ui_text(prop, "Weight Paint Capabilities", "");
4003
4004 prop = RNA_def_property(srna, "gpencil_settings", PROP_POINTER, PROP_NONE);
4005 RNA_def_property_struct_type(prop, "BrushGpencilSettings");
4006 RNA_def_property_pointer_sdna(prop, nullptr, "gpencil_settings");
4008 RNA_def_property_ui_text(prop, "Gpencil Settings", "");
4009
4010 prop = RNA_def_property(srna, "curves_sculpt_settings", PROP_POINTER, PROP_NONE);
4011 RNA_def_property_struct_type(prop, "BrushCurvesSculptSettings");
4013 RNA_def_property_ui_text(prop, "Curves Sculpt Settings", "");
4014}
4015
4027{
4028 StructRNA *srna;
4029 PropertyRNA *prop;
4030
4031 srna = RNA_def_struct(brna, "OperatorStrokeElement", "PropertyGroup");
4032 RNA_def_struct_ui_text(srna, "Operator Stroke Element", "");
4033
4034 prop = RNA_def_property(srna, "location", PROP_FLOAT, PROP_XYZ);
4036 RNA_def_property_array(prop, 3);
4037 RNA_def_property_ui_text(prop, "Location", "");
4038
4039 prop = RNA_def_property(srna, "mouse", PROP_FLOAT, PROP_XYZ);
4041 RNA_def_property_array(prop, 2);
4042 RNA_def_property_ui_text(prop, "Mouse", "");
4043
4044 prop = RNA_def_property(srna, "mouse_event", PROP_FLOAT, PROP_XYZ);
4046 RNA_def_property_array(prop, 2);
4047 RNA_def_property_ui_text(prop, "Mouse Event", "");
4048
4049 prop = RNA_def_property(srna, "pressure", PROP_FLOAT, PROP_FACTOR);
4051 RNA_def_property_range(prop, 0.0f, 1.0f);
4052 RNA_def_property_ui_text(prop, "Pressure", "Tablet pressure");
4053
4054 prop = RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE);
4056 RNA_def_property_range(prop, 0.0f, FLT_MAX);
4057 RNA_def_property_ui_text(prop, "Brush Size", "Brush size in screen space");
4058
4059 prop = RNA_def_property(srna, "x_tilt", PROP_FLOAT, PROP_FACTOR);
4061 RNA_def_property_range(prop, -1.0f, 1.0f);
4062 RNA_def_property_ui_text(prop, "Tilt X", "Pen tilt from left (-1.0) to right (+1.0)");
4063
4064 prop = RNA_def_property(srna, "y_tilt", PROP_FLOAT, PROP_FACTOR);
4066 RNA_def_property_range(prop, -1.0f, 1.0f);
4067 RNA_def_property_ui_text(prop, "Tilt Y", "Pen tilt from backward (-1.0) to forward (+1.0)");
4068
4069 /* used in uv painting */
4070 prop = RNA_def_property(srna, "time", PROP_FLOAT, PROP_UNSIGNED);
4072 RNA_def_property_ui_text(prop, "Time", "");
4073
4074 /* used for Grease Pencil sketching sessions */
4075 prop = RNA_def_property(srna, "is_start", PROP_BOOLEAN, PROP_NONE);
4077 RNA_def_property_ui_text(prop, "Is Stroke Start", "");
4078
4079 /* XXX: Tool (this will be for pressing a modifier key for a different brush,
4080 * e.g. switching to a Smooth brush in the middle of the stroke */
4081
4082 /* XXX: i don't think blender currently supports the ability to properly do a remappable modifier
4083 * in the middle of a stroke */
4084}
4085
4099
4100#endif
void BKE_brush_scale_unprojected_size(float *unprojected_size, int new_brush_size, int old_brush_size)
Definition brush.cc:1320
void BKE_brush_color_sync_legacy(Brush *brush)
Definition brush.cc:1227
void BKE_brush_scale_size(int *r_brush_size, float new_unprojected_size, float old_unprojected_size)
Definition brush.cc:1332
void BKE_brush_tag_unsaved_changes(Brush *brush)
Definition brush.cc:764
ColorBand * BKE_colorband_add(bool rangetype)
Definition colorband.cc:298
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_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:259
PaintMode BKE_paintmode_get_active_from_context(const bContext *C)
Definition paint.cc:505
void BKE_paint_invalidate_overlay_all()
Definition paint.cc:292
PaintMode
#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 CTX_N_(context, msgid)
#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
@ 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_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
@ 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
#define MAX_BRUSH_PIXEL_DIAMETER
@ 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
@ SCULPT_DISP_DIR_VIEW
@ SCULPT_DISP_DIR_X
@ SCULPT_DISP_DIR_Z
@ SCULPT_DISP_DIR_Y
@ SCULPT_DISP_DIR_AREA
@ 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_ANGLE_RANDOM
@ MTEX_ANGLE_RAKE
@ MTEX_MAP_MODE_AREA
@ MTEX_MAP_MODE_3D
@ MTEX_MAP_MODE_STENCIL
@ MTEX_MAP_MODE_TILED
@ MTEX_MAP_MODE_RANDOM
@ MTEX_MAP_MODE_VIEW
@ IMB_BLEND_EXCLUSION
Definition IMB_imbuf.hh:198
@ IMB_BLEND_DIFFERENCE
Definition IMB_imbuf.hh:197
@ IMB_BLEND_HARDLIGHT
Definition IMB_imbuf.hh:188
@ IMB_BLEND_COLORBURN
Definition IMB_imbuf.hh:189
@ IMB_BLEND_COLORDODGE
Definition IMB_imbuf.hh:191
@ IMB_BLEND_ERASE_ALPHA
Definition IMB_imbuf.hh:185
@ IMB_BLEND_SCREEN
Definition IMB_imbuf.hh:192
@ IMB_BLEND_HUE
Definition IMB_imbuf.hh:199
@ IMB_BLEND_MUL
Definition IMB_imbuf.hh:182
@ IMB_BLEND_ADD_ALPHA
Definition IMB_imbuf.hh:186
@ IMB_BLEND_DARKEN
Definition IMB_imbuf.hh:184
@ IMB_BLEND_OVERLAY
Definition IMB_imbuf.hh:187
@ IMB_BLEND_SATURATION
Definition IMB_imbuf.hh:200
@ IMB_BLEND_VIVIDLIGHT
Definition IMB_imbuf.hh:195
@ IMB_BLEND_LUMINOSITY
Definition IMB_imbuf.hh:201
@ IMB_BLEND_LIGHTEN
Definition IMB_imbuf.hh:183
@ IMB_BLEND_SOFTLIGHT
Definition IMB_imbuf.hh:193
@ IMB_BLEND_COLOR
Definition IMB_imbuf.hh:202
@ IMB_BLEND_LINEARLIGHT
Definition IMB_imbuf.hh:196
@ IMB_BLEND_PINLIGHT
Definition IMB_imbuf.hh:194
@ IMB_BLEND_MIX
Definition IMB_imbuf.hh:179
@ IMB_BLEND_ADD
Definition IMB_imbuf.hh:180
@ IMB_BLEND_SUB
Definition IMB_imbuf.hh:181
@ IMB_BLEND_LINEARBURN
Definition IMB_imbuf.hh:190
ParameterFlag
Definition RNA_types.hh:544
@ PROP_FLOAT
Definition RNA_types.hh:164
@ PROP_BOOLEAN
Definition RNA_types.hh:162
@ PROP_ENUM
Definition RNA_types.hh:166
@ PROP_INT
Definition RNA_types.hh:163
@ PROP_POINTER
Definition RNA_types.hh:167
#define RNA_ENUM_ITEM_SEPR
Definition RNA_types.hh:676
@ PROPOVERRIDE_OVERRIDABLE_LIBRARY
Definition RNA_types.hh:503
@ PROP_CONTEXT_UPDATE
Definition RNA_types.hh:407
@ PROP_ANIMATABLE
Definition RNA_types.hh:319
@ PROP_EDITABLE
Definition RNA_types.hh:306
@ PROP_NEVER_NULL
Definition RNA_types.hh:377
@ PROP_ID_SELF_CHECK
Definition RNA_types.hh:370
@ PROP_IDPROPERTY
Definition RNA_types.hh:426
@ PROP_XYZ
Definition RNA_types.hh:269
@ PROP_DISTANCE
Definition RNA_types.hh:256
@ PROP_COLOR
Definition RNA_types.hh:260
@ PROP_PIXEL
Definition RNA_types.hh:248
@ PROP_ANGLE
Definition RNA_types.hh:252
@ PROP_PIXEL_DIAMETER
Definition RNA_types.hh:293
@ PROP_NONE
Definition RNA_types.hh:233
@ PROP_PERCENTAGE
Definition RNA_types.hh:250
@ PROP_FACTOR
Definition RNA_types.hh:251
@ PROP_COLOR_GAMMA
Definition RNA_types.hh:272
@ PROP_UNSIGNED
Definition RNA_types.hh:249
@ PROP_DISTANCE_DIAMETER
Definition RNA_types.hh:294
#define C
Definition RandGen.cpp:29
#define NC_BRUSH
Definition WM_types.hh:385
#define ND_DATA
Definition WM_types.hh:509
#define ND_SPACE_PROPERTIES
Definition WM_types.hh:529
#define NC_SCENE
Definition WM_types.hh:378
#define ND_TOOLSETTINGS
Definition WM_types.hh:449
#define ND_SPACE_IMAGE
Definition WM_types.hh:522
#define NA_EDITED
Definition WM_types.hh:584
#define NC_GPENCIL
Definition WM_types.hh:399
#define NC_TEXTURE
Definition WM_types.hh:381
#define NC_SPACE
Definition WM_types.hh:392
#define INT32_MAX
bool supports_sculpt_plane(const Brush &brush)
Definition brush.cc:1854
bool supports_secondary_cursor_color(const Brush &brush)
Definition brush.cc:1867
bool supports_auto_smooth(const Brush &brush)
Definition brush.cc:1786
bool supports_jitter(const Brush &brush)
Definition brush.cc:1807
bool supports_space_attenuation(const Brush &brush)
Definition brush.cc:1892
bool supports_size_pressure(const Brush &brush)
Definition brush.cc:1925
bool supports_persistence(const Brush &brush)
Definition brush.cc:1827
bool supports_tilt(const Brush &brush)
Definition brush.cc:1967
bool supports_inverted_direction(const Brush &brush)
Definition brush.cc:1937
bool supports_auto_smooth_pressure(const Brush &brush)
Definition brush.cc:1929
bool supports_rake_factor(const Brush &brush)
Definition brush.cc:1823
bool supports_plane_depth(const Brush &brush)
Definition brush.cc:1803
bool supports_accumulate(const Brush &brush)
Definition brush.cc:1760
bool supports_gravity(const Brush &brush)
Definition brush.cc:1954
bool supports_hardness_pressure(const Brush &brush)
Definition brush.cc:1933
bool supports_smooth_stroke(const Brush &brush)
Definition brush.cc:1882
bool supports_plane_offset(const Brush &brush)
Definition brush.cc:1838
bool supports_pinch_factor(const Brush &brush)
Definition brush.cc:1831
bool supports_color(const Brush &brush)
Definition brush.cc:1863
bool supports_random_texture_angle(const Brush &brush)
Definition brush.cc:1846
bool supports_strength_pressure(const Brush &brush)
Definition brush.cc:1921
bool supports_dyntopo(const Brush &brush)
Definition brush.cc:1736
bool supports_height(const Brush &brush)
Definition brush.cc:1795
bool supports_topology_rake(const Brush &brush)
Definition brush.cc:1775
bool supports_plane_height(const Brush &brush)
Definition brush.cc:1799
bool supports_normal_weight(const Brush &brush)
Definition brush.cc:1816
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:316
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:351
static const EnumPropertyItem sculpt_stroke_method_items[]
Definition rna_brush.cc:36
const EnumPropertyItem rna_enum_brush_weight_brush_type_items[]
Definition rna_brush.cc:187
static void rna_def_curves_sculpt_options(BlenderRNA *brna)
static EnumPropertyItem rna_enum_gpencil_fill_layers_modes_items[]
Definition rna_brush.cc:342
#define VPAINT_BRUSH_CAPABILITY(prop_name_, ui_name_)
const EnumPropertyItem rna_enum_brush_gpencil_sculpt_types_items[]
Definition rna_brush.cc:250
#define BRUSH_CAPABILITY(prop_name_, ui_name_)
static EnumPropertyItem rna_enum_gpencil_fill_draw_modes_items[]
Definition rna_brush.cc:327
void RNA_def_brush(BlenderRNA *brna)
const EnumPropertyItem rna_enum_brush_image_brush_type_items[]
Definition rna_brush.cc:195
const EnumPropertyItem rna_enum_brush_automasking_flag_items[]
Definition rna_brush.cc:96
static void rna_def_brush(BlenderRNA *brna)
const EnumPropertyItem rna_enum_brush_sculpt_brush_type_items[]
Definition rna_brush.cc:134
static const EnumPropertyItem rna_enum_brush_texture_slot_map_all_mode_items[]
Definition rna_brush.cc:59
const EnumPropertyItem rna_enum_brush_gpencil_vertex_types_items[]
Definition rna_brush.cc:225
static EnumPropertyItem rna_enum_gpencil_brush_modes_items[]
Definition rna_brush.cc:357
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:286
const EnumPropertyItem rna_enum_brush_curve_preset_items[]
Definition rna_brush.cc:80
const EnumPropertyItem rna_enum_brush_vertex_brush_type_items[]
Definition rna_brush.cc:179
static void rna_def_brush_texture_slot(BlenderRNA *brna)
const EnumPropertyItem rna_enum_brush_gpencil_types_items[]
Definition rna_brush.cc:205
static void rna_def_weight_paint_capabilities(BlenderRNA *brna)
static EnumPropertyItem rna_enum_gpencil_fill_extend_modes_items[]
Definition rna_brush.cc:337
static void rna_def_brush_capabilities(BlenderRNA *brna)
const EnumPropertyItem rna_enum_brush_curves_sculpt_brush_type_items[]
Definition rna_brush.cc:298
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_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 ColorBand * gradient
int automasking_flags
struct MTex mtex
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
float unprojected_size
struct MTex mask_mtex
char weight_brush_type
char vertex_brush_type
const char * identifier
Definition RNA_types.hh:657
const char * name
Definition RNA_types.hh:661
const char * description
Definition RNA_types.hh:663
char brush_map_mode
struct Tex * tex
void * data
Definition RNA_types.hh:53
#define N_(msgid)
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:4238