2 * This program is free software; you can redistribute it and/or
3 * modify it under the terms of the GNU General Public License
4 * as published by the Free Software Foundation; either version 2
5 * of the License, or (at your option) any later version.
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software Foundation,
14 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23 #include "DNA_brush_types.h"
24 #include "DNA_gpencil_types.h"
25 #include "DNA_material_types.h"
26 #include "DNA_object_types.h"
27 #include "DNA_scene_types.h"
28 #include "DNA_texture_types.h"
29 #include "DNA_workspace_types.h"
33 #include "RNA_define.h"
34 #include "RNA_enum_types.h"
36 #include "rna_internal.h"
38 #include "IMB_imbuf.h"
42 static const EnumPropertyItem prop_direction_items[] = {
43 {0, "ADD", ICON_ADD, "Add", "Add effect of brush"},
44 {BRUSH_DIR_IN, "SUBTRACT", ICON_REMOVE, "Subtract", "Subtract effect of brush"},
45 {0, NULL, 0, NULL, NULL},
49 static const EnumPropertyItem prop_smooth_direction_items[] = {
50 {0, "SMOOTH", ICON_ADD, "Smooth", "Smooth the surfae"},
55 "Enhance the surface detail"},
56 {0, NULL, 0, NULL, NULL},
60 static const EnumPropertyItem sculpt_stroke_method_items[] = {
61 {0, "DOTS", 0, "Dots", "Apply paint on each mouse move step"},
62 {BRUSH_DRAG_DOT, "DRAG_DOT", 0, "Drag Dot", "Allows a single dot to be carefully positioned"},
67 "Limit brush application to the distance specified by spacing"},
72 "Keep applying paint effect while holding mouse (spray)"},
73 {BRUSH_ANCHORED, "ANCHORED", 0, "Anchored", "Keep the brush anchored to the initial location"},
74 {BRUSH_LINE, "LINE", 0, "Line", "Draw a line with dabs separated according to spacing"},
79 "Define the stroke curve with a bezier curve (dabs are separated according to spacing)"},
80 {0, NULL, 0, NULL, NULL},
83 static const EnumPropertyItem rna_enum_brush_texture_slot_map_all_mode_items[] = {
84 {MTEX_MAP_MODE_VIEW, "VIEW_PLANE", 0, "View Plane", ""},
85 {MTEX_MAP_MODE_AREA, "AREA_PLANE", 0, "Area Plane", ""},
86 {MTEX_MAP_MODE_TILED, "TILED", 0, "Tiled", ""},
87 {MTEX_MAP_MODE_3D, "3D", 0, "3D", ""},
88 {MTEX_MAP_MODE_RANDOM, "RANDOM", 0, "Random", ""},
89 {MTEX_MAP_MODE_STENCIL, "STENCIL", 0, "Stencil", ""},
90 {0, NULL, 0, NULL, NULL},
94 static const EnumPropertyItem rna_enum_brush_texture_slot_map_texture_mode_items[] = {
95 {MTEX_MAP_MODE_VIEW, "VIEW_PLANE", 0, "View Plane", ""},
96 {MTEX_MAP_MODE_TILED, "TILED", 0, "Tiled", ""},
97 {MTEX_MAP_MODE_3D, "3D", 0, "3D", ""},
98 {MTEX_MAP_MODE_RANDOM, "RANDOM", 0, "Random", ""},
99 {MTEX_MAP_MODE_STENCIL, "STENCIL", 0, "Stencil", ""},
100 {0, NULL, 0, NULL, NULL},
104 /* clang-format off */
105 const EnumPropertyItem rna_enum_brush_sculpt_tool_items[] = {
106 {SCULPT_TOOL_DRAW, "DRAW", ICON_BRUSH_SCULPT_DRAW, "Draw", ""},
107 {SCULPT_TOOL_DRAW_SHARP, "DRAW_SHARP", ICON_BRUSH_SCULPT_DRAW, "Draw Sharp", ""},
108 {SCULPT_TOOL_CLAY, "CLAY", ICON_BRUSH_CLAY, "Clay", ""},
109 {SCULPT_TOOL_CLAY_STRIPS, "CLAY_STRIPS", ICON_BRUSH_CLAY_STRIPS, "Clay Strips", ""},
110 {SCULPT_TOOL_CLAY_THUMB, "CLAY_THUMB", ICON_BRUSH_CLAY_STRIPS, "Clay Thumb", ""},
111 {SCULPT_TOOL_LAYER, "LAYER", ICON_BRUSH_LAYER, "Layer", ""},
112 {SCULPT_TOOL_INFLATE, "INFLATE", ICON_BRUSH_INFLATE, "Inflate", ""},
113 {SCULPT_TOOL_BLOB, "BLOB", ICON_BRUSH_BLOB, "Blob", ""},
114 {SCULPT_TOOL_CREASE, "CREASE", ICON_BRUSH_CREASE, "Crease", ""},
115 {0, "", 0, NULL, NULL},
116 {SCULPT_TOOL_SMOOTH, "SMOOTH", ICON_BRUSH_SMOOTH, "Smooth", ""},
117 {SCULPT_TOOL_FLATTEN, "FLATTEN", ICON_BRUSH_FLATTEN, "Flatten", ""},
118 {SCULPT_TOOL_FILL, "FILL", ICON_BRUSH_FILL, "Fill", ""},
119 {SCULPT_TOOL_SCRAPE, "SCRAPE", ICON_BRUSH_SCRAPE, "Scrape", ""},
120 {SCULPT_TOOL_MULTIPLANE_SCRAPE, "MULTIPLANE_SCRAPE", ICON_BRUSH_SCRAPE, "Multi-plane Scrape", ""},
121 {SCULPT_TOOL_PINCH, "PINCH", ICON_BRUSH_PINCH, "Pinch", ""},
122 {0, "", 0, NULL, NULL},
123 {SCULPT_TOOL_GRAB, "GRAB", ICON_BRUSH_GRAB, "Grab", ""},
124 {SCULPT_TOOL_ELASTIC_DEFORM, "ELASTIC_DEFORM", ICON_BRUSH_GRAB, "Elastic Deform", ""},
125 {SCULPT_TOOL_SNAKE_HOOK, "SNAKE_HOOK", ICON_BRUSH_SNAKE_HOOK, "Snake Hook", ""},
126 {SCULPT_TOOL_THUMB, "THUMB", ICON_BRUSH_THUMB, "Thumb", ""},
127 {SCULPT_TOOL_POSE, "POSE", ICON_BRUSH_GRAB, "Pose", ""},
128 {SCULPT_TOOL_NUDGE, "NUDGE", ICON_BRUSH_NUDGE, "Nudge", ""},
129 {SCULPT_TOOL_ROTATE, "ROTATE", ICON_BRUSH_ROTATE, "Rotate", ""},
130 {SCULPT_TOOL_SLIDE_RELAX, "TOPOLOGY", ICON_BRUSH_GRAB, "Slide Relax", ""},
131 {SCULPT_TOOL_BOUNDARY, "BOUNDARY", ICON_BRUSH_GRAB, "Boundary", ""},
132 {0, "", 0, NULL, NULL},
133 {SCULPT_TOOL_CLOTH, "CLOTH", ICON_BRUSH_SCULPT_DRAW, "Cloth", ""},
134 {SCULPT_TOOL_SIMPLIFY, "SIMPLIFY", ICON_BRUSH_DATA, "Simplify", ""},
135 {SCULPT_TOOL_MASK, "MASK", ICON_BRUSH_MASK, "Mask", ""},
136 {SCULPT_TOOL_DISPLACEMENT_ERASER, "DISPLACEMENT_ERASER", ICON_BRUSH_SCULPT_DRAW, "Multires Displacement Eraser", ""},
137 {SCULPT_TOOL_DISPLACEMENT_SMEAR, "DISPLACEMENT_SMEAR", ICON_BRUSH_SCULPT_DRAW, "Multires Displacement Smear", ""},
138 {SCULPT_TOOL_PAINT, "PAINT", ICON_BRUSH_SCULPT_DRAW, "Paint", ""},
139 {SCULPT_TOOL_SMEAR, "SMEAR", ICON_BRUSH_SCULPT_DRAW, "Smear", ""},
140 {SCULPT_TOOL_DRAW_FACE_SETS, "DRAW_FACE_SETS", ICON_BRUSH_MASK, "Draw Face Sets", ""},
141 {0, NULL, 0, NULL, NULL},
143 /* clang-format on */
145 const EnumPropertyItem rna_enum_brush_uv_sculpt_tool_items[] = {
146 {UV_SCULPT_TOOL_GRAB, "GRAB", 0, "Grab", "Grab UVs"},
147 {UV_SCULPT_TOOL_RELAX, "RELAX", 0, "Relax", "Relax UVs"},
148 {UV_SCULPT_TOOL_PINCH, "PINCH", 0, "Pinch", "Pinch UVs"},
149 {0, NULL, 0, NULL, NULL},
152 const EnumPropertyItem rna_enum_brush_vertex_tool_items[] = {
153 {VPAINT_TOOL_DRAW, "DRAW", ICON_BRUSH_MIX, "Draw", ""},
154 {VPAINT_TOOL_BLUR, "BLUR", ICON_BRUSH_BLUR, "Blur", ""},
155 {VPAINT_TOOL_AVERAGE, "AVERAGE", ICON_BRUSH_BLUR, "Average", ""},
156 {VPAINT_TOOL_SMEAR, "SMEAR", ICON_BRUSH_BLUR, "Smear", ""},
157 {0, NULL, 0, NULL, NULL},
160 const EnumPropertyItem rna_enum_brush_weight_tool_items[] = {
161 {WPAINT_TOOL_DRAW, "DRAW", ICON_BRUSH_MIX, "Draw", ""},
162 {WPAINT_TOOL_BLUR, "BLUR", ICON_BRUSH_BLUR, "Blur", ""},
163 {WPAINT_TOOL_AVERAGE, "AVERAGE", ICON_BRUSH_BLUR, "Average", ""},
164 {WPAINT_TOOL_SMEAR, "SMEAR", ICON_BRUSH_BLUR, "Smear", ""},
165 {0, NULL, 0, NULL, NULL},
168 const EnumPropertyItem rna_enum_brush_image_tool_items[] = {
169 {PAINT_TOOL_DRAW, "DRAW", ICON_BRUSH_TEXDRAW, "Draw", ""},
170 {PAINT_TOOL_SOFTEN, "SOFTEN", ICON_BRUSH_SOFTEN, "Soften", ""},
171 {PAINT_TOOL_SMEAR, "SMEAR", ICON_BRUSH_SMEAR, "Smear", ""},
172 {PAINT_TOOL_CLONE, "CLONE", ICON_BRUSH_CLONE, "Clone", ""},
173 {PAINT_TOOL_FILL, "FILL", ICON_BRUSH_TEXFILL, "Fill", ""},
174 {PAINT_TOOL_MASK, "MASK", ICON_BRUSH_TEXMASK, "Mask", ""},
175 {0, NULL, 0, NULL, NULL},
178 const EnumPropertyItem rna_enum_brush_gpencil_types_items[] = {
183 "The brush is of type used for drawing strokes"},
184 {GPAINT_TOOL_FILL, "FILL", ICON_COLOR, "Fill", "The brush is of type used for filling areas"},
189 "The brush is used for erasing strokes"},
194 "The brush is of type used for tinting strokes"},
195 {0, NULL, 0, NULL, NULL},
198 const EnumPropertyItem rna_enum_brush_gpencil_vertex_types_items[] = {
199 {GPVERTEX_TOOL_DRAW, "DRAW", ICON_BRUSH_MIX, "Draw", ""},
200 {GPVERTEX_TOOL_BLUR, "BLUR", ICON_BRUSH_BLUR, "Blur", ""},
201 {GPVERTEX_TOOL_AVERAGE, "AVERAGE", ICON_BRUSH_BLUR, "Average", ""},
202 {GPVERTEX_TOOL_SMEAR, "SMEAR", ICON_BRUSH_BLUR, "Smear", ""},
203 {GPVERTEX_TOOL_REPLACE, "REPLACE", ICON_BRUSH_BLUR, "Replace", ""},
204 {0, NULL, 0, NULL, NULL},
207 const EnumPropertyItem rna_enum_brush_gpencil_sculpt_types_items[] = {
208 {GPSCULPT_TOOL_SMOOTH, "SMOOTH", ICON_GPBRUSH_SMOOTH, "Smooth", "Smooth stroke points"},
209 {GPSCULPT_TOOL_THICKNESS,
211 ICON_GPBRUSH_THICKNESS,
213 "Adjust thickness of strokes"},
214 {GPSCULPT_TOOL_STRENGTH,
216 ICON_GPBRUSH_STRENGTH,
218 "Adjust color strength of strokes"},
219 {GPSCULPT_TOOL_RANDOMIZE,
221 ICON_GPBRUSH_RANDOMIZE,
223 "Introduce jitter/randomness into strokes"},
228 "Translate the set of points initially within the brush circle"},
233 "Move points out of the way, as if combing them"},
234 {GPSCULPT_TOOL_TWIST,
238 "Rotate points around the midpoint of the brush"},
239 {GPSCULPT_TOOL_PINCH,
243 "Pull points towards the midpoint of the brush"},
244 {GPSCULPT_TOOL_CLONE,
248 "Paste copies of the strokes stored on the clipboard"},
249 {0, NULL, 0, NULL, NULL}};
251 const EnumPropertyItem rna_enum_brush_gpencil_weight_types_items[] = {
256 "Weight Paint for Vertex Groups"},
257 {0, NULL, 0, NULL, NULL},
261 static EnumPropertyItem rna_enum_gpencil_brush_eraser_modes_items[] = {
262 {GP_BRUSH_ERASER_SOFT,
266 "Erase strokes, fading their points strength and thickness"},
267 {GP_BRUSH_ERASER_HARD, "HARD", 0, "Point", "Erase stroke points"},
268 {GP_BRUSH_ERASER_STROKE, "STROKE", 0, "Stroke", "Erase entire strokes"},
269 {0, NULL, 0, NULL, NULL},
272 static EnumPropertyItem rna_enum_gpencil_fill_draw_modes_items[] = {
277 "Use both visible strokes and edit lines as fill boundary limits"},
278 {GP_FILL_DMODE_STROKE, "STROKE", 0, "Strokes", "Use visible strokes as fill boundary limits"},
279 {GP_FILL_DMODE_CONTROL, "CONTROL", 0, "Edit Lines", "Use edit lines as fill boundary limits"},
280 {0, NULL, 0, NULL, NULL}};
282 static EnumPropertyItem rna_enum_gpencil_fill_layers_modes_items[] = {
283 {GP_FILL_GPLMODE_VISIBLE, "VISIBLE", 0, "Visible", "Visible layers"},
284 {GP_FILL_GPLMODE_ACTIVE, "ACTIVE", 0, "Active", "Only active layer"},
285 {GP_FILL_GPLMODE_ABOVE, "ABOVE", 0, "Layer Above", "Layer above active"},
286 {GP_FILL_GPLMODE_BELOW, "BELOW", 0, "Layer Below", "Layer below active"},
287 {GP_FILL_GPLMODE_ALL_ABOVE, "ALL_ABOVE", 0, "All Above", "All layers above active"},
288 {GP_FILL_GPLMODE_ALL_BELOW, "ALL_BELOW", 0, "All Below", "All layers below active"},
289 {0, NULL, 0, NULL, NULL}};
291 static EnumPropertyItem rna_enum_gpencil_fill_direction_items[] = {
292 {0, "NORMAL", ICON_ADD, "Normal", "Fill internal area"},
293 {BRUSH_DIR_IN, "INVERT", ICON_REMOVE, "Inverted", "Fill inverted area"},
294 {0, NULL, 0, NULL, NULL},
297 static EnumPropertyItem rna_enum_gpencil_brush_modes_items[] = {
298 {GP_BRUSH_MODE_ACTIVE, "ACTIVE", 0, "Active", "Use current mode"},
299 {GP_BRUSH_MODE_MATERIAL, "MATERIAL", 0, "Material", "Use always material mode"},
300 {GP_BRUSH_MODE_VERTEXCOLOR, "VERTEXCOLOR", 0, "Vertex Color", "Use always Vertex Color mode"},
301 {0, NULL, 0, NULL, NULL}};
303 static EnumPropertyItem rna_enum_gpencil_brush_paint_icons_items[] = {
304 {GP_BRUSH_ICON_PENCIL, "PENCIL", ICON_GPBRUSH_PENCIL, "Pencil", ""},
305 {GP_BRUSH_ICON_PEN, "PEN", ICON_GPBRUSH_PEN, "Pen", ""},
306 {GP_BRUSH_ICON_INK, "INK", ICON_GPBRUSH_INK, "Ink", ""},
307 {GP_BRUSH_ICON_INKNOISE, "INKNOISE", ICON_GPBRUSH_INKNOISE, "Ink Noise", ""},
308 {GP_BRUSH_ICON_BLOCK, "BLOCK", ICON_GPBRUSH_BLOCK, "Block", ""},
309 {GP_BRUSH_ICON_MARKER, "MARKER", ICON_GPBRUSH_MARKER, "Marker", ""},
310 {GP_BRUSH_ICON_AIRBRUSH, "AIRBRUSH", ICON_GPBRUSH_AIRBRUSH, "Airbrush", ""},
311 {GP_BRUSH_ICON_CHISEL, "CHISEL", ICON_GPBRUSH_CHISEL, "Chisel", ""},
312 {GP_BRUSH_ICON_FILL, "FILL", ICON_GPBRUSH_FILL, "Fill", ""},
313 {GP_BRUSH_ICON_ERASE_SOFT, "SOFT", ICON_GPBRUSH_ERASE_SOFT, "Eraser Soft", ""},
314 {GP_BRUSH_ICON_ERASE_HARD, "HARD", ICON_GPBRUSH_ERASE_HARD, "Eraser Hard", ""},
315 {GP_BRUSH_ICON_ERASE_STROKE, "STROKE", ICON_GPBRUSH_ERASE_STROKE, "Eraser Stroke", ""},
316 {0, NULL, 0, NULL, NULL},
319 static EnumPropertyItem rna_enum_gpencil_brush_sculpt_icons_items[] = {
320 {GP_BRUSH_ICON_GPBRUSH_SMOOTH, "SMOOTH", ICON_GPBRUSH_SMOOTH, "Smooth", ""},
321 {GP_BRUSH_ICON_GPBRUSH_THICKNESS, "THICKNESS", ICON_GPBRUSH_THICKNESS, "Thickness", ""},
322 {GP_BRUSH_ICON_GPBRUSH_STRENGTH, "STRENGTH", ICON_GPBRUSH_STRENGTH, "Strength", ""},
323 {GP_BRUSH_ICON_GPBRUSH_RANDOMIZE, "RANDOMIZE", ICON_GPBRUSH_RANDOMIZE, "Randomize", ""},
324 {GP_BRUSH_ICON_GPBRUSH_GRAB, "GRAB", ICON_GPBRUSH_GRAB, "Grab", ""},
325 {GP_BRUSH_ICON_GPBRUSH_PUSH, "PUSH", ICON_GPBRUSH_PUSH, "Push", ""},
326 {GP_BRUSH_ICON_GPBRUSH_TWIST, "TWIST", ICON_GPBRUSH_TWIST, "Twist", ""},
327 {GP_BRUSH_ICON_GPBRUSH_PINCH, "PINCH", ICON_GPBRUSH_PINCH, "Pinch", ""},
328 {GP_BRUSH_ICON_GPBRUSH_CLONE, "CLONE", ICON_GPBRUSH_CLONE, "Clone", ""},
329 {0, NULL, 0, NULL, NULL},
332 static EnumPropertyItem rna_enum_gpencil_brush_weight_icons_items[] = {
333 {GP_BRUSH_ICON_GPBRUSH_WEIGHT, "DRAW", ICON_GPBRUSH_WEIGHT, "Draw", ""},
334 {0, NULL, 0, NULL, NULL},
336 static EnumPropertyItem rna_enum_gpencil_brush_vertex_icons_items[] = {
337 {GP_BRUSH_ICON_VERTEX_DRAW, "DRAW", ICON_BRUSH_MIX, "Draw", ""},
338 {GP_BRUSH_ICON_VERTEX_BLUR, "BLUR", ICON_BRUSH_BLUR, "Blur", ""},
339 {GP_BRUSH_ICON_VERTEX_AVERAGE, "AVERAGE", ICON_BRUSH_BLUR, "Average", ""},
340 {GP_BRUSH_ICON_VERTEX_SMEAR, "SMEAR", ICON_BRUSH_BLUR, "Smear", ""},
341 {GP_BRUSH_ICON_VERTEX_REPLACE, "REPLACE", ICON_BRUSH_MIX, "Replace", ""},
342 {0, NULL, 0, NULL, NULL},
348 # include "MEM_guardedalloc.h"
350 # include "RNA_access.h"
352 # include "BKE_brush.h"
353 # include "BKE_colorband.h"
354 # include "BKE_gpencil.h"
355 # include "BKE_icons.h"
356 # include "BKE_material.h"
357 # include "BKE_paint.h"
361 static bool rna_BrushCapabilitiesSculpt_has_accumulate_get(PointerRNA *ptr)
363 Brush *br = (Brush *)ptr->data;
364 return SCULPT_TOOL_HAS_ACCUMULATE(br->sculpt_tool);
367 static bool rna_BrushCapabilitiesSculpt_has_topology_rake_get(PointerRNA *ptr)
369 Brush *br = (Brush *)ptr->data;
370 return SCULPT_TOOL_HAS_TOPOLOGY_RAKE(br->sculpt_tool);
373 static bool rna_BrushCapabilitiesSculpt_has_auto_smooth_get(PointerRNA *ptr)
375 Brush *br = (Brush *)ptr->data;
377 br->sculpt_tool, SCULPT_TOOL_MASK, SCULPT_TOOL_SMOOTH, SCULPT_TOOL_PAINT, SCULPT_TOOL_SMEAR);
380 static bool rna_BrushCapabilitiesSculpt_has_height_get(PointerRNA *ptr)
382 Brush *br = (Brush *)ptr->data;
383 return br->sculpt_tool == SCULPT_TOOL_LAYER;
386 static bool rna_BrushCapabilitiesSculpt_has_jitter_get(PointerRNA *ptr)
388 Brush *br = (Brush *)ptr->data;
389 return (!(br->flag & BRUSH_ANCHORED) && !(br->flag & BRUSH_DRAG_DOT) &&
390 !ELEM(br->sculpt_tool,
393 SCULPT_TOOL_SNAKE_HOOK,
397 static bool rna_BrushCapabilitiesSculpt_has_normal_weight_get(PointerRNA *ptr)
399 Brush *br = (Brush *)ptr->data;
400 return SCULPT_TOOL_HAS_NORMAL_WEIGHT(br->sculpt_tool);
403 static bool rna_BrushCapabilitiesSculpt_has_rake_factor_get(PointerRNA *ptr)
405 Brush *br = (Brush *)ptr->data;
406 return SCULPT_TOOL_HAS_RAKE(br->sculpt_tool);
409 static bool rna_BrushCapabilities_has_overlay_get(PointerRNA *ptr)
411 Brush *br = (Brush *)ptr->data;
413 br->mtex.brush_map_mode, MTEX_MAP_MODE_VIEW, MTEX_MAP_MODE_TILED, MTEX_MAP_MODE_STENCIL);
416 static bool rna_BrushCapabilitiesSculpt_has_persistence_get(PointerRNA *ptr)
418 Brush *br = (Brush *)ptr->data;
419 return ELEM(br->sculpt_tool, SCULPT_TOOL_LAYER, SCULPT_TOOL_CLOTH);
422 static bool rna_BrushCapabilitiesSculpt_has_pinch_factor_get(PointerRNA *ptr)
424 Brush *br = (Brush *)ptr->data;
425 return ELEM(br->sculpt_tool, SCULPT_TOOL_BLOB, SCULPT_TOOL_CREASE, SCULPT_TOOL_SNAKE_HOOK);
428 static bool rna_BrushCapabilitiesSculpt_has_plane_offset_get(PointerRNA *ptr)
430 Brush *br = (Brush *)ptr->data;
431 return ELEM(br->sculpt_tool,
433 SCULPT_TOOL_CLAY_STRIPS,
434 SCULPT_TOOL_CLAY_THUMB,
440 static bool rna_BrushCapabilitiesSculpt_has_random_texture_angle_get(PointerRNA *ptr)
442 Brush *br = (Brush *)ptr->data;
443 return (!ELEM(br->sculpt_tool,
446 SCULPT_TOOL_SNAKE_HOOK,
450 static bool rna_TextureCapabilities_has_random_texture_angle_get(PointerRNA *ptr)
452 MTex *mtex = (MTex *)ptr->data;
453 return ELEM(mtex->brush_map_mode, MTEX_MAP_MODE_VIEW, MTEX_MAP_MODE_AREA, MTEX_MAP_MODE_RANDOM);
456 static bool rna_BrushCapabilities_has_random_texture_angle_get(PointerRNA *ptr)
458 Brush *br = (Brush *)ptr->data;
459 return !(br->flag & BRUSH_ANCHORED);
462 static bool rna_BrushCapabilitiesSculpt_has_sculpt_plane_get(PointerRNA *ptr)
464 Brush *br = (Brush *)ptr->data;
465 return !ELEM(br->sculpt_tool,
472 static bool rna_BrushCapabilitiesSculpt_has_color_get(PointerRNA *ptr)
474 Brush *br = (Brush *)ptr->data;
475 return ELEM(br->sculpt_tool, SCULPT_TOOL_PAINT);
478 static bool rna_BrushCapabilitiesSculpt_has_secondary_color_get(PointerRNA *ptr)
480 Brush *br = (Brush *)ptr->data;
481 return BKE_brush_sculpt_has_secondary_color(br);
484 static bool rna_BrushCapabilitiesSculpt_has_smooth_stroke_get(PointerRNA *ptr)
486 Brush *br = (Brush *)ptr->data;
487 return (!(br->flag & BRUSH_ANCHORED) && !(br->flag & BRUSH_DRAG_DOT) &&
488 !(br->flag & BRUSH_LINE) && !(br->flag & BRUSH_CURVE) &&
489 !ELEM(br->sculpt_tool,
492 SCULPT_TOOL_SNAKE_HOOK,
496 static bool rna_BrushCapabilities_has_smooth_stroke_get(PointerRNA *ptr)
498 Brush *br = (Brush *)ptr->data;
499 return (!(br->flag & BRUSH_ANCHORED) && !(br->flag & BRUSH_DRAG_DOT) &&
500 !(br->flag & BRUSH_LINE) && !(br->flag & BRUSH_CURVE));
503 static bool rna_BrushCapabilitiesSculpt_has_space_attenuation_get(PointerRNA *ptr)
505 Brush *br = (Brush *)ptr->data;
506 return ((br->flag & (BRUSH_SPACE | BRUSH_LINE | BRUSH_CURVE)) && !ELEM(br->sculpt_tool,
510 SCULPT_TOOL_SNAKE_HOOK));
513 static bool rna_BrushCapabilitiesImagePaint_has_space_attenuation_get(PointerRNA *ptr)
515 Brush *br = (Brush *)ptr->data;
516 return (br->flag & (BRUSH_SPACE | BRUSH_LINE | BRUSH_CURVE)) &&
517 br->imagepaint_tool != PAINT_TOOL_FILL;
520 static bool rna_BrushCapabilitiesImagePaint_has_color_get(PointerRNA *ptr)
522 Brush *br = (Brush *)ptr->data;
523 return ELEM(br->imagepaint_tool, PAINT_TOOL_DRAW, PAINT_TOOL_FILL);
526 static bool rna_BrushCapabilitiesVertexPaint_has_color_get(PointerRNA *ptr)
528 Brush *br = (Brush *)ptr->data;
529 return ELEM(br->vertexpaint_tool, VPAINT_TOOL_DRAW);
532 static bool rna_BrushCapabilitiesWeightPaint_has_weight_get(PointerRNA *ptr)
534 Brush *br = (Brush *)ptr->data;
535 return ELEM(br->weightpaint_tool, WPAINT_TOOL_DRAW);
538 static bool rna_BrushCapabilities_has_spacing_get(PointerRNA *ptr)
540 Brush *br = (Brush *)ptr->data;
541 return (!(br->flag & BRUSH_ANCHORED));
544 static bool rna_BrushCapabilitiesSculpt_has_strength_pressure_get(PointerRNA *ptr)
546 Brush *br = (Brush *)ptr->data;
547 return !ELEM(br->sculpt_tool, SCULPT_TOOL_GRAB, SCULPT_TOOL_SNAKE_HOOK);
550 static bool rna_TextureCapabilities_has_texture_angle_get(PointerRNA *ptr)
552 MTex *mtex = (MTex *)ptr->data;
553 return mtex->brush_map_mode != MTEX_MAP_MODE_3D;
556 static bool rna_BrushCapabilitiesSculpt_has_direction_get(PointerRNA *ptr)
558 Brush *br = (Brush *)ptr->data;
559 return !ELEM(br->sculpt_tool,
561 SCULPT_TOOL_DRAW_SHARP,
563 SCULPT_TOOL_CLAY_STRIPS,
577 static bool rna_BrushCapabilitiesSculpt_has_gravity_get(PointerRNA *ptr)
579 Brush *br = (Brush *)ptr->data;
580 return !ELEM(br->sculpt_tool, SCULPT_TOOL_MASK, SCULPT_TOOL_SMOOTH);
583 static bool rna_BrushCapabilitiesSculpt_has_tilt_get(PointerRNA *ptr)
585 Brush *br = (Brush *)ptr->data;
586 return ELEM(br->sculpt_tool,
588 SCULPT_TOOL_DRAW_SHARP,
592 SCULPT_TOOL_CLAY_STRIPS,
593 SCULPT_TOOL_CLAY_THUMB);
596 static bool rna_TextureCapabilities_has_texture_angle_source_get(PointerRNA *ptr)
598 MTex *mtex = (MTex *)ptr->data;
599 return ELEM(mtex->brush_map_mode, MTEX_MAP_MODE_VIEW, MTEX_MAP_MODE_AREA, MTEX_MAP_MODE_RANDOM);
602 static bool rna_BrushCapabilitiesImagePaint_has_accumulate_get(PointerRNA *ptr)
604 /* only support for draw tool */
605 Brush *br = (Brush *)ptr->data;
607 return ((br->flag & BRUSH_AIRBRUSH) || (br->flag & BRUSH_DRAG_DOT) ||
608 (br->flag & BRUSH_ANCHORED) || (br->imagepaint_tool == PAINT_TOOL_SOFTEN) ||
609 (br->imagepaint_tool == PAINT_TOOL_SMEAR) || (br->imagepaint_tool == PAINT_TOOL_FILL) ||
610 (br->mtex.tex && !ELEM(br->mtex.brush_map_mode,
612 MTEX_MAP_MODE_STENCIL,
613 MTEX_MAP_MODE_3D))) ?
618 static bool rna_BrushCapabilitiesImagePaint_has_radius_get(PointerRNA *ptr)
620 /* only support for draw tool */
621 Brush *br = (Brush *)ptr->data;
623 return (br->imagepaint_tool != PAINT_TOOL_FILL);
626 static PointerRNA rna_Sculpt_tool_capabilities_get(PointerRNA *ptr)
628 return rna_pointer_inherit_refine(ptr, &RNA_BrushCapabilitiesSculpt, ptr->owner_id);
631 static PointerRNA rna_Imapaint_tool_capabilities_get(PointerRNA *ptr)
633 return rna_pointer_inherit_refine(ptr, &RNA_BrushCapabilitiesImagePaint, ptr->owner_id);
636 static PointerRNA rna_Vertexpaint_tool_capabilities_get(PointerRNA *ptr)
638 return rna_pointer_inherit_refine(ptr, &RNA_BrushCapabilitiesVertexPaint, ptr->owner_id);
641 static PointerRNA rna_Weightpaint_tool_capabilities_get(PointerRNA *ptr)
643 return rna_pointer_inherit_refine(ptr, &RNA_BrushCapabilitiesWeightPaint, ptr->owner_id);
646 static PointerRNA rna_Brush_capabilities_get(PointerRNA *ptr)
648 return rna_pointer_inherit_refine(ptr, &RNA_BrushCapabilities, ptr->owner_id);
651 static void rna_Brush_reset_icon(Brush *br)
655 if (br->flag & BRUSH_CUSTOM_ICON) {
659 if (id->icon_id >= BIFICONID_LAST) {
660 BKE_icon_id_delete(id);
661 BKE_previewimg_id_free(id);
667 static void rna_Brush_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
669 Brush *br = (Brush *)ptr->data;
670 WM_main_add_notifier(NC_BRUSH | NA_EDITED, br);
671 /*WM_main_add_notifier(NC_SPACE|ND_SPACE_VIEW3D, NULL); */
674 static void rna_Brush_material_update(bContext *UNUSED(C), PointerRNA *UNUSED(ptr))
676 /* number of material users changed */
677 WM_main_add_notifier(NC_SPACE | ND_SPACE_PROPERTIES, NULL);
680 static void rna_Brush_main_tex_update(bContext *C, PointerRNA *ptr)
682 Main *bmain = CTX_data_main(C);
683 Scene *scene = CTX_data_scene(C);
684 ViewLayer *view_layer = CTX_data_view_layer(C);
685 Brush *br = (Brush *)ptr->data;
686 BKE_paint_invalidate_overlay_tex(scene, view_layer, br->mtex.tex);
687 rna_Brush_update(bmain, scene, ptr);
690 static void rna_Brush_secondary_tex_update(bContext *C, PointerRNA *ptr)
692 Main *bmain = CTX_data_main(C);
693 Scene *scene = CTX_data_scene(C);
694 ViewLayer *view_layer = CTX_data_view_layer(C);
695 Brush *br = (Brush *)ptr->data;
696 BKE_paint_invalidate_overlay_tex(scene, view_layer, br->mask_mtex.tex);
697 rna_Brush_update(bmain, scene, ptr);
700 static void rna_Brush_size_update(Main *bmain, Scene *scene, PointerRNA *ptr)
702 BKE_paint_invalidate_overlay_all();
703 rna_Brush_update(bmain, scene, ptr);
706 static void rna_Brush_update_and_reset_icon(Main *bmain, Scene *scene, PointerRNA *ptr)
708 Brush *br = ptr->data;
709 rna_Brush_reset_icon(br);
710 rna_Brush_update(bmain, scene, ptr);
713 static void rna_Brush_stroke_update(Main *bmain, Scene *scene, PointerRNA *ptr)
715 WM_main_add_notifier(NC_SCENE | ND_TOOLSETTINGS, scene);
716 rna_Brush_update(bmain, scene, ptr);
719 static void rna_Brush_icon_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
721 Brush *br = (Brush *)ptr->data;
723 if (br->icon_imbuf) {
724 IMB_freeImBuf(br->icon_imbuf);
725 br->icon_imbuf = NULL;
730 if (br->flag & BRUSH_CUSTOM_ICON) {
731 BKE_icon_changed(BKE_icon_id_ensure(&br->id));
734 WM_main_add_notifier(NC_BRUSH | NA_EDITED, br);
737 static void rna_TextureSlot_brush_angle_update(bContext *C, PointerRNA *ptr)
739 Scene *scene = CTX_data_scene(C);
740 MTex *mtex = ptr->data;
741 /* skip invalidation of overlay for stencil mode */
742 if (mtex->mapping != MTEX_MAP_MODE_STENCIL) {
743 ViewLayer *view_layer = CTX_data_view_layer(C);
744 BKE_paint_invalidate_overlay_tex(scene, view_layer, mtex->tex);
747 rna_TextureSlot_update(C, ptr);
750 static void rna_Brush_set_size(PointerRNA *ptr, int value)
752 Brush *brush = ptr->data;
754 /* scale unprojected radius so it stays consistent with brush size */
755 BKE_brush_scale_unprojected_radius(&brush->unprojected_radius, value, brush->size);
759 static void rna_Brush_use_gradient_set(PointerRNA *ptr, bool value)
761 Brush *br = (Brush *)ptr->data;
764 br->flag |= BRUSH_USE_GRADIENT;
767 br->flag &= ~BRUSH_USE_GRADIENT;
770 if ((br->flag & BRUSH_USE_GRADIENT) && br->gradient == NULL) {
771 br->gradient = BKE_colorband_add(true);
775 static void rna_Brush_set_unprojected_radius(PointerRNA *ptr, float value)
777 Brush *brush = ptr->data;
779 /* scale brush size so it stays consistent with unprojected_radius */
780 BKE_brush_scale_size(&brush->size, value, brush->unprojected_radius);
781 brush->unprojected_radius = value;
784 static const EnumPropertyItem *rna_Brush_direction_itemf(bContext *C,
786 PropertyRNA *UNUSED(prop),
787 bool *UNUSED(r_free))
789 ePaintMode mode = BKE_paintmode_get_active_from_context(C);
792 static const EnumPropertyItem prop_flatten_contrast_items[] = {
793 {BRUSH_DIR_IN, "CONTRAST", ICON_ADD, "Contrast", "Subtract effect of brush"},
794 {0, "FLATTEN", ICON_REMOVE, "Flatten", "Add effect of brush"},
795 {0, NULL, 0, NULL, NULL},
798 static const EnumPropertyItem prop_fill_deepen_items[] = {
799 {0, "FILL", ICON_ADD, "Fill", "Add effect of brush"},
800 {BRUSH_DIR_IN, "DEEPEN", ICON_REMOVE, "Deepen", "Subtract effect of brush"},
801 {0, NULL, 0, NULL, NULL},
804 static const EnumPropertyItem prop_scrape_peaks_items[] = {
805 {0, "SCRAPE", ICON_ADD, "Scrape", "Add effect of brush"},
806 {BRUSH_DIR_IN, "PEAKS", ICON_REMOVE, "Peaks", "Subtract effect of brush"},
807 {0, NULL, 0, NULL, NULL},
810 static const EnumPropertyItem prop_pinch_magnify_items[] = {
811 {BRUSH_DIR_IN, "MAGNIFY", ICON_ADD, "Magnify", "Subtract effect of brush"},
812 {0, "PINCH", ICON_REMOVE, "Pinch", "Add effect of brush"},
813 {0, NULL, 0, NULL, NULL},
816 static const EnumPropertyItem prop_inflate_deflate_items[] = {
817 {0, "INFLATE", ICON_ADD, "Inflate", "Add effect of brush"},
818 {BRUSH_DIR_IN, "DEFLATE", ICON_REMOVE, "Deflate", "Subtract effect of brush"},
819 {0, NULL, 0, NULL, NULL},
822 /* texture paint mode */
823 static const EnumPropertyItem prop_soften_sharpen_items[] = {
824 {BRUSH_DIR_IN, "SHARPEN", ICON_ADD, "Sharpen", "Sharpen effect of brush"},
825 {0, "SOFTEN", ICON_REMOVE, "Soften", "Blur effect of brush"},
826 {0, NULL, 0, NULL, NULL},
829 Brush *me = (Brush *)(ptr->data);
832 case PAINT_MODE_SCULPT:
833 switch (me->sculpt_tool) {
834 case SCULPT_TOOL_DRAW:
835 case SCULPT_TOOL_DRAW_SHARP:
836 case SCULPT_TOOL_CREASE:
837 case SCULPT_TOOL_BLOB:
838 case SCULPT_TOOL_LAYER:
839 case SCULPT_TOOL_CLAY:
840 case SCULPT_TOOL_CLAY_STRIPS:
841 return prop_direction_items;
842 case SCULPT_TOOL_SMOOTH:
843 return prop_smooth_direction_items;
844 case SCULPT_TOOL_MASK:
845 switch ((BrushMaskTool)me->mask_tool) {
846 case BRUSH_MASK_DRAW:
847 return prop_direction_items;
849 case BRUSH_MASK_SMOOTH:
850 return DummyRNA_DEFAULT_items;
853 return DummyRNA_DEFAULT_items;
856 case SCULPT_TOOL_FLATTEN:
857 return prop_flatten_contrast_items;
859 case SCULPT_TOOL_FILL:
860 return prop_fill_deepen_items;
862 case SCULPT_TOOL_SCRAPE:
863 return prop_scrape_peaks_items;
865 case SCULPT_TOOL_PINCH:
866 return prop_pinch_magnify_items;
868 case SCULPT_TOOL_INFLATE:
869 return prop_inflate_deflate_items;
872 return DummyRNA_DEFAULT_items;
875 case PAINT_MODE_TEXTURE_2D:
876 case PAINT_MODE_TEXTURE_3D:
877 switch (me->imagepaint_tool) {
878 case PAINT_TOOL_SOFTEN:
879 return prop_soften_sharpen_items;
882 return DummyRNA_DEFAULT_items;
886 return DummyRNA_DEFAULT_items;
890 static const EnumPropertyItem *rna_Brush_stroke_itemf(bContext *C,
891 PointerRNA *UNUSED(ptr),
892 PropertyRNA *UNUSED(prop),
893 bool *UNUSED(r_free))
895 ePaintMode mode = BKE_paintmode_get_active_from_context(C);
897 static const EnumPropertyItem brush_stroke_method_items[] = {
898 {0, "DOTS", 0, "Dots", "Apply paint on each mouse move step"},
903 "Limit brush application to the distance specified by spacing"},
908 "Keep applying paint effect while holding mouse (spray)"},
909 {BRUSH_LINE, "LINE", 0, "Line", "Drag a line with dabs separated according to spacing"},
914 "Define the stroke curve with a bezier curve. Dabs are separated according to spacing"},
915 {0, NULL, 0, NULL, NULL},
919 case PAINT_MODE_SCULPT:
920 case PAINT_MODE_TEXTURE_2D:
921 case PAINT_MODE_TEXTURE_3D:
922 return sculpt_stroke_method_items;
925 return brush_stroke_method_items;
929 /* Grease Pencil Drawing Brushes Settings */
930 static char *rna_BrushGpencilSettings_path(PointerRNA *UNUSED(ptr))
932 return BLI_strdup("tool_settings.gpencil_paint.brush.gpencil_settings");
935 static void rna_BrushGpencilSettings_default_eraser_update(Main *bmain,
937 PointerRNA *UNUSED(ptr))
939 ToolSettings *ts = scene->toolsettings;
940 Paint *paint = &ts->gp_paint->paint;
941 Brush *brush_cur = paint->brush;
943 /* disable default eraser in all brushes */
944 for (Brush *brush = bmain->brushes.first; brush; brush = brush->id.next) {
945 if ((brush != brush_cur) && (brush->ob_mode == OB_MODE_PAINT_GPENCIL) &&
946 (brush->gpencil_tool == GPAINT_TOOL_ERASE)) {
947 brush->gpencil_settings->flag &= ~GP_BRUSH_DEFAULT_ERASER;
952 static void rna_BrushGpencilSettings_use_material_pin_update(bContext *C, PointerRNA *ptr)
954 ViewLayer *view_layer = CTX_data_view_layer(C);
955 Object *ob = OBACT(view_layer);
956 Brush *brush = (Brush *)ptr->owner_id;
958 if (brush->gpencil_settings->flag & GP_BRUSH_MATERIAL_PINNED) {
959 Material *material = BKE_object_material_get(ob, ob->actcol);
960 BKE_gpencil_brush_material_set(brush, material);
963 BKE_gpencil_brush_material_set(brush, NULL);
966 /* number of material users changed */
967 WM_event_add_notifier(C, NC_SPACE | ND_SPACE_PROPERTIES, NULL);
970 static void rna_BrushGpencilSettings_eraser_mode_update(Main *UNUSED(bmain),
972 PointerRNA *UNUSED(ptr))
974 ToolSettings *ts = scene->toolsettings;
975 Paint *paint = &ts->gp_paint->paint;
976 Brush *brush = paint->brush;
978 /* set eraser icon */
979 if ((brush) && (brush->gpencil_tool == GPAINT_TOOL_ERASE)) {
980 switch (brush->gpencil_settings->eraser_mode) {
981 case GP_BRUSH_ERASER_SOFT:
982 brush->gpencil_settings->icon_id = GP_BRUSH_ICON_ERASE_SOFT;
984 case GP_BRUSH_ERASER_HARD:
985 brush->gpencil_settings->icon_id = GP_BRUSH_ICON_ERASE_HARD;
987 case GP_BRUSH_ERASER_STROKE:
988 brush->gpencil_settings->icon_id = GP_BRUSH_ICON_ERASE_STROKE;
991 brush->gpencil_settings->icon_id = GP_BRUSH_ICON_ERASE_SOFT;
997 static bool rna_BrushGpencilSettings_material_poll(PointerRNA *UNUSED(ptr), PointerRNA value)
999 Material *ma = (Material *)value.data;
1001 /* GP materials only */
1002 return (ma->gp_style != NULL);
1005 static bool rna_GPencilBrush_pin_mode_get(PointerRNA *ptr)
1007 Brush *brush = (Brush *)ptr->owner_id;
1008 if ((brush != NULL) && (brush->gpencil_settings != NULL)) {
1009 return (brush->gpencil_settings->brush_draw_mode != GP_BRUSH_MODE_ACTIVE);
1014 static void rna_GPencilBrush_pin_mode_set(PointerRNA *UNUSED(ptr), bool UNUSED(value))
1016 /* All data is set in update. Keep this function only to avoid RNA compilation errors. */
1020 static void rna_GPencilBrush_pin_mode_update(bContext *C, PointerRNA *ptr)
1022 Brush *brush = (Brush *)ptr->owner_id;
1023 if ((brush != NULL) && (brush->gpencil_settings != NULL)) {
1024 if (brush->gpencil_settings->brush_draw_mode != GP_BRUSH_MODE_ACTIVE) {
1025 /* If not active, means that must be set to off. */
1026 brush->gpencil_settings->brush_draw_mode = GP_BRUSH_MODE_ACTIVE;
1029 ToolSettings *ts = CTX_data_tool_settings(C);
1030 brush->gpencil_settings->brush_draw_mode = GPENCIL_USE_VERTEX_COLOR(ts) ?
1031 GP_BRUSH_MODE_VERTEXCOLOR :
1032 GP_BRUSH_MODE_MATERIAL;
1037 static const EnumPropertyItem *rna_BrushTextureSlot_map_mode_itemf(bContext *C,
1038 PointerRNA *UNUSED(ptr),
1039 PropertyRNA *UNUSED(prop),
1040 bool *UNUSED(r_free))
1044 return rna_enum_brush_texture_slot_map_all_mode_items;
1047 # define rna_enum_brush_texture_slot_map_sculpt_mode_items \
1048 rna_enum_brush_texture_slot_map_all_mode_items;
1050 const ePaintMode mode = BKE_paintmode_get_active_from_context(C);
1051 if (mode == PAINT_MODE_SCULPT) {
1052 return rna_enum_brush_texture_slot_map_sculpt_mode_items;
1054 return rna_enum_brush_texture_slot_map_texture_mode_items;
1056 # undef rna_enum_brush_texture_slot_map_sculpt_mode_items
1061 static void rna_def_brush_texture_slot(BlenderRNA *brna)
1066 static const EnumPropertyItem prop_mask_paint_map_mode_items[] = {
1067 {MTEX_MAP_MODE_VIEW, "VIEW_PLANE", 0, "View Plane", ""},
1068 {MTEX_MAP_MODE_TILED, "TILED", 0, "Tiled", ""},
1069 {MTEX_MAP_MODE_RANDOM, "RANDOM", 0, "Random", ""},
1070 {MTEX_MAP_MODE_STENCIL, "STENCIL", 0, "Stencil", ""},
1071 {0, NULL, 0, NULL, NULL},
1074 # define TEXTURE_CAPABILITY(prop_name_, ui_name_) \
1075 prop = RNA_def_property(srna, #prop_name_, PROP_BOOLEAN, PROP_NONE); \
1076 RNA_def_property_clear_flag(prop, PROP_EDITABLE); \
1077 RNA_def_property_boolean_funcs(prop, "rna_TextureCapabilities_" #prop_name_ "_get", NULL); \
1078 RNA_def_property_ui_text(prop, ui_name_, NULL)
1080 srna = RNA_def_struct(brna, "BrushTextureSlot", "TextureSlot");
1081 RNA_def_struct_sdna(srna, "MTex");
1082 RNA_def_struct_ui_text(
1083 srna, "Brush Texture Slot", "Texture slot for textures in a Brush data-block");
1085 prop = RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE);
1086 RNA_def_property_float_sdna(prop, NULL, "rot");
1087 RNA_def_property_range(prop, 0, M_PI * 2);
1088 RNA_def_property_ui_text(prop, "Angle", "Brush texture rotation");
1089 RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
1090 RNA_def_property_update(prop, 0, "rna_TextureSlot_brush_angle_update");
1092 prop = RNA_def_property(srna, "map_mode", PROP_ENUM, PROP_NONE);
1093 RNA_def_property_enum_sdna(prop, NULL, "brush_map_mode");
1094 RNA_def_property_enum_items(prop, rna_enum_brush_texture_slot_map_all_mode_items);
1095 RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_BrushTextureSlot_map_mode_itemf");
1096 RNA_def_property_ui_text(prop, "Mode", "");
1097 RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
1098 RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
1100 prop = RNA_def_property(srna, "mask_map_mode", PROP_ENUM, PROP_NONE);
1101 RNA_def_property_enum_sdna(prop, NULL, "brush_map_mode");
1102 RNA_def_property_enum_items(prop, prop_mask_paint_map_mode_items);
1103 RNA_def_property_ui_text(prop, "Mode", "");
1104 RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
1105 RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
1107 prop = RNA_def_property(srna, "use_rake", PROP_BOOLEAN, PROP_NONE);
1108 RNA_def_property_boolean_sdna(prop, NULL, "brush_angle_mode", MTEX_ANGLE_RAKE);
1109 RNA_def_property_ui_text(prop, "Rake", "");
1110 RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
1111 RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
1113 prop = RNA_def_property(srna, "use_random", PROP_BOOLEAN, PROP_NONE);
1114 RNA_def_property_boolean_sdna(prop, NULL, "brush_angle_mode", MTEX_ANGLE_RANDOM);
1115 RNA_def_property_ui_text(prop, "Random", "");
1116 RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
1117 RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
1119 prop = RNA_def_property(srna, "random_angle", PROP_FLOAT, PROP_ANGLE);
1120 RNA_def_property_range(prop, 0, M_PI * 2);
1121 RNA_def_property_ui_text(prop, "Random Angle", "Brush texture random angle");
1122 RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
1123 RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
1125 TEXTURE_CAPABILITY(has_texture_angle_source, "Has Texture Angle Source");
1126 TEXTURE_CAPABILITY(has_random_texture_angle, "Has Random Texture Angle");
1127 TEXTURE_CAPABILITY(has_texture_angle, "Has Texture Angle Source");
1130 static void rna_def_sculpt_capabilities(BlenderRNA *brna)
1135 srna = RNA_def_struct(brna, "BrushCapabilitiesSculpt", NULL);
1136 RNA_def_struct_sdna(srna, "Brush");
1137 RNA_def_struct_nested(brna, srna, "Brush");
1138 RNA_def_struct_ui_text(srna,
1139 "Sculpt Capabilities",
1140 "Read-only indications of which brush operations "
1141 "are supported by the current sculpt tool");
1143 # define SCULPT_TOOL_CAPABILITY(prop_name_, ui_name_) \
1144 prop = RNA_def_property(srna, #prop_name_, PROP_BOOLEAN, PROP_NONE); \
1145 RNA_def_property_clear_flag(prop, PROP_EDITABLE); \
1146 RNA_def_property_boolean_funcs( \
1147 prop, "rna_BrushCapabilitiesSculpt_" #prop_name_ "_get", NULL); \
1148 RNA_def_property_ui_text(prop, ui_name_, NULL)
1150 SCULPT_TOOL_CAPABILITY(has_accumulate, "Has Accumulate");
1151 SCULPT_TOOL_CAPABILITY(has_auto_smooth, "Has Auto Smooth");
1152 SCULPT_TOOL_CAPABILITY(has_topology_rake, "Has Topology Rake");
1153 SCULPT_TOOL_CAPABILITY(has_height, "Has Height");
1154 SCULPT_TOOL_CAPABILITY(has_jitter, "Has Jitter");
1155 SCULPT_TOOL_CAPABILITY(has_normal_weight, "Has Crease/Pinch Factor");
1156 SCULPT_TOOL_CAPABILITY(has_rake_factor, "Has Rake Factor");
1157 SCULPT_TOOL_CAPABILITY(has_persistence, "Has Persistence");
1158 SCULPT_TOOL_CAPABILITY(has_pinch_factor, "Has Pinch Factor");
1159 SCULPT_TOOL_CAPABILITY(has_plane_offset, "Has Plane Offset");
1160 SCULPT_TOOL_CAPABILITY(has_random_texture_angle, "Has Random Texture Angle");
1161 SCULPT_TOOL_CAPABILITY(has_sculpt_plane, "Has Sculpt Plane");
1162 SCULPT_TOOL_CAPABILITY(has_color, "Has Color");
1163 SCULPT_TOOL_CAPABILITY(has_secondary_color, "Has Secondary Color");
1164 SCULPT_TOOL_CAPABILITY(has_smooth_stroke, "Has Smooth Stroke");
1165 SCULPT_TOOL_CAPABILITY(has_space_attenuation, "Has Space Attenuation");
1166 SCULPT_TOOL_CAPABILITY(has_strength_pressure, "Has Strength Pressure");
1167 SCULPT_TOOL_CAPABILITY(has_direction, "Has Direction");
1168 SCULPT_TOOL_CAPABILITY(has_gravity, "Has Gravity");
1169 SCULPT_TOOL_CAPABILITY(has_tilt, "Has Tilt");
1171 # undef SCULPT_CAPABILITY
1174 static void rna_def_brush_capabilities(BlenderRNA *brna)
1179 srna = RNA_def_struct(brna, "BrushCapabilities", NULL);
1180 RNA_def_struct_sdna(srna, "Brush");
1181 RNA_def_struct_nested(brna, srna, "Brush");
1182 RNA_def_struct_ui_text(
1183 srna, "Brush Capabilities", "Read-only indications of supported operations");
1185 # define BRUSH_CAPABILITY(prop_name_, ui_name_) \
1186 prop = RNA_def_property(srna, #prop_name_, PROP_BOOLEAN, PROP_NONE); \
1187 RNA_def_property_clear_flag(prop, PROP_EDITABLE); \
1188 RNA_def_property_boolean_funcs(prop, "rna_BrushCapabilities_" #prop_name_ "_get", NULL); \
1189 RNA_def_property_ui_text(prop, ui_name_, NULL)
1191 BRUSH_CAPABILITY(has_overlay, "Has Overlay");
1192 BRUSH_CAPABILITY(has_random_texture_angle, "Has Random Texture Angle");
1193 BRUSH_CAPABILITY(has_spacing, "Has Spacing");
1194 BRUSH_CAPABILITY(has_smooth_stroke, "Has Smooth Stroke");
1196 # undef BRUSH_CAPABILITY
1199 static void rna_def_image_paint_capabilities(BlenderRNA *brna)
1204 srna = RNA_def_struct(brna, "BrushCapabilitiesImagePaint", NULL);
1205 RNA_def_struct_sdna(srna, "Brush");
1206 RNA_def_struct_nested(brna, srna, "Brush");
1207 RNA_def_struct_ui_text(
1208 srna, "Image Paint Capabilities", "Read-only indications of supported operations");
1210 # define IMAPAINT_TOOL_CAPABILITY(prop_name_, ui_name_) \
1211 prop = RNA_def_property(srna, #prop_name_, PROP_BOOLEAN, PROP_NONE); \
1212 RNA_def_property_clear_flag(prop, PROP_EDITABLE); \
1213 RNA_def_property_boolean_funcs( \
1214 prop, "rna_BrushCapabilitiesImagePaint_" #prop_name_ "_get", NULL); \
1215 RNA_def_property_ui_text(prop, ui_name_, NULL)
1217 IMAPAINT_TOOL_CAPABILITY(has_accumulate, "Has Accumulate");
1218 IMAPAINT_TOOL_CAPABILITY(has_space_attenuation, "Has Space Attenuation");
1219 IMAPAINT_TOOL_CAPABILITY(has_radius, "Has Radius");
1220 IMAPAINT_TOOL_CAPABILITY(has_color, "Has Color");
1222 # undef IMAPAINT_TOOL_CAPABILITY
1225 static void rna_def_vertex_paint_capabilities(BlenderRNA *brna)
1230 srna = RNA_def_struct(brna, "BrushCapabilitiesVertexPaint", NULL);
1231 RNA_def_struct_sdna(srna, "Brush");
1232 RNA_def_struct_nested(brna, srna, "Brush");
1233 RNA_def_struct_ui_text(
1234 srna, "Vertex Paint Capabilities", "Read-only indications of supported operations");
1236 # define VPAINT_TOOL_CAPABILITY(prop_name_, ui_name_) \
1237 prop = RNA_def_property(srna, #prop_name_, PROP_BOOLEAN, PROP_NONE); \
1238 RNA_def_property_clear_flag(prop, PROP_EDITABLE); \
1239 RNA_def_property_boolean_funcs( \
1240 prop, "rna_BrushCapabilitiesVertexPaint_" #prop_name_ "_get", NULL); \
1241 RNA_def_property_ui_text(prop, ui_name_, NULL)
1243 VPAINT_TOOL_CAPABILITY(has_color, "Has Color");
1245 # undef VPAINT_TOOL_CAPABILITY
1248 static void rna_def_weight_paint_capabilities(BlenderRNA *brna)
1253 srna = RNA_def_struct(brna, "BrushCapabilitiesWeightPaint", NULL);
1254 RNA_def_struct_sdna(srna, "Brush");
1255 RNA_def_struct_nested(brna, srna, "Brush");
1256 RNA_def_struct_ui_text(
1257 srna, "Weight Paint Capabilities", "Read-only indications of supported operations");
1259 # define WPAINT_TOOL_CAPABILITY(prop_name_, ui_name_) \
1260 prop = RNA_def_property(srna, #prop_name_, PROP_BOOLEAN, PROP_NONE); \
1261 RNA_def_property_clear_flag(prop, PROP_EDITABLE); \
1262 RNA_def_property_boolean_funcs( \
1263 prop, "rna_BrushCapabilitiesWeightPaint_" #prop_name_ "_get", NULL); \
1264 RNA_def_property_ui_text(prop, ui_name_, NULL)
1266 WPAINT_TOOL_CAPABILITY(has_weight, "Has Weight");
1268 # undef WPAINT_TOOL_CAPABILITY
1271 static void rna_def_gpencil_options(BlenderRNA *brna)
1277 static EnumPropertyItem gppaint_mode_types_items[] = {
1278 {GPPAINT_MODE_STROKE, "STROKE", 0, "Stroke", "Vertex Color affects to Stroke only"},
1279 {GPPAINT_MODE_FILL, "FILL", 0, "Fill", "Vertex Color affects to Fill only"},
1280 {GPPAINT_MODE_BOTH, "BOTH", 0, "Stroke and Fill", "Vertex Color affects to Stroke and Fill"},
1281 {0, NULL, 0, NULL, NULL},
1284 srna = RNA_def_struct(brna, "BrushGpencilSettings", NULL);
1285 RNA_def_struct_sdna(srna, "BrushGpencilSettings");
1286 RNA_def_struct_path_func(srna, "rna_BrushGpencilSettings_path");
1287 RNA_def_struct_ui_text(srna, "Grease Pencil Brush Settings", "Settings for grease pencil brush");
1289 /* Strength factor for new strokes */
1290 prop = RNA_def_property(srna, "pen_strength", PROP_FLOAT, PROP_FACTOR);
1291 RNA_def_property_float_sdna(prop, NULL, "draw_strength");
1292 RNA_def_property_range(prop, 0.0f, 1.0f);
1293 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
1294 RNA_def_property_ui_text(
1295 prop, "Strength", "Color strength for new strokes (affect alpha factor of color)");
1296 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1297 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
1299 /* Jitter factor for new strokes */
1300 prop = RNA_def_property(srna, "pen_jitter", PROP_FLOAT, PROP_FACTOR);
1301 RNA_def_property_float_sdna(prop, NULL, "draw_jitter");
1302 RNA_def_property_range(prop, 0.0f, 1.0f);
1303 RNA_def_property_ui_text(prop, "Jitter", "Jitter factor for new strokes");
1304 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1305 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
1307 /* Randomnes factor for pressure */
1308 prop = RNA_def_property(srna, "random_pressure", PROP_FLOAT, PROP_FACTOR);
1309 RNA_def_property_float_sdna(prop, NULL, "draw_random_press");
1310 RNA_def_property_range(prop, 0.0f, 1.0f);
1311 RNA_def_property_ui_text(
1312 prop, "Pressure Randomness", "Randomness factor for pressure in new strokes");
1313 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1314 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
1316 /* Randomnes factor for strength */
1317 prop = RNA_def_property(srna, "random_strength", PROP_FLOAT, PROP_FACTOR);
1318 RNA_def_property_float_sdna(prop, NULL, "draw_random_strength");
1319 RNA_def_property_range(prop, 0.0f, 1.0f);
1320 RNA_def_property_ui_text(
1321 prop, "Strength Randomness", "Randomness factor strength in new strokes");
1322 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1323 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
1325 /* Angle when brush is full size */
1326 prop = RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE);
1327 RNA_def_property_float_sdna(prop, NULL, "draw_angle");
1328 RNA_def_property_range(prop, -M_PI_2, M_PI_2);
1329 RNA_def_property_ui_text(prop,
1331 "Direction of the stroke at which brush gives maximal thickness "
1332 "(0° for horizontal)");
1333 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1334 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
1336 /* Factor to change brush size depending of angle */
1337 prop = RNA_def_property(srna, "angle_factor", PROP_FLOAT, PROP_FACTOR);
1338 RNA_def_property_float_sdna(prop, NULL, "draw_angle_factor");
1339 RNA_def_property_range(prop, 0.0f, 1.0f);
1340 RNA_def_property_ui_text(
1343 "Reduce brush thickness by this factor when stroke is perpendicular to 'Angle' direction");
1344 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1345 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
1347 /* Smoothing factor for new strokes */
1348 prop = RNA_def_property(srna, "pen_smooth_factor", PROP_FLOAT, PROP_NONE);
1349 RNA_def_property_float_sdna(prop, NULL, "draw_smoothfac");
1350 RNA_def_property_range(prop, 0.0, 2.0f);
1351 RNA_def_property_ui_text(
1354 "Amount of smoothing to apply after finish newly created strokes, to reduce jitter/noise");
1355 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1356 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
1358 /* Iterations of the Smoothing factor */
1359 prop = RNA_def_property(srna, "pen_smooth_steps", PROP_INT, PROP_NONE);
1360 RNA_def_property_int_sdna(prop, NULL, "draw_smoothlvl");
1361 RNA_def_property_range(prop, 1, 3);
1362 RNA_def_property_ui_text(prop, "Iterations", "Number of times to smooth newly created strokes");
1363 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1364 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
1366 /* Subdivision level for new strokes */
1367 prop = RNA_def_property(srna, "pen_subdivision_steps", PROP_INT, PROP_NONE);
1368 RNA_def_property_int_sdna(prop, NULL, "draw_subdivide");
1369 RNA_def_property_range(prop, 0, 3);
1370 RNA_def_property_ui_text(
1372 "Subdivision Steps",
1373 "Number of times to subdivide newly created strokes, for less jagged strokes");
1374 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1375 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
1377 /* Simplify factor */
1378 prop = RNA_def_property(srna, "simplify_factor", PROP_FLOAT, PROP_NONE);
1379 RNA_def_property_float_sdna(prop, NULL, "simplify_f");
1380 RNA_def_property_range(prop, 0, 100.0);
1381 RNA_def_property_ui_range(prop, 0, 100.0, 1.0f, 3);
1382 RNA_def_property_ui_text(prop, "Simplify", "Factor of Simplify using adaptive algorithm");
1383 RNA_def_parameter_clear_flags(prop, PROP_ANIMATABLE, 0);
1385 /* Curves for pressure */
1386 prop = RNA_def_property(srna, "curve_sensitivity", PROP_POINTER, PROP_NONE);
1387 RNA_def_property_pointer_sdna(prop, NULL, "curve_sensitivity");
1388 RNA_def_property_struct_type(prop, "CurveMapping");
1389 RNA_def_property_ui_text(prop, "Curve Sensitivity", "Curve used for the sensitivity");
1390 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1391 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
1393 prop = RNA_def_property(srna, "curve_strength", PROP_POINTER, PROP_NONE);
1394 RNA_def_property_pointer_sdna(prop, NULL, "curve_strength");
1395 RNA_def_property_struct_type(prop, "CurveMapping");
1396 RNA_def_property_ui_text(prop, "Curve Strength", "Curve used for the strength");
1397 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1398 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
1400 prop = RNA_def_property(srna, "curve_jitter", PROP_POINTER, PROP_NONE);
1401 RNA_def_property_pointer_sdna(prop, NULL, "curve_jitter");
1402 RNA_def_property_struct_type(prop, "CurveMapping");
1403 RNA_def_property_ui_text(prop, "Curve Jitter", "Curve used for the jitter effect");
1404 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1405 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
1407 prop = RNA_def_property(srna, "curve_random_pressure", PROP_POINTER, PROP_NONE);
1408 RNA_def_property_pointer_sdna(prop, NULL, "curve_rand_pressure");
1409 RNA_def_property_struct_type(prop, "CurveMapping");
1410 RNA_def_property_ui_text(prop, "Random Curve", "Curve used for modulating effect");
1411 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1412 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
1414 prop = RNA_def_property(srna, "curve_random_strength", PROP_POINTER, PROP_NONE);
1415 RNA_def_property_pointer_sdna(prop, NULL, "curve_rand_strength");
1416 RNA_def_property_struct_type(prop, "CurveMapping");
1417 RNA_def_property_ui_text(prop, "Random Curve", "Curve used for modulating effect");
1418 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1419 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
1421 prop = RNA_def_property(srna, "curve_random_uv", PROP_POINTER, PROP_NONE);
1422 RNA_def_property_pointer_sdna(prop, NULL, "curve_rand_uv");
1423 RNA_def_property_struct_type(prop, "CurveMapping");
1424 RNA_def_property_ui_text(prop, "Random Curve", "Curve used for modulating effect");
1425 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1426 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
1428 prop = RNA_def_property(srna, "curve_random_hue", PROP_POINTER, PROP_NONE);
1429 RNA_def_property_pointer_sdna(prop, NULL, "curve_rand_hue");
1430 RNA_def_property_struct_type(prop, "CurveMapping");
1431 RNA_def_property_ui_text(prop, "Random Curve", "Curve used for modulating effect");
1432 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1433 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
1435 prop = RNA_def_property(srna, "curve_random_saturation", PROP_POINTER, PROP_NONE);
1436 RNA_def_property_pointer_sdna(prop, NULL, "curve_rand_saturation");
1437 RNA_def_property_struct_type(prop, "CurveMapping");
1438 RNA_def_property_ui_text(prop, "Random Curve", "Curve used for modulating effect");
1439 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1440 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
1442 prop = RNA_def_property(srna, "curve_random_value", PROP_POINTER, PROP_NONE);
1443 RNA_def_property_pointer_sdna(prop, NULL, "curve_rand_value");
1444 RNA_def_property_struct_type(prop, "CurveMapping");
1445 RNA_def_property_ui_text(prop, "Random Curve", "Curve used for modulating effect");
1446 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1447 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
1449 /* fill threshold for transparence */
1450 prop = RNA_def_property(srna, "fill_threshold", PROP_FLOAT, PROP_FACTOR);
1451 RNA_def_property_float_sdna(prop, NULL, "fill_threshold");
1452 RNA_def_property_range(prop, 0.0f, 1.0f);
1453 RNA_def_property_ui_text(
1454 prop, "Threshold", "Threshold to consider color transparent for filling");
1455 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1456 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
1458 /* fill leak size */
1459 prop = RNA_def_property(srna, "fill_leak", PROP_INT, PROP_PIXEL);
1460 RNA_def_property_int_sdna(prop, NULL, "fill_leak");
1461 RNA_def_property_range(prop, 0, 100);
1462 RNA_def_property_ui_text(prop, "Leak Size", "Size in pixels to consider the leak closed");
1463 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1464 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
1466 /* fill factor size */
1467 prop = RNA_def_property(srna, "fill_factor", PROP_FLOAT, PROP_NONE);
1468 RNA_def_property_float_sdna(prop, NULL, "fill_factor");
1469 RNA_def_property_range(prop, GPENCIL_MIN_FILL_FAC, 8.0f);
1470 RNA_def_property_ui_text(
1473 "Factor for fill boundary accuracy, higher values are more accurate but slower");
1474 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1475 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
1477 /* fill simplify steps */
1478 prop = RNA_def_property(srna, "fill_simplify_level", PROP_INT, PROP_NONE);
1479 RNA_def_property_int_sdna(prop, NULL, "fill_simplylvl");
1480 RNA_def_property_range(prop, 0, 10);
1481 RNA_def_property_ui_text(
1482 prop, "Simplify", "Number of simplify steps (large values reduce fill accuracy)");
1483 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1484 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
1486 prop = RNA_def_property(srna, "uv_random", PROP_FLOAT, PROP_FACTOR);
1487 RNA_def_property_float_sdna(prop, NULL, "uv_random");
1488 RNA_def_property_range(prop, 0.0, 1.0);
1489 RNA_def_property_ui_text(prop, "UV Random", "Random factor for autogenerated UV rotation");
1490 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1491 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
1493 /* gradient control */
1494 prop = RNA_def_property(srna, "hardness", PROP_FLOAT, PROP_FACTOR);
1495 RNA_def_property_float_sdna(prop, NULL, "hardeness");
1496 RNA_def_property_range(prop, 0.001f, 1.0f);
1497 RNA_def_property_float_default(prop, 1.0f);
1498 RNA_def_property_ui_text(
1501 "Gradient from the center of Dot and Box strokes (set to 1 for a solid stroke)");
1502 RNA_def_parameter_clear_flags(prop, PROP_ANIMATABLE, 0);
1504 /* gradient shape ratio */
1505 prop = RNA_def_property(srna, "aspect", PROP_FLOAT, PROP_XYZ);
1506 RNA_def_property_float_sdna(prop, NULL, "aspect_ratio");
1507 RNA_def_property_array(prop, 2);
1508 RNA_def_property_range(prop, 0.01f, 1.0f);
1509 RNA_def_property_float_default(prop, 1.0f);
1510 RNA_def_property_ui_text(prop, "Aspect", "");
1511 RNA_def_parameter_clear_flags(prop, PROP_ANIMATABLE, 0);
1513 prop = RNA_def_property(srna, "input_samples", PROP_INT, PROP_NONE);
1514 RNA_def_property_int_sdna(prop, NULL, "input_samples");
1515 RNA_def_property_range(prop, 0, GP_MAX_INPUT_SAMPLES);
1516 RNA_def_property_ui_text(
1519 "Generate intermediate points for very fast mouse movements. Set to 0 to disable");
1520 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1521 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
1523 /* active smooth factor while drawing */
1524 prop = RNA_def_property(srna, "active_smooth_factor", PROP_FLOAT, PROP_FACTOR);
1525 RNA_def_property_float_sdna(prop, NULL, "active_smooth");
1526 RNA_def_property_range(prop, 0.0f, 1.0f);
1527 RNA_def_property_ui_text(prop, "Active Smooth", "Amount of smoothing while drawing");
1528 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1529 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
1531 prop = RNA_def_property(srna, "eraser_strength_factor", PROP_FLOAT, PROP_PERCENTAGE);
1532 RNA_def_property_float_sdna(prop, NULL, "era_strength_f");
1533 RNA_def_property_range(prop, 0.0, 100.0);
1534 RNA_def_property_ui_range(prop, 0.0, 100.0, 10, 1);
1535 RNA_def_property_ui_text(prop, "Affect Stroke Strength", "Amount of erasing for strength");
1536 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1537 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
1539 prop = RNA_def_property(srna, "eraser_thickness_factor", PROP_FLOAT, PROP_PERCENTAGE);
1540 RNA_def_property_float_sdna(prop, NULL, "era_thickness_f");
1541 RNA_def_property_range(prop, 0.0, 100.0);
1542 RNA_def_property_ui_range(prop, 0.0, 100.0, 10, 1);
1543 RNA_def_property_ui_text(prop, "Affect Stroke Thickness", "Amount of erasing for thickness");
1544 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1545 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
1547 /* brush standard icon */
1548 prop = RNA_def_property(srna, "gpencil_paint_icon", PROP_ENUM, PROP_NONE);
1549 RNA_def_property_enum_sdna(prop, NULL, "icon_id");
1550 RNA_def_property_enum_items(prop, rna_enum_gpencil_brush_paint_icons_items);
1551 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1552 RNA_def_property_ui_text(prop, "Grease Pencil Icon", "");
1554 prop = RNA_def_property(srna, "gpencil_sculpt_icon", PROP_ENUM, PROP_NONE);
1555 RNA_def_property_enum_sdna(prop, NULL, "icon_id");
1556 RNA_def_property_enum_items(prop, rna_enum_gpencil_brush_sculpt_icons_items);
1557 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1558 RNA_def_property_ui_text(prop, "Grease Pencil Icon", "");
1560 prop = RNA_def_property(srna, "gpencil_weight_icon", PROP_ENUM, PROP_NONE);
1561 RNA_def_property_enum_sdna(prop, NULL, "icon_id");
1562 RNA_def_property_enum_items(prop, rna_enum_gpencil_brush_weight_icons_items);
1563 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1564 RNA_def_property_ui_text(prop, "Grease Pencil Icon", "");
1566 prop = RNA_def_property(srna, "gpencil_vertex_icon", PROP_ENUM, PROP_NONE);
1567 RNA_def_property_enum_sdna(prop, NULL, "icon_id");
1568 RNA_def_property_enum_items(prop, rna_enum_gpencil_brush_vertex_icons_items);
1569 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1570 RNA_def_property_ui_text(prop, "Grease Pencil Icon", "");
1573 prop = RNA_def_property(srna, "vertex_mode", PROP_ENUM, PROP_NONE);
1574 RNA_def_property_enum_bitflag_sdna(prop, NULL, "vertex_mode");
1575 RNA_def_property_enum_items(prop, gppaint_mode_types_items);
1576 RNA_def_property_ui_text(prop, "Mode Type", "Defines how vertex color affect to the strokes");
1577 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1579 /* Vertex Color mix factor. */
1580 prop = RNA_def_property(srna, "vertex_color_factor", PROP_FLOAT, PROP_FACTOR);
1581 RNA_def_property_float_sdna(prop, NULL, "vertex_factor");
1582 RNA_def_property_range(prop, 0.0f, 1.0f);
1583 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1584 RNA_def_property_ui_text(
1585 prop, "Vertex Color Factor", "Factor used to mix vertex color to get final color");
1587 /* Hue randomness. */
1588 prop = RNA_def_property(srna, "random_hue_factor", PROP_FLOAT, PROP_FACTOR);
1589 RNA_def_property_float_sdna(prop, NULL, "random_hue");
1590 RNA_def_property_range(prop, 0.0f, 1.0f);
1591 RNA_def_property_float_default(prop, 0.0f);
1592 RNA_def_property_ui_text(prop, "Hue", "Random factor to modify original hue");
1593 RNA_def_parameter_clear_flags(prop, PROP_ANIMATABLE, 0);
1595 /* Saturation randomness. */
1596 prop = RNA_def_property(srna, "random_saturation_factor", PROP_FLOAT, PROP_FACTOR);
1597 RNA_def_property_float_sdna(prop, NULL, "random_saturation");
1598 RNA_def_property_range(prop, 0.0f, 1.0f);
1599 RNA_def_property_float_default(prop, 0.0f);
1600 RNA_def_property_ui_text(prop, "Saturation", "Random factor to modify original saturation");
1601 RNA_def_parameter_clear_flags(prop, PROP_ANIMATABLE, 0);
1603 /* Value randomness. */
1604 prop = RNA_def_property(srna, "random_value_factor", PROP_FLOAT, PROP_FACTOR);
1605 RNA_def_property_float_sdna(prop, NULL, "random_value");
1606 RNA_def_property_range(prop, 0.0f, 1.0f);
1607 RNA_def_property_float_default(prop, 0.0f);
1608 RNA_def_property_ui_text(prop, "Value", "Random factor to modify original value");
1609 RNA_def_parameter_clear_flags(prop, PROP_ANIMATABLE, 0);
1612 prop = RNA_def_property(srna, "use_pressure", PROP_BOOLEAN, PROP_NONE);
1613 RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_BRUSH_USE_PRESSURE);
1614 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
1615 RNA_def_property_ui_text(prop, "Use Pressure", "Use tablet pressure");
1616 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1617 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
1619 prop = RNA_def_property(srna, "use_strength_pressure", PROP_BOOLEAN, PROP_NONE);
1620 RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_BRUSH_USE_STRENGTH_PRESSURE);
1621 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
1622 RNA_def_property_ui_text(
1623 prop, "Use Pressure Strength", "Use tablet pressure for color strength");
1624 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1625 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
1627 prop = RNA_def_property(srna, "use_jitter_pressure", PROP_BOOLEAN, PROP_NONE);
1628 RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_BRUSH_USE_JITTER_PRESSURE);
1629 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
1630 RNA_def_property_ui_text(prop, "Use Pressure Jitter", "Use tablet pressure for jitter");
1631 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1632 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
1634 prop = RNA_def_property(srna, "use_stroke_random_hue", PROP_BOOLEAN, PROP_NONE);
1635 RNA_def_property_boolean_sdna(prop, NULL, "flag2", GP_BRUSH_USE_HUE_AT_STROKE);
1636 RNA_def_property_ui_icon(prop, ICON_GP_SELECT_STROKES, 0);
1637 RNA_def_property_ui_text(prop, "Stroke Random", "Use randomness at stroke level");
1638 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1639 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
1641 prop = RNA_def_property(srna, "use_stroke_random_sat", PROP_BOOLEAN, PROP_NONE);
1642 RNA_def_property_boolean_sdna(prop, NULL, "flag2", GP_BRUSH_USE_SAT_AT_STROKE);
1643 RNA_def_property_ui_icon(prop, ICON_GP_SELECT_STROKES, 0);
1644 RNA_def_property_ui_text(prop, "Stroke Random", "Use randomness at stroke level");
1645 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1646 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
1648 prop = RNA_def_property(srna, "use_stroke_random_val", PROP_BOOLEAN, PROP_NONE);
1649 RNA_def_property_boolean_sdna(prop, NULL, "flag2", GP_BRUSH_USE_VAL_AT_STROKE);
1650 RNA_def_property_ui_icon(prop, ICON_GP_SELECT_STROKES, 0);
1651 RNA_def_property_ui_text(prop, "Stroke Random", "Use randomness at stroke level");
1652 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1653 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
1655 prop = RNA_def_property(srna, "use_stroke_random_radius", PROP_BOOLEAN, PROP_NONE);
1656 RNA_def_property_boolean_sdna(prop, NULL, "flag2", GP_BRUSH_USE_PRESS_AT_STROKE);
1657 RNA_def_property_ui_icon(prop, ICON_GP_SELECT_STROKES, 0);
1658 RNA_def_property_ui_text(prop, "Stroke Random", "Use randomness at stroke level");
1659 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1660 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
1662 prop = RNA_def_property(srna, "use_stroke_random_strength", PROP_BOOLEAN, PROP_NONE);
1663 RNA_def_property_boolean_sdna(prop, NULL, "flag2", GP_BRUSH_USE_STRENGTH_AT_STROKE);
1664 RNA_def_property_ui_icon(prop, ICON_GP_SELECT_STROKES, 0);
1665 RNA_def_property_ui_text(prop, "Stroke Random", "Use randomness at stroke level");
1666 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1667 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
1669 prop = RNA_def_property(srna, "use_stroke_random_uv", PROP_BOOLEAN, PROP_NONE);
1670 RNA_def_property_boolean_sdna(prop, NULL, "flag2", GP_BRUSH_USE_UV_AT_STROKE);
1671 RNA_def_property_ui_icon(prop, ICON_GP_SELECT_STROKES, 0);
1672 RNA_def_property_ui_text(prop, "Stroke Random", "Use randomness at stroke level");
1673 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1674 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
1676 prop = RNA_def_property(srna, "use_random_press_hue", PROP_BOOLEAN, PROP_NONE);
1677 RNA_def_property_boolean_sdna(prop, NULL, "flag2", GP_BRUSH_USE_HUE_RAND_PRESS);
1678 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
1679 RNA_def_property_ui_text(prop, "Use Pressure", "Use pressure to modulate randomness");
1680 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1681 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
1683 prop = RNA_def_property(srna, "use_random_press_sat", PROP_BOOLEAN, PROP_NONE);
1684 RNA_def_property_boolean_sdna(prop, NULL, "flag2", GP_BRUSH_USE_SAT_RAND_PRESS);
1685 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
1686 RNA_def_property_ui_text(prop, "Use Pressure", "Use pressure to modulate randomness");
1687 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1688 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
1690 prop = RNA_def_property(srna, "use_random_press_val", PROP_BOOLEAN, PROP_NONE);
1691 RNA_def_property_boolean_sdna(prop, NULL, "flag2", GP_BRUSH_USE_VAL_RAND_PRESS);
1692 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
1693 RNA_def_property_ui_text(prop, "Use Pressure", "Use pressure to modulate randomness");
1694 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1695 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
1697 prop = RNA_def_property(srna, "use_random_press_radius", PROP_BOOLEAN, PROP_NONE);
1698 RNA_def_property_boolean_sdna(prop, NULL, "flag2", GP_BRUSH_USE_PRESSURE_RAND_PRESS);
1699 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
1700 RNA_def_property_ui_text(prop, "Use Pressure", "Use pressure to modulate randomness");
1701 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1702 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
1704 prop = RNA_def_property(srna, "use_random_press_strength", PROP_BOOLEAN, PROP_NONE);
1705 RNA_def_property_boolean_sdna(prop, NULL, "flag2", GP_BRUSH_USE_STRENGTH_RAND_PRESS);
1706 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
1707 RNA_def_property_ui_text(prop, "Use Pressure", "Use pressure to modulate randomness");
1708 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1709 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
1711 prop = RNA_def_property(srna, "use_random_press_uv", PROP_BOOLEAN, PROP_NONE);
1712 RNA_def_property_boolean_sdna(prop, NULL, "flag2", GP_BRUSH_USE_UV_RAND_PRESS);
1713 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
1714 RNA_def_property_ui_text(prop, "Use Pressure", "Use pressure to modulate randomness");
1715 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1716 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
1718 prop = RNA_def_property(srna, "use_settings_stabilizer", PROP_BOOLEAN, PROP_NONE);
1719 RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_BRUSH_STABILIZE_MOUSE);
1720 RNA_def_property_boolean_default(prop, true);
1721 RNA_def_property_ui_text(prop,
1723 "Draw lines with a delay to allow smooth strokes. Press Shift key to "
1724 "override while drawing");
1725 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1727 prop = RNA_def_property(srna, "eraser_mode", PROP_ENUM, PROP_NONE);
1728 RNA_def_property_enum_sdna(prop, NULL, "eraser_mode");
1729 RNA_def_property_enum_items(prop, rna_enum_gpencil_brush_eraser_modes_items);
1730 RNA_def_property_ui_text(prop, "Mode", "Eraser Mode");
1731 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1732 RNA_def_property_update(
1733 prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_eraser_mode_update");
1735 prop = RNA_def_property(srna, "fill_draw_mode", PROP_ENUM, PROP_NONE);
1736 RNA_def_property_enum_sdna(prop, NULL, "fill_draw_mode");
1737 RNA_def_property_enum_items(prop, rna_enum_gpencil_fill_draw_modes_items);
1738 RNA_def_property_ui_text(prop, "Mode", "Mode to draw boundary limits");
1739 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1741 prop = RNA_def_property(srna, "fill_layer_mode", PROP_ENUM, PROP_NONE);
1742 RNA_def_property_enum_sdna(prop, NULL, "fill_layer_mode");
1743 RNA_def_property_enum_items(prop, rna_enum_gpencil_fill_layers_modes_items);
1744 RNA_def_property_ui_text(prop, "Layer Mode", "Layers used as boundaries");
1745 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1747 prop = RNA_def_property(srna, "fill_direction", PROP_ENUM, PROP_NONE);
1748 RNA_def_property_enum_sdna(prop, NULL, "fill_direction");
1749 RNA_def_property_enum_items(prop, rna_enum_gpencil_fill_direction_items);
1750 RNA_def_property_ui_text(prop, "Direction", "Direction of the fill");
1751 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1753 prop = RNA_def_property(srna, "pin_draw_mode", PROP_BOOLEAN, PROP_NONE);
1754 RNA_def_property_boolean_funcs(
1755 prop, "rna_GPencilBrush_pin_mode_get", "rna_GPencilBrush_pin_mode_set");
1756 RNA_def_property_ui_icon(prop, ICON_UNPINNED, 1);
1757 RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
1758 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1759 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencilBrush_pin_mode_update");
1760 RNA_def_property_ui_text(prop, "Pin Mode", "Pin the mode to the brush");
1762 prop = RNA_def_property(srna, "brush_draw_mode", PROP_ENUM, PROP_NONE);
1763 RNA_def_property_enum_sdna(prop, NULL, "brush_draw_mode");
1764 RNA_def_property_enum_items(prop, rna_enum_gpencil_brush_modes_items);
1765 RNA_def_property_ui_text(prop, "Mode", "Preselected mode when using this brush");
1766 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1768 prop = RNA_def_property(srna, "use_trim", PROP_BOOLEAN, PROP_NONE);
1769 RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_BRUSH_TRIM_STROKE);
1770 RNA_def_property_boolean_default(prop, false);
1771 RNA_def_property_ui_text(prop, "Trim Stroke Ends", "Trim intersecting stroke ends");
1772 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1774 prop = RNA_def_property(srna, "use_edit_pressure", PROP_BOOLEAN, PROP_NONE);
1775 RNA_def_property_boolean_sdna(prop, NULL, "sculpt_flag", GP_SCULPT_FLAG_SMOOTH_PRESSURE);
1776 RNA_def_property_ui_text(
1777 prop, "Affect Pressure", "Affect pressure values as well when smoothing strokes");
1778 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1779 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
1781 prop = RNA_def_property(srna, "direction", PROP_ENUM, PROP_NONE);
1782 RNA_def_property_enum_bitflag_sdna(prop, NULL, "sculpt_flag");
1783 RNA_def_property_enum_items(prop, prop_direction_items);
1784 RNA_def_property_ui_text(prop, "Direction", "");
1785 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1786 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
1788 prop = RNA_def_property(srna, "use_edit_position", PROP_BOOLEAN, PROP_NONE);
1789 RNA_def_property_boolean_sdna(prop, NULL, "sculpt_mode_flag", GP_SCULPT_FLAGMODE_APPLY_POSITION);
1790 RNA_def_property_ui_text(prop, "Affect Position", "The brush affects the position of the point");
1791 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1792 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
1794 prop = RNA_def_property(srna, "use_edit_strength", PROP_BOOLEAN, PROP_NONE);
1795 RNA_def_property_boolean_sdna(prop, NULL, "sculpt_mode_flag", GP_SCULPT_FLAGMODE_APPLY_STRENGTH);
1796 RNA_def_property_ui_text(
1797 prop, "Affect Strength", "The brush affects the color strength of the point");
1798 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1799 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
1801 prop = RNA_def_property(srna, "use_edit_thickness", PROP_BOOLEAN, PROP_NONE);
1802 RNA_def_property_boolean_sdna(
1803 prop, NULL, "sculpt_mode_flag", GP_SCULPT_FLAGMODE_APPLY_THICKNESS);
1804 RNA_def_property_ui_text(
1805 prop, "Affect Thickness", "The brush affects the thickness of the point");
1806 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1807 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
1809 prop = RNA_def_property(srna, "use_edit_uv", PROP_BOOLEAN, PROP_NONE);
1810 RNA_def_property_boolean_sdna(prop, NULL, "sculpt_mode_flag", GP_SCULPT_FLAGMODE_APPLY_UV);
1811 RNA_def_property_ui_text(prop, "Affect UV", "The brush affects the UV rotation of the point");
1812 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1813 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
1816 prop = RNA_def_property(srna, "material", PROP_POINTER, PROP_NONE);
1817 RNA_def_property_struct_type(prop, "Material");
1818 RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_BrushGpencilSettings_material_poll");
1819 RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK | PROP_CONTEXT_UPDATE);
1820 RNA_def_property_ui_text(prop, "Material", "Material used for strokes drawn using this brush");
1821 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1822 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_Brush_material_update");
1824 prop = RNA_def_property(srna, "show_fill_boundary", PROP_BOOLEAN, PROP_NONE);
1825 RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_BRUSH_FILL_SHOW_HELPLINES);
1826 RNA_def_property_boolean_default(prop, true);
1827 RNA_def_property_ui_text(prop, "Show Lines", "Show help lines for filling to see boundaries");
1828 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1830 prop = RNA_def_property(srna, "show_fill", PROP_BOOLEAN, PROP_NONE);
1831 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GP_BRUSH_FILL_HIDE);
1832 RNA_def_property_boolean_default(prop, true);
1833 RNA_def_property_ui_text(
1834 prop, "Show Fill", "Show transparent lines to use as boundary for filling");
1835 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1837 prop = RNA_def_property(srna, "use_default_eraser", PROP_BOOLEAN, PROP_NONE);
1838 RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_BRUSH_DEFAULT_ERASER);
1839 RNA_def_property_boolean_default(prop, true);
1840 RNA_def_property_ui_icon(prop, ICON_UNPINNED, 1);
1841 RNA_def_property_ui_text(
1842 prop, "Default Eraser", "Use this brush when enable eraser with fast switch key");
1843 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1844 RNA_def_property_update(
1845 prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_default_eraser_update");
1847 prop = RNA_def_property(srna, "use_settings_postprocess", PROP_BOOLEAN, PROP_NONE);
1848 RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_BRUSH_GROUP_SETTINGS);
1849 RNA_def_property_ui_text(
1850 prop, "Use Post-Process Settings", "Additional post processing options for new strokes");
1851 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1853 prop = RNA_def_property(srna, "use_settings_random", PROP_BOOLEAN, PROP_NONE);
1854 RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_BRUSH_GROUP_RANDOM);
1855 RNA_def_property_ui_text(prop, "Random Settings", "Random brush settings");
1856 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1858 prop = RNA_def_property(srna, "use_material_pin", PROP_BOOLEAN, PROP_NONE);
1859 RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_BRUSH_MATERIAL_PINNED);
1860 RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
1861 RNA_def_property_ui_icon(prop, ICON_UNPINNED, 1);
1862 RNA_def_property_ui_text(prop, "Pin Material", "Keep material assigned to brush");
1863 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1864 RNA_def_property_update(
1865 prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_use_material_pin_update");
1867 prop = RNA_def_property(srna, "show_lasso", PROP_BOOLEAN, PROP_NONE);
1868 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GP_BRUSH_DISSABLE_LASSO);
1869 RNA_def_property_ui_text(prop, "Show Lasso", "Do not draw fill color while drawing the stroke");
1870 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1872 prop = RNA_def_property(srna, "use_occlude_eraser", PROP_BOOLEAN, PROP_NONE);
1873 RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_BRUSH_OCCLUDE_ERASER);
1874 RNA_def_property_ui_text(prop, "Occlude Eraser", "Erase only strokes visible and not occluded");
1875 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1878 static void rna_def_brush(BlenderRNA *brna)
1883 static const EnumPropertyItem prop_blend_items[] = {
1884 {IMB_BLEND_MIX, "MIX", 0, "Mix", "Use Mix blending mode while painting"},
1885 {0, "", ICON_NONE, NULL, NULL},
1886 {IMB_BLEND_DARKEN, "DARKEN", 0, "Darken", "Use Darken blending mode while painting"},
1887 {IMB_BLEND_MUL, "MUL", 0, "Multiply", "Use Multiply blending mode while painting"},
1888 {IMB_BLEND_COLORBURN,
1892 "Use Color Burn blending mode while painting"},
1893 {IMB_BLEND_LINEARBURN,
1897 "Use Linear Burn blending mode while painting"},
1898 {0, "", ICON_NONE, NULL, NULL},
1899 {IMB_BLEND_LIGHTEN, "LIGHTEN", 0, "Lighten", "Use Lighten blending mode while painting"},
1900 {IMB_BLEND_SCREEN, "SCREEN", 0, "Screen", "Use Screen blending mode while painting"},
1901 {IMB_BLEND_COLORDODGE,
1905 "Use Color Dodge blending mode while painting"},
1906 {IMB_BLEND_ADD, "ADD", 0, "Add", "Use Add blending mode while painting"},
1907 {0, "", ICON_NONE, NULL, NULL},
1908 {IMB_BLEND_OVERLAY, "OVERLAY", 0, "Overlay", "Use Overlay blending mode while painting"},
1909 {IMB_BLEND_SOFTLIGHT,
1913 "Use Soft Light blending mode while painting"},
1914 {IMB_BLEND_HARDLIGHT,
1918 "Use Hard Light blending mode while painting"},
1919 {IMB_BLEND_VIVIDLIGHT,
1923 "Use Vivid Light blending mode while painting"},
1924 {IMB_BLEND_LINEARLIGHT,
1928 "Use Linear Light blending mode while painting"},
1929 {IMB_BLEND_PINLIGHT,
1933 "Use Pin Light blending mode while painting"},
1934 {0, "", ICON_NONE, NULL, NULL},
1935 {IMB_BLEND_DIFFERENCE,
1939 "Use Difference blending mode while painting"},
1940 {IMB_BLEND_EXCLUSION,
1944 "Use Exclusion blending mode while painting"},
1945 {IMB_BLEND_SUB, "SUB", 0, "Subtract", "Use Subtract blending mode while painting"},
1946 {0, "", ICON_NONE, NULL, NULL},
1947 {IMB_BLEND_HUE, "HUE", 0, "Hue", "Use Hue blending mode while painting"},
1948 {IMB_BLEND_SATURATION,
1952 "Use Saturation blending mode while painting"},
1953 {IMB_BLEND_COLOR, "COLOR", 0, "Color", "Use Color blending mode while painting"},
1954 {IMB_BLEND_LUMINOSITY, "LUMINOSITY", 0, "Value", "Use Value blending mode while painting"},
1955 {0, "", ICON_NONE, NULL, NULL},
1956 {IMB_BLEND_ERASE_ALPHA, "ERASE_ALPHA", 0, "Erase Alpha", "Erase alpha while painting"},
1957 {IMB_BLEND_ADD_ALPHA, "ADD_ALPHA", 0, "Add Alpha", "Add alpha while painting"},
1958 {0, NULL, 0, NULL, NULL},
1961 static const EnumPropertyItem brush_sculpt_plane_items[] = {
1962 {SCULPT_DISP_DIR_AREA, "AREA", 0, "Area Plane", ""},
1963 {SCULPT_DISP_DIR_VIEW, "VIEW", 0, "View Plane", ""},
1964 {SCULPT_DISP_DIR_X, "X", 0, "X Plane", ""},
1965 {SCULPT_DISP_DIR_Y, "Y", 0, "Y Plane", ""},
1966 {SCULPT_DISP_DIR_Z, "Z", 0, "Z Plane", ""},
1967 {0, NULL, 0, NULL, NULL},
1970 static const EnumPropertyItem brush_mask_tool_items[] = {
1971 {BRUSH_MASK_DRAW, "DRAW", 0, "Draw", ""},
1972 {BRUSH_MASK_SMOOTH, "SMOOTH", 0, "Smooth", ""},
1973 {0, NULL, 0, NULL, NULL},
1976 static const EnumPropertyItem brush_blur_mode_items[] = {
1977 {KERNEL_BOX, "BOX", 0, "Box", ""},
1978 {KERNEL_GAUSSIAN, "GAUSSIAN", 0, "Gaussian", ""},
1979 {0, NULL, 0, NULL, NULL},
1982 static const EnumPropertyItem brush_gradient_items[] = {
1983 {BRUSH_GRADIENT_PRESSURE, "PRESSURE", 0, "Pressure", ""},
1984 {BRUSH_GRADIENT_SPACING_REPEAT, "SPACING_REPEAT", 0, "Repeat", ""},
1985 {BRUSH_GRADIENT_SPACING_CLAMP, "SPACING_CLAMP", 0, "Clamp", ""},
1986 {0, NULL, 0, NULL, NULL},
1989 static const EnumPropertyItem brush_gradient_fill_items[] = {
1990 {BRUSH_GRADIENT_LINEAR, "LINEAR", 0, "Linear", ""},
1991 {BRUSH_GRADIENT_RADIAL, "RADIAL", 0, "Radial", ""},
1992 {0, NULL, 0, NULL, NULL},
1995 static const EnumPropertyItem brush_mask_pressure_items[] = {
1996 {0, "NONE", 0, "Off", ""},
1997 {BRUSH_MASK_PRESSURE_RAMP, "RAMP", ICON_STYLUS_PRESSURE, "Ramp", ""},
1998 {BRUSH_MASK_PRESSURE_CUTOFF, "CUTOFF", ICON_STYLUS_PRESSURE, "Cutoff", ""},
1999 {0, NULL, 0, NULL, NULL},
2002 static const EnumPropertyItem brush_size_unit_items[] = {
2003 {0, "VIEW", 0, "View", "Measure brush size relative to the view"},
2004 {BRUSH_LOCK_SIZE, "SCENE", 0, "Scene", "Measure brush size relative to the scene"},
2005 {0, NULL, 0, NULL, NULL},
2008 static const EnumPropertyItem color_gradient_items[] = {
2009 {0, "COLOR", 0, "Color", "Paint with a single color"},
2010 {BRUSH_USE_GRADIENT, "GRADIENT", 0, "Gradient", "Paint with a gradient"},
2011 {0, NULL, 0, NULL, NULL},
2014 static const EnumPropertyItem brush_spacing_unit_items[] = {
2015 {0, "VIEW", 0, "View", "Calculate brush spacing relative to the view"},
2016 {BRUSH_SCENE_SPACING,
2020 "Calculate brush spacing relative to the scene using the stroke location"},
2021 {0, NULL, 0, NULL, NULL},
2024 static const EnumPropertyItem brush_jitter_unit_items[] = {
2025 {BRUSH_ABSOLUTE_JITTER, "VIEW", 0, "View", "Jittering happens in screen space, in pixels"},
2026 {0, "BRUSH", 0, "Brush", "Jittering happens relative to the brush size"},
2027 {0, NULL, 0, NULL, NULL},
2030 static const EnumPropertyItem falloff_shape_unit_items[] = {
2031 {0, "SPHERE", 0, "Sphere", "Apply brush influence in a Sphere, outwards from the center"},
2032 {PAINT_FALLOFF_SHAPE_TUBE,
2036 "Apply brush influence in a 2D circle, projected from the view"},
2037 {0, NULL, 0, NULL, NULL},
2040 static const EnumPropertyItem brush_curve_preset_items[] = {
2041 {BRUSH_CURVE_CUSTOM, "CUSTOM", ICON_RNDCURVE, "Custom", ""},
2042 {BRUSH_CURVE_SMOOTH, "SMOOTH", ICON_SMOOTHCURVE, "Smooth", ""},
2043 {BRUSH_CURVE_SMOOTHER, "SMOOTHER", ICON_SMOOTHCURVE, "Smoother", ""},
2044 {BRUSH_CURVE_SPHERE, "SPHERE", ICON_SPHERECURVE, "Sphere", ""},
2045 {BRUSH_CURVE_ROOT, "ROOT", ICON_ROOTCURVE, "Root", ""},
2046 {BRUSH_CURVE_SHARP, "SHARP", ICON_SHARPCURVE, "Sharp", ""},
2047 {BRUSH_CURVE_LIN, "LIN", ICON_LINCURVE, "Linear", ""},
2048 {BRUSH_CURVE_POW4, "POW4", ICON_SHARPCURVE, "Sharper", ""},
2049 {BRUSH_CURVE_INVSQUARE, "INVSQUARE", ICON_INVERSESQUARECURVE, "Inverse Square", ""},
2050 {BRUSH_CURVE_CONSTANT, "CONSTANT", ICON_NOCURVE, "Constant", ""},
2051 {0, NULL, 0, NULL, NULL},
2054 static const EnumPropertyItem brush_deformation_target_items[] = {
2055 {BRUSH_DEFORM_TARGET_GEOMETRY,
2059 "Brush deformation displaces the vertices of the mesh"},
2060 {BRUSH_DEFORM_TARGET_CLOTH_SIM,
2064 "Brush deforms the mesh by deforming the constraints of a cloth simulation"},
2065 {0, NULL, 0, NULL, NULL},
2068 static const EnumPropertyItem brush_elastic_deform_type_items[] = {
2069 {BRUSH_ELASTIC_DEFORM_GRAB, "GRAB", 0, "Grab", ""},
2070 {BRUSH_ELASTIC_DEFORM_GRAB_BISCALE, "GRAB_BISCALE", 0, "Bi-Scale Grab", ""},
2071 {BRUSH_ELASTIC_DEFORM_GRAB_TRISCALE, "GRAB_TRISCALE", 0, "Tri-Scale Grab", ""},
2072 {BRUSH_ELASTIC_DEFORM_SCALE, "SCALE", 0, "Scale", ""},
2073 {BRUSH_ELASTIC_DEFORM_TWIST, "TWIST", 0, "Twist", ""},
2074 {0, NULL, 0, NULL, NULL},
2077 static const EnumPropertyItem brush_snake_hook_deform_type_items[] = {
2078 {BRUSH_SNAKE_HOOK_DEFORM_FALLOFF,
2082 "Applies the brush falloff in the tip of the brush"},
2083 {BRUSH_SNAKE_HOOK_DEFORM_ELASTIC,
2087 "Modifies the entire mesh using elastic deform"},
2088 {0, NULL, 0, NULL, NULL},
2091 static const EnumPropertyItem brush_cloth_deform_type_items[] = {
2092 {BRUSH_CLOTH_DEFORM_DRAG, "DRAG", 0, "Drag", ""},
2093 {BRUSH_CLOTH_DEFORM_PUSH, "PUSH", 0, "Push", ""},
2094 {BRUSH_CLOTH_DEFORM_PINCH_POINT, "PINCH_POINT", 0, "Pinch Point", ""},
2095 {BRUSH_CLOTH_DEFORM_PINCH_PERPENDICULAR,
2096 "PINCH_PERPENDICULAR",
2098 "Pinch Perpendicular",
2100 {BRUSH_CLOTH_DEFORM_INFLATE, "INFLATE", 0, "Inflate", ""},
2101 {BRUSH_CLOTH_DEFORM_GRAB, "GRAB", 0, "Grab", ""},
2102 {BRUSH_CLOTH_DEFORM_EXPAND, "EXPAND", 0, "Expand", ""},
2103 {BRUSH_CLOTH_DEFORM_SNAKE_HOOK, "SNAKE_HOOK", 0, "Snake Hook", ""},
2104 {0, NULL, 0, NULL, NULL},
2107 static const EnumPropertyItem brush_cloth_force_falloff_type_items[] = {
2108 {BRUSH_CLOTH_FORCE_FALLOFF_RADIAL, "RADIAL", 0, "Radial", ""},
2109 {BRUSH_CLOTH_FORCE_FALLOFF_PLANE, "PLANE", 0, "Plane", ""},
2110 {0, NULL, 0, NULL, NULL},
2113 static const EnumPropertyItem brush_boundary_falloff_type_items[] = {
2114 {BRUSH_BOUNDARY_FALLOFF_CONSTANT,
2118 "Applies the same deformation in the entire boundary"},
2119 {BRUSH_BOUNDARY_FALLOFF_RADIUS,
2123 "Applies the deformation in a localized area limited by the brush radius"},
2124 {BRUSH_BOUNDARY_FALLOFF_LOOP,
2128 "Applies the brush falloff in a loop pattern"},
2129 {BRUSH_BOUNDARY_FALLOFF_LOOP_INVERT,
2133 "Applies the falloff radius in a loop pattern, inverting the displacement direction in "
2134 "each pattern repetition"},
2135 {0, NULL, 0, NULL, NULL},
2138 static const EnumPropertyItem brush_cloth_simulation_area_type_items[] = {
2139 {BRUSH_CLOTH_SIMULATION_AREA_LOCAL,
2143 "Simulates only a specific area around the brush limited by a fixed radius"},
2144 {BRUSH_CLOTH_SIMULATION_AREA_GLOBAL, "GLOBAL", 0, "Global", "Simulates the entire mesh"},
2145 {BRUSH_CLOTH_SIMULATION_AREA_DYNAMIC,
2149 "The active simulation area moves with the brush"},
2150 {0, NULL, 0, NULL, NULL},
2153 static const EnumPropertyItem brush_smooth_deform_type_items[] = {
2154 {BRUSH_SMOOTH_DEFORM_LAPLACIAN,
2158 "Smooths the surface and the volume"},
2159 {BRUSH_SMOOTH_DEFORM_SURFACE,
2163 "Smooths the surface of the mesh, preserving the volume"},
2164 {0, NULL, 0, NULL, NULL},
2167 static const EnumPropertyItem brush_pose_deform_type_items[] = {
2168 {BRUSH_POSE_DEFORM_ROTATE_TWIST, "ROTATE_TWIST", 0, "Rotate/Twist", ""},
2169 {BRUSH_POSE_DEFORM_SCALE_TRASLATE, "SCALE_TRANSLATE", 0, "Scale/Translate", ""},
2170 {BRUSH_POSE_DEFORM_SQUASH_STRETCH, "SQUASH_STRETCH", 0, "Squash & Stretch", ""},
2171 {0, NULL, 0, NULL, NULL},
2174 static const EnumPropertyItem brush_pose_origin_type_items[] = {
2175 {BRUSH_POSE_ORIGIN_TOPOLOGY,
2179 "Sets the rotation origin automatically using the topology and shape of the mesh as a "
2181 {BRUSH_POSE_ORIGIN_FACE_SETS,
2185 "Creates a pose segment per face sets, starting from the active face set"},
2186 {BRUSH_POSE_ORIGIN_FACE_SETS_FK,
2190 "Simulates an FK deformation using the Face Set under the cursor as control"},
2191 {0, NULL, 0, NULL, NULL},
2194 static const EnumPropertyItem brush_smear_deform_type_items[] = {
2195 {BRUSH_SMEAR_DEFORM_DRAG, "DRAG", 0, "Drag", ""},
2196 {BRUSH_SMEAR_DEFORM_PINCH, "PINCH", 0, "Pinch", ""},
2197 {BRUSH_SMEAR_DEFORM_EXPAND, "EXPAND", 0, "Expand", ""},
2198 {0, NULL, 0, NULL, NULL},
2201 static const EnumPropertyItem brush_slide_deform_type_items[] = {
2202 {BRUSH_SLIDE_DEFORM_DRAG, "DRAG", 0, "Drag", ""},
2203 {BRUSH_SLIDE_DEFORM_PINCH, "PINCH", 0, "Pinch", ""},
2204 {BRUSH_SLIDE_DEFORM_EXPAND, "EXPAND", 0, "Expand", ""},
2205 {0, NULL, 0, NULL, NULL},
2208 static const EnumPropertyItem brush_boundary_deform_type_items[] = {
2209 {BRUSH_BOUNDARY_DEFORM_BEND, "BEND", 0, "Bend", ""},
2210 {BRUSH_BOUNDARY_DEFORM_EXPAND, "EXPAND", 0, "Expand", ""},
2211 {BRUSH_BOUNDARY_DEFORM_INFLATE, "INFLATE", 0, "Inflate", ""},
2212 {BRUSH_BOUNDARY_DEFORM_GRAB, "GRAB", 0, "Grab", ""},
2213 {BRUSH_BOUNDARY_DEFORM_TWIST, "TWIST", 0, "Twist", ""},
2214 {BRUSH_BOUNDARY_DEFORM_SMOOTH, "SMOOTH", 0, "Smooth", ""},
2215 {0, NULL, 0, NULL, NULL},
2218 srna = RNA_def_struct(brna, "Brush", "ID");
2219 RNA_def_struct_ui_text(
2220 srna, "Brush", "Brush data-block for storing brush settings for painting and sculpting");
2221 RNA_def_struct_ui_icon(srna, ICON_BRUSH_DATA);
2224 prop = RNA_def_property(srna, "blend", PROP_ENUM, PROP_NONE);
2225 RNA_def_property_enum_items(prop, prop_blend_items);
2226 RNA_def_property_ui_text(prop, "Blending Mode", "Brush blending mode");
2227 RNA_def_property_update(prop, 0, "rna_Brush_update");
2230 * Begin per-mode tool properties.
2232 * keep in sync with #BKE_paint_get_tool_prop_id_from_paintmode
2234 prop = RNA_def_property(srna, "sculpt_tool", PROP_ENUM, PROP_NONE);
2235 RNA_def_property_enum_items(prop, rna_enum_brush_sculpt_tool_items);
2236 RNA_def_property_ui_text(prop, "Sculpt Tool", "");
2237 RNA_def_property_update(prop, 0, "rna_Brush_update_and_reset_icon");
2239 prop = RNA_def_property(srna, "uv_sculpt_tool", PROP_ENUM, PROP_NONE);
2240 RNA_def_property_enum_items(prop, rna_enum_brush_uv_sculpt_tool_items);
2241 RNA_def_property_ui_text(prop, "Sculpt Tool", "");
2242 RNA_def_property_update(prop, 0, "rna_Brush_update_and_reset_icon");
2244 prop = RNA_def_property(srna, "vertex_tool", PROP_ENUM, PROP_NONE);
2245 RNA_def_property_enum_sdna(prop, NULL, "vertexpaint_tool");
2246 RNA_def_property_enum_items(prop, rna_enum_brush_vertex_tool_items);
2247 RNA_def_property_ui_text(prop, "Vertex Paint Tool", "");
2248 RNA_def_property_update(prop, 0, "rna_Brush_update_and_reset_icon");
2250 prop = RNA_def_property(srna, "weight_tool", PROP_ENUM, PROP_NONE);
2251 RNA_def_property_enum_sdna(prop, NULL, "weightpaint_tool");
2252 RNA_def_property_enum_items(prop, rna_enum_brush_weight_tool_items);
2253 RNA_def_property_ui_text(prop, "Weight Paint Tool", "");
2254 RNA_def_property_update(prop, 0, "rna_Brush_update_and_reset_icon");
2256 prop = RNA_def_property(srna, "image_tool", PROP_ENUM, PROP_NONE);
2257 RNA_def_property_enum_sdna(prop, NULL, "imagepaint_tool");
2258 RNA_def_property_enum_items(prop, rna_enum_brush_image_tool_items);
2259 RNA_def_property_ui_text(prop, "Image Paint Tool", "");
2260 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, "rna_Brush_update_and_reset_icon");
2262 prop = RNA_def_property(srna, "gpencil_tool", PROP_ENUM, PROP_NONE);
2263 RNA_def_property_enum_sdna(prop, NULL, "gpencil_tool");
2264 RNA_def_property_enum_items(prop, rna_enum_brush_gpencil_types_items);
2265 RNA_def_property_ui_text(prop, "Grease Pencil Draw Tool", "");
2266 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2268 prop = RNA_def_property(srna, "gpencil_vertex_tool", PROP_ENUM, PROP_NONE);
2269 RNA_def_property_enum_sdna(prop, NULL, "gpencil_vertex_tool");
2270 RNA_def_property_enum_items(prop, rna_enum_brush_gpencil_vertex_types_items);
2271 RNA_def_property_ui_text(prop, "Grease Pencil Vertex Paint Tool", "");
2272 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2274 prop = RNA_def_property(srna, "gpencil_sculpt_tool", PROP_ENUM, PROP_NONE);
2275 RNA_def_property_enum_sdna(prop, NULL, "gpencil_sculpt_tool");
2276 RNA_def_property_enum_items(prop, rna_enum_brush_gpencil_sculpt_types_items);
2277 RNA_def_property_ui_text(prop, "Grease Pencil Sculpt Paint Tool", "");
2278 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2280 prop = RNA_def_property(srna, "gpencil_weight_tool", PROP_ENUM, PROP_NONE);
2281 RNA_def_property_enum_sdna(prop, NULL, "gpencil_weight_tool");
2282 RNA_def_property_enum_items(prop, rna_enum_brush_gpencil_weight_types_items);
2283 RNA_def_property_ui_text(prop, "Grease Pencil Weight Paint Tool", "");
2284 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2286 /** End per mode tool properties. */
2288 prop = RNA_def_property(srna, "direction", PROP_ENUM, PROP_NONE);
2289 RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
2290 RNA_def_property_enum_items(prop, prop_direction_items);
2291 RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Brush_direction_itemf");
2292 RNA_def_property_ui_text(prop, "Direction", "");
2293 RNA_def_property_update(prop, 0, "rna_Brush_update");
2295 prop = RNA_def_property(srna, "stroke_method", PROP_ENUM, PROP_NONE);
2296 RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
2297 RNA_def_property_enum_items(prop, sculpt_stroke_method_items);
2298 RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Brush_stroke_itemf");
2299 RNA_def_property_ui_text(prop, "Stroke Method", "");
2300 RNA_def_property_update(prop, 0, "rna_Brush_stroke_update");
2302 prop = RNA_def_property(srna, "sculpt_plane", PROP_ENUM, PROP_NONE);
2303 RNA_def_property_enum_items(prop, brush_sculpt_plane_items);
2304 RNA_def_property_ui_text(prop, "Sculpt Plane", "");
2305 RNA_def_property_update(prop, 0, "rna_Brush_update");
2307 prop = RNA_def_property(srna, "mask_tool", PROP_ENUM, PROP_NONE);
2308 RNA_def_property_enum_items(prop, brush_mask_tool_items);
2309 RNA_def_property_ui_text(prop, "Mask Tool", "");
2310 RNA_def_property_update(prop, 0, "rna_Brush_update");
2312 prop = RNA_def_property(srna, "curve_preset", PROP_ENUM, PROP_NONE);
2313 RNA_def_property_enum_items(prop, brush_curve_preset_items);
2314 RNA_def_property_ui_text(prop, "Curve Preset", "");
2315 RNA_def_property_update(prop, 0, "rna_Brush_update");
2317 prop = RNA_def_property(srna, "deform_target", PROP_ENUM, PROP_NONE);
2318 RNA_def_property_enum_items(prop, brush_deformation_target_items);
2319 RNA_def_property_ui_text(
2320 prop, "Deformation Target", "How the deformation of the brush will affect the object");
2321 RNA_def_property_update(prop, 0, "rna_Brush_update");
2323 prop = RNA_def_property(srna, "elastic_deform_type", PROP_ENUM, PROP_NONE);
2324 RNA_def_property_enum_items(prop, brush_elastic_deform_type_items);
2325 RNA_def_property_ui_text(prop, "Deformation", "Deformation type that is used in the brush");
2326 RNA_def_property_update(prop, 0, "rna_Brush_update");
2328 prop = RNA_def_property(srna, "snake_hook_deform_type", PROP_ENUM, PROP_NONE);
2329 RNA_def_property_enum_items(prop, brush_snake_hook_deform_type_items);
2330 RNA_def_property_ui_text(prop, "Deformation", "Deformation type that is used in the brush");
2331 RNA_def_property_update(prop, 0, "rna_Brush_update");
2333 prop = RNA_def_property(srna, "cloth_deform_type", PROP_ENUM, PROP_NONE);
2334 RNA_def_property_enum_items(prop, brush_cloth_deform_type_items);
2335 RNA_def_property_ui_text(prop, "Deformation", "Deformation type that is used in the brush");
2336 RNA_def_property_update(prop, 0, "rna_Brush_update");
2338 prop = RNA_def_property(srna, "cloth_force_falloff_type", PROP_ENUM, PROP_NONE);
2339 RNA_def_property_enum_items(prop, brush_cloth_force_falloff_type_items);
2340 RNA_def_property_ui_text(
2341 prop, "Force Falloff", "Shape used in the brush to apply force to the cloth");
2342 RNA_def_property_update(prop, 0, "rna_Brush_update");
2344 prop = RNA_def_property(srna, "cloth_simulation_area_type", PROP_ENUM, PROP_NONE);
2345 RNA_def_property_enum_items(prop, brush_cloth_simulation_area_type_items);
2346 RNA_def_property_ui_text(
2349 "Part of the mesh that is going to be simulated when the stroke is active");
2350 RNA_def_property_update(prop, 0, "rna_Brush_update");
2352 prop = RNA_def_property(srna, "boundary_falloff_type", PROP_ENUM, PROP_NONE);
2353 RNA_def_property_enum_items(prop, brush_boundary_falloff_type_items);
2354 RNA_def_property_ui_text(
2355 prop, "Boundary Falloff", "How the brush falloff is applied across the boundary");
2356 RNA_def_property_update(prop, 0, "rna_Brush_update");
2358 prop = RNA_def_property(srna, "smooth_deform_type", PROP_ENUM, PROP_NONE);
2359 RNA_def_property_enum_items(prop, brush_smooth_deform_type_items);
2360 RNA_def_property_ui_text(prop, "Deformation", "Deformation type that is used in the brush");
2361 RNA_def_property_update(prop, 0, "rna_Brush_update");
2363 prop = RNA_def_property(srna, "smear_deform_type", PROP_ENUM, PROP_NONE);
2364 RNA_def_property_enum_items(prop, brush_smear_deform_type_items);
2365 RNA_def_property_ui_text(prop, "Deformation", "Deformation type that is used in the brush");
2366 RNA_def_property_update(prop, 0, "rna_Brush_update");
2368 prop = RNA_def_property(srna, "slide_deform_type", PROP_ENUM, PROP_NONE);
2369 RNA_def_property_enum_items(prop, brush_slide_deform_type_items);
2370 RNA_def_property_ui_text(prop, "Deformation", "Deformation type that is used in the brush");
2371 RNA_def_property_update(prop, 0, "rna_Brush_update");
2373 prop = RNA_def_property(srna, "boundary_deform_type", PROP_ENUM, PROP_NONE);
2374 RNA_def_property_enum_items(prop, brush_boundary_deform_type_items);
2375 RNA_def_property_ui_text(prop, "Deformation", "Deformation type that is used in the brush");
2376 RNA_def_property_update(prop, 0, "rna_Brush_update");
2378 prop = RNA_def_property(srna, "pose_deform_type", PROP_ENUM, PROP_NONE);
2379 RNA_def_property_enum_items(prop, brush_pose_deform_type_items);
2380 RNA_def_property_ui_text(prop, "Deformation", "Deformation type that is used in the brush");
2381 RNA_def_property_update(prop, 0, "rna_Brush_update");
2383 prop = RNA_def_property(srna, "pose_origin_type", PROP_ENUM, PROP_NONE);
2384 RNA_def_property_enum_items(prop, brush_pose_origin_type_items);
2385 RNA_def_property_ui_text(prop,
2387 "Method to set the rotation origins for the segments of the brush");
2388 RNA_def_property_update(prop, 0, "rna_Brush_update");
2390 prop = RNA_def_property(srna, "jitter_unit", PROP_ENUM, PROP_NONE); /* as an enum */
2391 RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
2392 RNA_def_property_enum_items(prop, brush_jitter_unit_items);
2393 RNA_def_property_ui_text(
2394 prop, "Jitter Unit", "Jitter in screen space or relative to brush size");
2395 RNA_def_property_update(prop, 0, "rna_Brush_update");
2397 prop = RNA_def_property(srna, "falloff_shape", PROP_ENUM, PROP_NONE); /* as an enum */
2398 RNA_def_property_enum_bitflag_sdna(prop, NULL, "falloff_shape");
2399 RNA_def_property_enum_items(prop, falloff_shape_unit_items);
2400 RNA_def_property_ui_text(prop, "Falloff Shape", "Use projected or spherical falloff");
2401 RNA_def_property_update(prop, 0, "rna_Brush_update");
2404 prop = RNA_def_property(srna, "size", PROP_INT, PROP_PIXEL);
2405 RNA_def_property_int_funcs(prop, NULL, "rna_Brush_set_size", NULL);
2406 RNA_def_property_range(prop, 1, MAX_BRUSH_PIXEL_RADIUS * 10);
2407 RNA_def_property_ui_range(prop, 1, MAX_BRUSH_PIXEL_RADIUS, 1, -1);
2408 RNA_def_property_ui_text(prop, "Radius", "Radius of the brush in pixels");
2409 RNA_def_property_update(prop, 0, "rna_Brush_size_update");
2411 prop = RNA_def_property(srna, "unprojected_radius", PROP_FLOAT, PROP_DISTANCE);
2412 RNA_def_property_float_funcs(prop, NULL, "rna_Brush_set_unprojected_radius", NULL);
2413 RNA_def_property_range(prop, 0.001, FLT_MAX);
2414 RNA_def_property_ui_range(prop, 0.001, 1, 1, -1);
2415 RNA_def_property_ui_text(prop, "Unprojected Radius", "Radius of brush in Blender units");
2416 RNA_def_property_update(prop, 0, "rna_Brush_size_update");
2418 prop = RNA_def_property(srna, "jitter", PROP_FLOAT, PROP_NONE);
2419 RNA_def_property_float_sdna(prop, NULL, "jitter");
2420 RNA_def_property_range(prop, 0.0f, 1000.0f);
2421 RNA_def_property_ui_range(prop, 0.0f, 2.0f, 0.1, 4);
2422 RNA_def_property_ui_text(prop, "Jitter", "Jitter the position of the brush while painting");
2423 RNA_def_property_update(prop, 0, "rna_Brush_update");
2425 prop = RNA_def_property(srna, "jitter_absolute", PROP_INT, PROP_PIXEL);
2426 RNA_def_property_int_sdna(prop, NULL, "jitter_absolute");
2427 RNA_def_property_range(prop, 0, 1000000);
2428 RNA_def_property_ui_text(
2429 prop, "Jitter", "Jitter the position of the brush in pixels while painting");
2430 RNA_def_property_update(prop, 0, "rna_Brush_update");
2432 prop = RNA_def_property(srna, "spacing", PROP_INT, PROP_PERCENTAGE);
2433 RNA_def_property_int_sdna(prop, NULL, "spacing");
2434 RNA_def_property_range(prop, 1, 1000);
2435 RNA_def_property_ui_range(prop, 1, 500, 5, -1);
2436 RNA_def_property_ui_text(
2437 prop, "Spacing", "Spacing between brush daubs as a percentage of brush diameter");
2438 RNA_def_property_update(prop, 0, "rna_Brush_update");
2440 prop = RNA_def_property(srna, "grad_spacing", PROP_INT, PROP_PIXEL);
2441 RNA_def_property_int_sdna(prop, NULL, "gradient_spacing");
2442 RNA_def_property_range(prop, 1, 10000);
2443 RNA_def_property_ui_range(prop, 1, 10000, 5, -1);
2444 RNA_def_property_ui_text(
2445 prop, "Gradient Spacing", "Spacing before brush gradient goes full circle");
2446 RNA_def_property_update(prop, 0, "rna_Brush_update");
2448 prop = RNA_def_property(srna, "smooth_stroke_radius", PROP_INT, PROP_PIXEL);
2449 RNA_def_property_range(prop, 10, 200);
2450 RNA_def_property_ui_text(
2451 prop, "Smooth Stroke Radius", "Minimum distance from last point before stroke continues");
2452 RNA_def_property_update(prop, 0, "rna_Brush_update");
2454 prop = RNA_def_property(srna, "smooth_stroke_factor", PROP_FLOAT, PROP_FACTOR);
2455 RNA_def_property_range(prop, 0.5, 0.99);
2456 RNA_def_property_ui_text(prop, "Smooth Stroke Factor", "Higher values give a smoother stroke");
2457 RNA_def_property_update(prop, 0, "rna_Brush_update");
2459 prop = RNA_def_property(srna, "rate", PROP_FLOAT, PROP_NONE);
2460 RNA_def_property_float_sdna(prop, NULL, "rate");
2461 RNA_def_property_range(prop, 0.0001f, 10000.0f);
2462 RNA_def_property_ui_range(prop, 0.01f, 1.0f, 1, 3);
2463 RNA_def_property_ui_text(prop, "Rate", "Interval between paints for Airbrush");
2464 RNA_def_property_update(prop, 0, "rna_Brush_update");
2466 prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR_GAMMA);
2467 RNA_def_property_range(prop, 0.0, 1.0);
2468 RNA_def_property_float_sdna(prop, NULL, "rgb");
2469 RNA_def_property_ui_text(prop, "Color", "");
2470 RNA_def_property_update(prop, 0, "rna_Brush_update");
2472 prop = RNA_def_property(srna, "secondary_color", PROP_FLOAT, PROP_COLOR_GAMMA);
2473 RNA_def_property_range(prop, 0.0, 1.0);
2474 RNA_def_property_float_sdna(prop, NULL, "secondary_rgb");
2475 RNA_def_property_ui_text(prop, "Secondary Color", "");
2476 RNA_def_property_update(prop, 0, "rna_Brush_update");
2478 prop = RNA_def_property(srna, "weight", PROP_FLOAT, PROP_FACTOR);
2479 RNA_def_property_range(prop, 0.0f, 1.0f);
2480 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
2481 RNA_def_property_ui_text(prop, "Weight", "Vertex weight when brush is applied");
2482 RNA_def_property_update(prop, 0, "rna_Brush_update");
2484 prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_FACTOR);
2485 RNA_def_property_float_sdna(prop, NULL, "alpha");
2486 RNA_def_property_range(prop, 0.0f, 10.0f);
2487 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
2488 RNA_def_property_ui_text(
2489 prop, "Strength", "How powerful the effect of the brush is when applied");
2490 RNA_def_property_update(prop, 0, "rna_Brush_update");
2492 prop = RNA_def_property(srna, "flow", PROP_FLOAT, PROP_FACTOR);
2493 RNA_def_property_float_sdna(prop, NULL, "flow");
2494 RNA_def_property_range(prop, 0.0f, 1.0f);
2495 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
2496 RNA_def_property_ui_text(prop, "Flow", "Amount of paint that is applied per stroke sample");
2497 RNA_def_property_update(prop, 0, "rna_Brush_update");
2499 prop = RNA_def_property(srna, "wet_mix", PROP_FLOAT, PROP_FACTOR);
2500 RNA_def_property_float_sdna(prop, NULL, "wet_mix");
2501 RNA_def_property_range(prop, 0.0f, 1.0f);
2502 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
2503 RNA_def_property_ui_text(
2504 prop, "Wet Mix", "Amount of paint that is picked from the surface into the brush color");
2505 RNA_def_property_update(prop, 0, "rna_Brush_update");
2507 prop = RNA_def_property(srna, "wet_persistence", PROP_FLOAT, PROP_FACTOR);
2508 RNA_def_property_float_sdna(prop, NULL, "wet_persistence");
2509 RNA_def_property_range(prop, 0.0f, 1.0f);
2510 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
2511 RNA_def_property_ui_text(
2514 "Amount of wet paint that stays in the brush after applying paint to the surface");
2515 RNA_def_property_update(prop, 0, "rna_Brush_update");
2517 prop = RNA_def_property(srna, "density", PROP_FLOAT, PROP_FACTOR);
2518 RNA_def_property_float_sdna(prop, NULL, "density");
2519 RNA_def_property_range(prop, 0.0f, 1.0f);
2520 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
2521 RNA_def_property_ui_text(
2522 prop, "Density", "Amount of random elements that are going to be affected by the brush");
2523 RNA_def_property_update(prop, 0, "rna_Brush_update");
2525 prop = RNA_def_property(srna, "tip_scale_x", PROP_FLOAT, PROP_FACTOR);
2526 RNA_def_property_float_sdna(prop, NULL, "tip_scale_x");
2527 RNA_def_property_range(prop, 0.0f, 1.0f);
2528 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
2529 RNA_def_property_ui_text(prop, "Tip Scale X", "Scale of the brush tip in the X axis");
2530 RNA_def_property_update(prop, 0, "rna_Brush_update");
2532 prop = RNA_def_property(srna, "use_hardness_pressure", PROP_BOOLEAN, PROP_NONE);
2533 RNA_def_property_boolean_sdna(prop, NULL, "paint_flags", BRUSH_PAINT_HARDNESS_PRESSURE);
2534 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
2535 RNA_def_property_ui_text(prop, "Use Pressure for Hardness", "Use pressure to modulate hardness");
2536 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2537 RNA_def_property_update(prop, 0, "rna_Brush_update");
2539 prop = RNA_def_property(srna, "invert_hardness_pressure", PROP_BOOLEAN, PROP_NONE);
2540 RNA_def_property_boolean_sdna(prop, NULL, "paint_flags", BRUSH_PAINT_HARDNESS_PRESSURE_INVERT);
2541 RNA_def_property_ui_icon(prop, ICON_ARROW_LEFTRIGHT, 0);
2542 RNA_def_property_ui_text(
2543 prop, "Invert Pressure for Hardness", "Invert the modulation of pressure in hardness");
2544 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2545 RNA_def_property_update(prop, 0, "rna_Brush_update");
2547 prop = RNA_def_property(srna, "use_flow_pressure", PROP_BOOLEAN, PROP_NONE);
2548 RNA_def_property_boolean_sdna(prop, NULL, "paint_flags", BRUSH_PAINT_FLOW_PRESSURE);
2549 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
2550 RNA_def_property_ui_text(prop, "Use Pressure for Flow", "Use pressure to modulate flow");
2551 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2552 RNA_def_property_update(prop, 0, "rna_Brush_update");
2554 prop = RNA_def_property(srna, "invert_flow_pressure", PROP_BOOLEAN, PROP_NONE);
2555 RNA_def_property_boolean_sdna(prop, NULL, "paint_flags", BRUSH_PAINT_FLOW_PRESSURE_INVERT);
2556 RNA_def_property_ui_icon(prop, ICON_ARROW_LEFTRIGHT, 0);
2557 RNA_def_property_ui_text(
2558 prop, "Invert Pressure for Flow", "Invert the modulation of pressure in flow");
2559 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2560 RNA_def_property_update(prop, 0, "rna_Brush_update");
2562 prop = RNA_def_property(srna, "use_wet_mix_pressure", PROP_BOOLEAN, PROP_NONE);
2563 RNA_def_property_boolean_sdna(prop, NULL, "paint_flags", BRUSH_PAINT_WET_MIX_PRESSURE);
2564 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
2565 RNA_def_property_ui_text(prop, "Use Pressure for Wet Mix", "Use pressure to modulate wet mix");
2566 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2567 RNA_def_property_update(prop, 0, "rna_Brush_update");
2569 prop = RNA_def_property(srna, "invert_wet_mix_pressure", PROP_BOOLEAN, PROP_NONE);
2570 RNA_def_property_boolean_sdna(prop, NULL, "paint_flags", BRUSH_PAINT_WET_MIX_PRESSURE_INVERT);
2571 RNA_def_property_ui_icon(prop, ICON_ARROW_LEFTRIGHT, 0);
2572 RNA_def_property_ui_text(
2573 prop, "Invert Pressure for Wet Mix", "Invert the modulation of pressure in wet mix");
2574 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2575 RNA_def_property_update(prop, 0, "rna_Brush_update");
2577 prop = RNA_def_property(srna, "use_wet_persistence_pressure", PROP_BOOLEAN, PROP_NONE);
2578 RNA_def_property_boolean_sdna(prop, NULL, "paint_flags", BRUSH_PAINT_WET_PERSISTENCE_PRESSURE);
2579 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
2580 RNA_def_property_ui_text(
2581 prop, "Use Pressure for Wet Persistence", "Use pressure to modulate wet persistence");
2582 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2583 RNA_def_property_update(prop, 0, "rna_Brush_update");
2585 prop = RNA_def_property(srna, "invert_wet_persistence_pressure", PROP_BOOLEAN, PROP_NONE);
2586 RNA_def_property_boolean_sdna(
2587 prop, NULL, "paint_flags", BRUSH_PAINT_WET_PERSISTENCE_PRESSURE_INVERT);
2588 RNA_def_property_ui_icon(prop, ICON_ARROW_LEFTRIGHT, 0);
2589 RNA_def_property_ui_text(prop,
2590 "Invert Pressure for Wet Persistence",
2591 "Invert the modulation of pressure in wet persistence");
2592 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2593 RNA_def_property_update(prop, 0, "rna_Brush_update");
2595 prop = RNA_def_property(srna, "use_density_pressure", PROP_BOOLEAN, PROP_NONE);
2596 RNA_def_property_boolean_sdna(prop, NULL, "paint_flags", BRUSH_PAINT_DENSITY_PRESSURE);
2597 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
2598 RNA_def_property_ui_text(prop, "Use Pressure for Density", "Use pressure to modulate density");
2599 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2600 RNA_def_property_update(prop, 0, "rna_Brush_update");
2602 prop = RNA_def_property(srna, "invert_density_pressure", PROP_BOOLEAN, PROP_NONE);
2603 RNA_def_property_boolean_sdna(prop, NULL, "paint_flags", BRUSH_PAINT_DENSITY_PRESSURE_INVERT);
2604 RNA_def_property_ui_icon(prop, ICON_ARROW_LEFTRIGHT, 0);
2605 RNA_def_property_ui_text(
2606 prop, "Invert Pressure for Density", "Invert the modulation of pressure in density");
2607 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2608 RNA_def_property_update(prop, 0, "rna_Brush_update");
2610 prop = RNA_def_property(srna, "dash_ratio", PROP_FLOAT, PROP_FACTOR);
2611 RNA_def_property_float_sdna(prop, NULL, "dash_ratio");
2612 RNA_def_property_range(prop, 0.0f, 1.0f);
2613 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
2614 RNA_def_property_ui_text(
2615 prop, "Dash Ratio", "Ratio of samples in a cycle that the brush is enabled");
2616 RNA_def_property_update(prop, 0, "rna_Brush_update");
2618 prop = RNA_def_property(srna, "dash_samples", PROP_INT, PROP_UNSIGNED);
2619 RNA_def_property_int_sdna(prop, NULL, "dash_samples");
2620 RNA_def_property_range(prop, 1, 10000);
2621 RNA_def_property_ui_range(prop, 1, 10000, 5, -1);
2622 RNA_def_property_ui_text(
2623 prop, "Dash Length", "Length of a dash cycle measured in stroke samples");
2624 RNA_def_property_update(prop, 0, "rna_Brush_update");
2626 prop = RNA_def_property(srna, "plane_offset", PROP_FLOAT, PROP_DISTANCE);
2627 RNA_def_property_float_sdna(prop, NULL, "plane_offset");
2628 RNA_def_property_float_default(prop, 0);
2629 RNA_def_property_range(prop, -2.0f, 2.0f);
2630 RNA_def_property_ui_range(prop, -0.5f, 0.5f, 0.001, 3);
2631 RNA_def_property_ui_text(
2634 "Adjust plane on which the brush acts towards or away from the object surface");
2635 RNA_def_property_update(prop, 0, "rna_Brush_update");
2637 prop = RNA_def_property(srna, "plane_trim", PROP_FLOAT, PROP_DISTANCE);
2638 RNA_def_property_float_sdna(prop, NULL, "plane_trim");
2639 RNA_def_property_range(prop, 0, 1.0f);
2640 RNA_def_property_ui_text(
2643 "If a vertex is further away from offset plane than this, then it is not affected");
2644 RNA_def_property_update(prop, 0, "rna_Brush_update");
2646 prop = RNA_def_property(srna, "height", PROP_FLOAT, PROP_DISTANCE);
2647 RNA_def_property_float_sdna(prop, NULL, "height");
2648 RNA_def_property_float_default(prop, 0.5f);
2649 RNA_def_property_range(prop, 0, 1.0f);
2650 RNA_def_property_ui_range(prop, 0, 0.2f, 1, 3);
2651 RNA_def_property_ui_text(
2652 prop, "Brush Height", "Affectable height of brush (layer height for layer tool, i.e.)");
2653 RNA_def_property_update(prop, 0, "rna_Brush_update");
2655 prop = RNA_def_property(srna, "texture_sample_bias", PROP_FLOAT, PROP_DISTANCE);
2656 RNA_def_property_float_sdna(prop, NULL, "texture_sample_bias");
2657 RNA_def_property_float_default(prop, 0);
2658 RNA_def_property_range(prop, -1, 1);
2659 RNA_def_property_ui_text(prop, "Texture Sample Bias", "Value added to texture samples");
2660 RNA_def_property_update(prop, 0, "rna_Brush_update");
2662 prop = RNA_def_property(srna, "normal_weight", PROP_FLOAT, PROP_FACTOR);
2663 RNA_def_property_float_sdna(prop, NULL, "normal_weight");
2664 RNA_def_property_float_default(prop, 0);
2665 RNA_def_property_range(prop, 0.0f, 1.0f);
2666 RNA_def_property_ui_text(
2667 prop, "Normal Weight", "How much grab will pull vertexes out of surface during a grab");
2668 RNA_def_property_update(prop, 0, "rna_Brush_update");
2670 prop = RNA_def_property(srna, "elastic_deform_volume_preservation", PROP_FLOAT, PROP_NONE);
2671 RNA_def_property_float_sdna(prop, NULL, "elastic_deform_volume_preservation");
2672 RNA_def_property_range(prop, 0.0f, 0.9f);
2673 RNA_def_property_ui_range(prop, 0.0f, 0.9f, 0.01f, 3);
2674 RNA_def_property_ui_text(prop,
2675 "Volume Preservation",
2676 "Poisson ratio for elastic deformation. Higher values preserve volume "
2677 "more, but also lead to more bulging");
2678 RNA_def_property_update(prop, 0, "rna_Brush_update");
2680 prop = RNA_def_property(srna, "rake_factor", PROP_FLOAT, PROP_FACTOR);
2681 RNA_def_property_float_sdna(prop, NULL, "rake_factor");
2682 RNA_def_property_float_default(prop, 0);
2683 RNA_def_property_range(prop, 0.0f, 10.0f);
2684 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
2685 RNA_def_property_ui_text(prop, "Rake", "How much grab will follow cursor rotation");
2686 RNA_def_property_update(prop, 0, "rna_Brush_update");
2688 prop = RNA_def_property(srna, "crease_pinch_factor", PROP_FLOAT, PROP_FACTOR);
2689 RNA_def_property_float_sdna(prop, NULL, "crease_pinch_factor");
2690 RNA_def_property_range(prop, 0.0f, 1.0f);
2691 RNA_def_property_ui_text(prop, "Crease Brush Pinch Factor", "How much the crease brush pinches");
2692 RNA_def_property_update(prop, 0, "rna_Brush_update");
2694 prop = RNA_def_property(srna, "pose_offset", PROP_FLOAT, PROP_FACTOR);
2695 RNA_def_property_float_sdna(prop, NULL, "pose_offset");
2696 RNA_def_property_range(prop, 0.0f, 2.0f);
2697 RNA_def_property_ui_text(
2698 prop, "Pose Origin Offset", "Offset of the pose origin in relation to the brush radius");
2699 RNA_def_property_update(prop, 0, "rna_Brush_update");
2701 prop = RNA_def_property(srna, "disconnected_distance_max", PROP_FLOAT, PROP_DISTANCE);
2702 RNA_def_property_float_sdna(prop, NULL, "disconnected_distance_max");
2703 RNA_def_property_range(prop, 0.0f, 10.0f);
2704 RNA_def_property_ui_text(prop,
2705 "Max Element Distance",
2706 "Maximum distance to search for disconnected loose parts in the mesh");
2707 RNA_def_property_update(prop, 0, "rna_Brush_update");
2709 prop = RNA_def_property(srna, "boundary_offset", PROP_FLOAT, PROP_FACTOR);
2710 RNA_def_property_float_sdna(prop, NULL, "boundary_offset");
2711 RNA_def_property_range(prop, 0.0f, 30.0f);
2712 RNA_def_property_ui_text(prop,
2713 "Boundary Origin Offset",
2714 "Offset of the boundary origin in relation to the brush radius");
2715 RNA_def_property_update(prop, 0, "rna_Brush_update");
2717 prop = RNA_def_property(srna, "surface_smooth_shape_preservation", PROP_FLOAT, PROP_FACTOR);
2718 RNA_def_property_float_sdna(prop, NULL, "surface_smooth_shape_preservation");
2719 RNA_def_property_range(prop, 0.0f, 1.0f);
2720 RNA_def_property_ui_text(
2721 prop, "Shape Preservation", "How much of the original shape is preserved when smoothing");
2722 RNA_def_property_update(prop, 0, "rna_Brush_update");
2724 prop = RNA_def_property(srna, "surface_smooth_current_vertex", PROP_FLOAT, PROP_FACTOR);
2725 RNA_def_property_float_sdna(prop, NULL, "surface_smooth_current_vertex");
2726 RNA_def_property_range(prop, 0.0f, 1.0f);
2727 RNA_def_property_ui_text(
2729 "Per Vertex Displacement",
2730 "How much the position of each individual vertex influences the final result");
2731 RNA_def_property_update(prop, 0, "rna_Brush_update");
2733 prop = RNA_def_property(srna, "surface_smooth_iterations", PROP_INT, PROP_UNSIGNED);
2734 RNA_def_property_int_sdna(prop, NULL, "surface_smooth_iterations");
2735 RNA_def_property_range(prop, 1, 10);
2736 RNA_def_property_ui_range(prop, 1, 10, 1, 3);
2737 RNA_def_property_ui_text(prop, "Iterations", "Number of smoothing iterations per brush step");
2738 RNA_def_property_update(prop, 0, "rna_Brush_update");
2740 prop = RNA_def_property(srna, "multiplane_scrape_angle", PROP_FLOAT, PROP_FACTOR);
2741 RNA_def_property_float_sdna(prop, NULL, "multiplane_scrape_angle");
2742 RNA_def_property_range(prop, 0.0f, 160.0f);
2743 RNA_def_property_ui_text(prop, "Plane Angle", "Angle between the planes of the crease");
2744 RNA_def_property_update(prop, 0, "rna_Brush_update");
2746 prop = RNA_def_property(srna, "pose_smooth_iterations", PROP_INT, PROP_UNSIGNED);
2747 RNA_def_property_int_sdna(prop, NULL, "pose_smooth_iterations");
2748 RNA_def_property_range(prop, 0, 100);
2749 RNA_def_property_ui_text(
2751 "Smooth Iterations",
2752 "Smooth iterations applied after calculating the pose factor of each vertex");
2753 RNA_def_property_update(prop, 0, "rna_Brush_update");
2755 prop = RNA_def_property(srna, "pose_ik_segments", PROP_INT, PROP_UNSIGNED);
2756 RNA_def_property_int_sdna(prop, NULL, "pose_ik_segments");
2757 RNA_def_property_range(prop, 1, 20);
2758 RNA_def_property_ui_range(prop, 1, 20, 1, 3);
2759 RNA_def_property_ui_text(
2762 "Number of segments of the inverse kinematics chain that will deform the mesh");
2763 RNA_def_property_update(prop, 0, "rna_Brush_update");
2765 prop = RNA_def_property(srna, "tip_roundness", PROP_FLOAT, PROP_FACTOR);
2766 RNA_def_property_float_sdna(prop, NULL, "tip_roundness");
2767 RNA_def_property_range(prop, 0.0f, 1.0f);
2768 RNA_def_property_ui_text(prop, "Tip Roundness", "Roundness of the brush tip");
2769 RNA_def_property_update(prop, 0, "rna_Brush_update");
2771 prop = RNA_def_property(srna, "cloth_mass", PROP_FLOAT, PROP_FACTOR);
2772 RNA_def_property_float_sdna(prop, NULL, "cloth_mass");
2773 RNA_def_property_range(prop, 0.01f, 2.0f);
2774 RNA_def_property_ui_text(prop, "Cloth Mass", "Mass of each simulation particle");
2775 RNA_def_property_update(prop, 0, "rna_Brush_update");
2777 prop = RNA_def_property(srna, "cloth_damping", PROP_FLOAT, PROP_FACTOR);
2778 RNA_def_property_float_sdna(prop, NULL, "cloth_damping");
2779 RNA_def_property_range(prop, 0.01f, 1.0f);
2780 RNA_def_property_ui_text(
2781 prop, "Cloth Damping", "How much the applied forces are propagated through the cloth");
2782 RNA_def_property_update(prop, 0, "rna_Brush_update");
2784 prop = RNA_def_property(srna, "cloth_sim_limit", PROP_FLOAT, PROP_FACTOR);
2785 RNA_def_property_float_sdna(prop, NULL, "cloth_sim_limit");
2786 RNA_def_property_range(prop, 0.1f, 10.0f);
2787 RNA_def_property_ui_text(
2790 "Factor added relative to the size of the radius to limit the cloth simulation effects");
2791 RNA_def_property_update(prop, 0, "rna_Brush_update");
2793 prop = RNA_def_property(srna, "cloth_sim_falloff", PROP_FLOAT, PROP_FACTOR);
2794 RNA_def_property_float_sdna(prop, NULL, "cloth_sim_falloff");
2795 RNA_def_property_range(prop, 0.0f, 1.0f);
2796 RNA_def_property_ui_text(prop,
2797 "Simulation Falloff",
2798 "Area to apply deformation falloff to the effects of the simulation");
2799 RNA_def_property_update(prop, 0, "rna_Brush_update");
2801 prop = RNA_def_property(srna, "cloth_constraint_softbody_strength", PROP_FLOAT, PROP_FACTOR);
2802 RNA_def_property_float_sdna(prop, NULL, "cloth_constraint_softbody_strength");
2803 RNA_def_property_range(prop, 0.0f, 1.0f);
2804 RNA_def_property_ui_text(
2806 "Soft Body Plasticity",
2807 "How much the cloth preserves the original shape, acting as a soft body");
2808 RNA_def_property_update(prop, 0, "rna_Brush_update");
2810 prop = RNA_def_property(srna, "hardness", PROP_FLOAT, PROP_FACTOR);
2811 RNA_def_property_float_sdna(prop, NULL, "hardness");
2812 RNA_def_property_range(prop, 0.0f, 1.0f);
2813 RNA_def_property_ui_text(
2814 prop, "Hardness", "How close the brush falloff starts from the edge of the brush");
2815 RNA_def_property_update(prop, 0, "rna_Brush_update");
2817 prop = RNA_def_property(
2818 srna, "automasking_boundary_edges_propagation_steps", PROP_INT, PROP_UNSIGNED);
2819 RNA_def_property_int_sdna(prop, NULL, "automasking_boundary_edges_propagation_steps");
2820 RNA_def_property_range(prop, 1, 20);
2821 RNA_def_property_ui_range(prop, 1, 20, 1, 3);
2822 RNA_def_property_ui_text(prop,
2823 "Propagation Steps",
2824 "Distance where boundary edge automasking is going to protect vertices "
2825 "from the fully masked edge");
2826 RNA_def_property_update(prop, 0, "rna_Brush_update");
2828 prop = RNA_def_property(srna, "auto_smooth_factor", PROP_FLOAT, PROP_FACTOR);
2829 RNA_def_property_float_sdna(prop, NULL, "autosmooth_factor");
2830 RNA_def_property_float_default(prop, 0);
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(
2834 prop, "Auto-Smooth", "Amount of smoothing to automatically apply to each stroke");
2835 RNA_def_property_update(prop, 0, "rna_Brush_update");
2837 prop = RNA_def_property(srna, "topology_rake_factor", PROP_FLOAT, PROP_FACTOR);
2838 RNA_def_property_float_sdna(prop, NULL, "topology_rake_factor");
2839 RNA_def_property_float_default(prop, 0);
2840 RNA_def_property_range(prop, 0.0f, 1.0f);
2841 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
2842 RNA_def_property_ui_text(prop,
2844 "Automatically align edges to the brush direction to "
2845 "generate cleaner topology and define sharp features. "
2846 "Best used on low-poly meshes as it has a performance impact");
2847 RNA_def_property_update(prop, 0, "rna_Brush_update");
2849 prop = RNA_def_property(srna, "tilt_strength_factor", PROP_FLOAT, PROP_FACTOR);
2850 RNA_def_property_float_sdna(prop, NULL, "tilt_strength_factor");
2851 RNA_def_property_float_default(prop, 0);
2852 RNA_def_property_range(prop, 0.0f, 1.0f);
2853 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
2854 RNA_def_property_ui_text(
2855 prop, "Tilt Strength", "How much the tilt of the pen will affect the brush");
2856 RNA_def_property_update(prop, 0, "rna_Brush_update");
2858 prop = RNA_def_property(srna, "normal_radius_factor", PROP_FLOAT, PROP_FACTOR);
2859 RNA_def_property_float_sdna(prop, NULL, "normal_radius_factor");
2860 RNA_def_property_range(prop, 0.0f, 2.0f);
2861 RNA_def_property_ui_range(prop, 0.0f, 2.0f, 0.001, 3);
2862 RNA_def_property_ui_text(prop,
2864 "Ratio between the brush radius and the radius that is going to be "
2865 "used to sample the normal");
2866 RNA_def_property_update(prop, 0, "rna_Brush_update");
2868 prop = RNA_def_property(srna, "area_radius_factor", PROP_FLOAT, PROP_FACTOR);
2869 RNA_def_property_float_sdna(prop, NULL, "area_radius_factor");
2870 RNA_def_property_range(prop, 0.0f, 2.0f);
2871 RNA_def_property_ui_range(prop, 0.0f, 2.0f, 0.001, 3);
2872 RNA_def_property_ui_text(prop,
2874 "Ratio between the brush radius and the radius that is going to be "
2875 "used to sample the area center");
2876 RNA_def_property_update(prop, 0, "rna_Brush_update");
2878 prop = RNA_def_property(srna, "wet_paint_radius_factor", PROP_FLOAT, PROP_FACTOR);
2879 RNA_def_property_float_sdna(prop, NULL, "wet_paint_radius_factor");
2880 RNA_def_property_range(prop, 0.0f, 2.0f);
2881 RNA_def_property_ui_range(prop, 0.0f, 2.0f, 0.001, 3);
2882 RNA_def_property_ui_text(prop,
2884 "Ratio between the brush radius and the radius that is going to be "
2885 "used to sample the color to blend in wet paint");
2886 RNA_def_property_update(prop, 0, "rna_Brush_update");
2888 prop = RNA_def_property(srna, "stencil_pos", PROP_FLOAT, PROP_XYZ);
2889 RNA_def_property_float_sdna(prop, NULL, "stencil_pos");
2890 RNA_def_property_array(prop, 2);
2891 RNA_def_property_ui_text(prop, "Stencil Position", "Position of stencil in viewport");
2892 RNA_def_property_update(prop, 0, "rna_Brush_update");
2894 prop = RNA_def_property(srna, "stencil_dimension", PROP_FLOAT, PROP_XYZ);
2895 RNA_def_property_float_sdna(prop, NULL, "stencil_dimension");
2896 RNA_def_property_array(prop, 2);
2897 RNA_def_property_ui_text(prop, "Stencil Dimensions", "Dimensions of stencil in viewport");
2898 RNA_def_property_update(prop, 0, "rna_Brush_update");
2900 prop = RNA_def_property(srna, "mask_stencil_pos", PROP_FLOAT, PROP_XYZ);
2901 RNA_def_property_float_sdna(prop, NULL, "mask_stencil_pos");
2902 RNA_def_property_array(prop, 2);
2903 RNA_def_property_ui_text(prop, "Mask Stencil Position", "Position of mask stencil in viewport");
2904 RNA_def_property_update(prop, 0, "rna_Brush_update");
2906 prop = RNA_def_property(srna, "mask_stencil_dimension", PROP_FLOAT, PROP_XYZ);
2907 RNA_def_property_float_sdna(prop, NULL, "mask_stencil_dimension");
2908 RNA_def_property_array(prop, 2);
2909 RNA_def_property_ui_text(
2910 prop, "Mask Stencil Dimensions", "Dimensions of mask stencil in viewport");
2911 RNA_def_property_update(prop, 0, "rna_Brush_update");
2913 prop = RNA_def_property(srna, "sharp_threshold", PROP_FLOAT, PROP_NONE);
2914 RNA_def_property_range(prop, 0.0, 100.0);
2915 RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 3);
2916 RNA_def_property_float_sdna(prop, NULL, "sharp_threshold");
2917 RNA_def_property_ui_text(
2918 prop, "Sharp Threshold", "Threshold below which, no sharpening is done");
2919 RNA_def_property_update(prop, 0, "rna_Brush_update");
2921 prop = RNA_def_property(srna, "fill_threshold", PROP_FLOAT, PROP_NONE);
2922 RNA_def_property_range(prop, 0.0, 100.0);
2923 RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 3);
2924 RNA_def_property_float_sdna(prop, NULL, "fill_threshold");
2925 RNA_def_property_ui_text(
2926 prop, "Fill Threshold", "Threshold above which filling is not propagated");
2927 RNA_def_property_update(prop, 0, "rna_Brush_update");
2929 prop = RNA_def_property(srna, "blur_kernel_radius", PROP_INT, PROP_NONE);
2930 RNA_def_property_int_sdna(prop, NULL, "blur_kernel_radius");
2931 RNA_def_property_range(prop, 1, 10000);
2932 RNA_def_property_ui_range(prop, 1, 50, 1, -1);
2933 RNA_def_property_ui_text(
2934 prop, "Kernel Radius", "Radius of kernel used for soften and sharpen in pixels");
2935 RNA_def_property_update(prop, 0, "rna_Brush_update");
2937 prop = RNA_def_property(srna, "blur_mode", PROP_ENUM, PROP_NONE);
2938 RNA_def_property_enum_items(prop, brush_blur_mode_items);
2939 RNA_def_property_ui_text(prop, "Blur Mode", "");
2940 RNA_def_property_update(prop, 0, "rna_Brush_update");
2942 prop = RNA_def_property(srna, "falloff_angle", PROP_FLOAT, PROP_ANGLE);
2943 RNA_def_property_float_sdna(prop, NULL, "falloff_angle");
2944 RNA_def_property_range(prop, 0, M_PI / 2);
2945 RNA_def_property_ui_text(
2948 "Paint most on faces pointing towards the view according to this angle");
2949 RNA_def_property_update(prop, 0, "rna_Brush_update");
2952 prop = RNA_def_property(srna, "use_airbrush", PROP_BOOLEAN, PROP_NONE);
2953 RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_AIRBRUSH);
2954 RNA_def_property_ui_text(
2955 prop, "Airbrush", "Keep applying paint effect while holding mouse (spray)");
2956 RNA_def_property_update(prop, 0, "rna_Brush_update");
2958 prop = RNA_def_property(srna, "use_original_normal", PROP_BOOLEAN, PROP_NONE);
2959 RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_ORIGINAL_NORMAL);
2960 RNA_def_property_ui_text(prop,
2962 "When locked keep using normal of surface where stroke was initiated");
2963 RNA_def_property_update(prop, 0, "rna_Brush_update");
2965 prop = RNA_def_property(srna, "use_original_plane", PROP_BOOLEAN, PROP_NONE);
2966 RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_ORIGINAL_PLANE);
2967 RNA_def_property_ui_text(
2970 "When locked keep using the plane origin of surface where stroke was initiated");
2971 RNA_def_property_update(prop, 0, "rna_Brush_update");
2973 prop = RNA_def_property(srna, "use_automasking_topology", PROP_BOOLEAN, PROP_NONE);
2974 RNA_def_property_boolean_sdna(prop, NULL, "automasking_flags", BRUSH_AUTOMASKING_TOPOLOGY);
2975 RNA_def_property_ui_text(prop,
2976 "Topology Auto-Masking",
2977 "Affect only vertices connected to the active vertex under the brush");
2978 RNA_def_property_update(prop, 0, "rna_Brush_update");
2980 prop = RNA_def_property(srna, "use_automasking_face_sets", PROP_BOOLEAN, PROP_NONE);
2981 RNA_def_property_boolean_sdna(prop, NULL, "automasking_flags", BRUSH_AUTOMASKING_FACE_SETS);
2982 RNA_def_property_ui_text(prop,
2983 "Face Sets Auto-Masking",
2984 "Affect only vertices that share Face Sets with the active vertex");
2985 RNA_def_property_update(prop, 0, "rna_Brush_update");
2987 prop = RNA_def_property(srna, "use_automasking_boundary_edges", PROP_BOOLEAN, PROP_NONE);
2988 RNA_def_property_boolean_sdna(prop, NULL, "automasking_flags", BRUSH_AUTOMASKING_BOUNDARY_EDGES);
2989 RNA_def_property_ui_text(
2990 prop, "Mesh Boundary Auto-Masking", "Do not affect non manifold boundary edges");
2991 RNA_def_property_update(prop, 0, "rna_Brush_update");
2993 prop = RNA_def_property(srna, "use_automasking_boundary_face_sets", PROP_BOOLEAN, PROP_NONE);
2994 RNA_def_property_boolean_sdna(
2995 prop, NULL, "automasking_flags", BRUSH_AUTOMASKING_BOUNDARY_FACE_SETS);
2996 RNA_def_property_ui_text(prop,
2997 "Face Sets Boundary Automasking",
2998 "Do not affect vertices that belong to a Face Set boundary");
2999 RNA_def_property_update(prop, 0, "rna_Brush_update");
3001 prop = RNA_def_property(srna, "use_scene_spacing", PROP_ENUM, PROP_NONE);
3002 RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
3003 RNA_def_property_enum_items(prop, brush_spacing_unit_items);
3004 RNA_def_property_ui_text(
3005 prop, "Spacing Distance", "Calculate the brush spacing using view or scene distance");
3006 RNA_def_property_update(prop, 0, "rna_Brush_update");
3008 prop = RNA_def_property(srna, "use_grab_active_vertex", PROP_BOOLEAN, PROP_NONE);
3009 RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_GRAB_ACTIVE_VERTEX);
3010 RNA_def_property_ui_text(
3012 "Grab Active Vertex",
3013 "Apply the maximum grab strength to the active vertex instead of the cursor location");
3014 RNA_def_property_update(prop, 0, "rna_Brush_update");
3016 prop = RNA_def_property(srna, "use_grab_silhouette", PROP_BOOLEAN, PROP_NONE);
3017 RNA_def_property_boolean_sdna(prop, NULL, "flag2", BRUSH_GRAB_SILHOUETTE);
3018 RNA_def_property_ui_text(
3019 prop, "Grab Silhouette", "Grabs trying to automask the silhouette of the object");
3020 RNA_def_property_update(prop, 0, "rna_Brush_update");
3022 prop = RNA_def_property(srna, "use_paint_antialiasing", PROP_BOOLEAN, PROP_NONE);
3023 RNA_def_property_boolean_sdna(prop, NULL, "sampling_flag", BRUSH_PAINT_ANTIALIASING);
3024 RNA_def_property_ui_text(prop, "Anti-Aliasing", "Smooths the edges of the strokes");
3026 prop = RNA_def_property(srna, "use_multiplane_scrape_dynamic", PROP_BOOLEAN, PROP_NONE);
3027 RNA_def_property_boolean_sdna(prop, NULL, "flag2", BRUSH_MULTIPLANE_SCRAPE_DYNAMIC);
3028 RNA_def_property_ui_text(prop,
3030 "The angle between the planes changes during the stroke to fit the "
3031 "surface under the cursor");
3032 RNA_def_property_update(prop, 0, "rna_Brush_update");
3034 prop = RNA_def_property(srna, "show_multiplane_scrape_planes_preview", PROP_BOOLEAN, PROP_NONE);
3035 RNA_def_property_boolean_sdna(prop, NULL, "flag2", BRUSH_MULTIPLANE_SCRAPE_PLANES_PREVIEW);
3036 RNA_def_property_ui_text(
3037 prop, "Show Cursor Preview", "Preview the scrape planes in the cursor during the stroke");
3038 RNA_def_property_update(prop, 0, "rna_Brush_update");
3040 prop = RNA_def_property(srna, "use_pose_ik_anchored", PROP_BOOLEAN, PROP_NONE);
3041 RNA_def_property_boolean_sdna(prop, NULL, "flag2", BRUSH_POSE_IK_ANCHORED);
3042 RNA_def_property_ui_text(
3043 prop, "Keep Anchor Point", "Keep the position of the last segment in the IK chain fixed");
3044 RNA_def_property_update(prop, 0, "rna_Brush_update");
3046 prop = RNA_def_property(srna, "use_pose_lock_rotation", PROP_BOOLEAN, PROP_NONE);
3047 RNA_def_property_boolean_sdna(prop, NULL, "flag2", BRUSH_POSE_USE_LOCK_ROTATION);
3048 RNA_def_property_ui_text(prop,
3049 "Lock Rotation When Scaling",
3050 "Do not rotate the segment when using the scale deform mode");
3051 RNA_def_property_update(prop, 0, "rna_Brush_update");
3053 prop = RNA_def_property(srna, "use_connected_only", PROP_BOOLEAN, PROP_NONE);
3054 RNA_def_property_boolean_sdna(prop, NULL, "flag2", BRUSH_USE_CONNECTED_ONLY);
3055 RNA_def_property_ui_text(prop, "Connected Only", "Affect only topologically connected elements");
3056 RNA_def_property_update(prop, 0, "rna_Brush_update");
3058 prop = RNA_def_property(srna, "use_cloth_pin_simulation_boundary", PROP_BOOLEAN, PROP_NONE);
3059 RNA_def_property_boolean_sdna(prop, NULL, "flag2", BRUSH_CLOTH_PIN_SIMULATION_BOUNDARY);
3060 RNA_def_property_ui_text(
3062 "Pin Simulation Boundary",
3063 "Lock the position of the vertices in the simulation falloff area to avoid artifacts and "
3064 "create a softer transition with unaffected areas");
3065 RNA_def_property_update(prop, 0, "rna_Brush_update");
3067 prop = RNA_def_property(srna, "use_cloth_collision", PROP_BOOLEAN, PROP_NONE);
3068 RNA_def_property_boolean_sdna(prop, NULL, "flag2", BRUSH_CLOTH_USE_COLLISION);
3069 RNA_def_property_ui_text(prop, "Enable Collision", "Collide with objects during the simulation");
3070 RNA_def_property_update(prop, 0, "rna_Brush_update");
3072 prop = RNA_def_property(srna, "invert_to_scrape_fill", PROP_BOOLEAN, PROP_NONE);
3073 RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_INVERT_TO_SCRAPE_FILL);
3074 RNA_def_property_ui_text(prop,
3075 "Invert to Scrape or Fill",
3076 "Use Scrape or Fill tool when inverting this brush instead of "
3077 "inverting its displacement direction");
3078 RNA_def_property_update(prop, 0, "rna_Brush_update");
3080 prop = RNA_def_property(srna, "use_pressure_strength", PROP_BOOLEAN, PROP_NONE);
3081 RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_ALPHA_PRESSURE);
3082 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
3083 RNA_def_property_ui_text(
3084 prop, "Strength Pressure", "Enable tablet pressure sensitivity for strength");
3085 RNA_def_property_update(prop, 0, "rna_Brush_update");
3087 prop = RNA_def_property(srna, "use_offset_pressure", PROP_BOOLEAN, PROP_NONE);
3088 RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_OFFSET_PRESSURE);
3089 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
3090 RNA_def_property_ui_text(
3091 prop, "Plane Offset Pressure", "Enable tablet pressure sensitivity for offset");
3092 RNA_def_property_update(prop, 0, "rna_Brush_update");
3094 prop = RNA_def_property(srna, "use_pressure_area_radius", PROP_BOOLEAN, PROP_NONE);
3095 RNA_def_property_boolean_sdna(prop, NULL, "flag2", BRUSH_AREA_RADIUS_PRESSURE);
3096 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
3097 RNA_def_property_ui_text(
3098 prop, "Area Radius Pressure", "Enable tablet pressure sensitivity for area radius");
3099 RNA_def_property_update(prop, 0, "rna_Brush_update");
3101 prop = RNA_def_property(srna, "use_pressure_size", PROP_BOOLEAN, PROP_NONE);
3102 RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_SIZE_PRESSURE);
3103 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
3104 RNA_def_property_ui_text(prop, "Size Pressure", "Enable tablet pressure sensitivity for size");
3105 RNA_def_property_update(prop, 0, "rna_Brush_update");
3107 prop = RNA_def_property(srna, "use_pressure_jitter", PROP_BOOLEAN, PROP_NONE);
3108 RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_JITTER_PRESSURE);
3109 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
3110 RNA_def_property_ui_text(
3111 prop, "Jitter Pressure", "Enable tablet pressure sensitivity for jitter");
3112 RNA_def_property_update(prop, 0, "rna_Brush_update");
3114 prop = RNA_def_property(srna, "use_pressure_spacing", PROP_BOOLEAN, PROP_NONE);
3115 RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_SPACING_PRESSURE);
3116 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
3117 RNA_def_property_ui_text(
3118 prop, "Spacing Pressure", "Enable tablet pressure sensitivity for spacing");
3119 RNA_def_property_update(prop, 0, "rna_Brush_update");
3121 prop = RNA_def_property(srna, "use_pressure_masking", PROP_ENUM, PROP_NONE);
3122 RNA_def_property_enum_sdna(prop, NULL, "mask_pressure");
3123 RNA_def_property_enum_items(prop, brush_mask_pressure_items);
3124 RNA_def_property_ui_text(
3125 prop, "Mask Pressure Mode", "Pen pressure makes texture influence smaller");
3126 RNA_def_property_update(prop, 0, "rna_Brush_update");
3128 prop = RNA_def_property(srna, "use_inverse_smooth_pressure", PROP_BOOLEAN, PROP_NONE);
3129 RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_INVERSE_SMOOTH_PRESSURE);
3130 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
3131 RNA_def_property_ui_text(
3132 prop, "Inverse Smooth Pressure", "Lighter pressure causes more smoothing to be applied");
3133 RNA_def_property_update(prop, 0, "rna_Brush_update");
3135 prop = RNA_def_property(srna, "use_plane_trim", PROP_BOOLEAN, PROP_NONE);
3136 RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_PLANE_TRIM);
3137 RNA_def_property_ui_text(prop, "Use Plane Trim", "Enable Plane Trim");
3138 RNA_def_property_update(prop, 0, "rna_Brush_update");
3140 prop = RNA_def_property(srna, "use_frontface", PROP_BOOLEAN, PROP_NONE);
3141 RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_FRONTFACE);
3142 RNA_def_property_ui_text(
3143 prop, "Use Front-Face", "Brush only affects vertexes that face the viewer");
3144 RNA_def_property_update(prop, 0, "rna_Brush_update");
3146 prop = RNA_def_property(srna, "use_frontface_falloff", PROP_BOOLEAN, PROP_NONE);
3147 RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_FRONTFACE_FALLOFF);
3148 RNA_def_property_ui_text(
3149 prop, "Use Front-Face Falloff", "Blend brush influence by how much they face the front");
3150 RNA_def_property_update(prop, 0, "rna_Brush_update");
3152 prop = RNA_def_property(srna, "use_anchor", PROP_BOOLEAN, PROP_NONE);
3153 RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_ANCHORED);
3154 RNA_def_property_ui_text(prop, "Anchored", "Keep the brush anchored to the initial location");
3155 RNA_def_property_update(prop, 0, "rna_Brush_update");
3157 prop = RNA_def_property(srna, "use_space", PROP_BOOLEAN, PROP_NONE);
3158 RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_SPACE);
3159 RNA_def_property_ui_text(
3160 prop, "Space", "Limit brush application to the distance specified by spacing");
3161 RNA_def_property_update(prop, 0, "rna_Brush_update");
3163 prop = RNA_def_property(srna, "use_line", PROP_BOOLEAN, PROP_NONE);
3164 RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_LINE);
3165 RNA_def_property_ui_text(prop, "Line", "Draw a line with dabs separated according to spacing");
3166 RNA_def_property_update(prop, 0, "rna_Brush_update");
3168 prop = RNA_def_property(srna, "use_curve", PROP_BOOLEAN, PROP_NONE);
3169 RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_CURVE);
3170 RNA_def_property_ui_text(
3173 "Define the stroke curve with a bezier curve. Dabs are separated according to spacing");
3174 RNA_def_property_update(prop, 0, "rna_Brush_update");
3176 prop = RNA_def_property(srna, "use_smooth_stroke", PROP_BOOLEAN, PROP_NONE);
3177 RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_SMOOTH_STROKE);
3178 RNA_def_property_ui_text(
3179 prop, "Smooth Stroke", "Brush lags behind mouse and follows a smoother path");
3180 RNA_def_property_update(prop, 0, "rna_Brush_update");
3182 prop = RNA_def_property(srna, "use_persistent", PROP_BOOLEAN, PROP_NONE);
3183 RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_PERSISTENT);
3184 RNA_def_property_ui_text(prop, "Persistent", "Sculpt on a persistent layer of the mesh");
3185 RNA_def_property_update(prop, 0, "rna_Brush_update");
3187 prop = RNA_def_property(srna, "use_accumulate", PROP_BOOLEAN, PROP_NONE);
3188 RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_ACCUMULATE);
3189 RNA_def_property_ui_text(prop, "Accumulate", "Accumulate stroke daubs on top of each other");
3190 RNA_def_property_update(prop, 0, "rna_Brush_update");
3192 prop = RNA_def_property(srna, "use_space_attenuation", PROP_BOOLEAN, PROP_NONE);
3193 RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_SPACE_ATTEN);
3194 RNA_def_property_ui_text(
3196 "Adjust Strength for Spacing",
3197 "Automatically adjust strength to give consistent results for different spacings");
3198 RNA_def_property_update(prop, 0, "rna_Brush_update");
3200 /* adaptive space is not implemented yet */
3201 prop = RNA_def_property(srna, "use_adaptive_space", PROP_BOOLEAN, PROP_NONE);
3202 RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_ADAPTIVE_SPACE);
3203 RNA_def_property_ui_text(prop,
3205 "Space daubs according to surface orientation instead of screen space");
3206 RNA_def_property_update(prop, 0, "rna_Brush_update");
3208 prop = RNA_def_property(srna, "use_locked_size", PROP_ENUM, PROP_NONE); /* as an enum */
3209 RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
3210 RNA_def_property_enum_items(prop, brush_size_unit_items);
3211 RNA_def_property_ui_text(
3212 prop, "Radius Unit", "Measure brush size relative to the view or the scene");
3213 RNA_def_property_update(prop, 0, "rna_Brush_update");
3215 prop = RNA_def_property(srna, "color_type", PROP_ENUM, PROP_NONE); /* as an enum */
3216 RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
3217 RNA_def_property_enum_items(prop, color_gradient_items);
3218 RNA_def_property_enum_funcs(prop, NULL, "rna_Brush_use_gradient_set", NULL);
3219 RNA_def_property_ui_text(prop, "Color Type", "Use single color or gradient when painting");
3220 RNA_def_property_update(prop, 0, "rna_Brush_update");
3222 prop = RNA_def_property(srna, "use_edge_to_edge", PROP_BOOLEAN, PROP_NONE);
3223 RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_EDGE_TO_EDGE);
3224 RNA_def_property_ui_text(prop, "Edge-to-Edge", "Drag anchor brush from edge-to-edge");
3225 RNA_def_property_update(prop, 0, "rna_Brush_update");
3227 prop = RNA_def_property(srna, "use_restore_mesh", PROP_BOOLEAN, PROP_NONE);
3228 RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_DRAG_DOT);
3229 RNA_def_property_ui_text(prop, "Restore Mesh", "Allow a single dot to be carefully positioned");
3230 RNA_def_property_update(prop, 0, "rna_Brush_update");
3232 /* only for projection paint & vertex paint, TODO, other paint modes */
3233 prop = RNA_def_property(srna, "use_alpha", PROP_BOOLEAN, PROP_NONE);
3234 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", BRUSH_LOCK_ALPHA);
3235 RNA_def_property_ui_text(
3236 prop, "Affect Alpha", "When this is disabled, lock alpha while painting");
3237 RNA_def_property_update(prop, 0, "rna_Brush_update");
3239 prop = RNA_def_property(srna, "curve", PROP_POINTER, PROP_NONE);
3240 RNA_def_property_flag(prop, PROP_NEVER_NULL);
3241 RNA_def_property_ui_text(prop, "Curve", "Editable falloff curve");
3242 RNA_def_property_update(prop, 0, "rna_Brush_update");
3244 prop = RNA_def_property(srna, "paint_curve", PROP_POINTER, PROP_NONE);
3245 RNA_def_property_flag(prop, PROP_EDITABLE);
3246 RNA_def_property_ui_text(prop, "Paint Curve", "Active paint curve");
3247 RNA_def_property_update(prop, 0, "rna_Brush_update");
3249 prop = RNA_def_property(srna, "gradient", PROP_POINTER, PROP_NEVER_NULL);
3250 RNA_def_property_pointer_sdna(prop, NULL, "gradient");
3251 RNA_def_property_struct_type(prop, "ColorRamp");
3252 RNA_def_property_ui_text(prop, "Gradient", "");
3253 RNA_def_property_update(prop, 0, "rna_Brush_update");
3255 /* gradient source */
3256 prop = RNA_def_property(srna, "gradient_stroke_mode", PROP_ENUM, PROP_NONE);
3257 RNA_def_property_enum_items(prop, brush_gradient_items);
3258 RNA_def_property_ui_text(prop, "Gradient Stroke Mode", "");
3259 RNA_def_property_update(prop, 0, "rna_Brush_update");
3261 prop = RNA_def_property(srna, "gradient_fill_mode", PROP_ENUM, PROP_NONE);
3262 RNA_def_property_enum_items(prop, brush_gradient_fill_items);
3263 RNA_def_property_ui_text(prop, "Gradient Fill Mode", "");
3264 RNA_def_property_update(prop, 0, "rna_Brush_update");
3267 prop = RNA_def_property(srna, "use_primary_overlay", PROP_BOOLEAN, PROP_NONE);
3268 RNA_def_property_boolean_sdna(prop, NULL, "overlay_flags", BRUSH_OVERLAY_PRIMARY);
3269 RNA_def_property_ui_text(prop, "Use Texture Overlay", "Show texture in viewport");
3270 RNA_def_property_update(prop, 0, "rna_Brush_update");
3272 prop = RNA_def_property(srna, "use_secondary_overlay", PROP_BOOLEAN, PROP_NONE);
3273 RNA_def_property_boolean_sdna(prop, NULL, "overlay_flags", BRUSH_OVERLAY_SECONDARY);
3274 RNA_def_property_ui_text(prop, "Use Texture Overlay", "Show texture in viewport");
3275 RNA_def_property_update(prop, 0, "rna_Brush_update");
3277 prop = RNA_def_property(srna, "use_cursor_overlay", PROP_BOOLEAN, PROP_NONE);
3278 RNA_def_property_boolean_sdna(prop, NULL, "overlay_flags", BRUSH_OVERLAY_CURSOR);
3279 RNA_def_property_ui_text(prop, "Use Cursor Overlay", "Show cursor in viewport");
3280 RNA_def_property_update(prop, 0, "rna_Brush_update");
3282 prop = RNA_def_property(srna, "use_cursor_overlay_override", PROP_BOOLEAN, PROP_NONE);
3283 RNA_def_property_boolean_sdna(
3284 prop, NULL, "overlay_flags", BRUSH_OVERLAY_CURSOR_OVERRIDE_ON_STROKE);
3285 RNA_def_property_ui_text(prop, "Override Overlay", "Don't show overlay during a stroke");
3286 RNA_def_property_update(prop, 0, "rna_Brush_update");
3288 prop = RNA_def_property(srna, "use_primary_overlay_override", PROP_BOOLEAN, PROP_NONE);
3289 RNA_def_property_boolean_sdna(
3290 prop, NULL, "overlay_flags", BRUSH_OVERLAY_PRIMARY_OVERRIDE_ON_STROKE);
3291 RNA_def_property_ui_text(prop, "Override Overlay", "Don't show overlay during a stroke");
3292 RNA_def_property_update(prop, 0, "rna_Brush_update");
3294 prop = RNA_def_property(srna, "use_secondary_overlay_override", PROP_BOOLEAN, PROP_NONE);
3295 RNA_def_property_boolean_sdna(
3296 prop, NULL, "overlay_flags", BRUSH_OVERLAY_SECONDARY_OVERRIDE_ON_STROKE);
3297 RNA_def_property_ui_text(prop, "Override Overlay", "Don't show overlay during a stroke");
3298 RNA_def_property_update(prop, 0, "rna_Brush_update");
3300 /* paint mode flags */
3301 prop = RNA_def_property(srna, "use_paint_sculpt", PROP_BOOLEAN, PROP_NONE);
3302 RNA_def_property_boolean_sdna(prop, NULL, "ob_mode", OB_MODE_SCULPT);
3303 RNA_def_property_ui_text(prop, "Use Sculpt", "Use this brush in sculpt mode");
3305 prop = RNA_def_property(srna, "use_paint_uv_sculpt", PROP_BOOLEAN, PROP_NONE);
3306 RNA_def_property_boolean_sdna(prop, NULL, "ob_mode", OB_MODE_EDIT);
3307 RNA_def_property_ui_text(prop, "Use UV Sculpt", "Use this brush in UV sculpt mode");
3309 prop = RNA_def_property(srna, "use_paint_vertex", PROP_BOOLEAN, PROP_NONE);
3310 RNA_def_property_boolean_sdna(prop, NULL, "ob_mode", OB_MODE_VERTEX_PAINT);
3311 RNA_def_property_ui_text(prop, "Use Vertex", "Use this brush in vertex paint mode");
3313 prop = RNA_def_property(srna, "use_paint_weight", PROP_BOOLEAN, PROP_NONE);
3314 RNA_def_property_boolean_sdna(prop, NULL, "ob_mode", OB_MODE_WEIGHT_PAINT);
3315 RNA_def_property_ui_text(prop, "Use Weight", "Use this brush in weight paint mode");
3317 prop = RNA_def_property(srna, "use_paint_image", PROP_BOOLEAN, PROP_NONE);
3318 RNA_def_property_boolean_sdna(prop, NULL, "ob_mode", OB_MODE_TEXTURE_PAINT);
3319 RNA_def_property_ui_text(prop, "Use Texture", "Use this brush in texture paint mode");
3321 prop = RNA_def_property(srna, "use_paint_grease_pencil", PROP_BOOLEAN, PROP_NONE);
3322 RNA_def_property_boolean_sdna(prop, NULL, "ob_mode", OB_MODE_PAINT_GPENCIL);
3323 RNA_def_property_ui_text(prop, "Use Paint", "Use this brush in grease pencil drawing mode");
3325 prop = RNA_def_property(srna, "use_vertex_grease_pencil", PROP_BOOLEAN, PROP_NONE);
3326 RNA_def_property_boolean_sdna(prop, NULL, "ob_mode", OB_MODE_VERTEX_GPENCIL);
3327 RNA_def_property_ui_text(
3328 prop, "Use Vertex", "Use this brush in grease pencil vertex color mode");
3331 prop = RNA_def_property(srna, "texture_slot", PROP_POINTER, PROP_NONE);
3332 RNA_def_property_struct_type(prop, "BrushTextureSlot");
3333 RNA_def_property_pointer_sdna(prop, NULL, "mtex");
3334 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
3335 RNA_def_property_ui_text(prop, "Texture Slot", "");
3337 prop = RNA_def_property(srna, "texture", PROP_POINTER, PROP_NONE);
3338 RNA_def_property_pointer_sdna(prop, NULL, "mtex.tex");
3339 RNA_def_property_flag(prop, PROP_EDITABLE | PROP_CONTEXT_UPDATE);
3340 RNA_def_property_ui_text(prop, "Texture", "");
3341 RNA_def_property_update(prop, NC_TEXTURE, "rna_Brush_main_tex_update");
3343 prop = RNA_def_property(srna, "mask_texture_slot", PROP_POINTER, PROP_NONE);
3344 RNA_def_property_struct_type(prop, "BrushTextureSlot");
3345 RNA_def_property_pointer_sdna(prop, NULL, "mask_mtex");
3346 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
3347 RNA_def_property_ui_text(prop, "Mask Texture Slot", "");
3349 prop = RNA_def_property(srna, "mask_texture", PROP_POINTER, PROP_NONE);
3350 RNA_def_property_pointer_sdna(prop, NULL, "mask_mtex.tex");
3351 RNA_def_property_flag(prop, PROP_EDITABLE | PROP_CONTEXT_UPDATE);
3352 RNA_def_property_ui_text(prop, "Mask Texture", "");
3353 RNA_def_property_update(prop, NC_TEXTURE, "rna_Brush_secondary_tex_update");
3355 prop = RNA_def_property(srna, "texture_overlay_alpha", PROP_INT, PROP_PERCENTAGE);
3356 RNA_def_property_int_sdna(prop, NULL, "texture_overlay_alpha");
3357 RNA_def_property_range(prop, 0, 100);
3358 RNA_def_property_ui_text(prop, "Texture Overlay Alpha", "");
3359 RNA_def_property_update(prop, 0, "rna_Brush_update");
3361 prop = RNA_def_property(srna, "mask_overlay_alpha", PROP_INT, PROP_PERCENTAGE);
3362 RNA_def_property_int_sdna(prop, NULL, "mask_overlay_alpha");
3363 RNA_def_property_range(prop, 0, 100);
3364 RNA_def_property_ui_text(prop, "Mask Texture Overlay Alpha", "");
3365 RNA_def_property_update(prop, 0, "rna_Brush_update");
3367 prop = RNA_def_property(srna, "cursor_overlay_alpha", PROP_INT, PROP_PERCENTAGE);
3368 RNA_def_property_int_sdna(prop, NULL, "cursor_overlay_alpha");
3369 RNA_def_property_range(prop, 0, 100);
3370 RNA_def_property_ui_text(prop, "Mask Texture Overlay Alpha", "");
3371 RNA_def_property_update(prop, 0, "rna_Brush_update");
3373 prop = RNA_def_property(srna, "cursor_color_add", PROP_FLOAT, PROP_COLOR);
3374 RNA_def_property_float_sdna(prop, NULL, "add_col");
3375 RNA_def_property_array(prop, 4);
3376 RNA_def_property_ui_text(prop, "Add Color", "Color of cursor when adding");
3377 RNA_def_property_update(prop, 0, "rna_Brush_update");
3379 prop = RNA_def_property(srna, "cursor_color_subtract", PROP_FLOAT, PROP_COLOR);
3380 RNA_def_property_float_sdna(prop, NULL, "sub_col");
3381 RNA_def_property_array(prop, 4);
3382 RNA_def_property_ui_text(prop, "Subtract Color", "Color of cursor when subtracting");
3383 RNA_def_property_update(prop, 0, "rna_Brush_update");
3385 prop = RNA_def_property(srna, "use_custom_icon", PROP_BOOLEAN, PROP_NONE);
3386 RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_CUSTOM_ICON);
3387 RNA_def_property_ui_text(prop, "Custom Icon", "Set the brush icon from an image file");
3388 RNA_def_property_update(prop, 0, "rna_Brush_icon_update");
3390 prop = RNA_def_property(srna, "icon_filepath", PROP_STRING, PROP_FILEPATH);
3391 RNA_def_property_string_sdna(prop, NULL, "icon_filepath");
3392 RNA_def_property_ui_text(prop, "Brush Icon Filepath", "File path to brush icon");
3393 RNA_def_property_update(prop, 0, "rna_Brush_icon_update");
3396 prop = RNA_def_property(srna, "clone_image", PROP_POINTER, PROP_NONE);
3397 RNA_def_property_pointer_sdna(prop, NULL, "clone.image");
3398 RNA_def_property_flag(prop, PROP_EDITABLE);
3399 RNA_def_property_ui_text(prop, "Clone Image", "Image for clone tool");
3400 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, "rna_Brush_update");
3402 prop = RNA_def_property(srna, "clone_alpha", PROP_FLOAT, PROP_FACTOR);
3403 RNA_def_property_float_sdna(prop, NULL, "clone.alpha");
3404 RNA_def_property_range(prop, 0.0f, 1.0f);
3405 RNA_def_property_ui_text(prop, "Clone Alpha", "Opacity of clone image display");
3406 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, "rna_Brush_update");
3408 prop = RNA_def_property(srna, "clone_offset", PROP_FLOAT, PROP_XYZ);
3409 RNA_def_property_float_sdna(prop, NULL, "clone.offset");
3410 RNA_def_property_ui_text(prop, "Clone Offset", "");
3411 RNA_def_property_ui_range(prop, -1.0f, 1.0f, 10.0f, 3);
3412 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, "rna_Brush_update");
3414 prop = RNA_def_property(srna, "brush_capabilities", PROP_POINTER, PROP_NONE);
3415 RNA_def_property_flag(prop, PROP_NEVER_NULL);
3416 RNA_def_property_struct_type(prop, "BrushCapabilities");
3417 RNA_def_property_pointer_funcs(prop, "rna_Brush_capabilities_get", NULL, NULL, NULL);
3418 RNA_def_property_ui_text(prop, "Brush Capabilities", "Brush's capabilities");
3420 /* brush capabilities (mode-dependent) */
3421 prop = RNA_def_property(srna, "sculpt_capabilities", PROP_POINTER, PROP_NONE);
3422 RNA_def_property_flag(prop, PROP_NEVER_NULL);
3423 RNA_def_property_struct_type(prop, "BrushCapabilitiesSculpt");
3424 RNA_def_property_pointer_funcs(prop, "rna_Sculpt_tool_capabilities_get", NULL, NULL, NULL);
3425 RNA_def_property_ui_text(prop, "Sculpt Capabilities", "");
3427 prop = RNA_def_property(srna, "image_paint_capabilities", PROP_POINTER, PROP_NONE);
3428 RNA_def_property_flag(prop, PROP_NEVER_NULL);
3429 RNA_def_property_struct_type(prop, "BrushCapabilitiesImagePaint");
3430 RNA_def_property_pointer_funcs(prop, "rna_Imapaint_tool_capabilities_get", NULL, NULL, NULL);
3431 RNA_def_property_ui_text(prop, "Image Paint Capabilities", "");
3433 prop = RNA_def_property(srna, "vertex_paint_capabilities", PROP_POINTER, PROP_NONE);
3434 RNA_def_property_flag(prop, PROP_NEVER_NULL);
3435 RNA_def_property_struct_type(prop, "BrushCapabilitiesVertexPaint");
3436 RNA_def_property_pointer_funcs(prop, "rna_Vertexpaint_tool_capabilities_get", NULL, NULL, NULL);
3437 RNA_def_property_ui_text(prop, "Vertex Paint Capabilities", "");
3439 prop = RNA_def_property(srna, "weight_paint_capabilities", PROP_POINTER, PROP_NONE);
3440 RNA_def_property_flag(prop, PROP_NEVER_NULL);
3441 RNA_def_property_struct_type(prop, "BrushCapabilitiesWeightPaint");
3442 RNA_def_property_pointer_funcs(prop, "rna_Weightpaint_tool_capabilities_get", NULL, NULL, NULL);
3443 RNA_def_property_ui_text(prop, "Weight Paint Capabilities", "");
3445 prop = RNA_def_property(srna, "gpencil_settings", PROP_POINTER, PROP_NONE);
3446 RNA_def_property_struct_type(prop, "BrushGpencilSettings");
3447 RNA_def_property_pointer_sdna(prop, NULL, "gpencil_settings");
3448 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
3449 RNA_def_property_ui_text(prop, "Gpencil Settings", "");
3453 * A brush stroke is a list of changes to the brush that
3454 * can occur during a stroke
3456 * - 3D location of the brush
3457 * - 2D mouse location
3463 static void rna_def_operator_stroke_element(BlenderRNA *brna)
3468 srna = RNA_def_struct(brna, "OperatorStrokeElement", "PropertyGroup");
3469 RNA_def_struct_ui_text(srna, "Operator Stroke Element", "");
3471 prop = RNA_def_property(srna, "location", PROP_FLOAT, PROP_XYZ);
3472 RNA_def_property_flag(prop, PROP_IDPROPERTY);
3473 RNA_def_property_array(prop, 3);
3474 RNA_def_property_ui_text(prop, "Location", "");
3476 prop = RNA_def_property(srna, "mouse", PROP_FLOAT, PROP_XYZ);
3477 RNA_def_property_flag(prop, PROP_IDPROPERTY);
3478 RNA_def_property_array(prop, 2);
3479 RNA_def_property_ui_text(prop, "Mouse", "");
3481 prop = RNA_def_property(srna, "mouse_event", PROP_FLOAT, PROP_XYZ);
3482 RNA_def_property_flag(prop, PROP_IDPROPERTY);
3483 RNA_def_property_array(prop, 2);
3484 RNA_def_property_ui_text(prop, "Mouse Event", "");
3486 prop = RNA_def_property(srna, "pressure", PROP_FLOAT, PROP_FACTOR);
3487 RNA_def_property_flag(prop, PROP_IDPROPERTY);
3488 RNA_def_property_range(prop, 0.0f, 1.0f);
3489 RNA_def_property_ui_text(prop, "Pressure", "Tablet pressure");
3491 prop = RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE);
3492 RNA_def_property_flag(prop, PROP_IDPROPERTY);
3493 RNA_def_property_range(prop, 0.0f, FLT_MAX);
3494 RNA_def_property_ui_text(prop, "Brush Size", "Brush size in screen space");
3496 prop = RNA_def_property(srna, "pen_flip", PROP_BOOLEAN, PROP_NONE);
3497 RNA_def_property_flag(prop, PROP_IDPROPERTY);
3498 RNA_def_property_ui_text(prop, "Flip", "");
3500 prop = RNA_def_property(srna, "x_tilt", PROP_FLOAT, PROP_FACTOR);
3501 RNA_def_property_flag(prop, PROP_IDPROPERTY);
3502 RNA_def_property_range(prop, -1.0f, 1.0f);
3503 RNA_def_property_ui_text(prop, "Tilt X", "");
3505 prop = RNA_def_property(srna, "y_tilt", PROP_FLOAT, PROP_FACTOR);
3506 RNA_def_property_flag(prop, PROP_IDPROPERTY);
3507 RNA_def_property_range(prop, -1.0f, 1.0f);
3508 RNA_def_property_ui_text(prop, "Tilt Y", "");
3510 /* used in uv painting */
3511 prop = RNA_def_property(srna, "time", PROP_FLOAT, PROP_UNSIGNED);
3512 RNA_def_property_flag(prop, PROP_IDPROPERTY);
3513 RNA_def_property_ui_text(prop, "Time", "");
3515 /* used for Grease Pencil sketching sessions */
3516 prop = RNA_def_property(srna, "is_start", PROP_BOOLEAN, PROP_NONE);
3517 RNA_def_property_flag(prop, PROP_IDPROPERTY);
3518 RNA_def_property_ui_text(prop, "Is Stroke Start", "");
3520 /* XXX: Tool (this will be for pressing a modifier key for a different brush,
3521 * e.g. switching to a Smooth brush in the middle of the stroke */
3523 /* XXX: i don't think blender currently supports the ability to properly do a remappable modifier
3524 * in the middle of a stroke */
3527 void RNA_def_brush(BlenderRNA *brna)
3529 rna_def_brush(brna);
3530 rna_def_brush_capabilities(brna);
3531 rna_def_sculpt_capabilities(brna);
3532 rna_def_image_paint_capabilities(brna);
3533 rna_def_vertex_paint_capabilities(brna);
3534 rna_def_weight_paint_capabilities(brna);
3535 rna_def_gpencil_options(brna);
3536 rna_def_brush_texture_slot(brna);
3537 rna_def_operator_stroke_element(brna);