Blender V4.3
rna_sculpt_paint.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
9#include <cstdlib>
10
11#include "BLI_utildefines.h"
12
13#include "RNA_access.hh"
14#include "RNA_define.hh"
15#include "RNA_enum_types.hh"
16
17#include "rna_internal.hh"
18
19#include "DNA_ID.h"
20#include "DNA_brush_types.h"
22#include "DNA_scene_types.h"
23#include "DNA_screen_types.h"
24#include "DNA_space_types.h"
25
26#include "BKE_brush.hh"
27#include "BKE_layer.hh"
28#include "BKE_material.h"
29#include "BKE_paint.hh"
30
31#include "ED_image.hh"
32
33#include "WM_api.hh"
34#include "WM_types.hh"
35
36#include "bmesh.hh"
37
39 {PE_BRUSH_COMB, "COMB", 0, "Comb", "Comb hairs"},
40 {PE_BRUSH_SMOOTH, "SMOOTH", 0, "Smooth", "Smooth hairs"},
41 {PE_BRUSH_ADD, "ADD", 0, "Add", "Add hairs"},
42 {PE_BRUSH_LENGTH, "LENGTH", 0, "Length", "Make hairs longer or shorter"},
43 {PE_BRUSH_PUFF, "PUFF", 0, "Puff", "Make hairs stand up"},
44 {PE_BRUSH_CUT, "CUT", 0, "Cut", "Cut hairs"},
45 {PE_BRUSH_WEIGHT, "WEIGHT", 0, "Weight", "Weight hair particles"},
46 {0, nullptr, 0, nullptr, nullptr},
47};
48
49#ifndef RNA_RUNTIME
52 "VIEW",
53 ICON_RESTRICT_VIEW_ON,
54 "View",
55 "Align strokes to current view plane"},
57 "AXIS_Y",
58 ICON_AXIS_FRONT,
59 "Front (X-Z)",
60 "Project strokes to plane locked to Y"},
62 "AXIS_X",
63 ICON_AXIS_SIDE,
64 "Side (Y-Z)",
65 "Project strokes to plane locked to X"},
66 {GP_LOCKAXIS_Z, "AXIS_Z", ICON_AXIS_TOP, "Top (X-Y)", "Project strokes to plane locked to Z"},
68 "CURSOR",
69 ICON_PIVOT_CURSOR,
70 "Cursor",
71 "Align strokes to current 3D cursor orientation"},
72 {0, nullptr, 0, nullptr, nullptr},
73};
74
77 "MATERIAL",
78 0,
79 "Material",
80 "Paint using the active material base color"},
82 "VERTEXCOLOR",
83 0,
84 "Color Attribute",
85 "Paint the material with a color attribute"},
86 {0, nullptr, 0, nullptr, nullptr},
87};
88#endif
89
91 {PAINT_CANVAS_SOURCE_COLOR_ATTRIBUTE, "COLOR_ATTRIBUTE", 0, "Color Attribute", ""},
92 {PAINT_CANVAS_SOURCE_MATERIAL, "MATERIAL", 0, "Material", ""},
93 {PAINT_CANVAS_SOURCE_IMAGE, "IMAGE", 0, "Image", ""},
94 {0, nullptr, 0, nullptr, nullptr},
95};
96
98 {BMO_SYMMETRIZE_NEGATIVE_X, "NEGATIVE_X", 0, "-X to +X", ""},
99 {BMO_SYMMETRIZE_POSITIVE_X, "POSITIVE_X", 0, "+X to -X", ""},
100
101 {BMO_SYMMETRIZE_NEGATIVE_Y, "NEGATIVE_Y", 0, "-Y to +Y", ""},
102 {BMO_SYMMETRIZE_POSITIVE_Y, "POSITIVE_Y", 0, "+Y to -Y", ""},
103
104 {BMO_SYMMETRIZE_NEGATIVE_Z, "NEGATIVE_Z", 0, "-Z to +Z", ""},
105 {BMO_SYMMETRIZE_POSITIVE_Z, "POSITIVE_Z", 0, "+Z to -Z", ""},
106 {0, nullptr, 0, nullptr, nullptr},
107};
108
109#ifdef RNA_RUNTIME
110# include "MEM_guardedalloc.h"
111
112# include "BKE_collection.hh"
113# include "BKE_colortools.hh"
114# include "BKE_context.hh"
115# include "BKE_gpencil_legacy.h"
116# include "BKE_object.hh"
117# include "BKE_particle.h"
118# include "BKE_pointcache.h"
119
120# include "DEG_depsgraph.hh"
121
122# include "ED_gpencil_legacy.hh"
123# include "ED_paint.hh"
124# include "ED_particle.hh"
125
126const EnumPropertyItem rna_enum_particle_edit_disconnected_hair_brush_items[] = {
127 {PE_BRUSH_COMB, "COMB", 0, "Comb", "Comb hairs"},
128 {PE_BRUSH_SMOOTH, "SMOOTH", 0, "Smooth", "Smooth hairs"},
129 {PE_BRUSH_LENGTH, "LENGTH", 0, "Length", "Make hairs longer or shorter"},
130 {PE_BRUSH_CUT, "CUT", 0, "Cut", "Cut hairs"},
131 {PE_BRUSH_WEIGHT, "WEIGHT", 0, "Weight", "Weight hair particles"},
132 {0, nullptr, 0, nullptr, nullptr},
133};
134
135static const EnumPropertyItem particle_edit_cache_brush_items[] = {
136 {PE_BRUSH_COMB, "COMB", 0, "Comb", "Comb paths"},
137 {PE_BRUSH_SMOOTH, "SMOOTH", 0, "Smooth", "Smooth paths"},
138 {PE_BRUSH_LENGTH, "LENGTH", 0, "Length", "Make paths longer or shorter"},
139 {0, nullptr, 0, nullptr, nullptr},
140};
141
142static PointerRNA rna_ParticleEdit_brush_get(PointerRNA *ptr)
143{
145 ParticleBrushData *brush = nullptr;
146
147 brush = &pset->brush[pset->brushtype];
148
149 return rna_pointer_inherit_refine(ptr, &RNA_ParticleBrush, brush);
150}
151
152static PointerRNA rna_ParticleBrush_curve_get(PointerRNA *ptr)
153{
154 return rna_pointer_inherit_refine(ptr, &RNA_CurveMapping, nullptr);
155}
156
157static void rna_ParticleEdit_redo(bContext *C, PointerRNA * /*ptr*/)
158{
160 Scene *scene = CTX_data_scene(C);
161 ViewLayer *view_layer = CTX_data_view_layer(C);
162 BKE_view_layer_synced_ensure(scene, view_layer);
164 PTCacheEdit *edit = PE_get_current(depsgraph, scene, ob);
165
166 if (!edit) {
167 return;
168 }
169
170 if (ob) {
172 }
173
174 if (edit->psys) {
176 psys_free_path_cache(edit->psys, edit);
177 }
179}
180
181static void rna_ParticleEdit_update(bContext *C, PointerRNA * /*ptr*/)
182{
183 Scene *scene = CTX_data_scene(C);
184 ViewLayer *view_layer = CTX_data_view_layer(C);
185 BKE_view_layer_synced_ensure(scene, view_layer);
187
188 if (ob) {
190 }
191
192 /* Sync tool setting changes from original to evaluated scenes. */
194}
195
196static void rna_ParticleEdit_tool_set(PointerRNA *ptr, int value)
197{
199
200 /* redraw hair completely if weight brush is/was used */
201 if ((pset->brushtype == PE_BRUSH_WEIGHT || value == PE_BRUSH_WEIGHT) && pset->object) {
202 Object *ob = pset->object;
203 if (ob) {
206 }
207 }
208
209 pset->brushtype = value;
210}
211static const EnumPropertyItem *rna_ParticleEdit_tool_itemf(bContext *C,
212 PointerRNA * /*ptr*/,
213 PropertyRNA * /*prop*/,
214 bool * /*r_free*/)
215{
216 const Scene *scene = CTX_data_scene(C);
217 ViewLayer *view_layer = CTX_data_view_layer(C);
218 BKE_view_layer_synced_ensure(scene, view_layer);
220# if 0
222 Scene *scene = CTX_data_scene(C);
223 PTCacheEdit *edit = PE_get_current(depsgraph, scene, ob);
224 ParticleSystem *psys = edit ? edit->psys : nullptr;
225# else
226 /* use this rather than PE_get_current() - because the editing cache is
227 * dependent on the cache being updated which can happen after this UI
228 * draws causing a glitch #28883. */
230# endif
231
232 if (psys) {
233 if (psys->flag & PSYS_GLOBAL_HAIR) {
234 return rna_enum_particle_edit_disconnected_hair_brush_items;
235 }
236 else {
238 }
239 }
240
241 return particle_edit_cache_brush_items;
242}
243
244static bool rna_ParticleEdit_editable_get(PointerRNA *ptr)
245{
247
248 return (pset->object && pset->scene && PE_get_current(nullptr, pset->scene, pset->object));
249}
250static bool rna_ParticleEdit_hair_get(PointerRNA *ptr)
251{
253
254 if (pset->scene) {
255 PTCacheEdit *edit = PE_get_current(nullptr, pset->scene, pset->object);
256
257 return (edit && edit->psys);
258 }
259
260 return 0;
261}
262
263static std::optional<std::string> rna_ParticleEdit_path(const PointerRNA * /*ptr*/)
264{
265 return "tool_settings.particle_edit";
266}
267
268static PointerRNA rna_Paint_brush_get(PointerRNA *ptr)
269{
270 Paint *paint = static_cast<Paint *>(ptr->data);
271 Brush *brush = BKE_paint_brush(paint);
272 if (!brush) {
273 return PointerRNA_NULL;
274 }
275 return RNA_id_pointer_create(&brush->id);
276}
277
278static void rna_Paint_brush_set(PointerRNA *ptr, PointerRNA value, ReportList * /*reports*/)
279{
280 Paint *paint = static_cast<Paint *>(ptr->data);
281 Brush *brush = static_cast<Brush *>(value.data);
282 BKE_paint_brush_set(paint, brush);
284}
285
286static bool rna_Paint_brush_poll(PointerRNA *ptr, PointerRNA value)
287{
288 const Paint *paint = static_cast<Paint *>(ptr->data);
289 const Brush *brush = static_cast<Brush *>(value.data);
290
291 return (brush == nullptr) || (paint->runtime.ob_mode & brush->ob_mode) != 0;
292}
293
294static PointerRNA rna_Paint_eraser_brush_get(PointerRNA *ptr)
295{
296 Paint *paint = static_cast<Paint *>(ptr->data);
297 Brush *brush = BKE_paint_eraser_brush(paint);
298 if (!brush) {
299 return PointerRNA_NULL;
300 }
301 return RNA_id_pointer_create(&brush->id);
302}
303
304static void rna_Paint_eraser_brush_set(PointerRNA *ptr, PointerRNA value, ReportList * /*reports*/)
305{
306 Paint *paint = static_cast<Paint *>(ptr->data);
307 Brush *brush = static_cast<Brush *>(value.data);
308 BKE_paint_eraser_brush_set(paint, brush);
310}
311
312static bool rna_Paint_eraser_brush_poll(PointerRNA *ptr, PointerRNA value)
313{
314 const Paint *paint = static_cast<Paint *>(ptr->data);
315 const Brush *brush = static_cast<Brush *>(value.data);
316
317 return (brush == nullptr) || (paint->runtime.ob_mode & brush->ob_mode) != 0;
318}
319
320static void rna_Sculpt_update(bContext *C, PointerRNA * /*ptr*/)
321{
322 Scene *scene = CTX_data_scene(C);
323 ViewLayer *view_layer = CTX_data_view_layer(C);
324 BKE_view_layer_synced_ensure(scene, view_layer);
326
327 if (ob) {
330 }
331}
332
333static std::optional<std::string> rna_Sculpt_path(const PointerRNA * /*ptr*/)
334{
335 return "tool_settings.sculpt";
336}
337
338static std::optional<std::string> rna_VertexPaint_path(const PointerRNA *ptr)
339{
340 const Scene *scene = (Scene *)ptr->owner_id;
341 const ToolSettings *ts = scene->toolsettings;
342 if (ptr->data == ts->vpaint) {
343 return "tool_settings.vertex_paint";
344 }
345 return "tool_settings.weight_paint";
346}
347
348static std::optional<std::string> rna_ImagePaintSettings_path(const PointerRNA * /*ptr*/)
349{
350 return "tool_settings.image_paint";
351}
352
353static std::optional<std::string> rna_PaintModeSettings_path(const PointerRNA * /*ptr*/)
354{
355 return "tool_settings.paint_mode";
356}
357
358static std::optional<std::string> rna_UvSculpt_path(const PointerRNA * /*ptr*/)
359{
360 return "tool_settings.uv_sculpt";
361}
362
363static std::optional<std::string> rna_CurvesSculpt_path(const PointerRNA * /*ptr*/)
364{
365 return "tool_settings.curves_sculpt";
366}
367
368static std::optional<std::string> rna_GpPaint_path(const PointerRNA * /*ptr*/)
369{
370 return "tool_settings.gpencil_paint";
371}
372
373static std::optional<std::string> rna_GpVertexPaint_path(const PointerRNA * /*ptr*/)
374{
375 return "tool_settings.gpencil_vertex_paint";
376}
377
378static std::optional<std::string> rna_GpSculptPaint_path(const PointerRNA * /*ptr*/)
379{
380 return "tool_settings.gpencil_sculpt_paint";
381}
382
383static std::optional<std::string> rna_GpWeightPaint_path(const PointerRNA * /*ptr*/)
384{
385 return "tool_settings.gpencil_weight_paint";
386}
387
388static std::optional<std::string> rna_ParticleBrush_path(const PointerRNA * /*ptr*/)
389{
390 return "tool_settings.particle_edit.brush";
391}
392
393static void rna_ImaPaint_viewport_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA * /*ptr*/)
394{
395 /* not the best solution maybe, but will refresh the 3D viewport */
397}
398
399static void rna_ImaPaint_mode_update(bContext *C, PointerRNA * /*ptr*/)
400{
401 Scene *scene = CTX_data_scene(C);
402 ViewLayer *view_layer = CTX_data_view_layer(C);
403 BKE_view_layer_synced_ensure(scene, view_layer);
405
406 if (ob && ob->type == OB_MESH) {
407 /* of course we need to invalidate here */
409
410 /* We assume that changing the current mode will invalidate the uv layers
411 * so we need to refresh display. */
412 ED_paint_proj_mesh_data_check(*scene, *ob, nullptr, nullptr, nullptr, nullptr);
414 }
415}
416
417static void rna_ImaPaint_stencil_update(bContext *C, PointerRNA * /*ptr*/)
418{
419 Scene *scene = CTX_data_scene(C);
420 ViewLayer *view_layer = CTX_data_view_layer(C);
421 BKE_view_layer_synced_ensure(scene, view_layer);
423
424 if (ob && ob->type == OB_MESH) {
425 ED_paint_proj_mesh_data_check(*scene, *ob, nullptr, nullptr, nullptr, nullptr);
427 }
428}
429
430static bool rna_ImaPaint_imagetype_poll(PointerRNA * /*ptr*/, PointerRNA value)
431{
432 Image *image = (Image *)value.owner_id;
433 return image->type != IMA_TYPE_R_RESULT && image->type != IMA_TYPE_COMPOSITE;
434}
435
436static void rna_ImaPaint_canvas_update(bContext *C, PointerRNA * /*ptr*/)
437{
438 Main *bmain = CTX_data_main(C);
439 Scene *scene = CTX_data_scene(C);
440 ViewLayer *view_layer = CTX_data_view_layer(C);
441 BKE_view_layer_synced_ensure(scene, view_layer);
443 Image *ima = scene->toolsettings->imapaint.canvas;
444
445 ED_space_image_sync(bmain, ima, false);
446
447 if (ob && ob->type == OB_MESH) {
448 ED_paint_proj_mesh_data_check(*scene, *ob, nullptr, nullptr, nullptr, nullptr);
450 }
451}
452
453static void rna_UvSculpt_curve_preset_set(PointerRNA *ptr, int value)
454{
455 Scene *scene = reinterpret_cast<Scene *>(ptr->owner_id);
456 if (value == BRUSH_CURVE_CUSTOM) {
457 if (!scene->toolsettings->uvsculpt.strength_curve) {
459 1, 0.0f, 0.0f, 1.0f, 1.0f);
460 }
461 }
462 scene->toolsettings->uvsculpt.curve_preset = int8_t(value);
463}
464
468static bool rna_PaintModeSettings_canvas_image_poll(PointerRNA * /*ptr*/, PointerRNA value)
469{
470 Image *image = (Image *)value.owner_id;
471 return !ELEM(image->type, IMA_TYPE_COMPOSITE, IMA_TYPE_R_RESULT);
472}
473
474static void rna_PaintModeSettings_canvas_source_update(bContext *C, PointerRNA * /*ptr*/)
475{
476 Scene *scene = CTX_data_scene(C);
478 /* When canvas source changes the #pbvh::Tree would require updates when switching between color
479 * attributes. */
480 if (ob && ob->type == OB_MESH) {
482 DEG_id_tag_update(&ob->id, 0);
484 }
485}
486
487/* \} */
488
489static bool rna_ImaPaint_detect_data(ImagePaintSettings *imapaint)
490{
491 return imapaint->missing_data == 0;
492}
493
494static std::optional<std::string> rna_GPencilSculptSettings_path(const PointerRNA * /*ptr*/)
495{
496 return "tool_settings.gpencil_sculpt";
497}
498
499static std::optional<std::string> rna_GPencilSculptGuide_path(const PointerRNA * /*ptr*/)
500{
501 return "tool_settings.gpencil_sculpt.guide";
502}
503
504static void rna_Sculpt_automasking_invert_cavity_set(PointerRNA *ptr, bool val)
505{
506 Sculpt *sd = (Sculpt *)ptr->data;
507
508 if (val) {
509 sd->automasking_flags &= ~BRUSH_AUTOMASKING_CAVITY_NORMAL;
510 sd->automasking_flags |= BRUSH_AUTOMASKING_CAVITY_INVERTED;
511 }
512 else {
513 sd->automasking_flags &= ~BRUSH_AUTOMASKING_CAVITY_INVERTED;
514 }
515}
516
517static void rna_Sculpt_automasking_cavity_set(PointerRNA *ptr, bool val)
518{
519 Sculpt *sd = (Sculpt *)ptr->data;
520
521 if (val) {
522 sd->automasking_flags &= ~BRUSH_AUTOMASKING_CAVITY_INVERTED;
523 sd->automasking_flags |= BRUSH_AUTOMASKING_CAVITY_NORMAL;
524 }
525 else {
526 sd->automasking_flags &= ~BRUSH_AUTOMASKING_CAVITY_NORMAL;
527 }
528}
529#else
530
532{
533 StructRNA *srna;
534
535 srna = RNA_def_struct(brna, "PaintCurve", "ID");
536 RNA_def_struct_ui_text(srna, "Paint Curve", "");
537 RNA_def_struct_ui_icon(srna, ICON_CURVE_BEZCURVE);
538}
539
540static void rna_def_paint(BlenderRNA *brna)
541{
542 StructRNA *srna;
543 PropertyRNA *prop;
544
545 srna = RNA_def_struct(brna, "Paint", nullptr);
546 RNA_def_struct_ui_text(srna, "Paint", "");
547
548 /* Global Settings */
549 prop = RNA_def_property(srna, "brush", PROP_POINTER, PROP_NONE);
551 RNA_def_property_struct_type(prop, "Brush");
553 prop, "rna_Paint_brush_get", "rna_Paint_brush_set", nullptr, "rna_Paint_brush_poll");
554 RNA_def_property_ui_text(prop, "Brush", "Active brush");
556
557 prop = RNA_def_property(srna, "brush_asset_reference", PROP_POINTER, PROP_NONE);
560 "Brush Asset Reference",
561 "A weak reference to the matching brush asset, used e.g. to restore "
562 "the last used brush on file load");
563
564 prop = RNA_def_property(srna, "eraser_brush", PROP_POINTER, PROP_NONE);
566 RNA_def_property_struct_type(prop, "Brush");
568 "rna_Paint_eraser_brush_get",
569 "rna_Paint_eraser_brush_set",
570 nullptr,
571 "rna_Paint_eraser_brush_poll");
573 "Default Eraser Brush",
574 "Default eraser brush for quickly alternating with the main brush");
576
577 prop = RNA_def_property(srna, "eraser_brush_asset_reference", PROP_POINTER, PROP_NONE);
580 "Eraser Brush Asset Reference",
581 "A weak reference to the matching brush asset, used e.g. to restore "
582 "the last used brush on file load");
583
584 prop = RNA_def_property(srna, "palette", PROP_POINTER, PROP_NONE);
586 RNA_def_property_pointer_funcs(prop, nullptr, nullptr, nullptr, nullptr);
587 RNA_def_property_ui_text(prop, "Palette", "Active Palette");
588
589 prop = RNA_def_property(srna, "show_brush", PROP_BOOLEAN, PROP_NONE);
590 RNA_def_property_boolean_sdna(prop, nullptr, "flags", PAINT_SHOW_BRUSH);
591 RNA_def_property_ui_text(prop, "Show Brush", "");
593
594 prop = RNA_def_property(srna, "show_brush_on_surface", PROP_BOOLEAN, PROP_NONE);
596 RNA_def_property_ui_text(prop, "Show Brush On Surface", "");
598
599 prop = RNA_def_property(srna, "show_low_resolution", PROP_BOOLEAN, PROP_NONE);
600 RNA_def_property_boolean_sdna(prop, nullptr, "flags", PAINT_FAST_NAVIGATE);
602 prop, "Fast Navigate", "For multires, show low resolution while navigating the view");
604
605 prop = RNA_def_property(srna, "use_sculpt_delay_updates", PROP_BOOLEAN, PROP_NONE);
608 prop,
609 "Delay Viewport Updates",
610 "Update the geometry when it enters the view, providing faster view navigation");
612
613 prop = RNA_def_property(srna, "use_symmetry_x", PROP_BOOLEAN, PROP_NONE);
614 RNA_def_property_boolean_sdna(prop, nullptr, "symmetry_flags", PAINT_SYMM_X);
615 RNA_def_property_ui_text(prop, "Symmetry X", "Mirror brush across the X axis");
617
618 prop = RNA_def_property(srna, "use_symmetry_y", PROP_BOOLEAN, PROP_NONE);
619 RNA_def_property_boolean_sdna(prop, nullptr, "symmetry_flags", PAINT_SYMM_Y);
620 RNA_def_property_ui_text(prop, "Symmetry Y", "Mirror brush across the Y axis");
622
623 prop = RNA_def_property(srna, "use_symmetry_z", PROP_BOOLEAN, PROP_NONE);
624 RNA_def_property_boolean_sdna(prop, nullptr, "symmetry_flags", PAINT_SYMM_Z);
625 RNA_def_property_ui_text(prop, "Symmetry Z", "Mirror brush across the Z axis");
627
628 prop = RNA_def_property(srna, "use_symmetry_feather", PROP_BOOLEAN, PROP_NONE);
629 RNA_def_property_boolean_sdna(prop, nullptr, "symmetry_flags", PAINT_SYMMETRY_FEATHER);
631 "Symmetry Feathering",
632 "Reduce the strength of the brush where it overlaps symmetrical daubs");
634
635 prop = RNA_def_property(srna, "cavity_curve", PROP_POINTER, PROP_NONE);
637 RNA_def_property_ui_text(prop, "Curve", "Editable cavity curve");
639
640 prop = RNA_def_property(srna, "use_cavity", PROP_BOOLEAN, PROP_NONE);
642 RNA_def_property_ui_text(prop, "Cavity Mask", "Mask painting according to mesh geometry cavity");
644
645 prop = RNA_def_property(srna, "tile_offset", PROP_FLOAT, PROP_XYZ_LENGTH);
646 RNA_def_property_float_sdna(prop, nullptr, "tile_offset");
647 RNA_def_property_array(prop, 3);
648 RNA_def_property_range(prop, 0.01, FLT_MAX);
649 RNA_def_property_ui_range(prop, 0.01, 100, 1 * 100, 2);
651 prop, "Tiling offset for the X Axis", "Stride at which tiled strokes are copied");
652
653 prop = RNA_def_property(srna, "tile_x", PROP_BOOLEAN, PROP_NONE);
654 RNA_def_property_boolean_sdna(prop, nullptr, "symmetry_flags", PAINT_TILE_X);
655 RNA_def_property_ui_text(prop, "Tile X", "Tile along X axis");
657
658 prop = RNA_def_property(srna, "tile_y", PROP_BOOLEAN, PROP_NONE);
659 RNA_def_property_boolean_sdna(prop, nullptr, "symmetry_flags", PAINT_TILE_Y);
660 RNA_def_property_ui_text(prop, "Tile Y", "Tile along Y axis");
662
663 prop = RNA_def_property(srna, "tile_z", PROP_BOOLEAN, PROP_NONE);
664 RNA_def_property_boolean_sdna(prop, nullptr, "symmetry_flags", PAINT_TILE_Z);
665 RNA_def_property_ui_text(prop, "Tile Z", "Tile along Z axis");
667}
668
669static void rna_def_sculpt(BlenderRNA *brna)
670{
671 static const EnumPropertyItem detail_refine_items[] = {
673 "SUBDIVIDE",
674 0,
675 "Subdivide Edges",
676 "Subdivide long edges to add mesh detail where needed"},
678 "COLLAPSE",
679 0,
680 "Collapse Edges",
681 "Collapse short edges to remove mesh detail where possible"},
683 "SUBDIVIDE_COLLAPSE",
684 0,
685 "Subdivide Collapse",
686 "Both subdivide long edges and collapse short edges to refine mesh detail"},
687 {0, nullptr, 0, nullptr, nullptr},
688 };
689
690 static const EnumPropertyItem detail_type_items[] = {
691 {0,
692 "RELATIVE",
693 0,
694 "Relative Detail",
695 "Mesh detail is relative to the brush size and detail size"},
697 "CONSTANT",
698 0,
699 "Constant Detail",
700 "Mesh detail is constant in world space according to detail size"},
702 "BRUSH",
703 0,
704 "Brush Detail",
705 "Mesh detail is relative to brush radius"},
707 "MANUAL",
708 0,
709 "Manual Detail",
710 "Mesh detail does not change on each stroke, only when using Flood Fill"},
711 {0, nullptr, 0, nullptr, nullptr},
712 };
713
714 static const EnumPropertyItem sculpt_transform_mode_items[] = {
716 "ALL_VERTICES",
717 0,
718 "All Vertices",
719 "Applies the transformation to all vertices in the mesh"},
721 "RADIUS_ELASTIC",
722 0,
723 "Elastic",
724 "Applies the transformation simulating elasticity using the radius of the cursor"},
725 {0, nullptr, 0, nullptr, nullptr},
726 };
727
728 StructRNA *srna;
729 PropertyRNA *prop;
730
731 srna = RNA_def_struct(brna, "Sculpt", "Paint");
732 RNA_def_struct_path_func(srna, "rna_Sculpt_path");
733 RNA_def_struct_ui_text(srna, "Sculpt", "");
734
735 prop = RNA_def_property(srna, "radial_symmetry", PROP_INT, PROP_XYZ);
736 RNA_def_property_int_sdna(prop, nullptr, "radial_symm");
738 RNA_def_property_range(prop, 1, 64);
739 RNA_def_property_ui_range(prop, 0, 32, 1, 1);
741 prop, "Radial Symmetry Count X Axis", "Number of times to copy strokes across the surface");
742
743 prop = RNA_def_property(srna, "lock_x", PROP_BOOLEAN, PROP_NONE);
744 RNA_def_property_boolean_sdna(prop, nullptr, "flags", SCULPT_LOCK_X);
745 RNA_def_property_ui_text(prop, "Lock X", "Disallow changes to the X axis of vertices");
747
748 prop = RNA_def_property(srna, "lock_y", PROP_BOOLEAN, PROP_NONE);
749 RNA_def_property_boolean_sdna(prop, nullptr, "flags", SCULPT_LOCK_Y);
750 RNA_def_property_ui_text(prop, "Lock Y", "Disallow changes to the Y axis of vertices");
752
753 prop = RNA_def_property(srna, "lock_z", PROP_BOOLEAN, PROP_NONE);
754 RNA_def_property_boolean_sdna(prop, nullptr, "flags", SCULPT_LOCK_Z);
755 RNA_def_property_ui_text(prop, "Lock Z", "Disallow changes to the Z axis of vertices");
757
758 prop = RNA_def_property(srna, "use_deform_only", PROP_BOOLEAN, PROP_NONE);
759 RNA_def_property_boolean_sdna(prop, nullptr, "flags", SCULPT_ONLY_DEFORM);
761 "Use Deform Only",
762 "Use only deformation modifiers (temporary disable all "
763 "constructive modifiers except multi-resolution)");
765 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Sculpt_update");
766
767 prop = RNA_def_property(srna, "detail_size", PROP_FLOAT, PROP_PIXEL);
768 RNA_def_property_range(prop, 0.5, 40.0);
769 RNA_def_property_ui_range(prop, 0.5, 40.0, 0.1, 2);
772 prop, "Detail Size", "Maximum edge length for dynamic topology sculpting (in pixels)");
774
775 prop = RNA_def_property(srna, "detail_percent", PROP_FLOAT, PROP_PERCENTAGE);
776 RNA_def_property_range(prop, 0.5, 100.0);
777 RNA_def_property_ui_range(prop, 0.5, 100.0, 10, 2);
779 prop,
780 "Detail Percentage",
781 "Maximum edge length for dynamic topology sculpting (in brush percenage)");
783
784 prop = RNA_def_property(srna, "constant_detail_resolution", PROP_FLOAT, PROP_NONE);
785 RNA_def_property_float_sdna(prop, nullptr, "constant_detail");
786 RNA_def_property_range(prop, 0.0001, FLT_MAX);
787 RNA_def_property_ui_range(prop, 0.001, 1000.0, 10, 2);
789 "Resolution",
790 "Maximum edge length for dynamic topology sculpting (as divisor "
791 "of Blender unit - higher value means smaller edge length)");
793
795 do {
796 prop = RNA_def_property(srna, entry->identifier, PROP_BOOLEAN, PROP_NONE);
797 RNA_def_property_boolean_sdna(prop, nullptr, "automasking_flags", entry->value);
798 RNA_def_property_ui_text(prop, entry->name, entry->description);
799
801 RNA_def_property_boolean_funcs(prop, nullptr, "rna_Sculpt_automasking_cavity_set");
802 }
803 else if (entry->value == BRUSH_AUTOMASKING_CAVITY_INVERTED) {
804 RNA_def_property_boolean_funcs(prop, nullptr, "rna_Sculpt_automasking_invert_cavity_set");
805 }
806
808 } while ((++entry)->identifier);
809
810 prop = RNA_def_property(
811 srna, "automasking_boundary_edges_propagation_steps", PROP_INT, PROP_UNSIGNED);
812 RNA_def_property_int_sdna(prop, nullptr, "automasking_boundary_edges_propagation_steps");
816 "Propagation Steps",
817 "Distance where boundary edge automasking is going to protect vertices "
818 "from the fully masked edge");
820
821 prop = RNA_def_property(srna, "automasking_cavity_factor", PROP_FLOAT, PROP_FACTOR);
822 RNA_def_property_float_sdna(prop, nullptr, "automasking_cavity_factor");
823 RNA_def_property_ui_text(prop, "Cavity Factor", "The contrast of the cavity mask");
825 RNA_def_property_range(prop, 0.0f, 5.0f);
826 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
828
829 prop = RNA_def_property(srna, "automasking_cavity_blur_steps", PROP_INT, PROP_NONE);
830 RNA_def_property_int_sdna(prop, nullptr, "automasking_cavity_blur_steps");
831 RNA_def_property_ui_text(prop, "Blur Steps", "The number of times the cavity mask is blurred");
833 RNA_def_property_range(prop, 0, 25);
834 RNA_def_property_ui_range(prop, 0, 10, 1, 1);
836
837 prop = RNA_def_property(srna, "automasking_cavity_curve", PROP_POINTER, PROP_NONE);
838 RNA_def_property_pointer_sdna(prop, nullptr, "automasking_cavity_curve");
839 RNA_def_property_struct_type(prop, "CurveMapping");
840 RNA_def_property_ui_text(prop, "Cavity Curve", "Curve used for the sensitivity");
843
844 prop = RNA_def_property(srna, "automasking_cavity_curve_op", PROP_POINTER, PROP_NONE);
845 RNA_def_property_pointer_sdna(prop, nullptr, "automasking_cavity_curve_op");
846 RNA_def_property_struct_type(prop, "CurveMapping");
847 RNA_def_property_ui_text(prop, "Cavity Curve", "Curve used for the sensitivity");
850
851 prop = RNA_def_property(srna, "use_automasking_start_normal", PROP_BOOLEAN, PROP_NONE);
853 prop, nullptr, "automasking_flags", BRUSH_AUTOMASKING_BRUSH_NORMAL);
855 prop,
856 "Area Normal",
857 "Affect only vertices with a similar normal to where the stroke starts");
859
860 prop = RNA_def_property(srna, "use_automasking_view_normal", PROP_BOOLEAN, PROP_NONE);
861 RNA_def_property_boolean_sdna(prop, nullptr, "automasking_flags", BRUSH_AUTOMASKING_VIEW_NORMAL);
863 prop, "View Normal", "Affect only vertices with a normal that faces the viewer");
865
866 prop = RNA_def_property(srna, "use_automasking_view_occlusion", PROP_BOOLEAN, PROP_NONE);
868 prop, nullptr, "automasking_flags", BRUSH_AUTOMASKING_VIEW_OCCLUSION);
870 prop,
871 "Occlusion",
872 "Only affect vertices that are not occluded by other faces (Slower performance)");
874
875 prop = RNA_def_property(srna, "automasking_start_normal_limit", PROP_FLOAT, PROP_ANGLE);
876 RNA_def_property_float_sdna(prop, nullptr, "automasking_start_normal_limit");
877 RNA_def_property_range(prop, 0.0001f, M_PI);
878 RNA_def_property_ui_text(prop, "Area Normal Limit", "The range of angles that will be affected");
880
881 prop = RNA_def_property(srna, "automasking_start_normal_falloff", PROP_FLOAT, PROP_FACTOR);
882 RNA_def_property_float_sdna(prop, nullptr, "automasking_start_normal_falloff");
883 RNA_def_property_range(prop, 0.0001f, 1.0f);
885 prop, "Area Normal Falloff", "Extend the angular range with a falloff gradient");
887
888 prop = RNA_def_property(srna, "automasking_view_normal_limit", PROP_FLOAT, PROP_ANGLE);
889 RNA_def_property_float_sdna(prop, nullptr, "automasking_view_normal_limit");
890 RNA_def_property_range(prop, 0.0001f, M_PI);
891 RNA_def_property_ui_text(prop, "View Normal Limit", "The range of angles that will be affected");
893
894 prop = RNA_def_property(srna, "automasking_view_normal_falloff", PROP_FLOAT, PROP_FACTOR);
895 RNA_def_property_float_sdna(prop, nullptr, "automasking_view_normal_falloff");
896 RNA_def_property_range(prop, 0.0001f, 1.0f);
898 prop, "View Normal Falloff", "Extend the angular range with a falloff gradient");
900
901 prop = RNA_def_property(srna, "symmetrize_direction", PROP_ENUM, PROP_NONE);
903 RNA_def_property_ui_text(prop, "Direction", "Source and destination for symmetrize operator");
904
905 prop = RNA_def_property(srna, "detail_refine_method", PROP_ENUM, PROP_NONE);
906 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flags");
907 RNA_def_property_enum_items(prop, detail_refine_items);
909 prop, "Detail Refine Method", "In dynamic-topology mode, how to add or remove mesh detail");
911
912 prop = RNA_def_property(srna, "detail_type_method", PROP_ENUM, PROP_NONE);
913 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flags");
914 RNA_def_property_enum_items(prop, detail_type_items);
916 prop, "Detail Type Method", "In dynamic-topology mode, how mesh detail size is calculated");
918
919 prop = RNA_def_property(srna, "gravity", PROP_FLOAT, PROP_FACTOR);
920 RNA_def_property_float_sdna(prop, nullptr, "gravity_factor");
921 RNA_def_property_range(prop, 0.0f, 1.0f);
922 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
923 RNA_def_property_ui_text(prop, "Gravity", "Amount of gravity after each dab");
925
926 prop = RNA_def_property(srna, "transform_mode", PROP_ENUM, PROP_NONE);
927 RNA_def_property_enum_items(prop, sculpt_transform_mode_items);
929 prop, "Transform Mode", "How the transformation is going to be applied to the target");
931
932 prop = RNA_def_property(srna, "gravity_object", PROP_POINTER, PROP_NONE);
935 prop, "Orientation", "Object whose Z axis defines orientation of gravity");
937}
938
940{
941 StructRNA *srna;
942 PropertyRNA *prop;
943
944 srna = RNA_def_struct(brna, "UvSculpt", "Paint");
945 RNA_def_struct_path_func(srna, "rna_UvSculpt_path");
946 RNA_def_struct_ui_text(srna, "UV Sculpting", "");
947
948 prop = RNA_def_property(srna, "size", PROP_INT, PROP_PIXEL);
949 RNA_def_property_ui_range(prop, 1, 500, 1, 1);
950 RNA_def_property_range(prop, 1, 5000);
951 RNA_def_property_ui_text(prop, "Size", "");
953
954 prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_FACTOR);
955 RNA_def_property_range(prop, 0.0f, 1.0f);
956 RNA_def_property_ui_text(prop, "Strength", "");
958
959 prop = RNA_def_property(srna, "strength_curve", PROP_POINTER, PROP_NONE);
960 RNA_def_property_struct_type(prop, "CurveMapping");
961 RNA_def_property_pointer_funcs(prop, nullptr, nullptr, nullptr, nullptr);
962 RNA_def_property_ui_text(prop, "Strength Curve", "");
964
965 prop = RNA_def_property(srna, "curve_preset", PROP_ENUM, PROP_NONE);
967 RNA_def_property_ui_text(prop, "Strength Curve Preset", "");
968 RNA_def_property_enum_funcs(prop, nullptr, "rna_UvSculpt_curve_preset_set", nullptr);
970}
971
972static void rna_def_gp_paint(BlenderRNA *brna)
973{
974 StructRNA *srna;
975 PropertyRNA *prop;
976
977 srna = RNA_def_struct(brna, "GpPaint", "Paint");
978 RNA_def_struct_path_func(srna, "rna_GpPaint_path");
979 RNA_def_struct_ui_text(srna, "Grease Pencil Paint", "");
980
981 /* Use vertex color (main switch). */
982 prop = RNA_def_property(srna, "color_mode", PROP_ENUM, PROP_NONE);
983 RNA_def_property_enum_sdna(prop, nullptr, "mode");
985 RNA_def_property_ui_text(prop, "Mode", "Paint Mode");
988}
989
991{
992 StructRNA *srna;
993
994 srna = RNA_def_struct(brna, "GpVertexPaint", "Paint");
995 RNA_def_struct_path_func(srna, "rna_GpVertexPaint_path");
996 RNA_def_struct_ui_text(srna, "Grease Pencil Vertex Paint", "");
997}
998
1000{
1001 StructRNA *srna;
1002
1003 srna = RNA_def_struct(brna, "GpSculptPaint", "Paint");
1004 RNA_def_struct_path_func(srna, "rna_GpSculptPaint_path");
1005 RNA_def_struct_ui_text(srna, "Grease Pencil Sculpt Paint", "");
1006}
1007
1009{
1010 StructRNA *srna;
1011
1012 srna = RNA_def_struct(brna, "GpWeightPaint", "Paint");
1013 RNA_def_struct_path_func(srna, "rna_GpWeightPaint_path");
1014 RNA_def_struct_ui_text(srna, "Grease Pencil Weight Paint", "");
1015}
1016
1017/* use for weight paint too */
1019{
1020 StructRNA *srna;
1021 PropertyRNA *prop;
1022
1023 srna = RNA_def_struct(brna, "VertexPaint", "Paint");
1024 RNA_def_struct_sdna(srna, "VPaint");
1025 RNA_def_struct_path_func(srna, "rna_VertexPaint_path");
1026 RNA_def_struct_ui_text(srna, "Vertex Paint", "Properties of vertex and weight paint mode");
1027
1028 /* weight paint only */
1029 prop = RNA_def_property(srna, "use_group_restrict", PROP_BOOLEAN, PROP_NONE);
1031 RNA_def_property_ui_text(prop, "Restrict", "Restrict painting to vertices in the group");
1033
1034 /* Mirroring */
1035 prop = RNA_def_property(srna, "radial_symmetry", PROP_INT, PROP_XYZ);
1036 RNA_def_property_int_sdna(prop, nullptr, "radial_symm");
1038 RNA_def_property_range(prop, 1, 64);
1039 RNA_def_property_ui_range(prop, 1, 32, 1, 1);
1041 prop, "Radial Symmetry Count X Axis", "Number of times to copy strokes across the surface");
1042}
1043
1045{
1046 StructRNA *srna;
1047 PropertyRNA *prop;
1048
1049 srna = RNA_def_struct(brna, "PaintModeSettings", nullptr);
1050 RNA_def_struct_sdna(srna, "PaintModeSettings");
1051 RNA_def_struct_path_func(srna, "rna_PaintModeSettings_path");
1052 RNA_def_struct_ui_text(srna, "Paint Mode", "Properties of paint mode");
1053
1054 prop = RNA_def_property(srna, "canvas_source", PROP_ENUM, PROP_NONE);
1057 RNA_def_property_ui_text(prop, "Source", "Source to select canvas from");
1058 RNA_def_property_update(prop, 0, "rna_PaintModeSettings_canvas_source_update");
1059
1060 prop = RNA_def_property(srna, "canvas_image", PROP_POINTER, PROP_NONE);
1062 prop, nullptr, nullptr, nullptr, "rna_PaintModeSettings_canvas_image_poll");
1064 RNA_def_property_ui_text(prop, "Texture", "Image used as painting target");
1065}
1066
1068{
1069 StructRNA *srna;
1070 PropertyRNA *prop;
1071 FunctionRNA *func;
1072
1073 static const EnumPropertyItem paint_type_items[] = {
1075 "MATERIAL",
1076 0,
1077 "Material",
1078 "Detect image slots from the material"},
1080 "IMAGE",
1081 0,
1082 "Single Image",
1083 "Set image for texture painting directly"},
1084 {0, nullptr, 0, nullptr, nullptr},
1085 };
1086
1087 static const EnumPropertyItem paint_interp_items[] = {
1088 {IMAGEPAINT_INTERP_LINEAR, "LINEAR", 0, "Linear", "Linear interpolation"},
1090 "CLOSEST",
1091 0,
1092 "Closest",
1093 "No interpolation (sample closest texel)"},
1094 {0, nullptr, 0, nullptr, nullptr},
1095 };
1096
1097 srna = RNA_def_struct(brna, "ImagePaint", "Paint");
1098 RNA_def_struct_sdna(srna, "ImagePaintSettings");
1099 RNA_def_struct_path_func(srna, "rna_ImagePaintSettings_path");
1100 RNA_def_struct_ui_text(srna, "Image Paint", "Properties of image and texture painting mode");
1101
1102 /* functions */
1103 func = RNA_def_function(srna, "detect_data", "rna_ImaPaint_detect_data");
1104 RNA_def_function_ui_description(func, "Check if required texpaint data exist");
1105
1106 /* return type */
1107 RNA_def_function_return(func, RNA_def_boolean(func, "ok", true, "", ""));
1108
1109 /* booleans */
1110 prop = RNA_def_property(srna, "use_occlude", PROP_BOOLEAN, PROP_NONE);
1113 prop, "Occlude", "Only paint onto the faces directly under the brush (slower)");
1115
1116 prop = RNA_def_property(srna, "use_backface_culling", PROP_BOOLEAN, PROP_NONE);
1118 RNA_def_property_ui_text(prop, "Cull", "Ignore faces pointing away from the view (faster)");
1120
1121 prop = RNA_def_property(srna, "use_normal_falloff", PROP_BOOLEAN, PROP_NONE);
1123 RNA_def_property_ui_text(prop, "Normal", "Paint most on faces pointing towards the view");
1125
1126 prop = RNA_def_property(srna, "use_stencil_layer", PROP_BOOLEAN, PROP_NONE);
1128 RNA_def_property_ui_text(prop, "Stencil Layer", "Set the mask layer from the UV map buttons");
1129 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_viewport_update");
1130
1131 prop = RNA_def_property(srna, "invert_stencil", PROP_BOOLEAN, PROP_NONE);
1133 RNA_def_property_ui_text(prop, "Invert", "Invert the stencil layer");
1134 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_viewport_update");
1135
1136 prop = RNA_def_property(srna, "stencil_image", PROP_POINTER, PROP_NONE);
1137 RNA_def_property_pointer_sdna(prop, nullptr, "stencil");
1139 RNA_def_property_ui_text(prop, "Stencil Image", "Image used as stencil");
1140 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_stencil_update");
1141 RNA_def_property_pointer_funcs(prop, nullptr, nullptr, nullptr, "rna_ImaPaint_imagetype_poll");
1142
1143 prop = RNA_def_property(srna, "canvas", PROP_POINTER, PROP_NONE);
1145 RNA_def_property_ui_text(prop, "Canvas", "Image used as canvas");
1146 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_canvas_update");
1147 RNA_def_property_pointer_funcs(prop, nullptr, nullptr, nullptr, "rna_ImaPaint_imagetype_poll");
1148
1149 prop = RNA_def_property(srna, "clone_image", PROP_POINTER, PROP_NONE);
1150 RNA_def_property_pointer_sdna(prop, nullptr, "clone");
1152 RNA_def_property_ui_text(prop, "Clone Image", "Image used as clone source");
1154 RNA_def_property_pointer_funcs(prop, nullptr, nullptr, nullptr, "rna_ImaPaint_imagetype_poll");
1155
1156 prop = RNA_def_property(srna, "stencil_color", PROP_FLOAT, PROP_COLOR_GAMMA);
1157 RNA_def_property_range(prop, 0.0, 1.0);
1158 RNA_def_property_float_sdna(prop, nullptr, "stencil_col");
1159 RNA_def_property_ui_text(prop, "Stencil Color", "Stencil color in the viewport");
1160 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_viewport_update");
1161
1162 prop = RNA_def_property(srna, "dither", PROP_FLOAT, PROP_NONE);
1163 RNA_def_property_range(prop, 0.0, 2.0);
1164 RNA_def_property_ui_text(prop, "Dither", "Amount of dithering when painting on byte images");
1166
1167 prop = RNA_def_property(srna, "use_clone_layer", PROP_BOOLEAN, PROP_NONE);
1170 prop,
1171 "Clone Map",
1172 "Use another UV map as clone source, otherwise use the 3D cursor as the source");
1173 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_viewport_update");
1174
1175 /* integers */
1176
1177 prop = RNA_def_property(srna, "seam_bleed", PROP_INT, PROP_PIXEL);
1178 RNA_def_property_ui_range(prop, 0, 8, 1, -1);
1180 prop, "Bleed", "Extend paint beyond the faces UVs to reduce seams (in pixels, slower)");
1181
1182 prop = RNA_def_property(srna, "normal_angle", PROP_INT, PROP_UNSIGNED);
1183 RNA_def_property_range(prop, 0, 90);
1185 prop, "Angle", "Paint most on faces pointing towards the view according to this angle");
1186
1187 prop = RNA_def_int_array(srna,
1188 "screen_grab_size",
1189 2,
1190 nullptr,
1191 0,
1192 0,
1193 "Screen Grab Size",
1194 "Size to capture the image for re-projecting",
1195 0,
1196 0);
1197 RNA_def_property_range(prop, 512, 16384);
1199
1200 prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
1202 RNA_def_property_enum_items(prop, paint_type_items);
1203 RNA_def_property_ui_text(prop, "Mode", "Mode of operation for projection painting");
1204 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_mode_update");
1205
1206 prop = RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE);
1207 RNA_def_property_enum_sdna(prop, nullptr, "interp");
1209 RNA_def_property_enum_items(prop, paint_interp_items);
1210 RNA_def_property_ui_text(prop, "Interpolation", "Texture filtering type");
1211 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_mode_update");
1212
1213 /* Missing data */
1214 prop = RNA_def_property(srna, "missing_uvs", PROP_BOOLEAN, PROP_NONE);
1215 RNA_def_property_boolean_sdna(prop, nullptr, "missing_data", IMAGEPAINT_MISSING_UVS);
1216 RNA_def_property_ui_text(prop, "Missing UVs", "A UV layer is missing on the mesh");
1218
1219 prop = RNA_def_property(srna, "missing_materials", PROP_BOOLEAN, PROP_NONE);
1220 RNA_def_property_boolean_sdna(prop, nullptr, "missing_data", IMAGEPAINT_MISSING_MATERIAL);
1221 RNA_def_property_ui_text(prop, "Missing Materials", "The mesh is missing materials");
1223
1224 prop = RNA_def_property(srna, "missing_stencil", PROP_BOOLEAN, PROP_NONE);
1225 RNA_def_property_boolean_sdna(prop, nullptr, "missing_data", IMAGEPAINT_MISSING_STENCIL);
1226 RNA_def_property_ui_text(prop, "Missing Stencil", "Image Painting does not have a stencil");
1228
1229 prop = RNA_def_property(srna, "missing_texture", PROP_BOOLEAN, PROP_NONE);
1230 RNA_def_property_boolean_sdna(prop, nullptr, "missing_data", IMAGEPAINT_MISSING_TEX);
1232 prop, "Missing Texture", "Image Painting does not have a texture to paint on");
1234}
1235
1237{
1238 StructRNA *srna;
1239 PropertyRNA *prop;
1240
1241 static const EnumPropertyItem select_mode_items[] = {
1242 {SCE_SELECT_PATH, "PATH", ICON_PARTICLE_PATH, "Path", "Path edit mode"},
1243 {SCE_SELECT_POINT, "POINT", ICON_PARTICLE_POINT, "Point", "Point select mode"},
1244 {SCE_SELECT_END, "TIP", ICON_PARTICLE_TIP, "Tip", "Tip select mode"},
1245 {0, nullptr, 0, nullptr, nullptr},
1246 };
1247
1248 static const EnumPropertyItem puff_mode[] = {
1249 {0, "ADD", 0, "Add", "Make hairs more puffy"},
1250 {1, "SUB", 0, "Sub", "Make hairs less puffy"},
1251 {0, nullptr, 0, nullptr, nullptr},
1252 };
1253
1254 static const EnumPropertyItem length_mode[] = {
1255 {0, "GROW", 0, "Grow", "Make hairs longer"},
1256 {1, "SHRINK", 0, "Shrink", "Make hairs shorter"},
1257 {0, nullptr, 0, nullptr, nullptr},
1258 };
1259
1260 static const EnumPropertyItem edit_type_items[] = {
1261 {PE_TYPE_PARTICLES, "PARTICLES", 0, "Particles", ""},
1262 {PE_TYPE_SOFTBODY, "SOFT_BODY", 0, "Soft Body", ""},
1263 {PE_TYPE_CLOTH, "CLOTH", 0, "Cloth", ""},
1264 {0, nullptr, 0, nullptr, nullptr},
1265 };
1266
1267 /* edit */
1268
1269 srna = RNA_def_struct(brna, "ParticleEdit", nullptr);
1270 RNA_def_struct_sdna(srna, "ParticleEditSettings");
1271 RNA_def_struct_path_func(srna, "rna_ParticleEdit_path");
1272 RNA_def_struct_ui_text(srna, "Particle Edit", "Properties of particle editing mode");
1273
1274 prop = RNA_def_property(srna, "tool", PROP_ENUM, PROP_NONE);
1275 RNA_def_property_enum_sdna(prop, nullptr, "brushtype");
1278 prop, nullptr, "rna_ParticleEdit_tool_set", "rna_ParticleEdit_tool_itemf");
1279 RNA_def_property_ui_text(prop, "Tool", "");
1280
1281 prop = RNA_def_property(srna, "select_mode", PROP_ENUM, PROP_NONE);
1282 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "selectmode");
1283 RNA_def_property_enum_items(prop, select_mode_items);
1284 RNA_def_property_ui_text(prop, "Selection Mode", "Particle select and display mode");
1286 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ParticleEdit_update");
1287
1288 prop = RNA_def_property(srna, "use_preserve_length", PROP_BOOLEAN, PROP_NONE);
1289 RNA_def_property_boolean_sdna(prop, nullptr, "flag", PE_KEEP_LENGTHS);
1290 RNA_def_property_ui_text(prop, "Keep Lengths", "Keep path lengths constant");
1291
1292 prop = RNA_def_property(srna, "use_preserve_root", PROP_BOOLEAN, PROP_NONE);
1293 RNA_def_property_boolean_sdna(prop, nullptr, "flag", PE_LOCK_FIRST);
1294 RNA_def_property_ui_text(prop, "Keep Root", "Keep root keys unmodified");
1295
1296 prop = RNA_def_property(srna, "use_emitter_deflect", PROP_BOOLEAN, PROP_NONE);
1297 RNA_def_property_boolean_sdna(prop, nullptr, "flag", PE_DEFLECT_EMITTER);
1298 RNA_def_property_ui_text(prop, "Deflect Emitter", "Keep paths from intersecting the emitter");
1299
1300 prop = RNA_def_property(srna, "emitter_distance", PROP_FLOAT, PROP_DISTANCE);
1301 RNA_def_property_float_sdna(prop, nullptr, "emitterdist");
1302 RNA_def_property_ui_range(prop, 0.0f, 10.0f, 10, 3);
1304 prop, "Emitter Distance", "Distance to keep particles away from the emitter");
1305
1306 prop = RNA_def_property(srna, "use_fade_time", PROP_BOOLEAN, PROP_NONE);
1307 RNA_def_property_boolean_sdna(prop, nullptr, "flag", PE_FADE_TIME);
1309 prop, "Fade Time", "Fade paths and keys further away from current frame");
1311 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ParticleEdit_update");
1312
1313 prop = RNA_def_property(srna, "use_auto_velocity", PROP_BOOLEAN, PROP_NONE);
1314 RNA_def_property_boolean_sdna(prop, nullptr, "flag", PE_AUTO_VELOCITY);
1315 RNA_def_property_ui_text(prop, "Auto Velocity", "Calculate point velocities automatically");
1316
1317 prop = RNA_def_property(srna, "show_particles", PROP_BOOLEAN, PROP_NONE);
1319 RNA_def_property_boolean_sdna(prop, nullptr, "flag", PE_DRAW_PART);
1320 RNA_def_property_ui_text(prop, "Display Particles", "Display actual particles");
1321 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ParticleEdit_redo");
1322
1323 prop = RNA_def_property(srna, "use_default_interpolate", PROP_BOOLEAN, PROP_NONE);
1326 prop, "Interpolate", "Interpolate new particles from the existing ones");
1328
1329 prop = RNA_def_property(srna, "default_key_count", PROP_INT, PROP_NONE);
1330 RNA_def_property_int_sdna(prop, nullptr, "totaddkey");
1331 RNA_def_property_range(prop, 2, SHRT_MAX);
1332 RNA_def_property_ui_range(prop, 2, 20, 10, 3);
1333 RNA_def_property_ui_text(prop, "Keys", "How many keys to make new particles with");
1334
1335 prop = RNA_def_property(srna, "brush", PROP_POINTER, PROP_NONE);
1336 RNA_def_property_struct_type(prop, "ParticleBrush");
1337 RNA_def_property_pointer_funcs(prop, "rna_ParticleEdit_brush_get", nullptr, nullptr, nullptr);
1338 RNA_def_property_ui_text(prop, "Brush", "");
1339
1340 prop = RNA_def_property(srna, "display_step", PROP_INT, PROP_NONE);
1341 RNA_def_property_int_sdna(prop, nullptr, "draw_step");
1343 RNA_def_property_range(prop, 1, 10);
1344 RNA_def_property_ui_text(prop, "Steps", "How many steps to display the path with");
1345 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ParticleEdit_redo");
1346
1347 prop = RNA_def_property(srna, "fade_frames", PROP_INT, PROP_NONE);
1348 RNA_def_property_range(prop, 1, 100);
1349 RNA_def_property_ui_text(prop, "Frames", "How many frames to fade");
1351 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ParticleEdit_update");
1352
1353 prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
1355 RNA_def_property_enum_sdna(prop, nullptr, "edittype");
1356 RNA_def_property_enum_items(prop, edit_type_items);
1357 RNA_def_property_ui_text(prop, "Type", "");
1358 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ParticleEdit_redo");
1359
1360 prop = RNA_def_property(srna, "is_editable", PROP_BOOLEAN, PROP_NONE);
1361 RNA_def_property_boolean_funcs(prop, "rna_ParticleEdit_editable_get", nullptr);
1363 RNA_def_property_ui_text(prop, "Editable", "A valid edit mode exists");
1364
1365 prop = RNA_def_property(srna, "is_hair", PROP_BOOLEAN, PROP_NONE);
1366 RNA_def_property_boolean_funcs(prop, "rna_ParticleEdit_hair_get", nullptr);
1368 RNA_def_property_ui_text(prop, "Hair", "Editing hair");
1369
1370 prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
1372 RNA_def_property_ui_text(prop, "Object", "The edited object");
1373
1374 prop = RNA_def_property(srna, "shape_object", PROP_POINTER, PROP_NONE);
1376 RNA_def_property_ui_text(prop, "Shape Object", "Outer shape to use for tools");
1377 RNA_def_property_pointer_funcs(prop, nullptr, nullptr, nullptr, "rna_Mesh_object_poll");
1378 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ParticleEdit_redo");
1379
1380 /* brush */
1381
1382 srna = RNA_def_struct(brna, "ParticleBrush", nullptr);
1383 RNA_def_struct_sdna(srna, "ParticleBrushData");
1384 RNA_def_struct_path_func(srna, "rna_ParticleBrush_path");
1385 RNA_def_struct_ui_text(srna, "Particle Brush", "Particle editing brush");
1386
1387 prop = RNA_def_property(srna, "size", PROP_INT, PROP_PIXEL);
1388 RNA_def_property_range(prop, 1, SHRT_MAX);
1390 RNA_def_property_ui_text(prop, "Radius", "Radius of the brush in pixels");
1391
1392 prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_FACTOR);
1393 RNA_def_property_range(prop, 0.001, 1.0);
1394 RNA_def_property_ui_text(prop, "Strength", "Brush strength");
1395
1396 prop = RNA_def_property(srna, "count", PROP_INT, PROP_NONE);
1397 RNA_def_property_range(prop, 1, 1000);
1398 RNA_def_property_ui_range(prop, 1, 100, 10, 3);
1399 RNA_def_property_ui_text(prop, "Count", "Particle count");
1400
1401 prop = RNA_def_property(srna, "steps", PROP_INT, PROP_NONE);
1402 RNA_def_property_int_sdna(prop, nullptr, "step");
1403 RNA_def_property_range(prop, 1, SHRT_MAX);
1404 RNA_def_property_ui_range(prop, 1, 50, 10, 3);
1405 RNA_def_property_ui_text(prop, "Steps", "Brush steps");
1406
1407 prop = RNA_def_property(srna, "puff_mode", PROP_ENUM, PROP_NONE);
1408 RNA_def_property_enum_sdna(prop, nullptr, "invert");
1409 RNA_def_property_enum_items(prop, puff_mode);
1410 RNA_def_property_ui_text(prop, "Puff Mode", "");
1411
1412 prop = RNA_def_property(srna, "use_puff_volume", PROP_BOOLEAN, PROP_NONE);
1415 prop,
1416 "Puff Volume",
1417 "Apply puff to unselected end-points (helps maintain hair volume when puffing root)");
1418
1419 prop = RNA_def_property(srna, "length_mode", PROP_ENUM, PROP_NONE);
1420 RNA_def_property_enum_sdna(prop, nullptr, "invert");
1421 RNA_def_property_enum_items(prop, length_mode);
1422 RNA_def_property_ui_text(prop, "Length Mode", "");
1423
1424 /* dummy */
1425 prop = RNA_def_property(srna, "curve", PROP_POINTER, PROP_NONE);
1426 RNA_def_property_struct_type(prop, "CurveMapping");
1427 RNA_def_property_pointer_funcs(prop, "rna_ParticleBrush_curve_get", nullptr, nullptr, nullptr);
1428 RNA_def_property_ui_text(prop, "Curve", "");
1429}
1430
1431/* srna -- gpencil speed guides */
1433{
1434 StructRNA *srna;
1435 PropertyRNA *prop;
1436
1437 srna = RNA_def_struct(brna, "GPencilSculptGuide", nullptr);
1438 RNA_def_struct_sdna(srna, "GP_Sculpt_Guide");
1439 RNA_def_struct_path_func(srna, "rna_GPencilSculptGuide_path");
1440 RNA_def_struct_ui_text(srna, "Grease Pencil Sculpt Guide", "Guides for drawing");
1441
1442 static const EnumPropertyItem prop_gpencil_guidetypes[] = {
1443 {GP_GUIDE_CIRCULAR, "CIRCULAR", 0, "Circular", "Use single point to create rings"},
1444 {GP_GUIDE_RADIAL, "RADIAL", 0, "Radial", "Use single point as direction"},
1445 {GP_GUIDE_PARALLEL, "PARALLEL", 0, "Parallel", "Parallel lines"},
1446 {GP_GUIDE_GRID, "GRID", 0, "Grid", "Grid allows horizontal and vertical lines"},
1447 {GP_GUIDE_ISO, "ISO", 0, "Isometric", "Grid allows isometric and vertical lines"},
1448 {0, nullptr, 0, nullptr, nullptr},
1449 };
1450
1451 static const EnumPropertyItem prop_gpencil_guide_references[] = {
1452 {GP_GUIDE_REF_CURSOR, "CURSOR", 0, "Cursor", "Use cursor as reference point"},
1453 {GP_GUIDE_REF_CUSTOM, "CUSTOM", 0, "Custom", "Use custom reference point"},
1454 {GP_GUIDE_REF_OBJECT, "OBJECT", 0, "Object", "Use object as reference point"},
1455 {0, nullptr, 0, nullptr, nullptr},
1456 };
1457
1458 prop = RNA_def_property(srna, "use_guide", PROP_BOOLEAN, PROP_NONE);
1459 RNA_def_property_boolean_sdna(prop, nullptr, "use_guide", false);
1461 RNA_def_property_ui_text(prop, "Use Guides", "Enable speed guides");
1464
1465 prop = RNA_def_property(srna, "use_snapping", PROP_BOOLEAN, PROP_NONE);
1466 RNA_def_property_boolean_sdna(prop, nullptr, "use_snapping", false);
1469 prop, "Use Snapping", "Enable snapping to guides angle or spacing options");
1472
1473 prop = RNA_def_property(srna, "reference_object", PROP_POINTER, PROP_NONE);
1474 RNA_def_property_pointer_sdna(prop, nullptr, "reference_object");
1475 RNA_def_property_ui_text(prop, "Object", "Object used for reference point");
1477 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_viewport_update");
1478
1479 prop = RNA_def_property(srna, "reference_point", PROP_ENUM, PROP_NONE);
1480 RNA_def_property_enum_sdna(prop, nullptr, "reference_point");
1481 RNA_def_property_enum_items(prop, prop_gpencil_guide_references);
1482 RNA_def_property_ui_text(prop, "Type", "Type of speed guide");
1484 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_viewport_update");
1485
1486 prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
1487 RNA_def_property_enum_sdna(prop, nullptr, "type");
1488 RNA_def_property_enum_items(prop, prop_gpencil_guidetypes);
1489 RNA_def_property_ui_text(prop, "Type", "Type of speed guide");
1492
1493 prop = RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE);
1494 RNA_def_property_float_sdna(prop, nullptr, "angle");
1495 RNA_def_property_range(prop, -(M_PI * 2.0f), (M_PI * 2.0f));
1496 RNA_def_property_ui_text(prop, "Angle", "Direction of lines");
1499
1500 prop = RNA_def_property(srna, "angle_snap", PROP_FLOAT, PROP_ANGLE);
1501 RNA_def_property_float_sdna(prop, nullptr, "angle_snap");
1502 RNA_def_property_range(prop, -(M_PI * 2.0f), (M_PI * 2.0f));
1503 RNA_def_property_ui_text(prop, "Angle Snap", "Angle snapping");
1506
1507 prop = RNA_def_property(srna, "spacing", PROP_FLOAT, PROP_DISTANCE);
1508 RNA_def_property_float_sdna(prop, nullptr, "spacing");
1509 RNA_def_property_range(prop, 0.0f, FLT_MAX);
1510 RNA_def_property_ui_range(prop, 0.0f, FLT_MAX, 1, 3);
1511 RNA_def_property_ui_text(prop, "Spacing", "Guide spacing");
1514
1515 prop = RNA_def_property(srna, "location", PROP_FLOAT, PROP_DISTANCE);
1516 RNA_def_property_float_sdna(prop, nullptr, "location");
1517 RNA_def_property_array(prop, 3);
1519 RNA_def_property_ui_text(prop, "Location", "Custom reference point for guides");
1522 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_viewport_update");
1523}
1524
1526{
1527 StructRNA *srna;
1528 PropertyRNA *prop;
1529
1530 /* == Settings == */
1531 srna = RNA_def_struct(brna, "GPencilSculptSettings", nullptr);
1532 RNA_def_struct_sdna(srna, "GP_Sculpt_Settings");
1533 RNA_def_struct_path_func(srna, "rna_GPencilSculptSettings_path");
1535 "GPencil Sculpt Settings",
1536 "General properties for Grease Pencil stroke sculpting tools");
1537
1538 prop = RNA_def_property(srna, "guide", PROP_POINTER, PROP_NONE);
1539 RNA_def_property_struct_type(prop, "GPencilSculptGuide");
1541 RNA_def_property_ui_text(prop, "Guide", "");
1542
1543 prop = RNA_def_property(srna, "use_multiframe_falloff", PROP_BOOLEAN, PROP_NONE);
1546 prop,
1547 "Use Falloff",
1548 "Use falloff effect when edit in multiframe mode to compute brush effect by frame");
1551
1552 prop = RNA_def_property(srna, "use_thickness_curve", PROP_BOOLEAN, PROP_NONE);
1554 RNA_def_property_ui_text(prop, "Use Curve", "Use curve to define primitive stroke thickness");
1557
1558 prop = RNA_def_property(srna, "use_scale_thickness", PROP_BOOLEAN, PROP_NONE);
1561 prop, "Scale Stroke Thickness", "Scale the stroke thickness when transforming strokes");
1564
1565 prop = RNA_def_property(srna, "use_automasking_stroke", PROP_BOOLEAN, PROP_NONE);
1567 RNA_def_property_ui_text(prop, "Auto-Masking Strokes", "Affect only strokes below the cursor");
1570
1571 prop = RNA_def_property(srna, "use_automasking_layer_stroke", PROP_BOOLEAN, PROP_NONE);
1573 RNA_def_property_ui_text(prop, "Auto-Masking Layer", "Affect only strokes below the cursor");
1576
1577 prop = RNA_def_property(srna, "use_automasking_material_stroke", PROP_BOOLEAN, PROP_NONE);
1579 prop, nullptr, "flag", GP_SCULPT_SETT_FLAG_AUTOMASK_MATERIAL_STROKE);
1580 RNA_def_property_ui_text(prop, "Auto-Masking Material", "Affect only strokes below the cursor");
1583
1584 prop = RNA_def_property(srna, "use_automasking_layer_active", PROP_BOOLEAN, PROP_NONE);
1586 RNA_def_property_ui_text(prop, "Auto-Masking Layer", "Affect only the Active Layer");
1589
1590 prop = RNA_def_property(srna, "use_automasking_material_active", PROP_BOOLEAN, PROP_NONE);
1592 prop, nullptr, "flag", GP_SCULPT_SETT_FLAG_AUTOMASK_MATERIAL_ACTIVE);
1593 RNA_def_property_ui_text(prop, "Auto-Masking Material", "Affect only the Active Material");
1596
1597 /* custom falloff curve */
1598 prop = RNA_def_property(srna, "multiframe_falloff_curve", PROP_POINTER, PROP_NONE);
1599 RNA_def_property_pointer_sdna(prop, nullptr, "cur_falloff");
1600 RNA_def_property_struct_type(prop, "CurveMapping");
1602 prop, "Curve", "Custom curve to control falloff of brush effect by Grease Pencil frames");
1605
1606 /* custom primitive curve */
1607 prop = RNA_def_property(srna, "thickness_primitive_curve", PROP_POINTER, PROP_NONE);
1608 RNA_def_property_pointer_sdna(prop, nullptr, "cur_primitive");
1609 RNA_def_property_struct_type(prop, "CurveMapping");
1610 RNA_def_property_ui_text(prop, "Curve", "Custom curve to control primitive thickness");
1613
1614 /* lock axis */
1615 prop = RNA_def_property(srna, "lock_axis", PROP_ENUM, PROP_NONE);
1616 RNA_def_property_enum_sdna(prop, nullptr, "lock_axis");
1618 RNA_def_property_ui_text(prop, "Lock Axis", "");
1620 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, nullptr);
1621
1622 /* threshold for cutter */
1623 prop = RNA_def_property(srna, "intersection_threshold", PROP_FLOAT, PROP_NONE);
1624 RNA_def_property_float_sdna(prop, nullptr, "isect_threshold");
1625 RNA_def_property_range(prop, 0.0f, 10.0f);
1627 RNA_def_property_ui_text(prop, "Threshold", "Threshold for stroke intersections");
1629}
1630
1632{
1633 StructRNA *srna;
1634
1635 srna = RNA_def_struct(brna, "CurvesSculpt", "Paint");
1636 RNA_def_struct_path_func(srna, "rna_CurvesSculpt_path");
1637 RNA_def_struct_ui_text(srna, "Curves Sculpt Paint", "");
1638}
1639
1641{
1642 /* *** Non-Animated *** */
1644 rna_def_paint_curve(brna);
1645 rna_def_paint(brna);
1646 rna_def_sculpt(brna);
1647 rna_def_uv_sculpt(brna);
1648 rna_def_gp_paint(brna);
1653 rna_def_paint_mode(brna);
1654 rna_def_image_paint(brna);
1660}
1661
1662#endif
CurveMapping * BKE_curvemapping_add(int tot, float minx, float miny, float maxx, float maxy)
Definition colortools.cc:90
Depsgraph * CTX_data_depsgraph_pointer(const bContext *C)
Object * CTX_data_active_object(const bContext *C)
Scene * CTX_data_scene(const bContext *C)
Main * CTX_data_main(const bContext *C)
ViewLayer * CTX_data_view_layer(const bContext *C)
void BKE_view_layer_synced_ensure(const Scene *scene, ViewLayer *view_layer)
Object * BKE_view_layer_active_object_get(const ViewLayer *view_layer)
General operations, lookup, etc. for materials.
void BKE_texpaint_slots_refresh_object(struct Scene *scene, struct Object *ob)
General operations, lookup, etc. for blender objects.
Brush * BKE_paint_eraser_brush(Paint *paint)
Definition paint.cc:1155
bool BKE_paint_brush_set(Paint *paint, Brush *brush)
Definition paint.cc:714
bool BKE_paint_eraser_brush_set(Paint *paint, Brush *brush)
Definition paint.cc:1165
Brush * BKE_paint_brush(Paint *paint)
Definition paint.cc:649
void BKE_paint_invalidate_overlay_all()
Definition paint.cc:286
struct ParticleSystem * psys_get_current(struct Object *ob)
Definition particle.cc:534
void psys_free_path_cache(struct ParticleSystem *psys, struct PTCacheEdit *edit)
Definition particle.cc:904
void BKE_particle_batch_cache_dirty_tag(struct ParticleSystem *psys, int mode)
Definition particle.cc:5295
@ BKE_PARTICLE_BATCH_DIRTY_ALL
#define M_PI
#define ELEM(...)
void DEG_id_tag_update(ID *id, unsigned int flags)
ID and Library types, which are fundamental for SDNA.
@ ID_RECALC_SYNC_TO_EVAL
Definition DNA_ID.h:1085
@ ID_RECALC_GEOMETRY
Definition DNA_ID.h:1041
@ BRUSH_CURVE_CUSTOM
@ BRUSH_AUTOMASKING_BRUSH_NORMAL
@ BRUSH_AUTOMASKING_CAVITY_NORMAL
@ BRUSH_AUTOMASKING_VIEW_OCCLUSION
@ BRUSH_AUTOMASKING_VIEW_NORMAL
@ BRUSH_AUTOMASKING_CAVITY_INVERTED
#define MAX_BRUSH_PIXEL_RADIUS
#define AUTOMASKING_BOUNDARY_EDGES_MAX_PROPAGATION_STEPS
@ IMA_TYPE_R_RESULT
@ IMA_TYPE_COMPOSITE
@ OB_MESH
@ PSYS_GLOBAL_HAIR
@ PAINT_TILE_Z
@ PAINT_SYMM_Y
@ PAINT_TILE_Y
@ PAINT_SYMMETRY_FEATHER
@ PAINT_TILE_X
@ PAINT_SYMM_X
@ PAINT_SYMM_Z
@ GP_GUIDE_CIRCULAR
@ GP_GUIDE_ISO
@ GP_GUIDE_PARALLEL
@ GP_GUIDE_RADIAL
@ GP_GUIDE_GRID
@ GP_GUIDE_REF_OBJECT
@ GP_GUIDE_REF_CUSTOM
@ GP_GUIDE_REF_CURSOR
@ SCULPT_ONLY_DEFORM
@ SCULPT_DYNTOPO_SUBDIVIDE
@ SCULPT_DYNTOPO_DETAIL_MANUAL
@ SCULPT_LOCK_X
@ SCULPT_LOCK_Z
@ SCULPT_DYNTOPO_DETAIL_CONSTANT
@ SCULPT_DYNTOPO_COLLAPSE
@ SCULPT_DYNTOPO_DETAIL_BRUSH
@ SCULPT_LOCK_Y
@ GP_SCULPT_SETT_FLAG_PRIMITIVE_CURVE
@ GP_SCULPT_SETT_FLAG_FRAME_FALLOFF
@ GP_SCULPT_SETT_FLAG_AUTOMASK_LAYER_ACTIVE
@ GP_SCULPT_SETT_FLAG_AUTOMASK_STROKE
@ GP_SCULPT_SETT_FLAG_AUTOMASK_MATERIAL_STROKE
@ GP_SCULPT_SETT_FLAG_AUTOMASK_MATERIAL_ACTIVE
@ GP_SCULPT_SETT_FLAG_SCALE_THICKNESS
@ GP_SCULPT_SETT_FLAG_AUTOMASK_LAYER_STROKE
@ IMAGEPAINT_INTERP_LINEAR
@ IMAGEPAINT_INTERP_CLOSEST
#define IMAGEPAINT_MODE_IMAGE
@ GPPAINT_FLAG_USE_VERTEXCOLOR
@ GPPAINT_FLAG_USE_MATERIAL
@ GP_LOCKAXIS_X
@ GP_LOCKAXIS_VIEW
@ GP_LOCKAXIS_Y
@ GP_LOCKAXIS_Z
@ GP_LOCKAXIS_CURSOR
@ SCE_SELECT_PATH
@ SCE_SELECT_POINT
@ SCE_SELECT_END
@ PE_BRUSH_DATA_PUFF_VOLUME
@ PE_TYPE_CLOTH
@ PE_TYPE_PARTICLES
@ PE_TYPE_SOFTBODY
#define IMAGEPAINT_MODE_MATERIAL
@ PE_DRAW_PART
@ PE_LOCK_FIRST
@ PE_FADE_TIME
@ PE_INTERPOLATE_ADDED
@ PE_DEFLECT_EMITTER
@ PE_KEEP_LENGTHS
@ PE_AUTO_VELOCITY
@ PAINT_USE_CAVITY_MASK
@ PAINT_SCULPT_DELAY_UPDATES
@ PAINT_SHOW_BRUSH
@ PAINT_SHOW_BRUSH_ON_SURFACE
@ PAINT_FAST_NAVIGATE
@ VP_FLAG_VGROUP_RESTRICT
@ IMAGEPAINT_PROJECT_LAYER_STENCIL_INV
@ IMAGEPAINT_PROJECT_BACKFACE
@ IMAGEPAINT_PROJECT_XRAY
@ IMAGEPAINT_PROJECT_LAYER_STENCIL
@ IMAGEPAINT_PROJECT_LAYER_CLONE
@ IMAGEPAINT_PROJECT_FLAT
@ PAINT_CANVAS_SOURCE_COLOR_ATTRIBUTE
@ PAINT_CANVAS_SOURCE_IMAGE
@ PAINT_CANVAS_SOURCE_MATERIAL
@ IMAGEPAINT_MISSING_TEX
@ IMAGEPAINT_MISSING_MATERIAL
@ IMAGEPAINT_MISSING_UVS
@ IMAGEPAINT_MISSING_STENCIL
@ PE_BRUSH_COMB
@ PE_BRUSH_CUT
@ PE_BRUSH_PUFF
@ PE_BRUSH_LENGTH
@ PE_BRUSH_WEIGHT
@ PE_BRUSH_ADD
@ PE_BRUSH_SMOOTH
@ SCULPT_TRANSFORM_MODE_RADIUS_ELASTIC
@ SCULPT_TRANSFORM_MODE_ALL_VERTICES
void ED_space_image_sync(Main *bmain, Image *image, bool ignore_render_viewer)
Definition image_edit.cc:70
bool ED_paint_proj_mesh_data_check(Scene &scene, Object &ob, bool *r_has_uvs, bool *r_has_mat, bool *r_has_tex, bool *r_has_stencil)
PTCacheEdit * PE_get_current(Depsgraph *depsgraph, Scene *scene, Object *ob)
Read Guarded memory(de)allocation.
@ PROP_SCALE_CUBIC
Definition RNA_types.hh:118
@ PROP_FLOAT
Definition RNA_types.hh:67
@ PROP_BOOLEAN
Definition RNA_types.hh:65
@ PROP_ENUM
Definition RNA_types.hh:69
@ PROP_INT
Definition RNA_types.hh:66
@ PROP_POINTER
Definition RNA_types.hh:70
@ PROP_CONTEXT_UPDATE
Definition RNA_types.hh:296
@ PROP_ANIMATABLE
Definition RNA_types.hh:220
@ PROP_EDITABLE
Definition RNA_types.hh:207
@ PROP_NEVER_NULL
Definition RNA_types.hh:266
@ PROP_ID_SELF_CHECK
Definition RNA_types.hh:259
@ PROP_XYZ
Definition RNA_types.hh:172
@ PROP_DISTANCE
Definition RNA_types.hh:159
@ PROP_PIXEL
Definition RNA_types.hh:151
@ PROP_ANGLE
Definition RNA_types.hh:155
@ PROP_NONE
Definition RNA_types.hh:136
@ PROP_PERCENTAGE
Definition RNA_types.hh:153
@ PROP_FACTOR
Definition RNA_types.hh:154
@ PROP_COLOR_GAMMA
Definition RNA_types.hh:175
@ PROP_XYZ_LENGTH
Definition RNA_types.hh:173
@ PROP_UNSIGNED
Definition RNA_types.hh:152
constexpr PointerRNA PointerRNA_NULL
Definition RNA_types.hh:45
#define NC_GEOM
Definition WM_types.hh:360
#define ND_DRAW
Definition WM_types.hh:428
#define NC_BRUSH
Definition WM_types.hh:352
#define ND_DATA
Definition WM_types.hh:475
#define NC_SCENE
Definition WM_types.hh:345
#define ND_TOOLSETTINGS
Definition WM_types.hh:416
#define ND_MODIFIER
Definition WM_types.hh:429
#define NA_EDITED
Definition WM_types.hh:550
#define ND_PARTICLE
Definition WM_types.hh:432
#define NC_GPENCIL
Definition WM_types.hh:366
#define NC_OBJECT
Definition WM_types.hh:346
#define NA_SELECTED
Definition WM_types.hh:555
@ BMO_SYMMETRIZE_NEGATIVE_X
@ BMO_SYMMETRIZE_NEGATIVE_Y
@ BMO_SYMMETRIZE_POSITIVE_Z
@ BMO_SYMMETRIZE_NEGATIVE_Z
@ BMO_SYMMETRIZE_POSITIVE_Y
@ BMO_SYMMETRIZE_POSITIVE_X
const Depsgraph * depsgraph
PointerRNA rna_pointer_inherit_refine(const PointerRNA *ptr, StructRNA *type, void *data)
PointerRNA RNA_id_pointer_create(ID *id)
const EnumPropertyItem rna_enum_brush_automasking_flag_items[]
Definition rna_brush.cc:113
const EnumPropertyItem rna_enum_brush_curve_preset_items[]
Definition rna_brush.cc:97
PropertyRNA * RNA_def_int_array(StructOrFunctionRNA *cont_, const char *identifier, const int len, const int *default_value, const int hardmin, const int hardmax, const char *ui_name, const char *ui_description, const int softmin, const int softmax)
void RNA_def_property_pointer_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_struct_path_func(StructRNA *srna, const char *path)
void RNA_define_animate_sdna(bool animate)
void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t bit)
void RNA_def_property_float_default(PropertyRNA *prop, float value)
void RNA_def_function_return(FunctionRNA *func, PropertyRNA *ret)
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
void RNA_def_property_boolean_default(PropertyRNA *prop, bool value)
void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const char *set)
void RNA_def_property_int_default(PropertyRNA *prop, int value)
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier, const char *call)
void RNA_def_property_array(PropertyRNA *prop, int length)
void RNA_def_property_range(PropertyRNA *prop, double min, double max)
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
void RNA_def_function_ui_description(FunctionRNA *func, const char *description)
void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *func)
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier, int type, int subtype)
void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char *set, const char *item)
void RNA_def_property_enum_bitflag_sdna(PropertyRNA *prop, const char *structname, const char *propname)
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_property_pointer_funcs(PropertyRNA *prop, const char *get, const char *set, const char *type_fn, const char *poll)
void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_struct_ui_icon(StructRNA *srna, int icon)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
void RNA_def_property_ui_scale_type(PropertyRNA *prop, PropertyScaleType ui_scale_type)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_property_subtype(PropertyRNA *prop, PropertySubType subtype)
void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double step, int precision)
void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_boolean_negative_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
static void rna_def_uv_sculpt(BlenderRNA *brna)
void RNA_def_sculpt_paint(BlenderRNA *brna)
const EnumPropertyItem rna_enum_symmetrize_direction_items[]
static void rna_def_paint(BlenderRNA *brna)
static const EnumPropertyItem rna_enum_gpencil_lock_axis_items[]
static const EnumPropertyItem rna_enum_gpencil_paint_mode[]
static void rna_def_sculpt(BlenderRNA *brna)
const EnumPropertyItem rna_enum_particle_edit_hair_brush_items[]
static void rna_def_gp_paint(BlenderRNA *brna)
static void rna_def_gp_sculptpaint(BlenderRNA *brna)
static void rna_def_vertex_paint(BlenderRNA *brna)
static void rna_def_curves_sculpt(BlenderRNA *brna)
static const EnumPropertyItem rna_enum_canvas_source_items[]
static void rna_def_paint_mode(BlenderRNA *brna)
static void rna_def_gp_weightpaint(BlenderRNA *brna)
static void rna_def_gp_vertexpaint(BlenderRNA *brna)
static void rna_def_image_paint(BlenderRNA *brna)
static void rna_def_paint_curve(BlenderRNA *brna)
static void rna_def_gpencil_sculpt(BlenderRNA *brna)
static void rna_def_particle_edit(BlenderRNA *brna)
static void rna_def_gpencil_guides(BlenderRNA *brna)
#define FLT_MAX
Definition stdcycles.h:14
signed char int8_t
Definition stdint.h:75
short ob_mode
const char * identifier
Definition RNA_types.hh:506
const char * name
Definition RNA_types.hh:510
const char * description
Definition RNA_types.hh:512
struct ParticleSystem * psys
unsigned short ob_mode
struct Paint_Runtime runtime
ID * owner_id
Definition RNA_types.hh:40
void * data
Definition RNA_types.hh:42
struct ToolSettings * toolsettings
struct CurveMapping * strength_curve
void WM_main_add_notifier(uint type, void *reference)
PointerRNA * ptr
Definition wm_files.cc:4126