Blender V4.3
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
9#include <cstdlib>
10
11#include "DNA_brush_types.h"
13#include "DNA_material_types.h"
14#include "DNA_object_types.h"
15#include "DNA_scene_types.h"
16#include "DNA_texture_types.h"
17#include "DNA_workspace_types.h"
18
19#include "BKE_layer.hh"
20
21#include "BLI_math_base.h"
23
24#include "BLT_translation.hh"
25
26#include "RNA_define.hh"
27#include "RNA_enum_types.hh"
28
29#include "rna_internal.hh"
30
31#include "IMB_imbuf.hh"
32
33#include "WM_types.hh"
34
36 {0, "ADD", ICON_ADD, "Add", "Add effect of brush"},
37 {BRUSH_DIR_IN, "SUBTRACT", ICON_REMOVE, "Subtract", "Subtract effect of brush"},
38 {0, nullptr, 0, nullptr, nullptr},
39};
40
41#ifdef RNA_RUNTIME
42static const EnumPropertyItem prop_smooth_direction_items[] = {
43 {0, "SMOOTH", ICON_ADD, "Smooth", "Smooth the surface"},
45 "ENHANCE_DETAILS",
46 ICON_REMOVE,
47 "Enhance Details",
48 "Enhance the surface detail"},
49 {0, nullptr, 0, nullptr, nullptr},
50};
51#endif
52
54 {0, "DOTS", 0, "Dots", "Apply paint on each mouse move step"},
55 {BRUSH_DRAG_DOT, "DRAG_DOT", 0, "Drag Dot", "Allows a single dot to be carefully positioned"},
57 "SPACE",
58 0,
59 "Space",
60 "Limit brush application to the distance specified by spacing"},
62 "AIRBRUSH",
63 0,
64 "Airbrush",
65 "Keep applying paint effect while holding mouse (spray)"},
66 {BRUSH_ANCHORED, "ANCHORED", 0, "Anchored", "Keep the brush anchored to the initial location"},
67 {BRUSH_LINE, "LINE", 0, "Line", "Draw a line with dabs separated according to spacing"},
69 "CURVE",
70 0,
71 "Curve",
72 "Define the stroke curve with a Bézier curve (dabs are separated according to spacing)"},
73 {0, nullptr, 0, nullptr, nullptr},
74};
75
77 {MTEX_MAP_MODE_VIEW, "VIEW_PLANE", 0, "View Plane", ""},
78 {MTEX_MAP_MODE_AREA, "AREA_PLANE", 0, "Area Plane", ""},
79 {MTEX_MAP_MODE_TILED, "TILED", 0, "Tiled", ""},
80 {MTEX_MAP_MODE_3D, "3D", 0, "3D", ""},
81 {MTEX_MAP_MODE_RANDOM, "RANDOM", 0, "Random", ""},
82 {MTEX_MAP_MODE_STENCIL, "STENCIL", 0, "Stencil", ""},
83 {0, nullptr, 0, nullptr, nullptr},
84};
85
86#ifdef RNA_RUNTIME
87static const EnumPropertyItem rna_enum_brush_texture_slot_map_texture_mode_items[] = {
88 {MTEX_MAP_MODE_VIEW, "VIEW_PLANE", 0, "View Plane", ""},
89 {MTEX_MAP_MODE_TILED, "TILED", 0, "Tiled", ""},
90 {MTEX_MAP_MODE_3D, "3D", 0, "3D", ""},
91 {MTEX_MAP_MODE_RANDOM, "RANDOM", 0, "Random", ""},
92 {MTEX_MAP_MODE_STENCIL, "STENCIL", 0, "Stencil", ""},
93 {0, nullptr, 0, nullptr, nullptr},
94};
95#endif
96
98 {BRUSH_CURVE_CUSTOM, "CUSTOM", ICON_RNDCURVE, "Custom", ""},
99 {BRUSH_CURVE_SMOOTH, "SMOOTH", ICON_SMOOTHCURVE, "Smooth", ""},
100 {BRUSH_CURVE_SMOOTHER, "SMOOTHER", ICON_SMOOTHCURVE, "Smoother", ""},
101 {BRUSH_CURVE_SPHERE, "SPHERE", ICON_SPHERECURVE, "Sphere", ""},
102 {BRUSH_CURVE_ROOT, "ROOT", ICON_ROOTCURVE, "Root", ""},
103 {BRUSH_CURVE_SHARP, "SHARP", ICON_SHARPCURVE, "Sharp", ""},
104 {BRUSH_CURVE_LIN, "LIN", ICON_LINCURVE, "Linear", ""},
105 {BRUSH_CURVE_POW4, "POW4", ICON_SHARPCURVE, "Sharper", ""},
106 {BRUSH_CURVE_INVSQUARE, "INVSQUARE", ICON_INVERSESQUARECURVE, "Inverse Square", ""},
107 {BRUSH_CURVE_CONSTANT, "CONSTANT", ICON_NOCURVE, "Constant", ""},
108 {0, nullptr, 0, nullptr, nullptr},
109};
110
111/* NOTE: we don't actually turn these into a single enum bit-mask property,
112 * instead we construct individual boolean properties. */
115 "use_automasking_topology",
116 0,
117 "Topology",
118 "Affect only vertices connected to the active vertex under the brush"},
120 "use_automasking_face_sets",
121 0,
122 "Face Sets",
123 "Affect only vertices that share Face Sets with the active vertex"},
125 "use_automasking_boundary_edges",
126 0,
127 "Mesh Boundary Auto-Masking",
128 "Do not affect non manifold boundary edges"},
130 "use_automasking_boundary_face_sets",
131 0,
132 "Face Sets Boundary Automasking",
133 "Do not affect vertices that belong to a Face Set boundary"},
135 "use_automasking_cavity",
136 0,
137 "Cavity Mask",
138 "Do not affect vertices on peaks, based on the surface curvature"},
140 "use_automasking_cavity_inverted",
141 0,
142 "Inverted Cavity Mask",
143 "Do not affect vertices within crevices, based on the surface curvature"},
145 "use_automasking_custom_cavity_curve",
146 0,
147 "Custom Cavity Curve",
148 "Use custom curve"},
149 {0, nullptr, 0, nullptr, nullptr}};
150
152 {SCULPT_BRUSH_TYPE_DRAW, "DRAW", 0, "Draw", ""},
153 {SCULPT_BRUSH_TYPE_DRAW_SHARP, "DRAW_SHARP", 0, "Draw Sharp", ""},
154 {SCULPT_BRUSH_TYPE_CLAY, "CLAY", 0, "Clay", ""},
155 {SCULPT_BRUSH_TYPE_CLAY_STRIPS, "CLAY_STRIPS", 0, "Clay Strips", ""},
156 {SCULPT_BRUSH_TYPE_CLAY_THUMB, "CLAY_THUMB", 0, "Clay Thumb", ""},
157 {SCULPT_BRUSH_TYPE_LAYER, "LAYER", 0, "Layer", ""},
158 {SCULPT_BRUSH_TYPE_INFLATE, "INFLATE", 0, "Inflate", ""},
159 {SCULPT_BRUSH_TYPE_BLOB, "BLOB", 0, "Blob", ""},
160 {SCULPT_BRUSH_TYPE_CREASE, "CREASE", 0, "Crease", ""},
162 {SCULPT_BRUSH_TYPE_SMOOTH, "SMOOTH", 0, "Smooth", ""},
163 {SCULPT_BRUSH_TYPE_FLATTEN, "FLATTEN", 0, "Flatten", ""},
164 {SCULPT_BRUSH_TYPE_FILL, "FILL", 0, "Fill", ""},
165 {SCULPT_BRUSH_TYPE_SCRAPE, "SCRAPE", 0, "Scrape", ""},
166 {SCULPT_BRUSH_TYPE_MULTIPLANE_SCRAPE, "MULTIPLANE_SCRAPE", 0, "Multi-plane Scrape", ""},
167 {SCULPT_BRUSH_TYPE_PINCH, "PINCH", 0, "Pinch", ""},
169 {SCULPT_BRUSH_TYPE_GRAB, "GRAB", 0, "Grab", ""},
170 {SCULPT_BRUSH_TYPE_ELASTIC_DEFORM, "ELASTIC_DEFORM", 0, "Elastic Deform", ""},
171 {SCULPT_BRUSH_TYPE_SNAKE_HOOK, "SNAKE_HOOK", 0, "Snake Hook", ""},
172 {SCULPT_BRUSH_TYPE_THUMB, "THUMB", 0, "Thumb", ""},
173 {SCULPT_BRUSH_TYPE_POSE, "POSE", 0, "Pose", ""},
174 {SCULPT_BRUSH_TYPE_NUDGE, "NUDGE", 0, "Nudge", ""},
175 {SCULPT_BRUSH_TYPE_ROTATE, "ROTATE", 0, "Rotate", ""},
176 {SCULPT_BRUSH_TYPE_SLIDE_RELAX, "TOPOLOGY", 0, "Slide Relax", ""},
177 {SCULPT_BRUSH_TYPE_BOUNDARY, "BOUNDARY", 0, "Boundary", ""},
179 {SCULPT_BRUSH_TYPE_CLOTH, "CLOTH", 0, "Cloth", ""},
180 {SCULPT_BRUSH_TYPE_SIMPLIFY, "SIMPLIFY", 0, "Simplify", ""},
181 {SCULPT_BRUSH_TYPE_MASK, "MASK", 0, "Mask", ""},
182 {SCULPT_BRUSH_TYPE_DRAW_FACE_SETS, "DRAW_FACE_SETS", 0, "Draw Face Sets", ""},
184 "DISPLACEMENT_ERASER",
185 0,
186 "Multires Displacement Eraser",
187 ""},
189 "DISPLACEMENT_SMEAR",
190 0,
191 "Multires Displacement Smear",
192 ""},
193 {SCULPT_BRUSH_TYPE_PAINT, "PAINT", 0, "Paint", ""},
194 {SCULPT_BRUSH_TYPE_SMEAR, "SMEAR", 0, "Smear", ""},
195 {0, nullptr, 0, nullptr, nullptr},
196};
197
199 {VPAINT_BRUSH_TYPE_DRAW, "DRAW", 0, "Draw", ""},
200 {VPAINT_BRUSH_TYPE_BLUR, "BLUR", 0, "Blur", ""},
201 {VPAINT_BRUSH_TYPE_AVERAGE, "AVERAGE", 0, "Average", ""},
202 {VPAINT_BRUSH_TYPE_SMEAR, "SMEAR", 0, "Smear", ""},
203 {0, nullptr, 0, nullptr, nullptr},
204};
205
207 {WPAINT_BRUSH_TYPE_DRAW, "DRAW", 0, "Draw", ""},
208 {WPAINT_BRUSH_TYPE_BLUR, "BLUR", 0, "Blur", ""},
209 {WPAINT_BRUSH_TYPE_AVERAGE, "AVERAGE", 0, "Average", ""},
210 {WPAINT_BRUSH_TYPE_SMEAR, "SMEAR", 0, "Smear", ""},
211 {0, nullptr, 0, nullptr, nullptr},
212};
213
215 {IMAGE_PAINT_BRUSH_TYPE_DRAW, "DRAW", 0, "Draw", ""},
216 {IMAGE_PAINT_BRUSH_TYPE_SOFTEN, "SOFTEN", 0, "Soften", ""},
217 {IMAGE_PAINT_BRUSH_TYPE_SMEAR, "SMEAR", 0, "Smear", ""},
218 {IMAGE_PAINT_BRUSH_TYPE_CLONE, "CLONE", 0, "Clone", ""},
219 {IMAGE_PAINT_BRUSH_TYPE_FILL, "FILL", 0, "Fill", ""},
220 {IMAGE_PAINT_BRUSH_TYPE_MASK, "MASK", 0, "Mask", ""},
221 {0, nullptr, 0, nullptr, nullptr},
222};
223
226 "DRAW",
227 ICON_STROKE,
228 "Draw",
229 "The brush is of type used for drawing strokes"},
231 "FILL",
232 ICON_COLOR,
233 "Fill",
234 "The brush is of type used for filling areas"},
236 "ERASE",
237 ICON_PANEL_CLOSE,
238 "Erase",
239 "The brush is used for erasing strokes"},
240 {GPAINT_BRUSH_TYPE_TINT, "TINT", 0, "Tint", "The brush is of type used for tinting strokes"},
241 {0, nullptr, 0, nullptr, nullptr},
242};
243
245 {GPVERTEX_BRUSH_TYPE_DRAW, "DRAW", 0, "Draw", "Paint a color on stroke points"},
247 "BLUR",
248 0,
249 "Blur",
250 "Smooth out the colors of adjacent stroke points"},
252 "AVERAGE",
253 0,
254 "Average",
255 "Smooth out colors with the average color under the brush"},
257 "SMEAR",
258 0,
259 "Smear",
260 "Smudge colors by grabbing and dragging them"},
262 "REPLACE",
263 0,
264 "Replace",
265 "Replace the color of stroke points that already have a color applied"},
266 {0, nullptr, 0, nullptr, nullptr},
267};
268
270 {GPSCULPT_BRUSH_TYPE_SMOOTH, "SMOOTH", 0, "Smooth", "Smooth stroke points"},
271 {GPSCULPT_BRUSH_TYPE_THICKNESS, "THICKNESS", 0, "Thickness", "Adjust thickness of strokes"},
272 {GPSCULPT_BRUSH_TYPE_STRENGTH, "STRENGTH", 0, "Strength", "Adjust color strength of strokes"},
274 "RANDOMIZE",
275 0,
276 "Randomize",
277 "Introduce jitter/randomness into strokes"},
279 "GRAB",
280 0,
281 "Grab",
282 "Translate the set of points initially within the brush circle"},
284 "PUSH",
285 0,
286 "Push",
287 "Move points out of the way, as if combing them"},
289 "TWIST",
290 0,
291 "Twist",
292 "Rotate points around the midpoint of the brush"},
294 "PINCH",
295 0,
296 "Pinch",
297 "Pull points towards the midpoint of the brush"},
299 "CLONE",
300 0,
301 "Clone",
302 "Paste copies of the strokes stored on the internal clipboard"},
303 {0, nullptr, 0, nullptr, nullptr}};
304
306 {GPWEIGHT_BRUSH_TYPE_DRAW, "WEIGHT", 0, "Weight", "Paint weight in active vertex group"},
307 {GPWEIGHT_BRUSH_TYPE_BLUR, "BLUR", 0, "Blur", "Blur weight in active vertex group"},
309 "AVERAGE",
310 0,
311 "Average",
312 "Average weight in active vertex group"},
313 {GPWEIGHT_BRUSH_TYPE_SMEAR, "SMEAR", 0, "Smear", "Smear weight in active vertex group"},
314 {0, nullptr, 0, nullptr, nullptr},
315};
316
318 {CURVES_SCULPT_BRUSH_TYPE_SELECTION_PAINT, "SELECTION_PAINT", 0, "Paint Selection", ""},
320 {CURVES_SCULPT_BRUSH_TYPE_ADD, "ADD", 0, "Add", ""},
321 {CURVES_SCULPT_BRUSH_TYPE_DELETE, "DELETE", 0, "Delete", ""},
322 {CURVES_SCULPT_BRUSH_TYPE_DENSITY, "DENSITY", 0, "Density", ""},
324 {CURVES_SCULPT_BRUSH_TYPE_COMB, "COMB", 0, "Comb", ""},
325 {CURVES_SCULPT_BRUSH_TYPE_SNAKE_HOOK, "SNAKE_HOOK", 0, "Snake Hook", ""},
326 {CURVES_SCULPT_BRUSH_TYPE_GROW_SHRINK, "GROW_SHRINK", 0, "Grow / Shrink", ""},
327 {CURVES_SCULPT_BRUSH_TYPE_PINCH, "PINCH", 0, "Pinch", ""},
328 {CURVES_SCULPT_BRUSH_TYPE_PUFF, "PUFF", 0, "Puff", ""},
329 {CURVES_SCULPT_BRUSH_TYPE_SMOOTH, "SMOOTH", 0, "Smooth", ""},
330 {CURVES_SCULPT_BRUSH_TYPE_SLIDE, "SLIDE", 0, "Slide", ""},
331 {0, nullptr, 0, nullptr, nullptr},
332};
333
334#ifndef RNA_RUNTIME
337 "SOFT",
338 0,
339 "Dissolve",
340 "Erase strokes, fading their points strength and thickness"},
341 {GP_BRUSH_ERASER_HARD, "HARD", 0, "Point", "Erase stroke points"},
342 {GP_BRUSH_ERASER_STROKE, "STROKE", 0, "Stroke", "Erase entire strokes"},
343 {0, nullptr, 0, nullptr, nullptr},
344};
345
348 "BOTH",
349 0,
350 "All",
351 "Use both visible strokes and edit lines as fill boundary limits"},
352 {GP_FILL_DMODE_STROKE, "STROKE", 0, "Strokes", "Use visible strokes as fill boundary limits"},
353 {GP_FILL_DMODE_CONTROL, "CONTROL", 0, "Edit Lines", "Use edit lines as fill boundary limits"},
354 {0, nullptr, 0, nullptr, nullptr}};
355
357 {GP_FILL_EMODE_EXTEND, "EXTEND", 0, "Extend", "Extend strokes in straight lines"},
358 {GP_FILL_EMODE_RADIUS, "RADIUS", 0, "Radius", "Connect endpoints that are close together"},
359 {0, nullptr, 0, nullptr, nullptr}};
360
362 {GP_FILL_GPLMODE_VISIBLE, "VISIBLE", 0, "Visible", "Visible layers"},
363 {GP_FILL_GPLMODE_ACTIVE, "ACTIVE", 0, "Active", "Only active layer"},
364 {GP_FILL_GPLMODE_ABOVE, "ABOVE", 0, "Layer Above", "Layer above active"},
365 {GP_FILL_GPLMODE_BELOW, "BELOW", 0, "Layer Below", "Layer below active"},
366 {GP_FILL_GPLMODE_ALL_ABOVE, "ALL_ABOVE", 0, "All Above", "All layers above active"},
367 {GP_FILL_GPLMODE_ALL_BELOW, "ALL_BELOW", 0, "All Below", "All layers below active"},
368 {0, nullptr, 0, nullptr, nullptr}};
369
371 {0, "NORMAL", ICON_ADD, "Normal", "Fill internal area"},
372 {BRUSH_DIR_IN, "INVERT", ICON_REMOVE, "Inverted", "Fill inverted area"},
373 {0, nullptr, 0, nullptr, nullptr},
374};
375
377 {GP_BRUSH_MODE_ACTIVE, "ACTIVE", 0, "Active", "Use current mode"},
378 {GP_BRUSH_MODE_MATERIAL, "MATERIAL", 0, "Material", "Use always material mode"},
379 {GP_BRUSH_MODE_VERTEXCOLOR, "VERTEXCOLOR", 0, "Vertex Color", "Use always Vertex Color mode"},
380 {0, nullptr, 0, nullptr, nullptr}};
381
382#endif
383
384#ifdef RNA_RUNTIME
385
386# include "MEM_guardedalloc.h"
387
388# include "RNA_access.hh"
389
390# include "BKE_brush.hh"
391# include "BKE_colorband.hh"
392# include "BKE_gpencil_legacy.h"
393# include "BKE_icons.h"
394# include "BKE_material.h"
395# include "BKE_paint.hh"
396# include "BKE_preview_image.hh"
397
398# include "WM_api.hh"
399
400static bool rna_BrushCapabilitiesSculpt_has_accumulate_get(PointerRNA *ptr)
401{
402 Brush *br = (Brush *)ptr->data;
403 return SCULPT_BRUSH_TYPE_HAS_ACCUMULATE(br->sculpt_brush_type);
404}
405
406static bool rna_BrushCapabilitiesSculpt_has_topology_rake_get(PointerRNA *ptr)
407{
408 Brush *br = (Brush *)ptr->data;
409 return SCULPT_BRUSH_TYPE_HAS_TOPOLOGY_RAKE(br->sculpt_brush_type);
410}
411
412static bool rna_BrushCapabilitiesSculpt_has_auto_smooth_get(PointerRNA *ptr)
413{
414 Brush *br = (Brush *)ptr->data;
415 return !ELEM(br->sculpt_brush_type,
420}
421
422static bool rna_BrushCapabilitiesSculpt_has_height_get(PointerRNA *ptr)
423{
424 Brush *br = (Brush *)ptr->data;
425 return br->sculpt_brush_type == SCULPT_BRUSH_TYPE_LAYER;
426}
427
428static bool rna_BrushCapabilitiesSculpt_has_jitter_get(PointerRNA *ptr)
429{
430 Brush *br = (Brush *)ptr->data;
431 return (!(br->flag & BRUSH_ANCHORED) && !(br->flag & BRUSH_DRAG_DOT) &&
432 !ELEM(br->sculpt_brush_type,
437}
438
439static bool rna_BrushCapabilitiesSculpt_has_normal_weight_get(PointerRNA *ptr)
440{
441 Brush *br = (Brush *)ptr->data;
442 return SCULPT_BRUSH_TYPE_HAS_NORMAL_WEIGHT(br->sculpt_brush_type);
443}
444
445static bool rna_BrushCapabilitiesSculpt_has_rake_factor_get(PointerRNA *ptr)
446{
447 Brush *br = (Brush *)ptr->data;
448 return SCULPT_BRUSH_TYPE_HAS_RAKE(br->sculpt_brush_type);
449}
450
451static bool rna_BrushCapabilities_has_overlay_get(PointerRNA *ptr)
452{
453 Brush *br = (Brush *)ptr->data;
454 return ELEM(
456}
457
458static bool rna_BrushCapabilitiesSculpt_has_persistence_get(PointerRNA *ptr)
459{
460 Brush *br = (Brush *)ptr->data;
461 return ELEM(br->sculpt_brush_type, SCULPT_BRUSH_TYPE_LAYER, SCULPT_BRUSH_TYPE_CLOTH);
462}
463
464static bool rna_BrushCapabilitiesSculpt_has_pinch_factor_get(PointerRNA *ptr)
465{
466 Brush *br = (Brush *)ptr->data;
467 return ELEM(br->sculpt_brush_type,
471}
472
473static bool rna_BrushCapabilitiesSculpt_has_plane_offset_get(PointerRNA *ptr)
474{
475 Brush *br = (Brush *)ptr->data;
476 return ELEM(br->sculpt_brush_type,
483}
484
485static bool rna_BrushCapabilitiesSculpt_has_random_texture_angle_get(PointerRNA *ptr)
486{
487 Brush *br = (Brush *)ptr->data;
488 return !ELEM(br->sculpt_brush_type,
493}
494
495static bool rna_TextureCapabilities_has_random_texture_angle_get(PointerRNA *ptr)
496{
497 MTex *mtex = (MTex *)ptr->data;
498 return ELEM(mtex->brush_map_mode, MTEX_MAP_MODE_VIEW, MTEX_MAP_MODE_AREA, MTEX_MAP_MODE_RANDOM);
499}
500
501static bool rna_BrushCapabilities_has_random_texture_angle_get(PointerRNA *ptr)
502{
503 Brush *br = (Brush *)ptr->data;
504 return !(br->flag & BRUSH_ANCHORED);
505}
506
507static bool rna_BrushCapabilitiesSculpt_has_sculpt_plane_get(PointerRNA *ptr)
508{
509 Brush *br = (Brush *)ptr->data;
510 return !ELEM(br->sculpt_brush_type,
515}
516
517static bool rna_BrushCapabilitiesSculpt_has_color_get(PointerRNA *ptr)
518{
519 Brush *br = (Brush *)ptr->data;
520 return ELEM(br->sculpt_brush_type, SCULPT_BRUSH_TYPE_PAINT);
521}
522
523static bool rna_BrushCapabilitiesSculpt_has_secondary_color_get(PointerRNA *ptr)
524{
525 Brush *br = (Brush *)ptr->data;
527}
528
529static bool rna_BrushCapabilitiesSculpt_has_smooth_stroke_get(PointerRNA *ptr)
530{
531 Brush *br = (Brush *)ptr->data;
532 return (!(br->flag & BRUSH_ANCHORED) && !(br->flag & BRUSH_DRAG_DOT) &&
533 !(br->flag & BRUSH_LINE) && !(br->flag & BRUSH_CURVE) &&
534 !ELEM(br->sculpt_brush_type,
539}
540
541static bool rna_BrushCapabilities_has_smooth_stroke_get(PointerRNA *ptr)
542{
543 Brush *br = (Brush *)ptr->data;
544 return (!(br->flag & BRUSH_ANCHORED) && !(br->flag & BRUSH_DRAG_DOT) &&
545 !(br->flag & BRUSH_LINE) && !(br->flag & BRUSH_CURVE));
546}
547
548static bool rna_BrushCapabilitiesSculpt_has_space_attenuation_get(PointerRNA *ptr)
549{
550 Brush *br = (Brush *)ptr->data;
551 return ((br->flag & (BRUSH_SPACE | BRUSH_LINE | BRUSH_CURVE)) &&
552 !ELEM(br->sculpt_brush_type,
557}
558
559static bool rna_BrushCapabilitiesImagePaint_has_space_attenuation_get(PointerRNA *ptr)
560{
561 Brush *br = (Brush *)ptr->data;
562 return (br->flag & (BRUSH_SPACE | BRUSH_LINE | BRUSH_CURVE)) &&
563 br->image_brush_type != IMAGE_PAINT_BRUSH_TYPE_FILL;
564}
565
566static bool rna_BrushCapabilitiesImagePaint_has_color_get(PointerRNA *ptr)
567{
568 Brush *br = (Brush *)ptr->data;
569 return ELEM(br->image_brush_type, IMAGE_PAINT_BRUSH_TYPE_DRAW, IMAGE_PAINT_BRUSH_TYPE_FILL);
570}
571
572static bool rna_BrushCapabilitiesVertexPaint_has_color_get(PointerRNA *ptr)
573{
574 Brush *br = (Brush *)ptr->data;
575 return ELEM(br->vertex_brush_type, VPAINT_BRUSH_TYPE_DRAW);
576}
577
578static bool rna_BrushCapabilitiesWeightPaint_has_weight_get(PointerRNA *ptr)
579{
580 Brush *br = (Brush *)ptr->data;
581 return ELEM(br->weight_brush_type, WPAINT_BRUSH_TYPE_DRAW);
582}
583
584static bool rna_BrushCapabilities_has_spacing_get(PointerRNA *ptr)
585{
586 Brush *br = (Brush *)ptr->data;
587 return (!(br->flag & BRUSH_ANCHORED));
588}
589
590static bool rna_BrushCapabilitiesSculpt_has_strength_pressure_get(PointerRNA *ptr)
591{
592 Brush *br = (Brush *)ptr->data;
593 return !ELEM(br->sculpt_brush_type, SCULPT_BRUSH_TYPE_GRAB, SCULPT_BRUSH_TYPE_SNAKE_HOOK);
594}
595
596static bool rna_TextureCapabilities_has_texture_angle_get(PointerRNA *ptr)
597{
598 MTex *mtex = (MTex *)ptr->data;
599 return mtex->brush_map_mode != MTEX_MAP_MODE_3D;
600}
601
602static bool rna_BrushCapabilitiesSculpt_has_direction_get(PointerRNA *ptr)
603{
604 Brush *br = (Brush *)ptr->data;
605 return !ELEM(br->sculpt_brush_type,
621}
622
623static bool rna_BrushCapabilitiesSculpt_has_gravity_get(PointerRNA *ptr)
624{
625 Brush *br = (Brush *)ptr->data;
626 return !ELEM(br->sculpt_brush_type, SCULPT_BRUSH_TYPE_MASK, SCULPT_BRUSH_TYPE_SMOOTH);
627}
628
629static bool rna_BrushCapabilitiesSculpt_has_tilt_get(PointerRNA *ptr)
630{
631 Brush *br = (Brush *)ptr->data;
632 return ELEM(br->sculpt_brush_type,
640}
641
642static bool rna_TextureCapabilities_has_texture_angle_source_get(PointerRNA *ptr)
643{
644 MTex *mtex = (MTex *)ptr->data;
645 return ELEM(mtex->brush_map_mode, MTEX_MAP_MODE_VIEW, MTEX_MAP_MODE_AREA, MTEX_MAP_MODE_RANDOM);
646}
647
648static bool rna_BrushCapabilitiesImagePaint_has_accumulate_get(PointerRNA *ptr)
649{
650 /* only support for draw brush */
651 Brush *br = (Brush *)ptr->data;
652
653 return ((br->flag & BRUSH_AIRBRUSH) || (br->flag & BRUSH_DRAG_DOT) ||
654 (br->flag & BRUSH_ANCHORED) || (br->image_brush_type == IMAGE_PAINT_BRUSH_TYPE_SOFTEN) ||
655 (br->image_brush_type == IMAGE_PAINT_BRUSH_TYPE_SMEAR) ||
656 (br->image_brush_type == IMAGE_PAINT_BRUSH_TYPE_FILL) ||
657 (br->mtex.tex && !ELEM(br->mtex.brush_map_mode,
661 false :
662 true;
663}
664
665static bool rna_BrushCapabilitiesImagePaint_has_radius_get(PointerRNA *ptr)
666{
667 /* only support for draw brush */
668 Brush *br = (Brush *)ptr->data;
669
670 return (br->image_brush_type != IMAGE_PAINT_BRUSH_TYPE_FILL);
671}
672
673static PointerRNA rna_Sculpt_brush_capabilities_get(PointerRNA *ptr)
674{
675 return rna_pointer_inherit_refine(ptr, &RNA_BrushCapabilitiesSculpt, ptr->owner_id);
676}
677
678static PointerRNA rna_Imapaint_brush_capabilities_get(PointerRNA *ptr)
679{
680 return rna_pointer_inherit_refine(ptr, &RNA_BrushCapabilitiesImagePaint, ptr->owner_id);
681}
682
683static PointerRNA rna_Vertexpaint_brush_capabilities_get(PointerRNA *ptr)
684{
685 return rna_pointer_inherit_refine(ptr, &RNA_BrushCapabilitiesVertexPaint, ptr->owner_id);
686}
687
688static PointerRNA rna_Weightpaint_brush_capabilities_get(PointerRNA *ptr)
689{
690 return rna_pointer_inherit_refine(ptr, &RNA_BrushCapabilitiesWeightPaint, ptr->owner_id);
691}
692
693static PointerRNA rna_Brush_capabilities_get(PointerRNA *ptr)
694{
695 return rna_pointer_inherit_refine(ptr, &RNA_BrushCapabilities, ptr->owner_id);
696}
697
698static void rna_Brush_reset_icon(Brush *br)
699{
700 ID *id = &br->id;
701
702 if (br->flag & BRUSH_CUSTOM_ICON) {
703 return;
704 }
705
706 if (id->icon_id >= BIFICONID_LAST_STATIC) {
709 }
710
711 id->icon_id = 0;
712}
713
714static void rna_Brush_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
715{
716 Brush *br = (Brush *)ptr->data;
719 // WM_main_add_notifier(NC_SPACE | ND_SPACE_VIEW3D, nullptr);
720}
721
722static void rna_Brush_material_update(bContext * /*C*/, PointerRNA *ptr)
723{
724 Brush *br = (Brush *)ptr->data;
726 /* number of material users changed */
728}
729
730static void rna_Brush_main_tex_update(bContext *C, PointerRNA *ptr)
731{
732 Main *bmain = CTX_data_main(C);
733 Scene *scene = CTX_data_scene(C);
734 ViewLayer *view_layer = CTX_data_view_layer(C);
735 Brush *br = (Brush *)ptr->data;
736 BKE_paint_invalidate_overlay_tex(scene, view_layer, br->mtex.tex);
737 rna_Brush_update(bmain, scene, ptr);
738}
739
740static void rna_Brush_secondary_tex_update(bContext *C, PointerRNA *ptr)
741{
742 Main *bmain = CTX_data_main(C);
743 Scene *scene = CTX_data_scene(C);
744 ViewLayer *view_layer = CTX_data_view_layer(C);
745 Brush *br = (Brush *)ptr->data;
746 BKE_paint_invalidate_overlay_tex(scene, view_layer, br->mask_mtex.tex);
747 rna_Brush_update(bmain, scene, ptr);
748}
749
750static void rna_Brush_size_update(Main *bmain, Scene *scene, PointerRNA *ptr)
751{
753 rna_Brush_update(bmain, scene, ptr);
754}
755
756static void rna_Brush_update_and_reset_icon(Main *bmain, Scene *scene, PointerRNA *ptr)
757{
758 Brush *br = static_cast<Brush *>(ptr->data);
759 rna_Brush_reset_icon(br);
760 rna_Brush_update(bmain, scene, ptr);
761}
762
763static void rna_Brush_stroke_update(Main *bmain, Scene *scene, PointerRNA *ptr)
764{
766 rna_Brush_update(bmain, scene, ptr);
767}
768
769static void rna_Brush_icon_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
770{
771 Brush *br = (Brush *)ptr->data;
772
773 if (br->icon_imbuf) {
774 IMB_freeImBuf(br->icon_imbuf);
775 br->icon_imbuf = nullptr;
776 }
777
778 br->id.icon_id = 0;
779
780 if (br->flag & BRUSH_CUSTOM_ICON) {
782 }
783
785}
786
787static bool rna_Brush_imagetype_poll(PointerRNA * /*ptr*/, PointerRNA value)
788{
789 Image *image = (Image *)value.owner_id;
790 return image->type != IMA_TYPE_R_RESULT && image->type != IMA_TYPE_COMPOSITE;
791}
792
793static void rna_TextureSlot_brush_angle_update(bContext *C, PointerRNA *ptr)
794{
795 Scene *scene = CTX_data_scene(C);
796 MTex *mtex = static_cast<MTex *>(ptr->data);
797 /* skip invalidation of overlay for stencil mode */
798 if (mtex->mapping != MTEX_MAP_MODE_STENCIL) {
799 ViewLayer *view_layer = CTX_data_view_layer(C);
800 BKE_paint_invalidate_overlay_tex(scene, view_layer, mtex->tex);
801 }
802
804}
805
806static void rna_Brush_set_size(PointerRNA *ptr, int value)
807{
808 Brush *brush = static_cast<Brush *>(ptr->data);
809
810 /* scale unprojected radius so it stays consistent with brush size */
812 brush->size = value;
813}
814
815static void rna_Brush_use_gradient_set(PointerRNA *ptr, int value)
816{
817 Brush *br = (Brush *)ptr->data;
818
819 if (value & BRUSH_USE_GRADIENT) {
820 br->flag |= BRUSH_USE_GRADIENT;
821 }
822 else {
823 br->flag &= ~BRUSH_USE_GRADIENT;
824 }
825
826 if ((br->flag & BRUSH_USE_GRADIENT) && br->gradient == nullptr) {
827 br->gradient = BKE_colorband_add(true);
828 }
829}
830
831static void rna_Brush_set_unprojected_radius(PointerRNA *ptr, float value)
832{
833 Brush *brush = static_cast<Brush *>(ptr->data);
834
835 /* scale brush size so it stays consistent with unprojected_radius */
836 BKE_brush_scale_size(&brush->size, value, brush->unprojected_radius);
837 brush->unprojected_radius = value;
838}
839
840static const EnumPropertyItem *rna_Brush_direction_itemf(bContext *C,
842 PropertyRNA * /*prop*/,
843 bool * /*r_free*/)
844{
846
847 /* sculpt mode */
848 static const EnumPropertyItem prop_flatten_contrast_items[] = {
849 {BRUSH_DIR_IN, "CONTRAST", ICON_ADD, "Contrast", "Subtract effect of brush"},
850 {0, "FLATTEN", ICON_REMOVE, "Flatten", "Add effect of brush"},
851 {0, nullptr, 0, nullptr, nullptr},
852 };
853
854 static const EnumPropertyItem prop_fill_deepen_items[] = {
855 {0, "FILL", ICON_ADD, "Fill", "Add effect of brush"},
856 {BRUSH_DIR_IN, "DEEPEN", ICON_REMOVE, "Deepen", "Subtract effect of brush"},
857 {0, nullptr, 0, nullptr, nullptr},
858 };
859
860 static const EnumPropertyItem prop_scrape_peaks_items[] = {
861 {0, "SCRAPE", ICON_ADD, "Scrape", "Add effect of brush"},
862 {BRUSH_DIR_IN, "PEAKS", ICON_REMOVE, "Peaks", "Subtract effect of brush"},
863 {0, nullptr, 0, nullptr, nullptr},
864 };
865
866 static const EnumPropertyItem prop_pinch_magnify_items[] = {
867 {BRUSH_DIR_IN, "MAGNIFY", ICON_ADD, "Magnify", "Subtract effect of brush"},
868 {0, "PINCH", ICON_REMOVE, "Pinch", "Add effect of brush"},
869 {0, nullptr, 0, nullptr, nullptr},
870 };
871
872 static const EnumPropertyItem prop_inflate_deflate_items[] = {
873 {0, "INFLATE", ICON_ADD, "Inflate", "Add effect of brush"},
874 {BRUSH_DIR_IN, "DEFLATE", ICON_REMOVE, "Deflate", "Subtract effect of brush"},
875 {0, nullptr, 0, nullptr, nullptr},
876 };
877
878 /* texture paint mode */
879 static const EnumPropertyItem prop_soften_sharpen_items[] = {
880 {BRUSH_DIR_IN, "SHARPEN", ICON_ADD, "Sharpen", "Sharpen effect of brush"},
881 {0, "SOFTEN", ICON_REMOVE, "Soften", "Blur effect of brush"},
882 {0, nullptr, 0, nullptr, nullptr},
883 };
884
885 /* gpencil sculpt */
886 static const EnumPropertyItem prop_pinch_items[] = {
887 {0, "ADD", ICON_ADD, "Pinch", "Add effect of brush"},
888 {BRUSH_DIR_IN, "SUBTRACT", ICON_REMOVE, "Inflate", "Subtract effect of brush"},
889 {0, nullptr, 0, nullptr, nullptr},
890 };
891 static const EnumPropertyItem prop_twist_items[] = {
892 {0, "ADD", ICON_ADD, "Counter-Clockwise", "Add effect of brush"},
893 {BRUSH_DIR_IN, "SUBTRACT", ICON_REMOVE, "Clockwise", "Subtract effect of brush"},
894 {0, nullptr, 0, nullptr, nullptr},
895 };
896
897 Brush *me = (Brush *)(ptr->data);
898
899 switch (mode) {
901 switch (me->sculpt_brush_type) {
911 return prop_smooth_direction_items;
913 switch ((BrushMaskTool)me->mask_tool) {
914 case BRUSH_MASK_DRAW:
916
919
920 default:
922 }
923
925 return prop_flatten_contrast_items;
926
928 return prop_fill_deepen_items;
929
931 return prop_scrape_peaks_items;
932
934 return prop_pinch_magnify_items;
935
937 return prop_inflate_deflate_items;
938
939 default:
941 }
942
945 switch (me->image_brush_type) {
947 return prop_soften_sharpen_items;
948
949 default:
951 }
953 switch (me->curves_sculpt_brush_type) {
958 default:
960 }
963 switch (me->gpencil_sculpt_brush_type) {
968 return prop_twist_items;
970 return prop_pinch_items;
971 default:
973 }
975 switch (me->gpencil_weight_brush_type) {
978 default:
980 }
981 default:
983 }
984}
985
986static const EnumPropertyItem *rna_Brush_stroke_itemf(bContext *C,
987 PointerRNA * /*ptr*/,
988 PropertyRNA * /*prop*/,
989 bool * /*r_free*/)
990{
992
993 static const EnumPropertyItem brush_stroke_method_items[] = {
994 {0, "DOTS", 0, "Dots", "Apply paint on each mouse move step"},
996 "SPACE",
997 0,
998 "Space",
999 "Limit brush application to the distance specified by spacing"},
1001 "AIRBRUSH",
1002 0,
1003 "Airbrush",
1004 "Keep applying paint effect while holding mouse (spray)"},
1005 {BRUSH_LINE, "LINE", 0, "Line", "Drag a line with dabs separated according to spacing"},
1006 {int(BRUSH_CURVE),
1007 "CURVE",
1008 0,
1009 "Curve",
1010 "Define the stroke curve with a Bézier curve. Dabs are separated according to spacing."},
1011 {0, nullptr, 0, nullptr, nullptr},
1012 };
1013
1014 switch (mode) {
1015 case PaintMode::Sculpt:
1019
1020 default:
1021 return brush_stroke_method_items;
1022 }
1023}
1024
1025/* Grease Pencil Drawing Brushes Settings */
1026static std::optional<std::string> rna_BrushGpencilSettings_path(const PointerRNA * /*ptr*/)
1027{
1028 return "gpencil_settings";
1029}
1030
1031static void rna_BrushGpencilSettings_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
1032{
1033 Brush *br = (Brush *)ptr->owner_id;
1035}
1036
1037static void rna_BrushGpencilSettings_use_material_pin_update(bContext *C, PointerRNA *ptr)
1038{
1039 const Scene *scene = CTX_data_scene(C);
1040 ViewLayer *view_layer = CTX_data_view_layer(C);
1041 BKE_view_layer_synced_ensure(scene, view_layer);
1042 Object *ob = BKE_view_layer_active_object_get(view_layer);
1043 Brush *brush = (Brush *)ptr->owner_id;
1044
1045 if (brush->gpencil_settings->flag & GP_BRUSH_MATERIAL_PINNED) {
1046 Material *material = BKE_object_material_get(ob, ob->actcol);
1047 BKE_gpencil_brush_material_set(brush, material);
1048 }
1049 else {
1050 BKE_gpencil_brush_material_set(brush, nullptr);
1051 }
1052
1053 rna_BrushGpencilSettings_update(CTX_data_main(C), CTX_data_scene(C), ptr);
1054 /* number of material users changed */
1056}
1057
1058static bool rna_BrushGpencilSettings_material_poll(PointerRNA * /*ptr*/, PointerRNA value)
1059{
1060 Material *ma = (Material *)value.data;
1061
1062 /* GP materials only */
1063 return (ma->gp_style != nullptr);
1064}
1065
1066static bool rna_GPencilBrush_pin_mode_get(PointerRNA *ptr)
1067{
1068 Brush *brush = (Brush *)ptr->owner_id;
1069 if ((brush != nullptr) && (brush->gpencil_settings != nullptr)) {
1070 return (brush->gpencil_settings->brush_draw_mode != GP_BRUSH_MODE_ACTIVE);
1071 }
1072 return false;
1073}
1074
1075static void rna_GPencilBrush_pin_mode_set(PointerRNA * /*ptr*/, bool /*value*/)
1076{
1077 /* All data is set in update. Keep this function only to avoid RNA compilation errors. */
1078 return;
1079}
1080
1081static void rna_GPencilBrush_pin_mode_update(bContext *C, PointerRNA *ptr)
1082{
1083 Brush *brush = (Brush *)ptr->owner_id;
1084 if ((brush != nullptr) && (brush->gpencil_settings != nullptr)) {
1085 if (brush->gpencil_settings->brush_draw_mode != GP_BRUSH_MODE_ACTIVE) {
1086 /* If not active, means that must be set to off. */
1087 brush->gpencil_settings->brush_draw_mode = GP_BRUSH_MODE_ACTIVE;
1088 }
1089 else {
1091 brush->gpencil_settings->brush_draw_mode = GPENCIL_USE_VERTEX_COLOR(ts) ?
1094 }
1095 }
1096 rna_BrushGpencilSettings_update(CTX_data_main(C), CTX_data_scene(C), ptr);
1097}
1098
1099static void rna_BrushCurvesSculptSettings_update(Main * /*bmain*/,
1100 Scene * /*scene*/,
1101 PointerRNA *ptr)
1102{
1103 Brush *br = (Brush *)ptr->owner_id;
1105}
1106
1107static const EnumPropertyItem *rna_BrushTextureSlot_map_mode_itemf(bContext *C,
1108 PointerRNA * /*ptr*/,
1109 PropertyRNA * /*prop*/,
1110 bool * /*r_free*/)
1111{
1112
1113 if (C == nullptr) {
1115 }
1116
1117# define rna_enum_brush_texture_slot_map_sculpt_mode_items \
1118 rna_enum_brush_texture_slot_map_all_mode_items;
1119
1121 if (mode == PaintMode::Sculpt) {
1122 return rna_enum_brush_texture_slot_map_sculpt_mode_items;
1123 }
1124 return rna_enum_brush_texture_slot_map_texture_mode_items;
1125
1126# undef rna_enum_brush_texture_slot_map_sculpt_mode_items
1127}
1128
1129static void rna_Brush_automasking_invert_cavity_set(PointerRNA *ptr, bool val)
1130{
1131 Brush *brush = (Brush *)ptr->data;
1132
1133 if (val) {
1134 brush->automasking_flags &= ~BRUSH_AUTOMASKING_CAVITY_NORMAL;
1135 brush->automasking_flags |= BRUSH_AUTOMASKING_CAVITY_INVERTED;
1136 }
1137 else {
1138 brush->automasking_flags &= ~BRUSH_AUTOMASKING_CAVITY_INVERTED;
1139 }
1140}
1141
1142static void rna_Brush_automasking_cavity_set(PointerRNA *ptr, bool val)
1143{
1144 Brush *brush = (Brush *)ptr->data;
1145
1146 if (val) {
1147 brush->automasking_flags &= ~BRUSH_AUTOMASKING_CAVITY_INVERTED;
1148 brush->automasking_flags |= BRUSH_AUTOMASKING_CAVITY_NORMAL;
1149 }
1150 else {
1151 brush->automasking_flags &= ~BRUSH_AUTOMASKING_CAVITY_NORMAL;
1152 }
1153}
1154
1155static std::optional<std::string> rna_BrushCurvesSculptSettings_path(const PointerRNA * /*ptr*/)
1156{
1157 return "curves_sculpt_settings";
1158}
1159
1160#else
1161
1163{
1164 StructRNA *srna;
1165 PropertyRNA *prop;
1166
1167 static const EnumPropertyItem prop_mask_paint_map_mode_items[] = {
1168 {MTEX_MAP_MODE_VIEW, "VIEW_PLANE", 0, "View Plane", ""},
1169 {MTEX_MAP_MODE_TILED, "TILED", 0, "Tiled", ""},
1170 {MTEX_MAP_MODE_RANDOM, "RANDOM", 0, "Random", ""},
1171 {MTEX_MAP_MODE_STENCIL, "STENCIL", 0, "Stencil", ""},
1172 {0, nullptr, 0, nullptr, nullptr},
1173 };
1174
1175# define TEXTURE_CAPABILITY(prop_name_, ui_name_) \
1176 prop = RNA_def_property(srna, #prop_name_, PROP_BOOLEAN, PROP_NONE); \
1177 RNA_def_property_clear_flag(prop, PROP_EDITABLE); \
1178 RNA_def_property_boolean_funcs(prop, "rna_TextureCapabilities_" #prop_name_ "_get", nullptr); \
1179 RNA_def_property_ui_text(prop, ui_name_, nullptr)
1180
1181 srna = RNA_def_struct(brna, "BrushTextureSlot", "TextureSlot");
1182 RNA_def_struct_sdna(srna, "MTex");
1184 srna, "Brush Texture Slot", "Texture slot for textures in a Brush data-block");
1185
1186 prop = RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE);
1187 RNA_def_property_float_sdna(prop, nullptr, "rot");
1188 RNA_def_property_range(prop, 0, M_PI * 2);
1189 RNA_def_property_ui_text(prop, "Angle", "Brush texture rotation");
1191 RNA_def_property_update(prop, 0, "rna_TextureSlot_brush_angle_update");
1192
1193 prop = RNA_def_property(srna, "map_mode", PROP_ENUM, PROP_NONE);
1194 RNA_def_property_enum_sdna(prop, nullptr, "brush_map_mode");
1196 RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_BrushTextureSlot_map_mode_itemf");
1197 RNA_def_property_ui_text(prop, "Mode", "");
1199 RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
1200
1201 prop = RNA_def_property(srna, "mask_map_mode", PROP_ENUM, PROP_NONE);
1202 RNA_def_property_enum_sdna(prop, nullptr, "brush_map_mode");
1203 RNA_def_property_enum_items(prop, prop_mask_paint_map_mode_items);
1204 RNA_def_property_ui_text(prop, "Mode", "");
1206 RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
1207
1208 prop = RNA_def_property(srna, "use_rake", PROP_BOOLEAN, PROP_NONE);
1209 RNA_def_property_boolean_sdna(prop, nullptr, "brush_angle_mode", MTEX_ANGLE_RAKE);
1210 RNA_def_property_ui_text(prop, "Rake", "");
1212 RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
1213
1214 prop = RNA_def_property(srna, "use_random", PROP_BOOLEAN, PROP_NONE);
1215 RNA_def_property_boolean_sdna(prop, nullptr, "brush_angle_mode", MTEX_ANGLE_RANDOM);
1216 RNA_def_property_ui_text(prop, "Random", "");
1218 RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
1219
1220 prop = RNA_def_property(srna, "random_angle", PROP_FLOAT, PROP_ANGLE);
1221 RNA_def_property_range(prop, 0, M_PI * 2);
1222 RNA_def_property_ui_text(prop, "Random Angle", "Brush texture random angle");
1224 RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
1225
1226 TEXTURE_CAPABILITY(has_texture_angle_source, "Has Texture Angle Source");
1227 TEXTURE_CAPABILITY(has_random_texture_angle, "Has Random Texture Angle");
1228 TEXTURE_CAPABILITY(has_texture_angle, "Has Texture Angle Source");
1229}
1230
1232{
1233 StructRNA *srna;
1234 PropertyRNA *prop;
1235
1236 srna = RNA_def_struct(brna, "BrushCapabilitiesSculpt", nullptr);
1237 RNA_def_struct_sdna(srna, "Brush");
1238 RNA_def_struct_nested(brna, srna, "Brush");
1240 "Sculpt Capabilities",
1241 "Read-only indications of which brush operations "
1242 "are supported by the current sculpt tool");
1243
1244# define SCULPT_BRUSH_CAPABILITY(prop_name_, ui_name_) \
1245 prop = RNA_def_property(srna, #prop_name_, PROP_BOOLEAN, PROP_NONE); \
1246 RNA_def_property_clear_flag(prop, PROP_EDITABLE); \
1247 RNA_def_property_boolean_funcs( \
1248 prop, "rna_BrushCapabilitiesSculpt_" #prop_name_ "_get", nullptr); \
1249 RNA_def_property_ui_text(prop, ui_name_, nullptr)
1250
1251 SCULPT_BRUSH_CAPABILITY(has_accumulate, "Has Accumulate");
1252 SCULPT_BRUSH_CAPABILITY(has_auto_smooth, "Has Auto Smooth");
1253 SCULPT_BRUSH_CAPABILITY(has_topology_rake, "Has Topology Rake");
1254 SCULPT_BRUSH_CAPABILITY(has_height, "Has Height");
1255 SCULPT_BRUSH_CAPABILITY(has_jitter, "Has Jitter");
1256 SCULPT_BRUSH_CAPABILITY(has_normal_weight, "Has Crease/Pinch Factor");
1257 SCULPT_BRUSH_CAPABILITY(has_rake_factor, "Has Rake Factor");
1258 SCULPT_BRUSH_CAPABILITY(has_persistence, "Has Persistence");
1259 SCULPT_BRUSH_CAPABILITY(has_pinch_factor, "Has Pinch Factor");
1260 SCULPT_BRUSH_CAPABILITY(has_plane_offset, "Has Plane Offset");
1261 SCULPT_BRUSH_CAPABILITY(has_random_texture_angle, "Has Random Texture Angle");
1262 SCULPT_BRUSH_CAPABILITY(has_sculpt_plane, "Has Sculpt Plane");
1263 SCULPT_BRUSH_CAPABILITY(has_color, "Has Color");
1264 SCULPT_BRUSH_CAPABILITY(has_secondary_color, "Has Secondary Color");
1265 SCULPT_BRUSH_CAPABILITY(has_smooth_stroke, "Has Smooth Stroke");
1266 SCULPT_BRUSH_CAPABILITY(has_space_attenuation, "Has Space Attenuation");
1267 SCULPT_BRUSH_CAPABILITY(has_strength_pressure, "Has Strength Pressure");
1268 SCULPT_BRUSH_CAPABILITY(has_direction, "Has Direction");
1269 SCULPT_BRUSH_CAPABILITY(has_gravity, "Has Gravity");
1270 SCULPT_BRUSH_CAPABILITY(has_tilt, "Has Tilt");
1271
1272# undef SCULPT_CAPABILITY
1273}
1274
1276{
1277 StructRNA *srna;
1278 PropertyRNA *prop;
1279
1280 srna = RNA_def_struct(brna, "BrushCapabilities", nullptr);
1281 RNA_def_struct_sdna(srna, "Brush");
1282 RNA_def_struct_nested(brna, srna, "Brush");
1284 srna, "Brush Capabilities", "Read-only indications of supported operations");
1285
1286# define BRUSH_CAPABILITY(prop_name_, ui_name_) \
1287 prop = RNA_def_property(srna, #prop_name_, PROP_BOOLEAN, PROP_NONE); \
1288 RNA_def_property_clear_flag(prop, PROP_EDITABLE); \
1289 RNA_def_property_boolean_funcs(prop, "rna_BrushCapabilities_" #prop_name_ "_get", nullptr); \
1290 RNA_def_property_ui_text(prop, ui_name_, nullptr)
1291
1292 BRUSH_CAPABILITY(has_overlay, "Has Overlay");
1293 BRUSH_CAPABILITY(has_random_texture_angle, "Has Random Texture Angle");
1294 BRUSH_CAPABILITY(has_spacing, "Has Spacing");
1295 BRUSH_CAPABILITY(has_smooth_stroke, "Has Smooth Stroke");
1296
1297# undef BRUSH_CAPABILITY
1298}
1299
1301{
1302 StructRNA *srna;
1303 PropertyRNA *prop;
1304
1305 srna = RNA_def_struct(brna, "BrushCapabilitiesImagePaint", nullptr);
1306 RNA_def_struct_sdna(srna, "Brush");
1307 RNA_def_struct_nested(brna, srna, "Brush");
1309 srna, "Image Paint Capabilities", "Read-only indications of supported operations");
1310
1311# define IMAPAINT_BRUSH_CAPABILITY(prop_name_, ui_name_) \
1312 prop = RNA_def_property(srna, #prop_name_, PROP_BOOLEAN, PROP_NONE); \
1313 RNA_def_property_clear_flag(prop, PROP_EDITABLE); \
1314 RNA_def_property_boolean_funcs( \
1315 prop, "rna_BrushCapabilitiesImagePaint_" #prop_name_ "_get", nullptr); \
1316 RNA_def_property_ui_text(prop, ui_name_, nullptr)
1317
1318 IMAPAINT_BRUSH_CAPABILITY(has_accumulate, "Has Accumulate");
1319 IMAPAINT_BRUSH_CAPABILITY(has_space_attenuation, "Has Space Attenuation");
1320 IMAPAINT_BRUSH_CAPABILITY(has_radius, "Has Radius");
1321 IMAPAINT_BRUSH_CAPABILITY(has_color, "Has Color");
1322
1323# undef IMAPAINT_BRUSH_CAPABILITY
1324}
1325
1327{
1328 StructRNA *srna;
1329 PropertyRNA *prop;
1330
1331 srna = RNA_def_struct(brna, "BrushCapabilitiesVertexPaint", nullptr);
1332 RNA_def_struct_sdna(srna, "Brush");
1333 RNA_def_struct_nested(brna, srna, "Brush");
1335 srna, "Vertex Paint Capabilities", "Read-only indications of supported operations");
1336
1337# define VPAINT_BRUSH_CAPABILITY(prop_name_, ui_name_) \
1338 prop = RNA_def_property(srna, #prop_name_, PROP_BOOLEAN, PROP_NONE); \
1339 RNA_def_property_clear_flag(prop, PROP_EDITABLE); \
1340 RNA_def_property_boolean_funcs( \
1341 prop, "rna_BrushCapabilitiesVertexPaint_" #prop_name_ "_get", nullptr); \
1342 RNA_def_property_ui_text(prop, ui_name_, nullptr)
1343
1344 VPAINT_BRUSH_CAPABILITY(has_color, "Has Color");
1345
1346# undef VPAINT_BRUSH_CAPABILITY
1347}
1348
1350{
1351 StructRNA *srna;
1352 PropertyRNA *prop;
1353
1354 srna = RNA_def_struct(brna, "BrushCapabilitiesWeightPaint", nullptr);
1355 RNA_def_struct_sdna(srna, "Brush");
1356 RNA_def_struct_nested(brna, srna, "Brush");
1358 srna, "Weight Paint Capabilities", "Read-only indications of supported operations");
1359
1360# define WPAINT_BRUSH_CAPABILITY(prop_name_, ui_name_) \
1361 prop = RNA_def_property(srna, #prop_name_, PROP_BOOLEAN, PROP_NONE); \
1362 RNA_def_property_clear_flag(prop, PROP_EDITABLE); \
1363 RNA_def_property_boolean_funcs( \
1364 prop, "rna_BrushCapabilitiesWeightPaint_" #prop_name_ "_get", nullptr); \
1365 RNA_def_property_ui_text(prop, ui_name_, nullptr)
1366
1367 WPAINT_BRUSH_CAPABILITY(has_weight, "Has Weight");
1368
1369# undef WPAINT_BRUSH_CAPABILITY
1370}
1371
1373{
1374 StructRNA *srna;
1375 PropertyRNA *prop;
1376
1377 /* modes */
1378 static const EnumPropertyItem gppaint_mode_types_items[] = {
1379 {GPPAINT_MODE_STROKE, "STROKE", 0, "Stroke", "Vertex Color affects to Stroke only"},
1380 {GPPAINT_MODE_FILL, "FILL", 0, "Fill", "Vertex Color affects to Fill only"},
1381 {GPPAINT_MODE_BOTH, "BOTH", 0, "Stroke & Fill", "Vertex Color affects to Stroke and Fill"},
1382 {0, nullptr, 0, nullptr, nullptr},
1383 };
1384
1385 static const EnumPropertyItem rna_enum_gpencil_brush_caps_types_items[] = {
1386 {GP_STROKE_CAP_ROUND, "ROUND", ICON_GP_CAPS_ROUND, "Round", ""},
1387 {GP_STROKE_CAP_FLAT, "FLAT", ICON_GP_CAPS_FLAT, "Flat", ""},
1388 {0, nullptr, 0, nullptr, nullptr},
1389 };
1390
1391 srna = RNA_def_struct(brna, "BrushGpencilSettings", nullptr);
1392 RNA_def_struct_sdna(srna, "BrushGpencilSettings");
1393 RNA_def_struct_path_func(srna, "rna_BrushGpencilSettings_path");
1394 RNA_def_struct_ui_text(srna, "Grease Pencil Brush Settings", "Settings for grease pencil brush");
1395
1396 /* Strength factor for new strokes */
1397 prop = RNA_def_property(srna, "pen_strength", PROP_FLOAT, PROP_FACTOR);
1398 RNA_def_property_float_sdna(prop, nullptr, "draw_strength");
1399 RNA_def_property_range(prop, 0.0f, 1.0f);
1400 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
1402 prop, "Strength", "Color strength for new strokes (affect alpha factor of color)");
1404 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1405
1406 /* Jitter factor for new strokes */
1407 prop = RNA_def_property(srna, "pen_jitter", PROP_FLOAT, PROP_FACTOR);
1408 RNA_def_property_float_sdna(prop, nullptr, "draw_jitter");
1409 RNA_def_property_range(prop, 0.0f, 100.0f);
1410 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
1411 RNA_def_property_ui_text(prop, "Jitter", "Jitter factor of brush radius for new strokes");
1414 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1415
1416 /* Randomness factor for pressure */
1417 prop = RNA_def_property(srna, "random_pressure", PROP_FLOAT, PROP_FACTOR);
1418 RNA_def_property_float_sdna(prop, nullptr, "draw_random_press");
1419 RNA_def_property_range(prop, 0.0f, 1.0f);
1421 prop, "Pressure Randomness", "Randomness factor for pressure in new strokes");
1423 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1424
1425 /* Randomness factor for strength */
1426 prop = RNA_def_property(srna, "random_strength", PROP_FLOAT, PROP_FACTOR);
1427 RNA_def_property_float_sdna(prop, nullptr, "draw_random_strength");
1428 RNA_def_property_range(prop, 0.0f, 1.0f);
1430 prop, "Strength Randomness", "Randomness factor strength in new strokes");
1432 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1433
1434 /* Angle when brush is full size */
1435 prop = RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE);
1436 RNA_def_property_float_sdna(prop, nullptr, "draw_angle");
1439 "Angle",
1440 "Direction of the stroke at which brush gives maximal thickness "
1441 "(0" BLI_STR_UTF8_DEGREE_SIGN " for horizontal)");
1443 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1444
1445 /* Factor to change brush size depending of angle */
1446 prop = RNA_def_property(srna, "angle_factor", PROP_FLOAT, PROP_FACTOR);
1447 RNA_def_property_float_sdna(prop, nullptr, "draw_angle_factor");
1448 RNA_def_property_range(prop, 0.0f, 1.0f);
1450 prop,
1451 "Angle Factor",
1452 "Reduce brush thickness by this factor when stroke is perpendicular to 'Angle' direction");
1454 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1455
1456 /* Smoothing factor for new strokes */
1457 prop = RNA_def_property(srna, "pen_smooth_factor", PROP_FLOAT, PROP_NONE);
1458 RNA_def_property_float_sdna(prop, nullptr, "draw_smoothfac");
1459 RNA_def_property_range(prop, 0.0, 2.0);
1460 RNA_def_property_ui_range(prop, 0.0, 1.0, 10, 3);
1462 prop,
1463 "Smooth",
1464 "Amount of smoothing to apply after finish newly created strokes, to reduce jitter/noise");
1467 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1468
1469 /* Iterations of the Smoothing factor */
1470 prop = RNA_def_property(srna, "pen_smooth_steps", PROP_INT, PROP_NONE);
1471 RNA_def_property_int_sdna(prop, nullptr, "draw_smoothlvl");
1472 RNA_def_property_range(prop, 0, 100);
1473 RNA_def_property_ui_text(prop, "Iterations", "Number of times to smooth newly created strokes");
1475 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1476
1477 /* Subdivision level for new strokes */
1478 prop = RNA_def_property(srna, "pen_subdivision_steps", PROP_INT, PROP_NONE);
1479 RNA_def_property_int_sdna(prop, nullptr, "draw_subdivide");
1480 RNA_def_property_range(prop, 0, 3);
1482 prop,
1483 "Subdivision Steps",
1484 "Number of times to subdivide newly created strokes, for less jagged strokes");
1486 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1487
1488 /* Simplify factor */
1489 prop = RNA_def_property(srna, "simplify_factor", PROP_FLOAT, PROP_NONE);
1490 RNA_def_property_float_sdna(prop, nullptr, "simplify_f");
1491 RNA_def_property_range(prop, 0, 100.0);
1492 RNA_def_property_ui_range(prop, 0, 100.0, 1.0f, 3);
1493 RNA_def_property_ui_text(prop, "Simplify", "Factor of Simplify using adaptive algorithm");
1495 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1496
1497 prop = RNA_def_property(srna, "simplify_pixel_threshold", PROP_FLOAT, PROP_PIXEL);
1498 RNA_def_property_float_sdna(prop, nullptr, "simplify_px");
1499 RNA_def_property_range(prop, 0, 10.0);
1500 RNA_def_property_ui_range(prop, 0, 10.0, 1.0f, 1);
1502 prop,
1503 "Simplify",
1504 "Threashold in screen space used for the simplify algorithm. Points within this threashold "
1505 "are treated as if they were in a straight line.");
1507 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1508
1509 /* Curves for pressure */
1510 prop = RNA_def_property(srna, "curve_sensitivity", PROP_POINTER, PROP_NONE);
1511 RNA_def_property_pointer_sdna(prop, nullptr, "curve_sensitivity");
1512 RNA_def_property_struct_type(prop, "CurveMapping");
1513 RNA_def_property_ui_text(prop, "Curve Sensitivity", "Curve used for the sensitivity");
1515 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1516
1517 prop = RNA_def_property(srna, "curve_strength", PROP_POINTER, PROP_NONE);
1518 RNA_def_property_pointer_sdna(prop, nullptr, "curve_strength");
1519 RNA_def_property_struct_type(prop, "CurveMapping");
1520 RNA_def_property_ui_text(prop, "Curve Strength", "Curve used for the strength");
1522 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1523
1524 prop = RNA_def_property(srna, "curve_jitter", PROP_POINTER, PROP_NONE);
1525 RNA_def_property_pointer_sdna(prop, nullptr, "curve_jitter");
1526 RNA_def_property_struct_type(prop, "CurveMapping");
1527 RNA_def_property_ui_text(prop, "Curve Jitter", "Curve used for the jitter effect");
1529 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1530
1531 prop = RNA_def_property(srna, "curve_random_pressure", PROP_POINTER, PROP_NONE);
1532 RNA_def_property_pointer_sdna(prop, nullptr, "curve_rand_pressure");
1533 RNA_def_property_struct_type(prop, "CurveMapping");
1534 RNA_def_property_ui_text(prop, "Random Curve", "Curve used for modulating effect");
1536 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1537
1538 prop = RNA_def_property(srna, "curve_random_strength", PROP_POINTER, PROP_NONE);
1539 RNA_def_property_pointer_sdna(prop, nullptr, "curve_rand_strength");
1540 RNA_def_property_struct_type(prop, "CurveMapping");
1541 RNA_def_property_ui_text(prop, "Random Curve", "Curve used for modulating effect");
1543 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1544
1545 prop = RNA_def_property(srna, "curve_random_uv", PROP_POINTER, PROP_NONE);
1546 RNA_def_property_pointer_sdna(prop, nullptr, "curve_rand_uv");
1547 RNA_def_property_struct_type(prop, "CurveMapping");
1548 RNA_def_property_ui_text(prop, "Random Curve", "Curve used for modulating effect");
1550 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1551
1552 prop = RNA_def_property(srna, "curve_random_hue", PROP_POINTER, PROP_NONE);
1553 RNA_def_property_pointer_sdna(prop, nullptr, "curve_rand_hue");
1554 RNA_def_property_struct_type(prop, "CurveMapping");
1555 RNA_def_property_ui_text(prop, "Random Curve", "Curve used for modulating effect");
1557 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1558
1559 prop = RNA_def_property(srna, "curve_random_saturation", PROP_POINTER, PROP_NONE);
1560 RNA_def_property_pointer_sdna(prop, nullptr, "curve_rand_saturation");
1561 RNA_def_property_struct_type(prop, "CurveMapping");
1562 RNA_def_property_ui_text(prop, "Random Curve", "Curve used for modulating effect");
1564 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1565
1566 prop = RNA_def_property(srna, "curve_random_value", PROP_POINTER, PROP_NONE);
1567 RNA_def_property_pointer_sdna(prop, nullptr, "curve_rand_value");
1568 RNA_def_property_struct_type(prop, "CurveMapping");
1569 RNA_def_property_ui_text(prop, "Random Curve", "Curve used for modulating effect");
1571 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1572
1573 /* Fill threshold for transparency. */
1574 prop = RNA_def_property(srna, "fill_threshold", PROP_FLOAT, PROP_FACTOR);
1575 RNA_def_property_float_sdna(prop, nullptr, "fill_threshold");
1576 RNA_def_property_range(prop, 0.0f, 1.0f);
1578 prop, "Threshold", "Threshold to consider color transparent for filling");
1580 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1581
1582 /* fill factor size */
1583 prop = RNA_def_property(srna, "fill_factor", PROP_FLOAT, PROP_NONE);
1584 RNA_def_property_float_sdna(prop, nullptr, "fill_factor");
1587 prop,
1588 "Precision",
1589 "Factor for fill boundary accuracy, higher values are more accurate but slower");
1591 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1592
1593 /* fill simplify steps */
1594 prop = RNA_def_property(srna, "fill_simplify_level", PROP_INT, PROP_NONE);
1595 RNA_def_property_int_sdna(prop, nullptr, "fill_simplylvl");
1596 RNA_def_property_range(prop, 0, 10);
1598 prop, "Simplify", "Number of simplify steps (large values reduce fill accuracy)");
1600 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1601
1602 prop = RNA_def_property(srna, "uv_random", PROP_FLOAT, PROP_FACTOR);
1603 RNA_def_property_float_sdna(prop, nullptr, "uv_random");
1604 RNA_def_property_range(prop, 0.0, 1.0);
1605 RNA_def_property_ui_text(prop, "UV Random", "Random factor for auto-generated UV rotation");
1607 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1608
1609 /* gradient control */
1610 prop = RNA_def_property(srna, "hardness", PROP_FLOAT, PROP_FACTOR);
1611 RNA_def_property_float_sdna(prop, nullptr, "hardness");
1612 RNA_def_property_range(prop, 0.001f, 1.0f);
1615 prop,
1616 "Hardness",
1617 "Gradient from the center of Dot and Box strokes (set to 1 for a solid stroke)");
1619 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1620
1621 /* gradient shape ratio */
1622 prop = RNA_def_property(srna, "aspect", PROP_FLOAT, PROP_XYZ);
1623 RNA_def_property_float_sdna(prop, nullptr, "aspect_ratio");
1624 RNA_def_property_array(prop, 2);
1625 RNA_def_property_range(prop, 0.01f, 1.0f);
1627 RNA_def_property_ui_text(prop, "Aspect", "");
1629 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1630
1631 prop = RNA_def_property(srna, "input_samples", PROP_INT, PROP_NONE);
1632 RNA_def_property_int_sdna(prop, nullptr, "input_samples");
1635 prop,
1636 "Input Samples",
1637 "Generated intermediate points for very fast mouse movements (Set to 0 to disable)");
1639 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1640
1641 /* active smooth factor while drawing */
1642 prop = RNA_def_property(srna, "active_smooth_factor", PROP_FLOAT, PROP_FACTOR);
1643 RNA_def_property_float_sdna(prop, nullptr, "active_smooth");
1644 RNA_def_property_range(prop, 0.0f, 1.0f);
1645 RNA_def_property_ui_text(prop, "Active Smooth", "Amount of smoothing while drawing");
1647 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1648
1649 prop = RNA_def_property(srna, "eraser_strength_factor", PROP_FLOAT, PROP_PERCENTAGE);
1650 RNA_def_property_float_sdna(prop, nullptr, "era_strength_f");
1651 RNA_def_property_range(prop, 0.0, 100.0);
1652 RNA_def_property_ui_range(prop, 0.0, 100.0, 10, 1);
1653 RNA_def_property_ui_text(prop, "Affect Stroke Strength", "Amount of erasing for strength");
1655 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1656
1657 prop = RNA_def_property(srna, "eraser_thickness_factor", PROP_FLOAT, PROP_PERCENTAGE);
1658 RNA_def_property_float_sdna(prop, nullptr, "era_thickness_f");
1659 RNA_def_property_range(prop, 0.0, 100.0);
1660 RNA_def_property_ui_range(prop, 0.0, 100.0, 10, 1);
1661 RNA_def_property_ui_text(prop, "Affect Stroke Thickness", "Amount of erasing for thickness");
1663 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1664
1665 /* Mode type. */
1666 prop = RNA_def_property(srna, "vertex_mode", PROP_ENUM, PROP_NONE);
1667 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "vertex_mode");
1668 RNA_def_property_enum_items(prop, gppaint_mode_types_items);
1669 RNA_def_property_ui_text(prop, "Mode Type", "Defines how vertex color affect to the strokes");
1671 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1672
1673 /* Vertex Color mix factor. */
1674 prop = RNA_def_property(srna, "vertex_color_factor", PROP_FLOAT, PROP_FACTOR);
1675 RNA_def_property_float_sdna(prop, nullptr, "vertex_factor");
1676 RNA_def_property_range(prop, 0.0f, 1.0f);
1679 prop, "Vertex Color Factor", "Factor used to mix vertex color to get final color");
1680 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1681
1682 /* Hue randomness. */
1683 prop = RNA_def_property(srna, "random_hue_factor", PROP_FLOAT, PROP_FACTOR);
1684 RNA_def_property_float_sdna(prop, nullptr, "random_hue");
1685 RNA_def_property_range(prop, 0.0f, 1.0f);
1687 RNA_def_property_ui_text(prop, "Hue", "Random factor to modify original hue");
1689
1690 /* Saturation randomness. */
1691 prop = RNA_def_property(srna, "random_saturation_factor", PROP_FLOAT, PROP_FACTOR);
1692 RNA_def_property_float_sdna(prop, nullptr, "random_saturation");
1693 RNA_def_property_range(prop, 0.0f, 1.0f);
1695 RNA_def_property_ui_text(prop, "Saturation", "Random factor to modify original saturation");
1697 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1698
1699 /* Value randomness. */
1700 prop = RNA_def_property(srna, "random_value_factor", PROP_FLOAT, PROP_FACTOR);
1701 RNA_def_property_float_sdna(prop, nullptr, "random_value");
1702 RNA_def_property_range(prop, 0.0f, 1.0f);
1704 RNA_def_property_ui_text(prop, "Value", "Random factor to modify original value");
1706 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1707
1708 /* Factor to extend stroke extremes in Fill brush. */
1709 prop = RNA_def_property(srna, "extend_stroke_factor", PROP_FLOAT, PROP_NONE);
1710 RNA_def_property_float_sdna(prop, nullptr, "fill_extend_fac");
1711 RNA_def_property_range(prop, 0.0f, 10.0f);
1714 prop, "Closure Size", "Strokes end extension for closing gaps, use zero to disable");
1716 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1717
1718 prop = RNA_def_property(srna, "fill_extend_mode", PROP_ENUM, PROP_NONE);
1719 RNA_def_property_enum_sdna(prop, nullptr, "fill_extend_mode");
1722 prop, "Closure Mode", "Types of stroke extensions used for closing gaps");
1724 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1725
1726 /* Number of pixels to dilate fill area. Negative values contract the filled area. */
1727 prop = RNA_def_property(srna, "dilate", PROP_INT, PROP_PIXEL);
1728 RNA_def_property_int_sdna(prop, nullptr, "dilate_pixels");
1729 RNA_def_property_range(prop, -40, 40);
1732 prop, "Dilate/Contract", "Number of pixels to expand or contract fill area");
1734 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1735
1736 /* Factor to determine outline external perimeter thickness. */
1737 prop = RNA_def_property(srna, "outline_thickness_factor", PROP_FLOAT, PROP_FACTOR);
1738 RNA_def_property_float_sdna(prop, nullptr, "outline_fac");
1739 RNA_def_property_range(prop, 0.0f, 1.0f);
1742 prop, "Thickness", "Thickness of the outline stroke relative to current brush thickness");
1744 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1745
1746 /* Flags */
1747 prop = RNA_def_property(srna, "use_pressure", PROP_BOOLEAN, PROP_NONE);
1749 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
1750 RNA_def_property_ui_text(prop, "Use Pressure", "Use tablet pressure");
1752 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1753
1754 prop = RNA_def_property(srna, "use_strength_pressure", PROP_BOOLEAN, PROP_NONE);
1756 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
1758 prop, "Use Pressure Strength", "Use tablet pressure for color strength");
1760 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1761
1762 prop = RNA_def_property(srna, "use_jitter_pressure", PROP_BOOLEAN, PROP_NONE);
1764 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
1765 RNA_def_property_ui_text(prop, "Use Pressure Jitter", "Use tablet pressure for jitter");
1767 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1768
1769 prop = RNA_def_property(srna, "use_stroke_random_hue", 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_stroke_random_sat", PROP_BOOLEAN, PROP_NONE);
1778 RNA_def_property_ui_icon(prop, ICON_GP_SELECT_STROKES, 0);
1779 RNA_def_property_ui_text(prop, "Stroke Random", "Use randomness at stroke level");
1781 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1782
1783 prop = RNA_def_property(srna, "use_stroke_random_val", PROP_BOOLEAN, PROP_NONE);
1785 RNA_def_property_ui_icon(prop, ICON_GP_SELECT_STROKES, 0);
1786 RNA_def_property_ui_text(prop, "Stroke Random", "Use randomness at stroke level");
1788 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1789
1790 prop = RNA_def_property(srna, "use_stroke_random_radius", PROP_BOOLEAN, PROP_NONE);
1792 RNA_def_property_ui_icon(prop, ICON_GP_SELECT_STROKES, 0);
1793 RNA_def_property_ui_text(prop, "Stroke Random", "Use randomness at stroke level");
1795 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1796
1797 prop = RNA_def_property(srna, "use_stroke_random_strength", PROP_BOOLEAN, PROP_NONE);
1799 RNA_def_property_ui_icon(prop, ICON_GP_SELECT_STROKES, 0);
1800 RNA_def_property_ui_text(prop, "Stroke Random", "Use randomness at stroke level");
1802 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1803
1804 prop = RNA_def_property(srna, "use_stroke_random_uv", PROP_BOOLEAN, PROP_NONE);
1806 RNA_def_property_ui_icon(prop, ICON_GP_SELECT_STROKES, 0);
1807 RNA_def_property_ui_text(prop, "Stroke Random", "Use randomness at stroke level");
1809 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1810
1811 prop = RNA_def_property(srna, "use_random_press_hue", 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_random_press_sat", PROP_BOOLEAN, PROP_NONE);
1820 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
1821 RNA_def_property_ui_text(prop, "Use Pressure", "Use pressure to modulate randomness");
1823 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1824
1825 prop = RNA_def_property(srna, "use_random_press_val", PROP_BOOLEAN, PROP_NONE);
1827 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
1828 RNA_def_property_ui_text(prop, "Use Pressure", "Use pressure to modulate randomness");
1830 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1831
1832 prop = RNA_def_property(srna, "use_random_press_radius", PROP_BOOLEAN, PROP_NONE);
1834 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
1835 RNA_def_property_ui_text(prop, "Use Pressure", "Use pressure to modulate randomness");
1837 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1838
1839 prop = RNA_def_property(srna, "use_random_press_strength", PROP_BOOLEAN, PROP_NONE);
1841 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
1842 RNA_def_property_ui_text(prop, "Use Pressure", "Use pressure to modulate randomness");
1844 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1845
1846 prop = RNA_def_property(srna, "use_random_press_uv", PROP_BOOLEAN, PROP_NONE);
1848 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
1849 RNA_def_property_ui_text(prop, "Use Pressure", "Use pressure to modulate randomness");
1851 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1852
1853 prop = RNA_def_property(srna, "use_settings_stabilizer", PROP_BOOLEAN, PROP_NONE);
1857 "Use Stabilizer",
1858 "Draw lines with a delay to allow smooth strokes (press Shift key to "
1859 "override while drawing)");
1861 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1862
1863 prop = RNA_def_property(srna, "eraser_mode", PROP_ENUM, PROP_NONE);
1864 RNA_def_property_enum_sdna(prop, nullptr, "eraser_mode");
1866 RNA_def_property_ui_text(prop, "Mode", "Eraser Mode");
1869 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_update");
1870
1871 prop = RNA_def_property(srna, "caps_type", PROP_ENUM, PROP_NONE);
1872 RNA_def_property_enum_sdna(prop, nullptr, "caps_type");
1873 RNA_def_property_enum_items(prop, rna_enum_gpencil_brush_caps_types_items);
1874 RNA_def_property_ui_text(prop, "Caps Type", "The shape of the start and end of the stroke");
1877 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1878
1879 prop = RNA_def_property(srna, "fill_draw_mode", PROP_ENUM, PROP_NONE);
1880 RNA_def_property_enum_sdna(prop, nullptr, "fill_draw_mode");
1882 RNA_def_property_ui_text(prop, "Mode", "Mode to draw boundary limits");
1884 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1885
1886 prop = RNA_def_property(srna, "fill_layer_mode", PROP_ENUM, PROP_NONE);
1887 RNA_def_property_enum_sdna(prop, nullptr, "fill_layer_mode");
1889 RNA_def_property_ui_text(prop, "Layer Mode", "Layers used as boundaries");
1891 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1892
1893 prop = RNA_def_property(srna, "fill_direction", PROP_ENUM, PROP_NONE);
1894 RNA_def_property_enum_sdna(prop, nullptr, "fill_direction");
1896 RNA_def_property_ui_text(prop, "Direction", "Direction of the fill");
1898 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1899
1900 prop = RNA_def_property(srna, "pin_draw_mode", PROP_BOOLEAN, PROP_NONE);
1902 prop, "rna_GPencilBrush_pin_mode_get", "rna_GPencilBrush_pin_mode_set");
1903 RNA_def_property_ui_icon(prop, ICON_UNPINNED, 1);
1906 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencilBrush_pin_mode_update");
1907 RNA_def_property_ui_text(prop, "Pin Mode", "Pin the mode to the brush");
1908
1909 prop = RNA_def_property(srna, "brush_draw_mode", PROP_ENUM, PROP_NONE);
1910 RNA_def_property_enum_sdna(prop, nullptr, "brush_draw_mode");
1912 RNA_def_property_ui_text(prop, "Mode", "Preselected mode when using this brush");
1914 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1915
1916 prop = RNA_def_property(srna, "use_trim", PROP_BOOLEAN, PROP_NONE);
1919 RNA_def_property_ui_text(prop, "Trim Stroke Ends", "Trim intersecting stroke ends");
1921 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1922
1923 prop = RNA_def_property(srna, "use_settings_outline", PROP_BOOLEAN, PROP_NONE);
1926 RNA_def_property_ui_text(prop, "Outline", "Convert stroke to outline");
1928 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1929
1930 prop = RNA_def_property(srna, "use_edit_position", PROP_BOOLEAN, PROP_NONE);
1932 prop, nullptr, "sculpt_mode_flag", GP_SCULPT_FLAGMODE_APPLY_POSITION);
1933 RNA_def_property_ui_text(prop, "Affect Position", "The brush affects the position of the point");
1935 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_BrushGpencilSettings_update");
1936
1937 prop = RNA_def_property(srna, "use_edit_strength", PROP_BOOLEAN, PROP_NONE);
1939 prop, nullptr, "sculpt_mode_flag", GP_SCULPT_FLAGMODE_APPLY_STRENGTH);
1941 prop, "Affect Strength", "The brush affects the color strength of the point");
1943 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_BrushGpencilSettings_update");
1944
1945 prop = RNA_def_property(srna, "use_edit_thickness", PROP_BOOLEAN, PROP_NONE);
1947 prop, nullptr, "sculpt_mode_flag", GP_SCULPT_FLAGMODE_APPLY_THICKNESS);
1949 prop, "Affect Thickness", "The brush affects the thickness of the point");
1951 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_BrushGpencilSettings_update");
1952
1953 prop = RNA_def_property(srna, "use_edit_uv", PROP_BOOLEAN, PROP_NONE);
1954 RNA_def_property_boolean_sdna(prop, nullptr, "sculpt_mode_flag", GP_SCULPT_FLAGMODE_APPLY_UV);
1955 RNA_def_property_ui_text(prop, "Affect UV", "The brush affects the UV rotation of the point");
1957 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_BrushGpencilSettings_update");
1958
1959 /* Material */
1960 prop = RNA_def_property(srna, "material", PROP_POINTER, PROP_NONE);
1961 RNA_def_property_struct_type(prop, "Material");
1963 prop, nullptr, nullptr, nullptr, "rna_BrushGpencilSettings_material_poll");
1965 RNA_def_property_ui_text(prop, "Material", "Material used for strokes drawn using this brush");
1967 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_Brush_material_update");
1968
1969 /* Secondary Material */
1970 prop = RNA_def_property(srna, "material_alt", PROP_POINTER, PROP_NONE);
1971 RNA_def_property_struct_type(prop, "Material");
1973 prop, nullptr, nullptr, nullptr, "rna_BrushGpencilSettings_material_poll");
1975 RNA_def_property_ui_text(prop, "Material", "Material used for secondary uses for this brush");
1977 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_Brush_material_update");
1978
1979 prop = RNA_def_property(srna, "show_fill_boundary", PROP_BOOLEAN, PROP_NONE);
1982 RNA_def_property_ui_text(prop, "Show Lines", "Show help lines for filling to see boundaries");
1984 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1985
1986 prop = RNA_def_property(srna, "show_fill_extend", PROP_BOOLEAN, PROP_NONE);
1989 RNA_def_property_ui_text(prop, "Visual Aids", "Show help lines for stroke extension");
1991 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
1992
1993 prop = RNA_def_property(srna, "use_collide_strokes", PROP_BOOLEAN, PROP_NONE);
1997 prop, "Strokes Collision", "Check if extend lines collide with strokes");
1999 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
2000
2001 prop = RNA_def_property(srna, "show_fill", PROP_BOOLEAN, PROP_NONE);
2005 prop, "Show Fill", "Show transparent lines to use as boundary for filling");
2007 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
2008
2009 prop = RNA_def_property(srna, "use_fill_limit", PROP_BOOLEAN, PROP_NONE);
2012 RNA_def_property_ui_text(prop, "Limit to Viewport", "Fill only visible areas in viewport");
2014 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
2015
2016 prop = RNA_def_property(srna, "use_settings_postprocess", PROP_BOOLEAN, PROP_NONE);
2019 prop, "Use Post-Process Settings", "Additional post processing options for new strokes");
2021 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
2022
2023 prop = RNA_def_property(srna, "use_settings_random", PROP_BOOLEAN, PROP_NONE);
2025 RNA_def_property_ui_text(prop, "Random Settings", "Random brush settings");
2027 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
2028
2029 prop = RNA_def_property(srna, "use_material_pin", PROP_BOOLEAN, PROP_NONE);
2032 RNA_def_property_ui_icon(prop, ICON_UNPINNED, 1);
2033 RNA_def_property_ui_text(prop, "Pin Material", "Keep material assigned to brush");
2036 prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_use_material_pin_update");
2037
2038 prop = RNA_def_property(srna, "show_lasso", PROP_BOOLEAN, PROP_NONE);
2041 prop, "Show Lasso", "Do not display fill color while drawing the stroke");
2043 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
2044
2045 prop = RNA_def_property(srna, "use_occlude_eraser", PROP_BOOLEAN, PROP_NONE);
2047 RNA_def_property_ui_text(prop, "Occlude Eraser", "Erase only strokes visible and not occluded");
2049 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
2050
2051 prop = RNA_def_property(srna, "use_keep_caps_eraser", PROP_BOOLEAN, PROP_NONE);
2054 prop, "Keep Caps", "Keep the caps as they are and don't flatten them when erasing");
2056 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
2057
2058 prop = RNA_def_property(srna, "use_active_layer_only", PROP_BOOLEAN, PROP_NONE);
2060 RNA_def_property_ui_text(prop, "Active Layer", "Only edit the active layer of the object");
2062 RNA_def_property_update(prop, 0, "rna_BrushGpencilSettings_update");
2063}
2064
2066{
2067 StructRNA *srna;
2068 PropertyRNA *prop;
2069
2070 static const EnumPropertyItem density_mode_items[] = {
2072 "AUTO",
2073 ICON_AUTO,
2074 "Auto",
2075 "Either add or remove curves depending on the minimum distance of the curves under the "
2076 "cursor"},
2078 "ADD",
2079 ICON_ADD,
2080 "Add",
2081 "Add new curves between existing curves, taking the minimum distance into account"},
2083 "REMOVE",
2084 ICON_REMOVE,
2085 "Remove",
2086 "Remove curves whose root points are too close"},
2087 {0, nullptr, 0, nullptr, nullptr},
2088 };
2089
2090 srna = RNA_def_struct(brna, "BrushCurvesSculptSettings", nullptr);
2091 RNA_def_struct_path_func(srna, "rna_BrushCurvesSculptSettings_path");
2092 RNA_def_struct_sdna(srna, "BrushCurvesSculptSettings");
2093 RNA_def_struct_ui_text(srna, "Curves Sculpt Brush Settings", "");
2094
2095 prop = RNA_def_property(srna, "add_amount", PROP_INT, PROP_NONE);
2097 RNA_def_property_ui_text(prop, "Count", "Number of curves added by the Add brush");
2098 RNA_def_property_update(prop, 0, "rna_BrushCurvesSculptSettings_update");
2099
2100 prop = RNA_def_property(srna, "points_per_curve", PROP_INT, PROP_NONE);
2103 prop, "Points per Curve", "Number of control points in a newly added curve");
2104 RNA_def_property_update(prop, 0, "rna_BrushCurvesSculptSettings_update");
2105
2106 prop = RNA_def_property(srna, "use_uniform_scale", PROP_BOOLEAN, PROP_NONE);
2109 "Scale Uniform",
2110 "Grow or shrink curves by changing their size uniformly instead of "
2111 "using trimming or extrapolation");
2112 RNA_def_property_update(prop, 0, "rna_BrushCurvesSculptSettings_update");
2113
2114 prop = RNA_def_property(srna, "minimum_length", PROP_FLOAT, PROP_DISTANCE);
2115 RNA_def_property_range(prop, 0.0f, FLT_MAX);
2117 prop, "Minimum Length", "Avoid shrinking curves shorter than this length");
2118
2119 prop = RNA_def_property(srna, "use_length_interpolate", PROP_BOOLEAN, PROP_NONE);
2121 prop, nullptr, "flag", BRUSH_CURVES_SCULPT_FLAG_INTERPOLATE_LENGTH);
2123 prop, "Interpolate Length", "Use length of the curves in close proximity");
2124 RNA_def_property_update(prop, 0, "rna_BrushCurvesSculptSettings_update");
2125
2126 prop = RNA_def_property(srna, "use_radius_interpolate", PROP_BOOLEAN, PROP_NONE);
2128 prop, nullptr, "flag", BRUSH_CURVES_SCULPT_FLAG_INTERPOLATE_RADIUS);
2131 prop, "Interpolate Radius", "Use radius of the curves in close proximity");
2132 RNA_def_property_update(prop, 0, "rna_BrushCurvesSculptSettings_update");
2133
2134 prop = RNA_def_property(srna, "use_point_count_interpolate", PROP_BOOLEAN, PROP_NONE);
2138 "Interpolate Point Count",
2139 "Use the number of points from the curves in close proximity");
2140 RNA_def_property_update(prop, 0, "rna_BrushCurvesSculptSettings_update");
2141
2142 prop = RNA_def_property(srna, "use_shape_interpolate", PROP_BOOLEAN, PROP_NONE);
2145 prop, "Interpolate Shape", "Use shape of the curves in close proximity");
2146 RNA_def_property_update(prop, 0, "rna_BrushCurvesSculptSettings_update");
2147
2148 prop = RNA_def_property(srna, "curve_length", PROP_FLOAT, PROP_DISTANCE);
2149 RNA_def_property_range(prop, 0.0, FLT_MAX);
2151 prop,
2152 "Curve Length",
2153 "Length of newly added curves when it is not interpolated from other curves");
2154 RNA_def_property_update(prop, 0, "rna_BrushCurvesSculptSettings_update");
2155
2156 prop = RNA_def_property(srna, "minimum_distance", PROP_FLOAT, PROP_DISTANCE);
2157 RNA_def_property_range(prop, 0.0f, FLT_MAX);
2158 RNA_def_property_ui_range(prop, 0.0, 1000.0f, 0.001, 2);
2160 prop, "Minimum Distance", "Goal distance between curve roots for the Density brush");
2161 RNA_def_property_update(prop, 0, "rna_BrushCurvesSculptSettings_update");
2162
2163 prop = RNA_def_property(srna, "curve_radius", PROP_FLOAT, PROP_DISTANCE);
2164 RNA_def_property_range(prop, 0.0, FLT_MAX);
2165 RNA_def_property_float_default(prop, 0.01f);
2166 RNA_def_property_ui_range(prop, 0.0, 1000.0f, 0.001, 2);
2168 prop,
2169 "Curve Radius",
2170 "Radius of newly added curves when it is not interpolated from other curves");
2171 RNA_def_property_update(prop, 0, "rna_BrushCurvesSculptSettings_update");
2172
2173 prop = RNA_def_property(srna, "density_add_attempts", PROP_INT, PROP_NONE);
2176 prop, "Density Add Attempts", "How many times the Density brush tries to add a new curve");
2177 RNA_def_property_update(prop, 0, "rna_BrushCurvesSculptSettings_update");
2178
2179 prop = RNA_def_property(srna, "density_mode", PROP_ENUM, PROP_NONE);
2180 RNA_def_property_enum_items(prop, density_mode_items);
2182 prop, "Density Mode", "Determines whether the brush adds or removes curves");
2184 RNA_def_property_update(prop, 0, "rna_BrushCurvesSculptSettings_update");
2185
2186 prop = RNA_def_property(srna, "curve_parameter_falloff", PROP_POINTER, PROP_NONE);
2187 RNA_def_property_struct_type(prop, "CurveMapping");
2189 "Curve Parameter Falloff",
2190 "Falloff that is applied from the tip to the root of each curve");
2191 RNA_def_property_update(prop, 0, "rna_BrushCurvesSculptSettings_update");
2192}
2193
2194static void rna_def_brush(BlenderRNA *brna)
2195{
2196 StructRNA *srna;
2197 PropertyRNA *prop;
2198
2199 static const EnumPropertyItem prop_blend_items[] = {
2200 {IMB_BLEND_MIX, "MIX", 0, "Mix", "Use Mix blending mode while painting"},
2202 {IMB_BLEND_DARKEN, "DARKEN", 0, "Darken", "Use Darken blending mode while painting"},
2203 {IMB_BLEND_MUL, "MUL", 0, "Multiply", "Use Multiply blending mode while painting"},
2205 "COLORBURN",
2206 0,
2207 "Color Burn",
2208 "Use Color Burn blending mode while painting"},
2210 "LINEARBURN",
2211 0,
2212 "Linear Burn",
2213 "Use Linear Burn blending mode while painting"},
2215 {IMB_BLEND_LIGHTEN, "LIGHTEN", 0, "Lighten", "Use Lighten blending mode while painting"},
2216 {IMB_BLEND_SCREEN, "SCREEN", 0, "Screen", "Use Screen blending mode while painting"},
2218 "COLORDODGE",
2219 0,
2220 "Color Dodge",
2221 "Use Color Dodge blending mode while painting"},
2222 {IMB_BLEND_ADD, "ADD", 0, "Add", "Use Add blending mode while painting"},
2224 {IMB_BLEND_OVERLAY, "OVERLAY", 0, "Overlay", "Use Overlay blending mode while painting"},
2226 "SOFTLIGHT",
2227 0,
2228 "Soft Light",
2229 "Use Soft Light blending mode while painting"},
2231 "HARDLIGHT",
2232 0,
2233 "Hard Light",
2234 "Use Hard Light blending mode while painting"},
2236 "VIVIDLIGHT",
2237 0,
2238 "Vivid Light",
2239 "Use Vivid Light blending mode while painting"},
2241 "LINEARLIGHT",
2242 0,
2243 "Linear Light",
2244 "Use Linear Light blending mode while painting"},
2246 "PINLIGHT",
2247 0,
2248 "Pin Light",
2249 "Use Pin Light blending mode while painting"},
2252 "DIFFERENCE",
2253 0,
2254 "Difference",
2255 "Use Difference blending mode while painting"},
2257 "EXCLUSION",
2258 0,
2259 "Exclusion",
2260 "Use Exclusion blending mode while painting"},
2261 {IMB_BLEND_SUB, "SUB", 0, "Subtract", "Use Subtract blending mode while painting"},
2263 {IMB_BLEND_HUE, "HUE", 0, "Hue", "Use Hue blending mode while painting"},
2265 "SATURATION",
2266 0,
2267 "Saturation",
2268 "Use Saturation blending mode while painting"},
2269 {IMB_BLEND_COLOR, "COLOR", 0, "Color", "Use Color blending mode while painting"},
2270 {IMB_BLEND_LUMINOSITY, "LUMINOSITY", 0, "Value", "Use Value blending mode while painting"},
2272 {IMB_BLEND_ERASE_ALPHA, "ERASE_ALPHA", 0, "Erase Alpha", "Erase alpha while painting"},
2273 {IMB_BLEND_ADD_ALPHA, "ADD_ALPHA", 0, "Add Alpha", "Add alpha while painting"},
2274 {0, nullptr, 0, nullptr, nullptr},
2275 };
2276
2277 static const EnumPropertyItem brush_sculpt_plane_items[] = {
2278 {SCULPT_DISP_DIR_AREA, "AREA", 0, "Area Plane", ""},
2279 {SCULPT_DISP_DIR_VIEW, "VIEW", 0, "View Plane", ""},
2280 {SCULPT_DISP_DIR_X, "X", 0, "X Plane", ""},
2281 {SCULPT_DISP_DIR_Y, "Y", 0, "Y Plane", ""},
2282 {SCULPT_DISP_DIR_Z, "Z", 0, "Z Plane", ""},
2283 {0, nullptr, 0, nullptr, nullptr},
2284 };
2285
2286 static const EnumPropertyItem brush_mask_tool_items[] = {
2287 {BRUSH_MASK_DRAW, "DRAW", 0, "Draw", ""},
2288 {BRUSH_MASK_SMOOTH, "SMOOTH", 0, "Smooth", ""},
2289 {0, nullptr, 0, nullptr, nullptr},
2290 };
2291
2292 static const EnumPropertyItem brush_blur_mode_items[] = {
2293 {KERNEL_BOX, "BOX", 0, "Box", ""},
2294 {KERNEL_GAUSSIAN, "GAUSSIAN", 0, "Gaussian", ""},
2295 {0, nullptr, 0, nullptr, nullptr},
2296 };
2297
2298 static const EnumPropertyItem brush_gradient_items[] = {
2299 {BRUSH_GRADIENT_PRESSURE, "PRESSURE", 0, "Pressure", ""},
2300 {BRUSH_GRADIENT_SPACING_REPEAT, "SPACING_REPEAT", 0, "Repeat", ""},
2301 {BRUSH_GRADIENT_SPACING_CLAMP, "SPACING_CLAMP", 0, "Clamp", ""},
2302 {0, nullptr, 0, nullptr, nullptr},
2303 };
2304
2305 static const EnumPropertyItem brush_gradient_fill_items[] = {
2306 {BRUSH_GRADIENT_LINEAR, "LINEAR", 0, "Linear", ""},
2307 {BRUSH_GRADIENT_RADIAL, "RADIAL", 0, "Radial", ""},
2308 {0, nullptr, 0, nullptr, nullptr},
2309 };
2310
2311 static const EnumPropertyItem brush_mask_pressure_items[] = {
2312 {0, "NONE", 0, "Off", ""},
2313 {BRUSH_MASK_PRESSURE_RAMP, "RAMP", ICON_STYLUS_PRESSURE, "Ramp", ""},
2314 {BRUSH_MASK_PRESSURE_CUTOFF, "CUTOFF", ICON_STYLUS_PRESSURE, "Cutoff", ""},
2315 {0, nullptr, 0, nullptr, nullptr},
2316 };
2317
2318 static const EnumPropertyItem brush_size_unit_items[] = {
2319 {0, "VIEW", 0, "View", "Measure brush size relative to the view"},
2320 {BRUSH_LOCK_SIZE, "SCENE", 0, "Scene", "Measure brush size relative to the scene"},
2321 {0, nullptr, 0, nullptr, nullptr},
2322 };
2323
2324 static const EnumPropertyItem color_gradient_items[] = {
2325 {0, "COLOR", 0, "Color", "Paint with a single color"},
2326 {BRUSH_USE_GRADIENT, "GRADIENT", 0, "Gradient", "Paint with a gradient"},
2327 {0, nullptr, 0, nullptr, nullptr},
2328 };
2329
2330 static const EnumPropertyItem brush_spacing_unit_items[] = {
2331 {0, "VIEW", 0, "View", "Calculate brush spacing relative to the view"},
2333 "SCENE",
2334 0,
2335 "Scene",
2336 "Calculate brush spacing relative to the scene using the stroke location"},
2337 {0, nullptr, 0, nullptr, nullptr},
2338 };
2339
2340 static const EnumPropertyItem brush_jitter_unit_items[] = {
2341 {BRUSH_ABSOLUTE_JITTER, "VIEW", 0, "View", "Jittering happens in screen space, in pixels"},
2342 {0, "BRUSH", 0, "Brush", "Jittering happens relative to the brush size"},
2343 {0, nullptr, 0, nullptr, nullptr},
2344 };
2345
2346 static const EnumPropertyItem falloff_shape_unit_items[] = {
2347 {0, "SPHERE", 0, "Sphere", "Apply brush influence in a Sphere, outwards from the center"},
2349 "PROJECTED",
2350 0,
2351 "Projected",
2352 "Apply brush influence in a 2D circle, projected from the view"},
2353 {0, nullptr, 0, nullptr, nullptr},
2354 };
2355
2356 static const EnumPropertyItem brush_deformation_target_items[] = {
2358 "GEOMETRY",
2359 0,
2360 "Geometry",
2361 "Brush deformation displaces the vertices of the mesh"},
2363 "CLOTH_SIM",
2364 0,
2365 "Cloth Simulation",
2366 "Brush deforms the mesh by deforming the constraints of a cloth simulation"},
2367 {0, nullptr, 0, nullptr, nullptr},
2368 };
2369
2370 static const EnumPropertyItem brush_elastic_deform_type_items[] = {
2371 {BRUSH_ELASTIC_DEFORM_GRAB, "GRAB", 0, "Grab", ""},
2372 {BRUSH_ELASTIC_DEFORM_GRAB_BISCALE, "GRAB_BISCALE", 0, "Bi-Scale Grab", ""},
2373 {BRUSH_ELASTIC_DEFORM_GRAB_TRISCALE, "GRAB_TRISCALE", 0, "Tri-Scale Grab", ""},
2374 {BRUSH_ELASTIC_DEFORM_SCALE, "SCALE", 0, "Scale", ""},
2375 {BRUSH_ELASTIC_DEFORM_TWIST, "TWIST", 0, "Twist", ""},
2376 {0, nullptr, 0, nullptr, nullptr},
2377 };
2378
2379 static const EnumPropertyItem brush_snake_hook_deform_type_items[] = {
2381 "FALLOFF",
2382 0,
2383 "Radius Falloff",
2384 "Applies the brush falloff in the tip of the brush"},
2386 "ELASTIC",
2387 0,
2388 "Elastic",
2389 "Modifies the entire mesh using elastic deform"},
2390 {0, nullptr, 0, nullptr, nullptr},
2391 };
2392
2393 static const EnumPropertyItem brush_cloth_deform_type_items[] = {
2394 {BRUSH_CLOTH_DEFORM_DRAG, "DRAG", 0, "Drag", ""},
2395 {BRUSH_CLOTH_DEFORM_PUSH, "PUSH", 0, "Push", ""},
2396 {BRUSH_CLOTH_DEFORM_PINCH_POINT, "PINCH_POINT", 0, "Pinch Point", ""},
2398 "PINCH_PERPENDICULAR",
2399 0,
2400 "Pinch Perpendicular",
2401 ""},
2402 {BRUSH_CLOTH_DEFORM_INFLATE, "INFLATE", 0, "Inflate", ""},
2403 {BRUSH_CLOTH_DEFORM_GRAB, "GRAB", 0, "Grab", ""},
2404 {BRUSH_CLOTH_DEFORM_EXPAND, "EXPAND", 0, "Expand", ""},
2405 {BRUSH_CLOTH_DEFORM_SNAKE_HOOK, "SNAKE_HOOK", 0, "Snake Hook", ""},
2406 {0, nullptr, 0, nullptr, nullptr},
2407 };
2408
2409 static const EnumPropertyItem brush_cloth_force_falloff_type_items[] = {
2410 {BRUSH_CLOTH_FORCE_FALLOFF_RADIAL, "RADIAL", 0, "Radial", ""},
2411 {BRUSH_CLOTH_FORCE_FALLOFF_PLANE, "PLANE", 0, "Plane", ""},
2412 {0, nullptr, 0, nullptr, nullptr},
2413 };
2414
2415 static const EnumPropertyItem brush_boundary_falloff_type_items[] = {
2417 "CONSTANT",
2418 0,
2419 "Constant",
2420 "Applies the same deformation in the entire boundary"},
2422 "RADIUS",
2423 0,
2424 "Brush Radius",
2425 "Applies the deformation in a localized area limited by the brush radius"},
2427 "LOOP",
2428 0,
2429 "Loop",
2430 "Applies the brush falloff in a loop pattern"},
2432 "LOOP_INVERT",
2433 0,
2434 "Loop and Invert",
2435 "Applies the falloff radius in a loop pattern, inverting the displacement direction in "
2436 "each pattern repetition"},
2437 {0, nullptr, 0, nullptr, nullptr},
2438 };
2439
2440 static const EnumPropertyItem brush_cloth_simulation_area_type_items[] = {
2442 "LOCAL",
2443 0,
2444 "Local",
2445 "Simulates only a specific area around the brush limited by a fixed radius"},
2446 {BRUSH_CLOTH_SIMULATION_AREA_GLOBAL, "GLOBAL", 0, "Global", "Simulates the entire mesh"},
2448 "DYNAMIC",
2449 0,
2450 "Dynamic",
2451 "The active simulation area moves with the brush"},
2452 {0, nullptr, 0, nullptr, nullptr},
2453 };
2454
2455 static const EnumPropertyItem brush_smooth_deform_type_items[] = {
2457 "LAPLACIAN",
2458 0,
2459 "Laplacian",
2460 "Smooths the surface and the volume"},
2462 "SURFACE",
2463 0,
2464 "Surface",
2465 "Smooths the surface of the mesh, preserving the volume"},
2466 {0, nullptr, 0, nullptr, nullptr},
2467 };
2468
2469 static const EnumPropertyItem brush_pose_deform_type_items[] = {
2470 {BRUSH_POSE_DEFORM_ROTATE_TWIST, "ROTATE_TWIST", 0, "Rotate/Twist", ""},
2471 {BRUSH_POSE_DEFORM_SCALE_TRASLATE, "SCALE_TRANSLATE", 0, "Scale/Translate", ""},
2472 {BRUSH_POSE_DEFORM_SQUASH_STRETCH, "SQUASH_STRETCH", 0, "Squash & Stretch", ""},
2473 {0, nullptr, 0, nullptr, nullptr},
2474 };
2475
2476 static const EnumPropertyItem brush_pose_origin_type_items[] = {
2478 "TOPOLOGY",
2479 0,
2480 "Topology",
2481 "Sets the rotation origin automatically using the topology and shape of the mesh as a "
2482 "guide"},
2484 "FACE_SETS",
2485 0,
2486 "Face Sets",
2487 "Creates a pose segment per face sets, starting from the active face set"},
2489 "FACE_SETS_FK",
2490 0,
2491 "Face Sets FK",
2492 "Simulates an FK deformation using the Face Set under the cursor as control"},
2493 {0, nullptr, 0, nullptr, nullptr},
2494 };
2495
2496 static const EnumPropertyItem brush_smear_deform_type_items[] = {
2497 {BRUSH_SMEAR_DEFORM_DRAG, "DRAG", 0, "Drag", ""},
2498 {BRUSH_SMEAR_DEFORM_PINCH, "PINCH", 0, "Pinch", ""},
2499 {BRUSH_SMEAR_DEFORM_EXPAND, "EXPAND", 0, "Expand", ""},
2500 {0, nullptr, 0, nullptr, nullptr},
2501 };
2502
2503 static const EnumPropertyItem brush_slide_deform_type_items[] = {
2504 {BRUSH_SLIDE_DEFORM_DRAG, "DRAG", 0, "Drag", ""},
2505 {BRUSH_SLIDE_DEFORM_PINCH, "PINCH", 0, "Pinch", ""},
2506 {BRUSH_SLIDE_DEFORM_EXPAND, "EXPAND", 0, "Expand", ""},
2507 {0, nullptr, 0, nullptr, nullptr},
2508 };
2509
2510 static const EnumPropertyItem brush_boundary_deform_type_items[] = {
2511 {BRUSH_BOUNDARY_DEFORM_BEND, "BEND", 0, "Bend", ""},
2512 {BRUSH_BOUNDARY_DEFORM_EXPAND, "EXPAND", 0, "Expand", ""},
2513 {BRUSH_BOUNDARY_DEFORM_INFLATE, "INFLATE", 0, "Inflate", ""},
2514 {BRUSH_BOUNDARY_DEFORM_GRAB, "GRAB", 0, "Grab", ""},
2515 {BRUSH_BOUNDARY_DEFORM_TWIST, "TWIST", 0, "Twist", ""},
2516 {BRUSH_BOUNDARY_DEFORM_SMOOTH, "SMOOTH", 0, "Smooth", ""},
2517 {0, nullptr, 0, nullptr, nullptr},
2518 };
2519
2520 srna = RNA_def_struct(brna, "Brush", "ID");
2522 srna, "Brush", "Brush data-block for storing brush settings for painting and sculpting");
2523 RNA_def_struct_ui_icon(srna, ICON_BRUSH_DATA);
2524
2525 prop = RNA_def_property(srna, "has_unsaved_changes", PROP_BOOLEAN, PROP_NONE);
2528 "Has unsaved changes",
2529 "Indicates that there are any user visible changes since the brush has "
2530 "been imported or read from the file");
2531
2532 /* enums */
2533 prop = RNA_def_property(srna, "blend", PROP_ENUM, PROP_NONE);
2534 RNA_def_property_enum_items(prop, prop_blend_items);
2535 RNA_def_property_ui_text(prop, "Blending Mode", "Brush blending mode");
2536 RNA_def_property_update(prop, 0, "rna_Brush_update");
2537
2543 prop = RNA_def_property(srna, "sculpt_tool", PROP_ENUM, PROP_NONE);
2544 RNA_def_property_enum_sdna(prop, nullptr, "sculpt_brush_type");
2546 RNA_def_property_ui_text(prop, "Brush Type", "");
2548 RNA_def_property_update(prop, 0, "rna_Brush_update_and_reset_icon");
2549
2550 prop = RNA_def_property(srna, "vertex_tool", PROP_ENUM, PROP_NONE);
2551 RNA_def_property_enum_sdna(prop, nullptr, "vertex_brush_type");
2553 RNA_def_property_ui_text(prop, "Brush Type", "");
2554 RNA_def_property_update(prop, 0, "rna_Brush_update_and_reset_icon");
2555
2556 prop = RNA_def_property(srna, "weight_tool", PROP_ENUM, PROP_NONE);
2557 RNA_def_property_enum_sdna(prop, nullptr, "weight_brush_type");
2559 RNA_def_property_ui_text(prop, "Brush Type", "");
2560 RNA_def_property_update(prop, 0, "rna_Brush_update_and_reset_icon");
2561
2562 prop = RNA_def_property(srna, "image_tool", PROP_ENUM, PROP_NONE);
2563 RNA_def_property_enum_sdna(prop, nullptr, "image_brush_type");
2565 RNA_def_property_ui_text(prop, "Brush Type", "");
2567 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, "rna_Brush_update_and_reset_icon");
2568
2569 prop = RNA_def_property(srna, "gpencil_tool", PROP_ENUM, PROP_NONE);
2570 RNA_def_property_enum_sdna(prop, nullptr, "gpencil_brush_type");
2572 RNA_def_property_ui_text(prop, "Brush Type", "");
2575 RNA_def_property_update(prop, 0, "rna_Brush_update");
2576
2577 prop = RNA_def_property(srna, "gpencil_vertex_tool", PROP_ENUM, PROP_NONE);
2578 RNA_def_property_enum_sdna(prop, nullptr, "gpencil_vertex_brush_type");
2580 RNA_def_property_ui_text(prop, "Brush Type", "");
2582 RNA_def_property_update(prop, 0, "rna_Brush_update");
2583
2584 prop = RNA_def_property(srna, "gpencil_sculpt_tool", PROP_ENUM, PROP_NONE);
2585 RNA_def_property_enum_sdna(prop, nullptr, "gpencil_sculpt_brush_type");
2587 RNA_def_property_ui_text(prop, "Brush Type", "");
2590 RNA_def_property_update(prop, 0, "rna_Brush_update");
2591
2592 prop = RNA_def_property(srna, "gpencil_weight_tool", PROP_ENUM, PROP_NONE);
2593 RNA_def_property_enum_sdna(prop, nullptr, "gpencil_weight_brush_type");
2595 RNA_def_property_ui_text(prop, "Brush Type", "");
2597 RNA_def_property_update(prop, 0, "rna_Brush_update");
2598
2599 prop = RNA_def_property(srna, "curves_sculpt_tool", PROP_ENUM, PROP_NONE);
2600 RNA_def_property_enum_sdna(prop, nullptr, "curves_sculpt_brush_type");
2602 RNA_def_property_ui_text(prop, "Brush Type", "");
2605 RNA_def_property_update(prop, 0, "rna_Brush_update");
2606
2609 prop = RNA_def_property(srna, "direction", PROP_ENUM, PROP_NONE);
2610 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flag");
2612 RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_Brush_direction_itemf");
2613 RNA_def_property_ui_text(prop, "Direction", "");
2614 RNA_def_property_update(prop, 0, "rna_Brush_update");
2615
2616 prop = RNA_def_property(srna, "stroke_method", PROP_ENUM, PROP_NONE);
2617 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flag");
2619 RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_Brush_stroke_itemf");
2620 RNA_def_property_ui_text(prop, "Stroke Method", "");
2621 RNA_def_property_update(prop, 0, "rna_Brush_stroke_update");
2622
2623 prop = RNA_def_property(srna, "sculpt_plane", PROP_ENUM, PROP_NONE);
2624 RNA_def_property_enum_items(prop, brush_sculpt_plane_items);
2625 RNA_def_property_ui_text(prop, "Sculpt Plane", "");
2626 RNA_def_property_update(prop, 0, "rna_Brush_update");
2627
2628 prop = RNA_def_property(srna, "mask_tool", PROP_ENUM, PROP_NONE);
2629 RNA_def_property_enum_items(prop, brush_mask_tool_items);
2630 RNA_def_property_ui_text(prop, "Mask Tool", "");
2632 RNA_def_property_update(prop, 0, "rna_Brush_update");
2633
2634 prop = RNA_def_property(srna, "curve_preset", PROP_ENUM, PROP_NONE);
2636 RNA_def_property_ui_text(prop, "Curve Preset", "");
2637 RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_CURVES); /* Abusing id_curves :/ */
2638 RNA_def_property_update(prop, 0, "rna_Brush_update");
2639
2640 prop = RNA_def_property(srna, "deform_target", PROP_ENUM, PROP_NONE);
2641 RNA_def_property_enum_items(prop, brush_deformation_target_items);
2643 prop, "Deformation Target", "How the deformation of the brush will affect the object");
2644 RNA_def_property_update(prop, 0, "rna_Brush_update");
2645
2646 prop = RNA_def_property(srna, "elastic_deform_type", PROP_ENUM, PROP_NONE);
2647 RNA_def_property_enum_items(prop, brush_elastic_deform_type_items);
2648 RNA_def_property_ui_text(prop, "Deformation", "Deformation type that is used in the brush");
2650 RNA_def_property_update(prop, 0, "rna_Brush_update");
2651
2652 prop = RNA_def_property(srna, "snake_hook_deform_type", PROP_ENUM, PROP_NONE);
2653 RNA_def_property_enum_items(prop, brush_snake_hook_deform_type_items);
2654 RNA_def_property_ui_text(prop, "Deformation", "Deformation type that is used in the brush");
2655 RNA_def_property_update(prop, 0, "rna_Brush_update");
2656
2657 prop = RNA_def_property(srna, "cloth_deform_type", PROP_ENUM, PROP_NONE);
2658 RNA_def_property_enum_items(prop, brush_cloth_deform_type_items);
2659 RNA_def_property_ui_text(prop, "Deformation", "Deformation type that is used in the brush");
2660 RNA_def_property_update(prop, 0, "rna_Brush_update");
2661
2662 prop = RNA_def_property(srna, "cloth_force_falloff_type", PROP_ENUM, PROP_NONE);
2663 RNA_def_property_enum_items(prop, brush_cloth_force_falloff_type_items);
2665 prop, "Force Falloff", "Shape used in the brush to apply force to the cloth");
2666 RNA_def_property_update(prop, 0, "rna_Brush_update");
2667
2668 prop = RNA_def_property(srna, "cloth_simulation_area_type", PROP_ENUM, PROP_NONE);
2669 RNA_def_property_enum_items(prop, brush_cloth_simulation_area_type_items);
2671 prop,
2672 "Simulation Area",
2673 "Part of the mesh that is going to be simulated when the stroke is active");
2674 RNA_def_property_update(prop, 0, "rna_Brush_update");
2675
2676 prop = RNA_def_property(srna, "boundary_falloff_type", PROP_ENUM, PROP_NONE);
2677 RNA_def_property_enum_items(prop, brush_boundary_falloff_type_items);
2679 prop, "Boundary Falloff", "How the brush falloff is applied across the boundary");
2680 RNA_def_property_update(prop, 0, "rna_Brush_update");
2681
2682 prop = RNA_def_property(srna, "smooth_deform_type", PROP_ENUM, PROP_NONE);
2683 RNA_def_property_enum_items(prop, brush_smooth_deform_type_items);
2684 RNA_def_property_ui_text(prop, "Deformation", "Deformation type that is used in the brush");
2685 RNA_def_property_update(prop, 0, "rna_Brush_update");
2686
2687 prop = RNA_def_property(srna, "smear_deform_type", PROP_ENUM, PROP_NONE);
2688 RNA_def_property_enum_items(prop, brush_smear_deform_type_items);
2689 RNA_def_property_ui_text(prop, "Deformation", "Deformation type that is used in the brush");
2690 RNA_def_property_update(prop, 0, "rna_Brush_update");
2691
2692 prop = RNA_def_property(srna, "slide_deform_type", PROP_ENUM, PROP_NONE);
2693 RNA_def_property_enum_items(prop, brush_slide_deform_type_items);
2694 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);
2730 RNA_def_property_int_funcs(prop, nullptr, "rna_Brush_set_size", nullptr);
2733 RNA_def_property_ui_text(prop, "Radius", "Radius of the brush in pixels");
2734 RNA_def_property_update(prop, 0, "rna_Brush_size_update");
2735
2736 prop = RNA_def_property(srna, "unprojected_radius", PROP_FLOAT, PROP_DISTANCE);
2737 RNA_def_property_float_funcs(prop, nullptr, "rna_Brush_set_unprojected_radius", 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 Radius", "Radius 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, "smooth_stroke_radius", PROP_INT, PROP_PIXEL);
2786 RNA_def_property_range(prop, 10, 200);
2788 prop, "Smooth Stroke Radius", "Minimum distance from last point before stroke continues");
2789 RNA_def_property_update(prop, 0, "rna_Brush_update");
2790
2791 prop = RNA_def_property(srna, "smooth_stroke_factor", PROP_FLOAT, PROP_FACTOR);
2792 RNA_def_property_range(prop, 0.5, 0.99);
2793 RNA_def_property_ui_text(prop, "Smooth Stroke Factor", "Higher values give a smoother stroke");
2794 RNA_def_property_update(prop, 0, "rna_Brush_update");
2795
2796 prop = RNA_def_property(srna, "rate", PROP_FLOAT, PROP_NONE);
2797 RNA_def_property_float_sdna(prop, nullptr, "rate");
2798 RNA_def_property_range(prop, 0.0001f, 10000.0f);
2799 RNA_def_property_ui_range(prop, 0.01f, 1.0f, 1, 3);
2800 RNA_def_property_ui_text(prop, "Rate", "Interval between paints for Airbrush");
2801 RNA_def_property_update(prop, 0, "rna_Brush_update");
2802
2803 prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR_GAMMA);
2804 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
2805 RNA_def_property_float_sdna(prop, nullptr, "rgb");
2806 RNA_def_property_ui_text(prop, "Color", "");
2807 RNA_def_property_update(prop, 0, "rna_Brush_update");
2808
2809 prop = RNA_def_property(srna, "secondary_color", PROP_FLOAT, PROP_COLOR_GAMMA);
2810 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
2811 RNA_def_property_float_sdna(prop, nullptr, "secondary_rgb");
2812 RNA_def_property_ui_text(prop, "Secondary Color", "");
2813 RNA_def_property_update(prop, 0, "rna_Brush_update");
2814
2815 prop = RNA_def_property(srna, "weight", PROP_FLOAT, PROP_FACTOR);
2816 RNA_def_property_range(prop, 0.0f, 1.0f);
2817 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
2818 RNA_def_property_ui_text(prop, "Weight", "Vertex weight when brush is applied");
2819 RNA_def_property_update(prop, 0, "rna_Brush_update");
2820
2821 prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_FACTOR);
2822 RNA_def_property_float_sdna(prop, nullptr, "alpha");
2823 RNA_def_property_range(prop, 0.0f, 10.0f);
2824 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
2826 prop, "Strength", "How powerful the effect of the brush is when applied");
2827 RNA_def_property_update(prop, 0, "rna_Brush_update");
2828
2829 prop = RNA_def_property(srna, "flow", PROP_FLOAT, PROP_FACTOR);
2830 RNA_def_property_float_sdna(prop, nullptr, "flow");
2831 RNA_def_property_range(prop, 0.0f, 1.0f);
2832 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
2833 RNA_def_property_ui_text(prop, "Flow", "Amount of paint that is applied per stroke sample");
2834 RNA_def_property_update(prop, 0, "rna_Brush_update");
2835
2836 prop = RNA_def_property(srna, "wet_mix", PROP_FLOAT, PROP_FACTOR);
2837 RNA_def_property_float_sdna(prop, nullptr, "wet_mix");
2838 RNA_def_property_range(prop, 0.0f, 1.0f);
2839 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
2841 prop, "Wet Mix", "Amount of paint that is picked from the surface into the brush color");
2842 RNA_def_property_update(prop, 0, "rna_Brush_update");
2843
2844 prop = RNA_def_property(srna, "wet_persistence", PROP_FLOAT, PROP_FACTOR);
2845 RNA_def_property_float_sdna(prop, nullptr, "wet_persistence");
2846 RNA_def_property_range(prop, 0.0f, 1.0f);
2847 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
2849 prop,
2850 "Wet Persistence",
2851 "Amount of wet paint that stays in the brush after applying paint to the surface");
2852 RNA_def_property_update(prop, 0, "rna_Brush_update");
2853
2854 prop = RNA_def_property(srna, "density", PROP_FLOAT, PROP_FACTOR);
2855 RNA_def_property_float_sdna(prop, nullptr, "density");
2856 RNA_def_property_range(prop, 0.0f, 1.0f);
2857 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
2859 prop, "Density", "Amount of random elements that are going to be affected by the brush");
2860 RNA_def_property_update(prop, 0, "rna_Brush_update");
2861
2862 prop = RNA_def_property(srna, "tip_scale_x", PROP_FLOAT, PROP_FACTOR);
2863 RNA_def_property_float_sdna(prop, nullptr, "tip_scale_x");
2864 RNA_def_property_range(prop, 0.0f, 1.0f);
2865 RNA_def_property_ui_range(prop, 0.0001f, 1.0f, 0.001, 3);
2866 RNA_def_property_ui_text(prop, "Tip Scale X", "Scale of the brush tip in the X axis");
2867 RNA_def_property_update(prop, 0, "rna_Brush_update");
2868
2869 prop = RNA_def_property(srna, "use_hardness_pressure", PROP_BOOLEAN, PROP_NONE);
2870 RNA_def_property_boolean_sdna(prop, nullptr, "paint_flags", BRUSH_PAINT_HARDNESS_PRESSURE);
2871 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
2872 RNA_def_property_ui_text(prop, "Use Pressure for Hardness", "Use pressure to modulate hardness");
2874 RNA_def_property_update(prop, 0, "rna_Brush_update");
2875
2876 prop = RNA_def_property(srna, "invert_hardness_pressure", PROP_BOOLEAN, PROP_NONE);
2878 prop, nullptr, "paint_flags", BRUSH_PAINT_HARDNESS_PRESSURE_INVERT);
2879 RNA_def_property_ui_icon(prop, ICON_ARROW_LEFTRIGHT, 0);
2881 prop, "Invert Pressure for Hardness", "Invert the modulation of pressure in hardness");
2883 RNA_def_property_update(prop, 0, "rna_Brush_update");
2884
2885 prop = RNA_def_property(srna, "use_flow_pressure", PROP_BOOLEAN, PROP_NONE);
2886 RNA_def_property_boolean_sdna(prop, nullptr, "paint_flags", BRUSH_PAINT_FLOW_PRESSURE);
2887 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
2888 RNA_def_property_ui_text(prop, "Use Pressure for Flow", "Use pressure to modulate flow");
2890 RNA_def_property_update(prop, 0, "rna_Brush_update");
2891
2892 prop = RNA_def_property(srna, "invert_flow_pressure", PROP_BOOLEAN, PROP_NONE);
2894 RNA_def_property_ui_icon(prop, ICON_ARROW_LEFTRIGHT, 0);
2896 prop, "Invert Pressure for Flow", "Invert the modulation of pressure in flow");
2898 RNA_def_property_update(prop, 0, "rna_Brush_update");
2899
2900 prop = RNA_def_property(srna, "use_wet_mix_pressure", PROP_BOOLEAN, PROP_NONE);
2901 RNA_def_property_boolean_sdna(prop, nullptr, "paint_flags", BRUSH_PAINT_WET_MIX_PRESSURE);
2902 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
2903 RNA_def_property_ui_text(prop, "Use Pressure for Wet Mix", "Use pressure to modulate wet mix");
2905 RNA_def_property_update(prop, 0, "rna_Brush_update");
2906
2907 prop = RNA_def_property(srna, "invert_wet_mix_pressure", PROP_BOOLEAN, PROP_NONE);
2909 RNA_def_property_ui_icon(prop, ICON_ARROW_LEFTRIGHT, 0);
2911 prop, "Invert Pressure for Wet Mix", "Invert the modulation of pressure in wet mix");
2913 RNA_def_property_update(prop, 0, "rna_Brush_update");
2914
2915 prop = RNA_def_property(srna, "use_wet_persistence_pressure", PROP_BOOLEAN, PROP_NONE);
2917 prop, nullptr, "paint_flags", BRUSH_PAINT_WET_PERSISTENCE_PRESSURE);
2918 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
2920 prop, "Use Pressure for Wet Persistence", "Use pressure to modulate wet persistence");
2922 RNA_def_property_update(prop, 0, "rna_Brush_update");
2923
2924 prop = RNA_def_property(srna, "invert_wet_persistence_pressure", PROP_BOOLEAN, PROP_NONE);
2926 prop, nullptr, "paint_flags", BRUSH_PAINT_WET_PERSISTENCE_PRESSURE_INVERT);
2927 RNA_def_property_ui_icon(prop, ICON_ARROW_LEFTRIGHT, 0);
2929 "Invert Pressure for Wet Persistence",
2930 "Invert the modulation of pressure in wet persistence");
2932 RNA_def_property_update(prop, 0, "rna_Brush_update");
2933
2934 prop = RNA_def_property(srna, "use_density_pressure", PROP_BOOLEAN, PROP_NONE);
2935 RNA_def_property_boolean_sdna(prop, nullptr, "paint_flags", BRUSH_PAINT_DENSITY_PRESSURE);
2936 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
2937 RNA_def_property_ui_text(prop, "Use Pressure for Density", "Use pressure to modulate density");
2939 RNA_def_property_update(prop, 0, "rna_Brush_update");
2940
2941 prop = RNA_def_property(srna, "invert_density_pressure", PROP_BOOLEAN, PROP_NONE);
2943 RNA_def_property_ui_icon(prop, ICON_ARROW_LEFTRIGHT, 0);
2945 prop, "Invert Pressure for Density", "Invert the modulation of pressure in density");
2947 RNA_def_property_update(prop, 0, "rna_Brush_update");
2948
2949 prop = RNA_def_property(srna, "dash_ratio", PROP_FLOAT, PROP_FACTOR);
2950 RNA_def_property_float_sdna(prop, nullptr, "dash_ratio");
2951 RNA_def_property_range(prop, 0.0f, 1.0f);
2952 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
2954 prop, "Dash Ratio", "Ratio of samples in a cycle that the brush is enabled");
2955 RNA_def_property_update(prop, 0, "rna_Brush_update");
2956
2957 prop = RNA_def_property(srna, "dash_samples", PROP_INT, PROP_UNSIGNED);
2958 RNA_def_property_int_sdna(prop, nullptr, "dash_samples");
2959 RNA_def_property_range(prop, 1, 10000);
2960 RNA_def_property_ui_range(prop, 1, 10000, 5, -1);
2962 prop, "Dash Length", "Length of a dash cycle measured in stroke samples");
2963 RNA_def_property_update(prop, 0, "rna_Brush_update");
2964
2965 prop = RNA_def_property(srna, "plane_offset", PROP_FLOAT, PROP_DISTANCE);
2966 RNA_def_property_float_sdna(prop, nullptr, "plane_offset");
2968 RNA_def_property_range(prop, -2.0f, 2.0f);
2969 RNA_def_property_ui_range(prop, -0.5f, 0.5f, 0.001, 3);
2971 prop,
2972 "Plane Offset",
2973 "Adjust plane on which the brush acts towards or away from the object surface");
2974 RNA_def_property_update(prop, 0, "rna_Brush_update");
2975
2976 prop = RNA_def_property(srna, "plane_trim", PROP_FLOAT, PROP_DISTANCE);
2977 RNA_def_property_float_sdna(prop, nullptr, "plane_trim");
2978 RNA_def_property_range(prop, 0, 1.0f);
2980 prop,
2981 "Plane Trim",
2982 "If a vertex is further away from offset plane than this, then it is not affected");
2983 RNA_def_property_update(prop, 0, "rna_Brush_update");
2984
2985 prop = RNA_def_property(srna, "height", PROP_FLOAT, PROP_DISTANCE);
2986 RNA_def_property_float_sdna(prop, nullptr, "height");
2988 RNA_def_property_range(prop, 0, 1.0f);
2989 RNA_def_property_ui_range(prop, 0, 0.2f, 1, 3);
2991 prop,
2992 "Brush Height",
2993 "Affectable height of brush (i.e. the layer height for the layer tool)");
2994 RNA_def_property_update(prop, 0, "rna_Brush_update");
2995
2996 prop = RNA_def_property(srna, "texture_sample_bias", PROP_FLOAT, PROP_DISTANCE);
2997 RNA_def_property_float_sdna(prop, nullptr, "texture_sample_bias");
2999 RNA_def_property_range(prop, -1, 1);
3000 RNA_def_property_ui_text(prop, "Texture Sample Bias", "Value added to texture samples");
3001 RNA_def_property_update(prop, 0, "rna_Brush_update");
3002
3003 prop = RNA_def_property(srna, "use_color_as_displacement", PROP_BOOLEAN, PROP_NONE);
3006 prop,
3007 "Vector Displacement",
3008 "Handle each pixel color as individual vector for displacement (area plane mapping only)");
3009 RNA_def_property_update(prop, 0, "rna_Brush_update");
3010
3011 prop = RNA_def_property(srna, "normal_weight", PROP_FLOAT, PROP_FACTOR);
3012 RNA_def_property_float_sdna(prop, nullptr, "normal_weight");
3014 RNA_def_property_range(prop, 0.0f, 1.0f);
3016 prop, "Normal Weight", "How much grab will pull vertices out of surface during a grab");
3017 RNA_def_property_update(prop, 0, "rna_Brush_update");
3018
3019 prop = RNA_def_property(srna, "elastic_deform_volume_preservation", PROP_FLOAT, PROP_NONE);
3020 RNA_def_property_float_sdna(prop, nullptr, "elastic_deform_volume_preservation");
3021 RNA_def_property_range(prop, 0.0f, 0.9f);
3022 RNA_def_property_ui_range(prop, 0.0f, 0.9f, 0.01f, 3);
3024 "Volume Preservation",
3025 "Poisson ratio for elastic deformation. Higher values preserve volume "
3026 "more, but also lead to more bulging.");
3027 RNA_def_property_update(prop, 0, "rna_Brush_update");
3028
3029 prop = RNA_def_property(srna, "rake_factor", PROP_FLOAT, PROP_FACTOR);
3030 RNA_def_property_float_sdna(prop, nullptr, "rake_factor");
3032 RNA_def_property_range(prop, 0.0f, 10.0f);
3033 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
3034 RNA_def_property_ui_text(prop, "Rake", "How much grab will follow cursor rotation");
3035 RNA_def_property_update(prop, 0, "rna_Brush_update");
3036
3037 prop = RNA_def_property(srna, "crease_pinch_factor", PROP_FLOAT, PROP_FACTOR);
3038 RNA_def_property_float_sdna(prop, nullptr, "crease_pinch_factor");
3039 RNA_def_property_range(prop, 0.0f, 1.0f);
3040 RNA_def_property_ui_text(prop, "Crease Brush Pinch Factor", "How much the crease brush pinches");
3041 RNA_def_property_update(prop, 0, "rna_Brush_update");
3042
3043 prop = RNA_def_property(srna, "pose_offset", PROP_FLOAT, PROP_FACTOR);
3044 RNA_def_property_float_sdna(prop, nullptr, "pose_offset");
3045 RNA_def_property_range(prop, 0.0f, 2.0f);
3047 prop, "Pose Origin Offset", "Offset of the pose origin in relation to the brush radius");
3048 RNA_def_property_update(prop, 0, "rna_Brush_update");
3049
3050 prop = RNA_def_property(srna, "disconnected_distance_max", PROP_FLOAT, PROP_DISTANCE);
3051 RNA_def_property_float_sdna(prop, nullptr, "disconnected_distance_max");
3052 RNA_def_property_range(prop, 0.0f, 10.0f);
3054 "Max Element Distance",
3055 "Maximum distance to search for disconnected loose parts in the mesh");
3056 RNA_def_property_update(prop, 0, "rna_Brush_update");
3057
3058 prop = RNA_def_property(srna, "boundary_offset", PROP_FLOAT, PROP_FACTOR);
3059 RNA_def_property_float_sdna(prop, nullptr, "boundary_offset");
3060 RNA_def_property_range(prop, 0.0f, 30.0f);
3062 "Boundary Origin Offset",
3063 "Offset of the boundary origin in relation to the brush radius");
3064 RNA_def_property_update(prop, 0, "rna_Brush_update");
3065
3066 prop = RNA_def_property(srna, "surface_smooth_shape_preservation", PROP_FLOAT, PROP_FACTOR);
3067 RNA_def_property_float_sdna(prop, nullptr, "surface_smooth_shape_preservation");
3068 RNA_def_property_range(prop, 0.0f, 1.0f);
3070 prop, "Shape Preservation", "How much of the original shape is preserved when smoothing");
3071 RNA_def_property_update(prop, 0, "rna_Brush_update");
3072
3073 prop = RNA_def_property(srna, "surface_smooth_current_vertex", PROP_FLOAT, PROP_FACTOR);
3074 RNA_def_property_float_sdna(prop, nullptr, "surface_smooth_current_vertex");
3075 RNA_def_property_range(prop, 0.0f, 1.0f);
3077 prop,
3078 "Per Vertex Displacement",
3079 "How much the position of each individual vertex influences the final result");
3080 RNA_def_property_update(prop, 0, "rna_Brush_update");
3081
3082 prop = RNA_def_property(srna, "surface_smooth_iterations", PROP_INT, PROP_UNSIGNED);
3083 RNA_def_property_int_sdna(prop, nullptr, "surface_smooth_iterations");
3084 RNA_def_property_range(prop, 1, 10);
3085 RNA_def_property_ui_range(prop, 1, 10, 1, 3);
3086 RNA_def_property_ui_text(prop, "Iterations", "Number of smoothing iterations per brush step");
3087 RNA_def_property_update(prop, 0, "rna_Brush_update");
3088
3089 prop = RNA_def_property(srna, "multiplane_scrape_angle", PROP_FLOAT, PROP_FACTOR);
3090 RNA_def_property_float_sdna(prop, nullptr, "multiplane_scrape_angle");
3091 RNA_def_property_range(prop, 0.0f, 160.0f);
3092 RNA_def_property_ui_text(prop, "Plane Angle", "Angle between the planes of the crease");
3093 RNA_def_property_update(prop, 0, "rna_Brush_update");
3094
3095 prop = RNA_def_property(srna, "pose_smooth_iterations", PROP_INT, PROP_UNSIGNED);
3096 RNA_def_property_int_sdna(prop, nullptr, "pose_smooth_iterations");
3097 RNA_def_property_range(prop, 0, 100);
3099 prop,
3100 "Smooth Iterations",
3101 "Smooth iterations applied after calculating the pose factor of each vertex");
3102 RNA_def_property_update(prop, 0, "rna_Brush_update");
3103
3104 prop = RNA_def_property(srna, "pose_ik_segments", PROP_INT, PROP_UNSIGNED);
3105 RNA_def_property_int_sdna(prop, nullptr, "pose_ik_segments");
3106 RNA_def_property_range(prop, 1, 20);
3107 RNA_def_property_ui_range(prop, 1, 20, 1, 3);
3109 prop,
3110 "Pose IK Segments",
3111 "Number of segments of the inverse kinematics chain that will deform the mesh");
3112 RNA_def_property_update(prop, 0, "rna_Brush_update");
3113
3114 prop = RNA_def_property(srna, "tip_roundness", PROP_FLOAT, PROP_FACTOR);
3115 RNA_def_property_float_sdna(prop, nullptr, "tip_roundness");
3116 RNA_def_property_range(prop, 0.0f, 1.0f);
3117 RNA_def_property_ui_text(prop, "Tip Roundness", "Roundness of the brush tip");
3118 RNA_def_property_update(prop, 0, "rna_Brush_update");
3119
3120 prop = RNA_def_property(srna, "cloth_mass", PROP_FLOAT, PROP_FACTOR);
3121 RNA_def_property_float_sdna(prop, nullptr, "cloth_mass");
3122 RNA_def_property_range(prop, 0.01f, 2.0f);
3123 RNA_def_property_ui_text(prop, "Cloth Mass", "Mass of each simulation particle");
3124 RNA_def_property_update(prop, 0, "rna_Brush_update");
3125
3126 prop = RNA_def_property(srna, "cloth_damping", PROP_FLOAT, PROP_FACTOR);
3127 RNA_def_property_float_sdna(prop, nullptr, "cloth_damping");
3128 RNA_def_property_range(prop, 0.01f, 1.0f);
3130 prop, "Cloth Damping", "How much the applied forces are propagated through the cloth");
3131 RNA_def_property_update(prop, 0, "rna_Brush_update");
3132
3133 prop = RNA_def_property(srna, "cloth_sim_limit", PROP_FLOAT, PROP_FACTOR);
3134 RNA_def_property_float_sdna(prop, nullptr, "cloth_sim_limit");
3135 RNA_def_property_range(prop, 0.1f, 10.0f);
3137 prop,
3138 "Simulation Limit",
3139 "Factor added relative to the size of the radius to limit the cloth simulation effects");
3140 RNA_def_property_update(prop, 0, "rna_Brush_update");
3141
3142 prop = RNA_def_property(srna, "cloth_sim_falloff", PROP_FLOAT, PROP_FACTOR);
3143 RNA_def_property_float_sdna(prop, nullptr, "cloth_sim_falloff");
3144 RNA_def_property_range(prop, 0.0f, 1.0f);
3146 "Simulation Falloff",
3147 "Area to apply deformation falloff to the effects of the simulation");
3148 RNA_def_property_update(prop, 0, "rna_Brush_update");
3149
3150 prop = RNA_def_property(srna, "cloth_constraint_softbody_strength", PROP_FLOAT, PROP_FACTOR);
3151 RNA_def_property_float_sdna(prop, nullptr, "cloth_constraint_softbody_strength");
3152 RNA_def_property_range(prop, 0.0f, 1.0f);
3154 prop,
3155 "Soft Body Plasticity",
3156 "How much the cloth preserves the original shape, acting as a soft body");
3157 RNA_def_property_update(prop, 0, "rna_Brush_update");
3158
3159 prop = RNA_def_property(srna, "hardness", PROP_FLOAT, PROP_FACTOR);
3160 RNA_def_property_float_sdna(prop, nullptr, "hardness");
3161 RNA_def_property_range(prop, 0.0f, 1.0f);
3163 prop, "Hardness", "How close the brush falloff starts from the edge of the brush");
3164 RNA_def_property_update(prop, 0, "rna_Brush_update");
3165
3166 prop = RNA_def_property(
3167 srna, "automasking_boundary_edges_propagation_steps", PROP_INT, PROP_UNSIGNED);
3168 RNA_def_property_int_sdna(prop, nullptr, "automasking_boundary_edges_propagation_steps");
3172 "Propagation Steps",
3173 "Distance where boundary edge automasking is going to protect vertices "
3174 "from the fully masked edge");
3175 RNA_def_property_update(prop, 0, "rna_Brush_update");
3176
3177 prop = RNA_def_property(srna, "auto_smooth_factor", PROP_FLOAT, PROP_FACTOR);
3178 RNA_def_property_float_sdna(prop, nullptr, "autosmooth_factor");
3180 RNA_def_property_range(prop, 0.0f, 1.0f);
3181 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
3183 prop, "Auto-Smooth", "Amount of smoothing to automatically apply to each stroke");
3184 RNA_def_property_update(prop, 0, "rna_Brush_update");
3185
3186 prop = RNA_def_property(srna, "topology_rake_factor", PROP_FLOAT, PROP_FACTOR);
3187 RNA_def_property_float_sdna(prop, nullptr, "topology_rake_factor");
3189 RNA_def_property_range(prop, 0.0f, 1.0f);
3190 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
3192 "Topology Rake",
3193 "Automatically align edges to the brush direction to "
3194 "generate cleaner topology and define sharp features. "
3195 "Best used on low-poly meshes as it has a performance impact.");
3196 RNA_def_property_update(prop, 0, "rna_Brush_update");
3197
3198 prop = RNA_def_property(srna, "tilt_strength_factor", PROP_FLOAT, PROP_FACTOR);
3199 RNA_def_property_float_sdna(prop, nullptr, "tilt_strength_factor");
3201 RNA_def_property_range(prop, 0.0f, 1.0f);
3202 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
3204 prop, "Tilt Strength", "How much the tilt of the pen will affect the brush");
3205 RNA_def_property_update(prop, 0, "rna_Brush_update");
3206
3207 prop = RNA_def_property(srna, "normal_radius_factor", PROP_FLOAT, PROP_FACTOR);
3208 RNA_def_property_float_sdna(prop, nullptr, "normal_radius_factor");
3209 RNA_def_property_range(prop, 0.0f, 2.0f);
3210 RNA_def_property_ui_range(prop, 0.0f, 2.0f, 0.001, 3);
3212 "Normal Radius",
3213 "Ratio between the brush radius and the radius that is going to be "
3214 "used to sample the normal");
3215 RNA_def_property_update(prop, 0, "rna_Brush_update");
3216
3217 prop = RNA_def_property(srna, "area_radius_factor", PROP_FLOAT, PROP_FACTOR);
3218 RNA_def_property_float_sdna(prop, nullptr, "area_radius_factor");
3219 RNA_def_property_range(prop, 0.0f, 2.0f);
3220 RNA_def_property_ui_range(prop, 0.0f, 2.0f, 0.001, 3);
3222 "Area Radius",
3223 "Ratio between the brush radius and the radius that is going to be "
3224 "used to sample the area center");
3225 RNA_def_property_update(prop, 0, "rna_Brush_update");
3226
3227 prop = RNA_def_property(srna, "wet_paint_radius_factor", PROP_FLOAT, PROP_FACTOR);
3228 RNA_def_property_float_sdna(prop, nullptr, "wet_paint_radius_factor");
3229 RNA_def_property_range(prop, 0.0f, 2.0f);
3230 RNA_def_property_ui_range(prop, 0.0f, 2.0f, 0.001, 3);
3232 "Wet Paint Radius",
3233 "Ratio between the brush radius and the radius that is going to be "
3234 "used to sample the color to blend in wet paint");
3235 RNA_def_property_update(prop, 0, "rna_Brush_update");
3236
3237 prop = RNA_def_property(srna, "stencil_pos", PROP_FLOAT, PROP_XYZ);
3238 RNA_def_property_float_sdna(prop, nullptr, "stencil_pos");
3239 RNA_def_property_array(prop, 2);
3240 RNA_def_property_ui_text(prop, "Stencil Position", "Position of stencil in viewport");
3241 RNA_def_property_update(prop, 0, "rna_Brush_update");
3242
3243 prop = RNA_def_property(srna, "stencil_dimension", PROP_FLOAT, PROP_XYZ);
3244 RNA_def_property_float_sdna(prop, nullptr, "stencil_dimension");
3245 RNA_def_property_array(prop, 2);
3246 RNA_def_property_ui_text(prop, "Stencil Dimensions", "Dimensions of stencil in viewport");
3247 RNA_def_property_update(prop, 0, "rna_Brush_update");
3248
3249 prop = RNA_def_property(srna, "mask_stencil_pos", PROP_FLOAT, PROP_XYZ);
3250 RNA_def_property_float_sdna(prop, nullptr, "mask_stencil_pos");
3251 RNA_def_property_array(prop, 2);
3252 RNA_def_property_ui_text(prop, "Mask Stencil Position", "Position of mask stencil in viewport");
3253 RNA_def_property_update(prop, 0, "rna_Brush_update");
3254
3255 prop = RNA_def_property(srna, "mask_stencil_dimension", PROP_FLOAT, PROP_XYZ);
3256 RNA_def_property_float_sdna(prop, nullptr, "mask_stencil_dimension");
3257 RNA_def_property_array(prop, 2);
3259 prop, "Mask Stencil Dimensions", "Dimensions of mask stencil in viewport");
3260 RNA_def_property_update(prop, 0, "rna_Brush_update");
3261
3262 prop = RNA_def_property(srna, "sharp_threshold", PROP_FLOAT, PROP_NONE);
3263 RNA_def_property_range(prop, 0.0, 100.0);
3264 RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 3);
3265 RNA_def_property_float_sdna(prop, nullptr, "sharp_threshold");
3267 prop, "Sharp Threshold", "Threshold below which, no sharpening is done");
3268 RNA_def_property_update(prop, 0, "rna_Brush_update");
3269
3270 prop = RNA_def_property(srna, "fill_threshold", PROP_FLOAT, PROP_NONE);
3271 RNA_def_property_range(prop, 0.0, 100.0);
3272 RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 3);
3273 RNA_def_property_float_sdna(prop, nullptr, "fill_threshold");
3275 prop, "Fill Threshold", "Threshold above which filling is not propagated");
3276 RNA_def_property_update(prop, 0, "rna_Brush_update");
3277
3278 prop = RNA_def_property(srna, "blur_kernel_radius", PROP_INT, PROP_NONE);
3279 RNA_def_property_int_sdna(prop, nullptr, "blur_kernel_radius");
3280 RNA_def_property_range(prop, 1, 10000);
3281 RNA_def_property_ui_range(prop, 1, 50, 1, -1);
3283 prop, "Kernel Radius", "Radius of kernel used for soften and sharpen in pixels");
3284 RNA_def_property_update(prop, 0, "rna_Brush_update");
3285
3286 prop = RNA_def_property(srna, "blur_mode", PROP_ENUM, PROP_NONE);
3287 RNA_def_property_enum_items(prop, brush_blur_mode_items);
3288 RNA_def_property_ui_text(prop, "Blur Mode", "");
3289 RNA_def_property_update(prop, 0, "rna_Brush_update");
3290
3291 prop = RNA_def_property(srna, "falloff_angle", PROP_FLOAT, PROP_ANGLE);
3292 RNA_def_property_float_sdna(prop, nullptr, "falloff_angle");
3295 prop,
3296 "Falloff Angle",
3297 "Paint most on faces pointing towards the view according to this angle");
3298 RNA_def_property_update(prop, 0, "rna_Brush_update");
3299
3300 /* flag */
3301 prop = RNA_def_property(srna, "use_airbrush", PROP_BOOLEAN, PROP_NONE);
3302 RNA_def_property_boolean_sdna(prop, nullptr, "flag", BRUSH_AIRBRUSH);
3304 prop, "Airbrush", "Keep applying paint effect while holding mouse (spray)");
3305 RNA_def_property_update(prop, 0, "rna_Brush_update");
3306
3307 prop = RNA_def_property(srna, "use_original_normal", PROP_BOOLEAN, PROP_NONE);
3310 "Original Normal",
3311 "When locked keep using normal of surface where stroke was initiated");
3312 RNA_def_property_update(prop, 0, "rna_Brush_update");
3313
3314 prop = RNA_def_property(srna, "use_original_plane", PROP_BOOLEAN, PROP_NONE);
3317 prop,
3318 "Original Plane",
3319 "When locked keep using the plane origin of surface where stroke was initiated");
3320 RNA_def_property_update(prop, 0, "rna_Brush_update");
3321
3323 do {
3324 prop = RNA_def_property(srna, entry->identifier, PROP_BOOLEAN, PROP_NONE);
3325 RNA_def_property_boolean_sdna(prop, nullptr, "automasking_flags", entry->value);
3326 RNA_def_property_ui_text(prop, entry->name, entry->description);
3327
3328 if (entry->value == BRUSH_AUTOMASKING_CAVITY_NORMAL) {
3329 RNA_def_property_boolean_funcs(prop, nullptr, "rna_Brush_automasking_cavity_set");
3330 }
3331 else if (entry->value == BRUSH_AUTOMASKING_CAVITY_INVERTED) {
3332 RNA_def_property_boolean_funcs(prop, nullptr, "rna_Brush_automasking_invert_cavity_set");
3333 }
3334
3335 RNA_def_property_update(prop, 0, "rna_Brush_update");
3336 } while ((++entry)->identifier);
3337
3338 prop = RNA_def_property(srna, "automasking_cavity_factor", PROP_FLOAT, PROP_FACTOR);
3339 RNA_def_property_float_sdna(prop, nullptr, "automasking_cavity_factor");
3340 RNA_def_property_ui_text(prop, "Cavity Factor", "The contrast of the cavity mask");
3341 RNA_def_property_range(prop, 0.0f, 5.0f);
3342 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
3344 RNA_def_property_update(prop, 0, "rna_Brush_update");
3345
3346 prop = RNA_def_property(srna, "automasking_cavity_blur_steps", PROP_INT, PROP_NONE);
3347 RNA_def_property_int_sdna(prop, nullptr, "automasking_cavity_blur_steps");
3349 RNA_def_property_ui_text(prop, "Blur Steps", "The number of times the cavity mask is blurred");
3350 RNA_def_property_range(prop, 0, 25);
3351 RNA_def_property_ui_range(prop, 0, 10, 1, 1);
3353 RNA_def_property_update(prop, 0, "rna_Brush_update");
3354
3355 prop = RNA_def_property(srna, "automasking_cavity_curve", PROP_POINTER, PROP_NONE);
3356 RNA_def_property_pointer_sdna(prop, nullptr, "automasking_cavity_curve");
3357 RNA_def_property_struct_type(prop, "CurveMapping");
3358 RNA_def_property_ui_text(prop, "Cavity Curve", "Curve used for the sensitivity");
3361 RNA_def_property_update(prop, 0, "rna_Brush_update");
3362
3363 prop = RNA_def_property(srna, "use_automasking_start_normal", PROP_BOOLEAN, PROP_NONE);
3365 prop, nullptr, "automasking_flags", BRUSH_AUTOMASKING_BRUSH_NORMAL);
3367 prop,
3368 "Area Normal",
3369 "Affect only vertices with a similar normal to where the stroke starts");
3370 RNA_def_property_update(prop, 0, "rna_Brush_update");
3371
3372 prop = RNA_def_property(srna, "automasking_start_normal_limit", PROP_FLOAT, PROP_ANGLE);
3373 RNA_def_property_float_sdna(prop, nullptr, "automasking_start_normal_limit");
3374 RNA_def_property_range(prop, 0.0001f, M_PI);
3375 RNA_def_property_ui_text(prop, "Area Normal Limit", "The range of angles that will be affected");
3376 RNA_def_property_update(prop, 0, "rna_Brush_update");
3377
3378 prop = RNA_def_property(srna, "automasking_start_normal_falloff", PROP_FLOAT, PROP_FACTOR);
3379 RNA_def_property_float_sdna(prop, nullptr, "automasking_start_normal_falloff");
3380 RNA_def_property_range(prop, 0.0001f, 1.0f);
3382 prop, "Area Normal Falloff", "Extend the angular range with a falloff gradient");
3383 RNA_def_property_update(prop, 0, "rna_Brush_update");
3384
3385 prop = RNA_def_property(srna, "use_automasking_view_normal", PROP_BOOLEAN, PROP_NONE);
3386 RNA_def_property_boolean_sdna(prop, nullptr, "automasking_flags", BRUSH_AUTOMASKING_VIEW_NORMAL);
3388 prop, "View Normal", "Affect only vertices with a normal that faces the viewer");
3389 RNA_def_property_update(prop, 0, "rna_Brush_update");
3390
3391 prop = RNA_def_property(srna, "use_automasking_view_occlusion", PROP_BOOLEAN, PROP_NONE);
3393 prop, nullptr, "automasking_flags", BRUSH_AUTOMASKING_VIEW_OCCLUSION);
3395 prop,
3396 "Occlusion",
3397 "Only affect vertices that are not occluded by other faces (Slower performance)");
3398 RNA_def_property_update(prop, 0, "rna_Brush_update");
3399
3400 prop = RNA_def_property(srna, "automasking_view_normal_limit", PROP_FLOAT, PROP_ANGLE);
3401 RNA_def_property_float_sdna(prop, nullptr, "automasking_view_normal_limit");
3402 RNA_def_property_range(prop, 0.0001f, M_PI);
3403 RNA_def_property_ui_text(prop, "View Normal Limit", "The range of angles that will be affected");
3404 RNA_def_property_update(prop, 0, "rna_Brush_update");
3405
3406 prop = RNA_def_property(srna, "automasking_view_normal_falloff", PROP_FLOAT, PROP_FACTOR);
3407 RNA_def_property_float_sdna(prop, nullptr, "automasking_view_normal_falloff");
3408 RNA_def_property_range(prop, 0.0001f, 1.0f);
3410 prop, "View Normal Falloff", "Extend the angular range with a falloff gradient");
3411 RNA_def_property_update(prop, 0, "rna_Brush_update");
3412
3413 prop = RNA_def_property(srna, "use_scene_spacing", PROP_ENUM, PROP_NONE);
3414 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flag");
3415 RNA_def_property_enum_items(prop, brush_spacing_unit_items);
3417 prop, "Spacing Distance", "Calculate the brush spacing using view or scene distance");
3418 RNA_def_property_update(prop, 0, "rna_Brush_update");
3419
3420 prop = RNA_def_property(srna, "use_grab_active_vertex", PROP_BOOLEAN, PROP_NONE);
3423 prop,
3424 "Grab Active Vertex",
3425 "Apply the maximum grab strength to the active vertex instead of the cursor location");
3426 RNA_def_property_update(prop, 0, "rna_Brush_update");
3427
3428 prop = RNA_def_property(srna, "use_grab_silhouette", PROP_BOOLEAN, PROP_NONE);
3431 prop, "Grab Silhouette", "Grabs trying to automask the silhouette of the object");
3432 RNA_def_property_update(prop, 0, "rna_Brush_update");
3433
3434 prop = RNA_def_property(srna, "use_paint_antialiasing", PROP_BOOLEAN, PROP_NONE);
3435 RNA_def_property_boolean_sdna(prop, nullptr, "sampling_flag", BRUSH_PAINT_ANTIALIASING);
3436 RNA_def_property_ui_text(prop, "Anti-Aliasing", "Smooths the edges of the strokes");
3437 RNA_def_property_update(prop, 0, "rna_Brush_update");
3438
3439 prop = RNA_def_property(srna, "use_multiplane_scrape_dynamic", PROP_BOOLEAN, PROP_NONE);
3442 "Dynamic Mode",
3443 "The angle between the planes changes during the stroke to fit the "
3444 "surface under the cursor");
3445 RNA_def_property_update(prop, 0, "rna_Brush_update");
3446
3447 prop = RNA_def_property(srna, "show_multiplane_scrape_planes_preview", PROP_BOOLEAN, PROP_NONE);
3450 prop, "Show Cursor Preview", "Preview the scrape planes in the cursor during the stroke");
3451 RNA_def_property_update(prop, 0, "rna_Brush_update");
3452
3453 prop = RNA_def_property(srna, "use_pose_ik_anchored", PROP_BOOLEAN, PROP_NONE);
3456 prop, "Keep Anchor Point", "Keep the position of the last segment in the IK chain fixed");
3457 RNA_def_property_update(prop, 0, "rna_Brush_update");
3458
3459 prop = RNA_def_property(srna, "use_pose_lock_rotation", PROP_BOOLEAN, PROP_NONE);
3462 "Lock Rotation When Scaling",
3463 "Do not rotate the segment when using the scale deform mode");
3464 RNA_def_property_update(prop, 0, "rna_Brush_update");
3465
3466 prop = RNA_def_property(srna, "use_connected_only", PROP_BOOLEAN, PROP_NONE);
3468 RNA_def_property_ui_text(prop, "Connected Only", "Affect only topologically connected elements");
3469 RNA_def_property_update(prop, 0, "rna_Brush_update");
3470
3471 prop = RNA_def_property(srna, "use_cloth_pin_simulation_boundary", PROP_BOOLEAN, PROP_NONE);
3474 prop,
3475 "Pin Simulation Boundary",
3476 "Lock the position of the vertices in the simulation falloff area to avoid artifacts and "
3477 "create a softer transition with unaffected areas");
3478 RNA_def_property_update(prop, 0, "rna_Brush_update");
3479
3480 prop = RNA_def_property(srna, "use_cloth_collision", PROP_BOOLEAN, PROP_NONE);
3482 RNA_def_property_ui_text(prop, "Enable Collision", "Collide with objects during the simulation");
3483 RNA_def_property_update(prop, 0, "rna_Brush_update");
3484
3485 prop = RNA_def_property(srna, "invert_to_scrape_fill", PROP_BOOLEAN, PROP_NONE);
3488 "Invert to Scrape or Fill",
3489 "Use Scrape or Fill brush when inverting this brush instead of "
3490 "inverting its displacement direction");
3491 RNA_def_property_update(prop, 0, "rna_Brush_update");
3492
3493 prop = RNA_def_property(srna, "use_pressure_strength", PROP_BOOLEAN, PROP_NONE);
3495 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
3497 prop, "Strength Pressure", "Enable tablet pressure sensitivity for strength");
3498 RNA_def_property_update(prop, 0, "rna_Brush_update");
3499
3500 prop = RNA_def_property(srna, "use_offset_pressure", PROP_BOOLEAN, PROP_NONE);
3502 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
3504 prop, "Plane Offset Pressure", "Enable tablet pressure sensitivity for offset");
3505 RNA_def_property_update(prop, 0, "rna_Brush_update");
3506
3507 prop = RNA_def_property(srna, "use_pressure_area_radius", PROP_BOOLEAN, PROP_NONE);
3509 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
3511 prop, "Area Radius Pressure", "Enable tablet pressure sensitivity for area radius");
3512 RNA_def_property_update(prop, 0, "rna_Brush_update");
3513
3514 prop = RNA_def_property(srna, "use_pressure_size", PROP_BOOLEAN, PROP_NONE);
3515 RNA_def_property_boolean_sdna(prop, nullptr, "flag", BRUSH_SIZE_PRESSURE);
3516 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
3517 RNA_def_property_ui_text(prop, "Size Pressure", "Enable tablet pressure sensitivity for size");
3518 RNA_def_property_update(prop, 0, "rna_Brush_update");
3519
3520 prop = RNA_def_property(srna, "use_pressure_jitter", PROP_BOOLEAN, PROP_NONE);
3522 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
3524 prop, "Jitter Pressure", "Enable tablet pressure sensitivity for jitter");
3525 RNA_def_property_update(prop, 0, "rna_Brush_update");
3526
3527 prop = RNA_def_property(srna, "use_pressure_spacing", PROP_BOOLEAN, PROP_NONE);
3529 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
3531 prop, "Spacing Pressure", "Enable tablet pressure sensitivity for spacing");
3532 RNA_def_property_update(prop, 0, "rna_Brush_update");
3533
3534 prop = RNA_def_property(srna, "use_pressure_masking", PROP_ENUM, PROP_NONE);
3535 RNA_def_property_enum_sdna(prop, nullptr, "mask_pressure");
3536 RNA_def_property_enum_items(prop, brush_mask_pressure_items);
3538 prop, "Mask Pressure Mode", "Pen pressure makes texture influence smaller");
3539 RNA_def_property_update(prop, 0, "rna_Brush_update");
3540
3541 prop = RNA_def_property(srna, "use_inverse_smooth_pressure", PROP_BOOLEAN, PROP_NONE);
3543 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
3545 prop, "Inverse Smooth Pressure", "Lighter pressure causes more smoothing to be applied");
3546 RNA_def_property_update(prop, 0, "rna_Brush_update");
3547
3548 prop = RNA_def_property(srna, "use_plane_trim", PROP_BOOLEAN, PROP_NONE);
3549 RNA_def_property_boolean_sdna(prop, nullptr, "flag", BRUSH_PLANE_TRIM);
3551 prop,
3552 "Use Plane Trim",
3553 "Limit the distance from the offset plane that a vertex can be affected");
3554 RNA_def_property_update(prop, 0, "rna_Brush_update");
3555
3556 prop = RNA_def_property(srna, "use_frontface", PROP_BOOLEAN, PROP_NONE);
3557 RNA_def_property_boolean_sdna(prop, nullptr, "flag", BRUSH_FRONTFACE);
3559 prop, "Use Front-Face", "Brush only affects vertices that face the viewer");
3560 RNA_def_property_update(prop, 0, "rna_Brush_update");
3561
3562 prop = RNA_def_property(srna, "use_frontface_falloff", PROP_BOOLEAN, PROP_NONE);
3565 prop, "Use Front-Face Falloff", "Blend brush influence by how much they face the front");
3566 RNA_def_property_update(prop, 0, "rna_Brush_update");
3567
3568 prop = RNA_def_property(srna, "use_anchor", PROP_BOOLEAN, PROP_NONE);
3569 RNA_def_property_boolean_sdna(prop, nullptr, "flag", BRUSH_ANCHORED);
3570 RNA_def_property_ui_text(prop, "Anchored", "Keep the brush anchored to the initial location");
3571 RNA_def_property_update(prop, 0, "rna_Brush_update");
3572
3573 prop = RNA_def_property(srna, "use_space", PROP_BOOLEAN, PROP_NONE);
3574 RNA_def_property_boolean_sdna(prop, nullptr, "flag", BRUSH_SPACE);
3576 prop, "Space", "Limit brush application to the distance specified by spacing");
3577 RNA_def_property_update(prop, 0, "rna_Brush_update");
3578
3579 prop = RNA_def_property(srna, "use_line", PROP_BOOLEAN, PROP_NONE);
3580 RNA_def_property_boolean_sdna(prop, nullptr, "flag", BRUSH_LINE);
3581 RNA_def_property_ui_text(prop, "Line", "Draw a line with dabs separated according to spacing");
3582 RNA_def_property_update(prop, 0, "rna_Brush_update");
3583
3584 prop = RNA_def_property(srna, "use_curve", PROP_BOOLEAN, PROP_NONE);
3585 RNA_def_property_boolean_sdna(prop, nullptr, "flag", BRUSH_CURVE);
3587 prop,
3588 "Curve",
3589 "Define the stroke curve with a Bézier curve. Dabs are separated according to spacing.");
3590 RNA_def_property_update(prop, 0, "rna_Brush_update");
3591
3592 prop = RNA_def_property(srna, "use_smooth_stroke", PROP_BOOLEAN, PROP_NONE);
3593 RNA_def_property_boolean_sdna(prop, nullptr, "flag", BRUSH_SMOOTH_STROKE);
3595 prop, "Smooth Stroke", "Brush lags behind mouse and follows a smoother path");
3596 RNA_def_property_update(prop, 0, "rna_Brush_update");
3597
3598 prop = RNA_def_property(srna, "use_persistent", PROP_BOOLEAN, PROP_NONE);
3599 RNA_def_property_boolean_sdna(prop, nullptr, "flag", BRUSH_PERSISTENT);
3600 RNA_def_property_ui_text(prop, "Persistent", "Sculpt on a persistent layer of the mesh");
3601 RNA_def_property_update(prop, 0, "rna_Brush_update");
3602
3603 prop = RNA_def_property(srna, "use_accumulate", PROP_BOOLEAN, PROP_NONE);
3604 RNA_def_property_boolean_sdna(prop, nullptr, "flag", BRUSH_ACCUMULATE);
3605 RNA_def_property_ui_text(prop, "Accumulate", "Accumulate stroke daubs on top of each other");
3606 RNA_def_property_update(prop, 0, "rna_Brush_update");
3607
3608 prop = RNA_def_property(srna, "use_space_attenuation", PROP_BOOLEAN, PROP_NONE);
3609 RNA_def_property_boolean_sdna(prop, nullptr, "flag", BRUSH_SPACE_ATTEN);
3611 prop,
3612 "Adjust Strength for Spacing",
3613 "Automatically adjust strength to give consistent results for different spacings");
3614 RNA_def_property_update(prop, 0, "rna_Brush_update");
3615
3616 /* adaptive space is not implemented yet */
3617 prop = RNA_def_property(srna, "use_adaptive_space", PROP_BOOLEAN, PROP_NONE);
3620 "Adaptive Spacing",
3621 "Space daubs according to surface orientation instead of screen space");
3622 RNA_def_property_update(prop, 0, "rna_Brush_update");
3623
3624 prop = RNA_def_property(srna, "use_locked_size", PROP_ENUM, PROP_NONE); /* as an enum */
3625 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flag");
3626 RNA_def_property_enum_items(prop, brush_size_unit_items);
3628 prop, "Radius Unit", "Measure brush size relative to the view or the scene");
3629 RNA_def_property_update(prop, 0, "rna_Brush_update");
3630
3631 prop = RNA_def_property(srna, "color_type", PROP_ENUM, PROP_NONE); /* as an enum */
3632 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flag");
3633 RNA_def_property_enum_items(prop, color_gradient_items);
3634 RNA_def_property_enum_funcs(prop, nullptr, "rna_Brush_use_gradient_set", nullptr);
3635 RNA_def_property_ui_text(prop, "Color Type", "Use single color or gradient when painting");
3636 RNA_def_property_update(prop, 0, "rna_Brush_update");
3637
3638 prop = RNA_def_property(srna, "use_edge_to_edge", PROP_BOOLEAN, PROP_NONE);
3639 RNA_def_property_boolean_sdna(prop, nullptr, "flag", BRUSH_EDGE_TO_EDGE);
3640 RNA_def_property_ui_text(prop, "Edge-to-Edge", "Drag anchor brush from edge-to-edge");
3641 RNA_def_property_update(prop, 0, "rna_Brush_update");
3642
3643 prop = RNA_def_property(srna, "use_restore_mesh", PROP_BOOLEAN, PROP_NONE);
3644 RNA_def_property_boolean_sdna(prop, nullptr, "flag", BRUSH_DRAG_DOT);
3645 RNA_def_property_ui_text(prop, "Restore Mesh", "Allow a single dot to be carefully positioned");
3646 RNA_def_property_update(prop, 0, "rna_Brush_update");
3647
3648 /* only for projection paint & vertex paint, TODO: other paint modes. */
3649 prop = RNA_def_property(srna, "use_alpha", PROP_BOOLEAN, PROP_NONE);
3652 prop, "Affect Alpha", "When this is disabled, lock alpha while painting");
3653 RNA_def_property_update(prop, 0, "rna_Brush_update");
3654
3655 prop = RNA_def_property(srna, "curve", PROP_POINTER, PROP_NONE);
3657 RNA_def_property_ui_text(prop, "Curve", "Editable falloff curve");
3658 RNA_def_property_update(prop, 0, "rna_Brush_update");
3659
3660 prop = RNA_def_property(srna, "paint_curve", PROP_POINTER, PROP_NONE);
3662 RNA_def_property_ui_text(prop, "Paint Curve", "Active paint curve");
3663 RNA_def_property_update(prop, 0, "rna_Brush_update");
3664
3665 prop = RNA_def_property(srna, "gradient", PROP_POINTER, PROP_NEVER_NULL);
3666 RNA_def_property_pointer_sdna(prop, nullptr, "gradient");
3667 RNA_def_property_struct_type(prop, "ColorRamp");
3668 RNA_def_property_ui_text(prop, "Gradient", "");
3669 RNA_def_property_update(prop, 0, "rna_Brush_update");
3670
3671 /* gradient source */
3672 prop = RNA_def_property(srna, "gradient_stroke_mode", PROP_ENUM, PROP_NONE);
3673 RNA_def_property_enum_items(prop, brush_gradient_items);
3674 RNA_def_property_ui_text(prop, "Gradient Stroke Mode", "");
3675 RNA_def_property_update(prop, 0, "rna_Brush_update");
3676
3677 prop = RNA_def_property(srna, "gradient_fill_mode", PROP_ENUM, PROP_NONE);
3678 RNA_def_property_enum_items(prop, brush_gradient_fill_items);
3679 RNA_def_property_ui_text(prop, "Gradient Fill Mode", "");
3680 RNA_def_property_update(prop, 0, "rna_Brush_update");
3681
3682 /* overlay flags */
3683 prop = RNA_def_property(srna, "use_primary_overlay", PROP_BOOLEAN, PROP_NONE);
3684 RNA_def_property_boolean_sdna(prop, nullptr, "overlay_flags", BRUSH_OVERLAY_PRIMARY);
3685 RNA_def_property_ui_text(prop, "Use Texture Overlay", "Show texture in viewport");
3686 RNA_def_property_update(prop, 0, "rna_Brush_update");
3687
3688 prop = RNA_def_property(srna, "use_secondary_overlay", PROP_BOOLEAN, PROP_NONE);
3689 RNA_def_property_boolean_sdna(prop, nullptr, "overlay_flags", BRUSH_OVERLAY_SECONDARY);
3690 RNA_def_property_ui_text(prop, "Use Texture Overlay", "Show texture in viewport");
3691 RNA_def_property_update(prop, 0, "rna_Brush_update");
3692
3693 prop = RNA_def_property(srna, "use_cursor_overlay", PROP_BOOLEAN, PROP_NONE);
3694 RNA_def_property_boolean_sdna(prop, nullptr, "overlay_flags", BRUSH_OVERLAY_CURSOR);
3695 RNA_def_property_ui_text(prop, "Use Cursor Overlay", "Show cursor in viewport");
3696 RNA_def_property_update(prop, 0, "rna_Brush_update");
3697
3698 prop = RNA_def_property(srna, "use_cursor_overlay_override", PROP_BOOLEAN, PROP_NONE);
3700 prop, nullptr, "overlay_flags", BRUSH_OVERLAY_CURSOR_OVERRIDE_ON_STROKE);
3701 RNA_def_property_ui_text(prop, "Override Overlay", "Don't show overlay during a stroke");
3702 RNA_def_property_update(prop, 0, "rna_Brush_update");
3703
3704 prop = RNA_def_property(srna, "use_primary_overlay_override", PROP_BOOLEAN, PROP_NONE);
3706 prop, nullptr, "overlay_flags", BRUSH_OVERLAY_PRIMARY_OVERRIDE_ON_STROKE);
3707 RNA_def_property_ui_text(prop, "Override Overlay", "Don't show overlay during a stroke");
3708 RNA_def_property_update(prop, 0, "rna_Brush_update");
3709
3710 prop = RNA_def_property(srna, "use_secondary_overlay_override", PROP_BOOLEAN, PROP_NONE);
3712 prop, nullptr, "overlay_flags", BRUSH_OVERLAY_SECONDARY_OVERRIDE_ON_STROKE);
3713 RNA_def_property_ui_text(prop, "Override Overlay", "Don't show overlay during a stroke");
3714 RNA_def_property_update(prop, 0, "rna_Brush_update");
3715
3716 /* paint mode flags */
3717 prop = RNA_def_property(srna, "use_paint_sculpt", PROP_BOOLEAN, PROP_NONE);
3718 RNA_def_property_boolean_sdna(prop, nullptr, "ob_mode", OB_MODE_SCULPT);
3719 RNA_def_property_ui_text(prop, "Use Sculpt", "Use this brush in sculpt mode");
3720 RNA_def_property_update(prop, 0, "rna_Brush_update");
3721
3722 prop = RNA_def_property(srna, "use_paint_uv_sculpt", PROP_BOOLEAN, PROP_NONE);
3723 RNA_def_property_boolean_sdna(prop, nullptr, "ob_mode", OB_MODE_EDIT);
3724 RNA_def_property_ui_text(prop, "Use UV Sculpt", "Use this brush in UV sculpt mode");
3725 RNA_def_property_update(prop, 0, "rna_Brush_update");
3726
3727 prop = RNA_def_property(srna, "use_paint_vertex", PROP_BOOLEAN, PROP_NONE);
3728 RNA_def_property_boolean_sdna(prop, nullptr, "ob_mode", OB_MODE_VERTEX_PAINT);
3729 RNA_def_property_ui_text(prop, "Use Vertex", "Use this brush in vertex paint mode");
3730 RNA_def_property_update(prop, 0, "rna_Brush_update");
3731
3732 prop = RNA_def_property(srna, "use_paint_weight", PROP_BOOLEAN, PROP_NONE);
3733 RNA_def_property_boolean_sdna(prop, nullptr, "ob_mode", OB_MODE_WEIGHT_PAINT);
3734 RNA_def_property_ui_text(prop, "Use Weight", "Use this brush in weight paint mode");
3735 RNA_def_property_update(prop, 0, "rna_Brush_update");
3736
3737 prop = RNA_def_property(srna, "use_paint_image", PROP_BOOLEAN, PROP_NONE);
3738 RNA_def_property_boolean_sdna(prop, nullptr, "ob_mode", OB_MODE_TEXTURE_PAINT);
3739 RNA_def_property_ui_text(prop, "Use Texture", "Use this brush in texture paint mode");
3740 RNA_def_property_update(prop, 0, "rna_Brush_update");
3741
3742 prop = RNA_def_property(srna, "use_paint_grease_pencil", PROP_BOOLEAN, PROP_NONE);
3744 RNA_def_property_ui_text(prop, "Use Paint", "Use this brush in grease pencil drawing mode");
3745 RNA_def_property_update(prop, 0, "rna_Brush_update");
3746
3747 prop = RNA_def_property(srna, "use_vertex_grease_pencil", PROP_BOOLEAN, PROP_NONE);
3750 prop, "Use Vertex", "Use this brush in grease pencil vertex color mode");
3751 RNA_def_property_update(prop, 0, "rna_Brush_update");
3752
3753 prop = RNA_def_property(srna, "use_paint_sculpt_curves", PROP_BOOLEAN, PROP_NONE);
3754 RNA_def_property_boolean_sdna(prop, nullptr, "ob_mode", OB_MODE_SCULPT_CURVES);
3755 RNA_def_property_ui_text(prop, "Use Sculpt", "Use this brush in sculpt curves mode");
3756 RNA_def_property_update(prop, 0, "rna_Brush_update");
3757
3758 /* texture */
3759 prop = RNA_def_property(srna, "texture_slot", PROP_POINTER, PROP_NONE);
3760 RNA_def_property_struct_type(prop, "BrushTextureSlot");
3761 RNA_def_property_pointer_sdna(prop, nullptr, "mtex");
3763 RNA_def_property_ui_text(prop, "Texture Slot", "");
3764
3765 prop = RNA_def_property(srna, "texture", PROP_POINTER, PROP_NONE);
3766 RNA_def_property_pointer_sdna(prop, nullptr, "mtex.tex");
3768 RNA_def_property_ui_text(prop, "Texture", "");
3769 RNA_def_property_update(prop, NC_TEXTURE, "rna_Brush_main_tex_update");
3770
3771 prop = RNA_def_property(srna, "mask_texture_slot", PROP_POINTER, PROP_NONE);
3772 RNA_def_property_struct_type(prop, "BrushTextureSlot");
3773 RNA_def_property_pointer_sdna(prop, nullptr, "mask_mtex");
3775 RNA_def_property_ui_text(prop, "Mask Texture Slot", "");
3776
3777 prop = RNA_def_property(srna, "mask_texture", PROP_POINTER, PROP_NONE);
3778 RNA_def_property_pointer_sdna(prop, nullptr, "mask_mtex.tex");
3780 RNA_def_property_ui_text(prop, "Mask Texture", "");
3781 RNA_def_property_update(prop, NC_TEXTURE, "rna_Brush_secondary_tex_update");
3782
3783 prop = RNA_def_property(srna, "texture_overlay_alpha", PROP_INT, PROP_PERCENTAGE);
3784 RNA_def_property_int_sdna(prop, nullptr, "texture_overlay_alpha");
3785 RNA_def_property_range(prop, 0, 100);
3786 RNA_def_property_ui_text(prop, "Texture Overlay Alpha", "");
3787 RNA_def_property_update(prop, 0, "rna_Brush_update");
3788
3789 prop = RNA_def_property(srna, "mask_overlay_alpha", PROP_INT, PROP_PERCENTAGE);
3790 RNA_def_property_int_sdna(prop, nullptr, "mask_overlay_alpha");
3791 RNA_def_property_range(prop, 0, 100);
3792 RNA_def_property_ui_text(prop, "Mask Texture Overlay Alpha", "");
3793 RNA_def_property_update(prop, 0, "rna_Brush_update");
3794
3795 prop = RNA_def_property(srna, "cursor_overlay_alpha", PROP_INT, PROP_PERCENTAGE);
3796 RNA_def_property_int_sdna(prop, nullptr, "cursor_overlay_alpha");
3797 RNA_def_property_range(prop, 0, 100);
3798 RNA_def_property_ui_text(prop, "Mask Texture Overlay Alpha", "");
3799 RNA_def_property_update(prop, 0, "rna_Brush_update");
3800
3801 prop = RNA_def_property(srna, "cursor_color_add", PROP_FLOAT, PROP_COLOR_GAMMA);
3802 RNA_def_property_float_sdna(prop, nullptr, "add_col");
3803 RNA_def_property_array(prop, 4);
3804 RNA_def_property_ui_text(prop, "Add Color", "Color of cursor when adding");
3805 RNA_def_property_update(prop, 0, "rna_Brush_update");
3806
3807 prop = RNA_def_property(srna, "cursor_color_subtract", PROP_FLOAT, PROP_COLOR_GAMMA);
3808 RNA_def_property_float_sdna(prop, nullptr, "sub_col");
3809 RNA_def_property_array(prop, 4);
3810 RNA_def_property_ui_text(prop, "Subtract Color", "Color of cursor when subtracting");
3811 RNA_def_property_update(prop, 0, "rna_Brush_update");
3812
3813 prop = RNA_def_property(srna, "use_custom_icon", PROP_BOOLEAN, PROP_NONE);
3814 RNA_def_property_boolean_sdna(prop, nullptr, "flag", BRUSH_CUSTOM_ICON);
3815 RNA_def_property_ui_text(prop, "Custom Icon", "Set the brush icon from an image file");
3816 RNA_def_property_update(prop, 0, "rna_Brush_icon_update");
3817
3818 prop = RNA_def_property(srna, "icon_filepath", PROP_STRING, PROP_FILEPATH);
3819 RNA_def_property_string_sdna(prop, nullptr, "icon_filepath");
3820 RNA_def_property_ui_text(prop, "Brush Icon Filepath", "File path to brush icon");
3821 RNA_def_property_update(prop, 0, "rna_Brush_icon_update");
3822
3823 /* clone brush */
3824 prop = RNA_def_property(srna, "clone_image", PROP_POINTER, PROP_NONE);
3825 RNA_def_property_pointer_sdna(prop, nullptr, "clone.image");
3827 RNA_def_property_ui_text(prop, "Clone Image", "Image for clone brushes");
3828 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, "rna_Brush_update");
3829 RNA_def_property_pointer_funcs(prop, nullptr, nullptr, nullptr, "rna_Brush_imagetype_poll");
3830
3831 prop = RNA_def_property(srna, "clone_alpha", PROP_FLOAT, PROP_FACTOR);
3832 RNA_def_property_float_sdna(prop, nullptr, "clone.alpha");
3833 RNA_def_property_range(prop, 0.0f, 1.0f);
3834 RNA_def_property_ui_text(prop, "Clone Alpha", "Opacity of clone image display");
3835 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, "rna_Brush_update");
3836
3837 prop = RNA_def_property(srna, "clone_offset", PROP_FLOAT, PROP_XYZ);
3838 RNA_def_property_float_sdna(prop, nullptr, "clone.offset");
3839 RNA_def_property_ui_text(prop, "Clone Offset", "");
3840 RNA_def_property_ui_range(prop, -1.0f, 1.0f, 10.0f, 3);
3841 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, "rna_Brush_update");
3842
3843 prop = RNA_def_property(srna, "brush_capabilities", PROP_POINTER, PROP_NONE);
3845 RNA_def_property_struct_type(prop, "BrushCapabilities");
3846 RNA_def_property_pointer_funcs(prop, "rna_Brush_capabilities_get", nullptr, nullptr, nullptr);
3847 RNA_def_property_ui_text(prop, "Brush Capabilities", "Brush's capabilities");
3848
3849 /* brush capabilities (mode-dependent) */
3850 prop = RNA_def_property(srna, "sculpt_capabilities", PROP_POINTER, PROP_NONE);
3852 RNA_def_property_struct_type(prop, "BrushCapabilitiesSculpt");
3854 prop, "rna_Sculpt_brush_capabilities_get", nullptr, nullptr, nullptr);
3855 RNA_def_property_ui_text(prop, "Sculpt Capabilities", "");
3856
3857 prop = RNA_def_property(srna, "image_paint_capabilities", PROP_POINTER, PROP_NONE);
3859 RNA_def_property_struct_type(prop, "BrushCapabilitiesImagePaint");
3861 prop, "rna_Imapaint_brush_capabilities_get", nullptr, nullptr, nullptr);
3862 RNA_def_property_ui_text(prop, "Image Paint Capabilities", "");
3863
3864 prop = RNA_def_property(srna, "vertex_paint_capabilities", PROP_POINTER, PROP_NONE);
3866 RNA_def_property_struct_type(prop, "BrushCapabilitiesVertexPaint");
3868 prop, "rna_Vertexpaint_brush_capabilities_get", nullptr, nullptr, nullptr);
3869 RNA_def_property_ui_text(prop, "Vertex Paint Capabilities", "");
3870
3871 prop = RNA_def_property(srna, "weight_paint_capabilities", PROP_POINTER, PROP_NONE);
3873 RNA_def_property_struct_type(prop, "BrushCapabilitiesWeightPaint");
3875 prop, "rna_Weightpaint_brush_capabilities_get", nullptr, nullptr, nullptr);
3876 RNA_def_property_ui_text(prop, "Weight Paint Capabilities", "");
3877
3878 prop = RNA_def_property(srna, "gpencil_settings", PROP_POINTER, PROP_NONE);
3879 RNA_def_property_struct_type(prop, "BrushGpencilSettings");
3880 RNA_def_property_pointer_sdna(prop, nullptr, "gpencil_settings");
3882 RNA_def_property_ui_text(prop, "Gpencil Settings", "");
3883
3884 prop = RNA_def_property(srna, "curves_sculpt_settings", PROP_POINTER, PROP_NONE);
3885 RNA_def_property_struct_type(prop, "BrushCurvesSculptSettings");
3887 RNA_def_property_ui_text(prop, "Curves Sculpt Settings", "");
3888}
3889
3902{
3903 StructRNA *srna;
3904 PropertyRNA *prop;
3905
3906 srna = RNA_def_struct(brna, "OperatorStrokeElement", "PropertyGroup");
3907 RNA_def_struct_ui_text(srna, "Operator Stroke Element", "");
3908
3909 prop = RNA_def_property(srna, "location", PROP_FLOAT, PROP_XYZ);
3911 RNA_def_property_array(prop, 3);
3912 RNA_def_property_ui_text(prop, "Location", "");
3913
3914 prop = RNA_def_property(srna, "mouse", PROP_FLOAT, PROP_XYZ);
3916 RNA_def_property_array(prop, 2);
3917 RNA_def_property_ui_text(prop, "Mouse", "");
3918
3919 prop = RNA_def_property(srna, "mouse_event", PROP_FLOAT, PROP_XYZ);
3921 RNA_def_property_array(prop, 2);
3922 RNA_def_property_ui_text(prop, "Mouse Event", "");
3923
3924 prop = RNA_def_property(srna, "pressure", PROP_FLOAT, PROP_FACTOR);
3926 RNA_def_property_range(prop, 0.0f, 1.0f);
3927 RNA_def_property_ui_text(prop, "Pressure", "Tablet pressure");
3928
3929 prop = RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE);
3931 RNA_def_property_range(prop, 0.0f, FLT_MAX);
3932 RNA_def_property_ui_text(prop, "Brush Size", "Brush size in screen space");
3933
3934 prop = RNA_def_property(srna, "pen_flip", PROP_BOOLEAN, PROP_NONE);
3936 RNA_def_property_ui_text(prop, "Flip", "");
3937
3938 prop = RNA_def_property(srna, "x_tilt", PROP_FLOAT, PROP_FACTOR);
3940 RNA_def_property_range(prop, -1.0f, 1.0f);
3941 RNA_def_property_ui_text(prop, "Tilt X", "");
3942
3943 prop = RNA_def_property(srna, "y_tilt", PROP_FLOAT, PROP_FACTOR);
3945 RNA_def_property_range(prop, -1.0f, 1.0f);
3946 RNA_def_property_ui_text(prop, "Tilt Y", "");
3947
3948 /* used in uv painting */
3949 prop = RNA_def_property(srna, "time", PROP_FLOAT, PROP_UNSIGNED);
3951 RNA_def_property_ui_text(prop, "Time", "");
3952
3953 /* used for Grease Pencil sketching sessions */
3954 prop = RNA_def_property(srna, "is_start", PROP_BOOLEAN, PROP_NONE);
3956 RNA_def_property_ui_text(prop, "Is Stroke Start", "");
3957
3958 /* XXX: Tool (this will be for pressing a modifier key for a different brush,
3959 * e.g. switching to a Smooth brush in the middle of the stroke */
3960
3961 /* XXX: i don't think blender currently supports the ability to properly do a remappable modifier
3962 * in the middle of a stroke */
3963}
3964
3978
3979#endif
bool BKE_brush_sculpt_has_secondary_color(const Brush *brush)
Definition brush.cc:1101
void BKE_brush_scale_size(int *r_brush_size, float new_unprojected_radius, float old_unprojected_radius)
Definition brush.cc:1212
void BKE_brush_scale_unprojected_radius(float *unprojected_radius, int new_brush_size, int old_brush_size)
Definition brush.cc:1200
void BKE_brush_tag_unsaved_changes(Brush *brush)
Definition brush.cc:621
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_icon_id_delete(struct ID *id)
Definition icons.cc:451
void BKE_icon_changed(int icon_id)
Definition icons.cc:205
int BKE_icon_id_ensure(struct ID *id)
Definition icons.cc:268
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.
struct Material * BKE_object_material_get(struct Object *ob, short act)
void BKE_paint_invalidate_overlay_tex(Scene *scene, ViewLayer *view_layer, const Tex *tex)
Definition paint.cc:253
PaintMode
Definition BKE_paint.hh:99
@ SculptGreasePencil
PaintMode BKE_paintmode_get_active_from_context(const bContext *C)
Definition paint.cc:506
void BKE_paint_invalidate_overlay_all()
Definition paint.cc:286
void BKE_previewimg_id_free(ID *id)
#define M_PI_2
#define M_PI
#define BLI_STR_UTF8_DEGREE_SIGN
#define ELEM(...)
#define BLT_I18NCONTEXT_AMOUNT
#define BLT_I18NCONTEXT_ID_BRUSH
#define BLT_I18NCONTEXT_ID_CURVES
#define BLT_I18NCONTEXT_ID_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
@ 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_FILL
@ 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_FLATTEN
@ SCULPT_BRUSH_TYPE_SMOOTH
@ SCULPT_BRUSH_TYPE_PAINT
@ SCULPT_BRUSH_TYPE_DISPLACEMENT_ERASER
@ SCULPT_BRUSH_TYPE_SCRAPE
@ 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_OCCLUDE_ERASER
@ GP_BRUSH_USE_STRENGTH_PRESSURE
@ GP_BRUSH_GROUP_SETTINGS
@ GP_BRUSH_FILL_STROKE_COLLIDE
@ GP_BRUSH_MATERIAL_PINNED
@ GP_BRUSH_FILL_SHOW_EXTENDLINES
@ GP_BRUSH_FILL_FIT_DISABLE
@ GP_BRUSH_USE_JITTER_PRESSURE
@ GP_BRUSH_USE_PRESSURE
@ BRUSH_OFFSET_PRESSURE
@ BRUSH_ORIGINAL_NORMAL
@ BRUSH_ALPHA_PRESSURE
@ BRUSH_SPACE_ATTEN
@ BRUSH_LOCK_ALPHA
@ BRUSH_FRONTFACE
@ BRUSH_ADAPTIVE_SPACE
@ BRUSH_DRAG_DOT
@ BRUSH_SPACING_PRESSURE
@ BRUSH_LINE
@ BRUSH_CURVE
@ BRUSH_GRAB_ACTIVE_VERTEX
@ BRUSH_EDGE_TO_EDGE
@ BRUSH_SMOOTH_STROKE
@ BRUSH_ORIGINAL_PLANE
@ BRUSH_ACCUMULATE
@ BRUSH_DIR_IN
@ BRUSH_ANCHORED
@ BRUSH_FRONTFACE_FALLOFF
@ BRUSH_CUSTOM_ICON
@ BRUSH_JITTER_PRESSURE
@ BRUSH_PLANE_TRIM
@ BRUSH_LOCK_SIZE
@ BRUSH_INVERSE_SMOOTH_PRESSURE
@ BRUSH_ABSOLUTE_JITTER
@ BRUSH_USE_GRADIENT
@ BRUSH_SCENE_SPACING
@ BRUSH_PERSISTENT
@ BRUSH_SIZE_PRESSURE
@ BRUSH_AIRBRUSH
@ BRUSH_SPACE
@ BRUSH_INVERT_TO_SCRAPE_FILL
@ IMAGE_PAINT_BRUSH_TYPE_MASK
@ IMAGE_PAINT_BRUSH_TYPE_FILL
@ IMAGE_PAINT_BRUSH_TYPE_DRAW
@ IMAGE_PAINT_BRUSH_TYPE_CLONE
@ IMAGE_PAINT_BRUSH_TYPE_SOFTEN
@ IMAGE_PAINT_BRUSH_TYPE_SMEAR
@ BRUSH_CLOTH_DEFORM_DRAG
@ BRUSH_CLOTH_DEFORM_EXPAND
@ BRUSH_CLOTH_DEFORM_GRAB
@ BRUSH_CLOTH_DEFORM_PINCH_POINT
@ BRUSH_CLOTH_DEFORM_PUSH
@ BRUSH_CLOTH_DEFORM_INFLATE
@ BRUSH_CLOTH_DEFORM_SNAKE_HOOK
@ BRUSH_CLOTH_DEFORM_PINCH_PERPENDICULAR
#define SCULPT_BRUSH_TYPE_HAS_ACCUMULATE(t)
@ VPAINT_BRUSH_TYPE_AVERAGE
@ VPAINT_BRUSH_TYPE_DRAW
@ VPAINT_BRUSH_TYPE_SMEAR
@ VPAINT_BRUSH_TYPE_BLUR
#define SCULPT_BRUSH_TYPE_HAS_RAKE(t)
@ BRUSH_SNAKE_HOOK_DEFORM_ELASTIC
@ BRUSH_SNAKE_HOOK_DEFORM_FALLOFF
@ BRUSH_MASK_PRESSURE_RAMP
@ BRUSH_MASK_PRESSURE_CUTOFF
@ GP_BRUSH_ERASER_SOFT
@ GP_BRUSH_ERASER_STROKE
@ GP_BRUSH_ERASER_HARD
@ BRUSH_ELASTIC_DEFORM_SCALE
@ BRUSH_ELASTIC_DEFORM_GRAB
@ BRUSH_ELASTIC_DEFORM_TWIST
@ BRUSH_ELASTIC_DEFORM_GRAB_BISCALE
@ BRUSH_ELASTIC_DEFORM_GRAB_TRISCALE
@ BRUSH_GRADIENT_SPACING_CLAMP
@ BRUSH_GRADIENT_PRESSURE
@ BRUSH_GRADIENT_SPACING_REPEAT
@ PAINT_FALLOFF_SHAPE_TUBE
@ BRUSH_SMOOTH_DEFORM_SURFACE
@ BRUSH_SMOOTH_DEFORM_LAPLACIAN
@ BRUSH_PAINT_WET_MIX_PRESSURE
@ BRUSH_PAINT_HARDNESS_PRESSURE
@ BRUSH_PAINT_FLOW_PRESSURE
@ BRUSH_PAINT_DENSITY_PRESSURE
@ BRUSH_PAINT_WET_PERSISTENCE_PRESSURE
@ BRUSH_PAINT_WET_MIX_PRESSURE_INVERT
@ BRUSH_PAINT_HARDNESS_PRESSURE_INVERT
@ BRUSH_PAINT_FLOW_PRESSURE_INVERT
@ BRUSH_PAINT_DENSITY_PRESSURE_INVERT
@ BRUSH_PAINT_WET_PERSISTENCE_PRESSURE_INVERT
@ BRUSH_CURVES_SCULPT_FLAG_INTERPOLATE_POINT_COUNT
@ BRUSH_CURVES_SCULPT_FLAG_SCALE_UNIFORM
@ BRUSH_CURVES_SCULPT_FLAG_INTERPOLATE_RADIUS
@ BRUSH_CURVES_SCULPT_FLAG_INTERPOLATE_LENGTH
@ BRUSH_CURVES_SCULPT_FLAG_INTERPOLATE_SHAPE
@ BRUSH_OVERLAY_SECONDARY_OVERRIDE_ON_STROKE
@ BRUSH_OVERLAY_PRIMARY_OVERRIDE_ON_STROKE
@ BRUSH_OVERLAY_SECONDARY
@ BRUSH_OVERLAY_CURSOR
@ BRUSH_OVERLAY_CURSOR_OVERRIDE_ON_STROKE
@ BRUSH_OVERLAY_PRIMARY
@ BRUSH_GRADIENT_LINEAR
@ BRUSH_GRADIENT_RADIAL
#define MAX_BRUSH_PIXEL_RADIUS
@ BRUSH_BOUNDARY_DEFORM_GRAB
@ BRUSH_BOUNDARY_DEFORM_TWIST
@ BRUSH_BOUNDARY_DEFORM_BEND
@ BRUSH_BOUNDARY_DEFORM_EXPAND
@ BRUSH_BOUNDARY_DEFORM_INFLATE
@ BRUSH_BOUNDARY_DEFORM_SMOOTH
@ BRUSH_USE_COLOR_AS_DISPLACEMENT
@ BRUSH_GRAB_SILHOUETTE
@ BRUSH_CLOTH_PIN_SIMULATION_BOUNDARY
@ BRUSH_AREA_RADIUS_PRESSURE
@ BRUSH_MULTIPLANE_SCRAPE_PLANES_PREVIEW
@ BRUSH_MULTIPLANE_SCRAPE_DYNAMIC
@ BRUSH_USE_CONNECTED_ONLY
@ BRUSH_POSE_USE_LOCK_ROTATION
@ BRUSH_POSE_IK_ANCHORED
@ BRUSH_CLOTH_USE_COLLISION
@ BRUSH_CURVES_SCULPT_DENSITY_MODE_REMOVE
@ BRUSH_CURVES_SCULPT_DENSITY_MODE_ADD
@ BRUSH_CURVES_SCULPT_DENSITY_MODE_AUTO
BrushMaskTool
@ BRUSH_MASK_DRAW
@ BRUSH_MASK_SMOOTH
@ BRUSH_CLOTH_FORCE_FALLOFF_RADIAL
@ BRUSH_CLOTH_FORCE_FALLOFF_PLANE
@ GPWEIGHT_BRUSH_TYPE_AVERAGE
@ GPWEIGHT_BRUSH_TYPE_DRAW
@ GPWEIGHT_BRUSH_TYPE_SMEAR
@ GPWEIGHT_BRUSH_TYPE_BLUR
@ GPSCULPT_BRUSH_TYPE_SMOOTH
@ GPSCULPT_BRUSH_TYPE_PUSH
@ GPSCULPT_BRUSH_TYPE_CLONE
@ GPSCULPT_BRUSH_TYPE_TWIST
@ GPSCULPT_BRUSH_TYPE_RANDOMIZE
@ GPSCULPT_BRUSH_TYPE_GRAB
@ GPSCULPT_BRUSH_TYPE_PINCH
@ GPSCULPT_BRUSH_TYPE_THICKNESS
@ GPSCULPT_BRUSH_TYPE_STRENGTH
@ GPPAINT_MODE_STROKE
@ GPPAINT_MODE_FILL
@ GPPAINT_MODE_BOTH
@ GP_FILL_GPLMODE_ABOVE
@ GP_FILL_GPLMODE_ALL_ABOVE
@ GP_FILL_GPLMODE_VISIBLE
@ GP_FILL_GPLMODE_ALL_BELOW
@ GP_FILL_GPLMODE_BELOW
@ GP_FILL_GPLMODE_ACTIVE
#define SCULPT_BRUSH_TYPE_HAS_NORMAL_WEIGHT(t)
#define SCULPT_BRUSH_TYPE_HAS_TOPOLOGY_RAKE(t)
@ BRUSH_CLOTH_SIMULATION_AREA_LOCAL
@ BRUSH_CLOTH_SIMULATION_AREA_DYNAMIC
@ BRUSH_CLOTH_SIMULATION_AREA_GLOBAL
@ BRUSH_POSE_ORIGIN_FACE_SETS_FK
@ BRUSH_POSE_ORIGIN_TOPOLOGY
@ BRUSH_POSE_ORIGIN_FACE_SETS
@ BRUSH_SLIDE_DEFORM_DRAG
@ BRUSH_SLIDE_DEFORM_EXPAND
@ BRUSH_SLIDE_DEFORM_PINCH
@ BRUSH_BOUNDARY_FALLOFF_CONSTANT
@ BRUSH_BOUNDARY_FALLOFF_LOOP
@ BRUSH_BOUNDARY_FALLOFF_LOOP_INVERT
@ BRUSH_BOUNDARY_FALLOFF_RADIUS
@ SCULPT_DISP_DIR_VIEW
@ SCULPT_DISP_DIR_X
@ SCULPT_DISP_DIR_Z
@ SCULPT_DISP_DIR_Y
@ SCULPT_DISP_DIR_AREA
@ 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
@ IMA_TYPE_R_RESULT
@ IMA_TYPE_COMPOSITE
@ 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
Object is a sort of wrapper for general info.
#define PAINT_MAX_INPUT_SAMPLES
@ MTEX_MAP_MODE_AREA
@ MTEX_MAP_MODE_3D
@ MTEX_MAP_MODE_STENCIL
@ MTEX_MAP_MODE_TILED
@ MTEX_MAP_MODE_RANDOM
@ MTEX_MAP_MODE_VIEW
@ MTEX_ANGLE_RANDOM
@ MTEX_ANGLE_RAKE
@ IMB_BLEND_EXCLUSION
Definition IMB_imbuf.hh:206
@ IMB_BLEND_DIFFERENCE
Definition IMB_imbuf.hh:205
@ IMB_BLEND_HARDLIGHT
Definition IMB_imbuf.hh:196
@ IMB_BLEND_COLORBURN
Definition IMB_imbuf.hh:197
@ IMB_BLEND_COLORDODGE
Definition IMB_imbuf.hh:199
@ IMB_BLEND_ERASE_ALPHA
Definition IMB_imbuf.hh:193
@ IMB_BLEND_SCREEN
Definition IMB_imbuf.hh:200
@ IMB_BLEND_HUE
Definition IMB_imbuf.hh:207
@ IMB_BLEND_MUL
Definition IMB_imbuf.hh:190
@ IMB_BLEND_ADD_ALPHA
Definition IMB_imbuf.hh:194
@ IMB_BLEND_DARKEN
Definition IMB_imbuf.hh:192
@ IMB_BLEND_OVERLAY
Definition IMB_imbuf.hh:195
@ IMB_BLEND_SATURATION
Definition IMB_imbuf.hh:208
@ IMB_BLEND_VIVIDLIGHT
Definition IMB_imbuf.hh:203
@ IMB_BLEND_LUMINOSITY
Definition IMB_imbuf.hh:209
@ IMB_BLEND_LIGHTEN
Definition IMB_imbuf.hh:191
@ IMB_BLEND_SOFTLIGHT
Definition IMB_imbuf.hh:201
@ IMB_BLEND_COLOR
Definition IMB_imbuf.hh:210
@ IMB_BLEND_LINEARLIGHT
Definition IMB_imbuf.hh:204
@ IMB_BLEND_PINLIGHT
Definition IMB_imbuf.hh:202
@ IMB_BLEND_MIX
Definition IMB_imbuf.hh:187
@ IMB_BLEND_ADD
Definition IMB_imbuf.hh:188
@ IMB_BLEND_SUB
Definition IMB_imbuf.hh:189
@ IMB_BLEND_LINEARBURN
Definition IMB_imbuf.hh:198
Read Guarded memory(de)allocation.
ParameterFlag
Definition RNA_types.hh:396
@ PROP_FLOAT
Definition RNA_types.hh:67
@ PROP_BOOLEAN
Definition RNA_types.hh:65
@ PROP_ENUM
Definition RNA_types.hh:69
@ PROP_INT
Definition RNA_types.hh:66
@ PROP_STRING
Definition RNA_types.hh:68
@ PROP_POINTER
Definition RNA_types.hh:70
#define RNA_ENUM_ITEM_SEPR
Definition RNA_types.hh:528
@ PROPOVERRIDE_OVERRIDABLE_LIBRARY
Definition RNA_types.hh:355
@ PROP_CONTEXT_UPDATE
Definition RNA_types.hh:296
@ PROP_ANIMATABLE
Definition RNA_types.hh:220
@ PROP_EDITABLE
Definition RNA_types.hh:207
@ PROP_NEVER_NULL
Definition RNA_types.hh:266
@ PROP_ID_SELF_CHECK
Definition RNA_types.hh:259
@ PROP_IDPROPERTY
Definition RNA_types.hh:315
@ PROP_XYZ
Definition RNA_types.hh:172
@ PROP_DISTANCE
Definition RNA_types.hh:159
@ PROP_PIXEL
Definition RNA_types.hh:151
@ PROP_ANGLE
Definition RNA_types.hh:155
@ PROP_NONE
Definition RNA_types.hh:136
@ PROP_PERCENTAGE
Definition RNA_types.hh:153
@ PROP_FACTOR
Definition RNA_types.hh:154
@ PROP_COLOR_GAMMA
Definition RNA_types.hh:175
@ PROP_UNSIGNED
Definition RNA_types.hh:152
@ PROP_FILEPATH
Definition RNA_types.hh:139
@ BIFICONID_LAST_STATIC
#define NC_BRUSH
Definition WM_types.hh:352
#define ND_DATA
Definition WM_types.hh:475
#define ND_SPACE_PROPERTIES
Definition WM_types.hh:495
#define NC_SCENE
Definition WM_types.hh:345
#define ND_TOOLSETTINGS
Definition WM_types.hh:416
#define ND_SPACE_IMAGE
Definition WM_types.hh:488
#define NA_EDITED
Definition WM_types.hh:550
#define NC_GPENCIL
Definition WM_types.hh:366
#define NC_TEXTURE
Definition WM_types.hh:348
#define NC_SPACE
Definition WM_types.hh:359
draw_view push_constant(Type::INT, "radiance_src") .push_constant(Type capture_info_buf storage_buf(1, Qualifier::READ, "ObjectBounds", "bounds_buf[]") .push_constant(Type draw_view int
void IMB_freeImBuf(ImBuf *)
PointerRNA rna_pointer_inherit_refine(const PointerRNA *ptr, StructRNA *type, void *data)
#define TEXTURE_CAPABILITY(prop_name_, ui_name_)
static EnumPropertyItem rna_enum_gpencil_brush_eraser_modes_items[]
Definition rna_brush.cc:335
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:370
static const EnumPropertyItem sculpt_stroke_method_items[]
Definition rna_brush.cc:53
const EnumPropertyItem rna_enum_brush_weight_brush_type_items[]
Definition rna_brush.cc:206
static void rna_def_curves_sculpt_options(BlenderRNA *brna)
static EnumPropertyItem rna_enum_gpencil_fill_layers_modes_items[]
Definition rna_brush.cc:361
#define VPAINT_BRUSH_CAPABILITY(prop_name_, ui_name_)
const EnumPropertyItem rna_enum_brush_gpencil_sculpt_types_items[]
Definition rna_brush.cc:269
#define BRUSH_CAPABILITY(prop_name_, ui_name_)
static EnumPropertyItem rna_enum_gpencil_fill_draw_modes_items[]
Definition rna_brush.cc:346
void RNA_def_brush(BlenderRNA *brna)
const EnumPropertyItem rna_enum_brush_image_brush_type_items[]
Definition rna_brush.cc:214
const EnumPropertyItem rna_enum_brush_automasking_flag_items[]
Definition rna_brush.cc:113
static void rna_def_brush(BlenderRNA *brna)
static const EnumPropertyItem prop_direction_items[]
Definition rna_brush.cc:35
const EnumPropertyItem rna_enum_brush_sculpt_brush_type_items[]
Definition rna_brush.cc:151
static const EnumPropertyItem rna_enum_brush_texture_slot_map_all_mode_items[]
Definition rna_brush.cc:76
const EnumPropertyItem rna_enum_brush_gpencil_vertex_types_items[]
Definition rna_brush.cc:244
static EnumPropertyItem rna_enum_gpencil_brush_modes_items[]
Definition rna_brush.cc:376
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:305
const EnumPropertyItem rna_enum_brush_curve_preset_items[]
Definition rna_brush.cc:97
const EnumPropertyItem rna_enum_brush_vertex_brush_type_items[]
Definition rna_brush.cc:198
static void rna_def_brush_texture_slot(BlenderRNA *brna)
const EnumPropertyItem rna_enum_brush_gpencil_types_items[]
Definition rna_brush.cc:224
static void rna_def_weight_paint_capabilities(BlenderRNA *brna)
static EnumPropertyItem rna_enum_gpencil_fill_extend_modes_items[]
Definition rna_brush.cc:356
static void rna_def_brush_capabilities(BlenderRNA *brna)
const EnumPropertyItem rna_enum_brush_curves_sculpt_brush_type_items[]
Definition rna_brush.cc:317
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_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t bit)
void RNA_def_parameter_clear_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
void RNA_def_property_float_default(PropertyRNA *prop, float value)
void RNA_def_property_float_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
void RNA_def_property_string_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_ui_icon(PropertyRNA *prop, int icon, int consecutive)
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
void RNA_def_property_boolean_default(PropertyRNA *prop, bool value)
void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const char *set)
void RNA_def_property_int_default(PropertyRNA *prop, int value)
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
void RNA_def_property_array(PropertyRNA *prop, int length)
void RNA_def_property_range(PropertyRNA *prop, double min, double max)
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *func)
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier, int type, int subtype)
void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char *set, const char *item)
void RNA_def_property_enum_bitflag_sdna(PropertyRNA *prop, const char *structname, const char *propname)
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_property_pointer_funcs(PropertyRNA *prop, const char *get, const char *set, const char *type_fn, const char *poll)
void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_int_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
void RNA_def_struct_ui_icon(StructRNA *srna, int icon)
void RNA_def_property_translation_context(PropertyRNA *prop, const char *context)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double step, int precision)
void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_boolean_negative_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
void RNA_def_struct_nested(BlenderRNA *brna, StructRNA *srna, const char *structname)
void RNA_def_property_override_flag(PropertyRNA *prop, PropertyOverrideFlag flag)
void rna_TextureSlot_update(bContext *C, PointerRNA *ptr)
const EnumPropertyItem rna_enum_dummy_DEFAULT_items[]
Definition rna_rna.cc:35
#define FLT_MAX
Definition stdcycles.h:14
#define INT32_MAX
Definition stdint.h:137
char sculpt_brush_type
float unprojected_radius
char gpencil_sculpt_brush_type
char image_brush_type
char gpencil_weight_brush_type
char curves_sculpt_brush_type
char mask_tool
const char * identifier
Definition RNA_types.hh:506
const char * name
Definition RNA_types.hh:510
const char * description
Definition RNA_types.hh:512
Definition DNA_ID.h:413
struct Tex * tex
ID * owner_id
Definition RNA_types.hh:40
void * data
Definition RNA_types.hh:42
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:4126