Blender V5.0
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
8
9#include <cstdlib>
10
11#include "BLI_math_base.h"
12
13#include "BLT_translation.hh"
14
15#include "RNA_define.hh"
16#include "RNA_enum_types.hh"
17
18#include "rna_internal.hh"
19
20#include "DNA_brush_types.h"
21#include "DNA_scene_types.h"
22
23#include "BKE_paint.hh"
24
25#include "WM_api.hh"
26#include "WM_types.hh"
27
28#include "bmesh.hh"
29
31 {PE_BRUSH_COMB, "COMB", 0, "Comb", "Comb hairs"},
32 {PE_BRUSH_SMOOTH, "SMOOTH", 0, "Smooth", "Smooth hairs"},
33 {PE_BRUSH_ADD, "ADD", 0, "Add", "Add hairs"},
34 {PE_BRUSH_LENGTH, "LENGTH", 0, "Length", "Make hairs longer or shorter"},
35 {PE_BRUSH_PUFF, "PUFF", 0, "Puff", "Make hairs stand up"},
36 {PE_BRUSH_CUT, "CUT", 0, "Cut", "Cut hairs"},
37 {PE_BRUSH_WEIGHT, "WEIGHT", 0, "Weight", "Weight hair particles"},
38 {0, nullptr, 0, nullptr, nullptr},
39};
40
41#ifndef RNA_RUNTIME
44 "VIEW",
45 ICON_RESTRICT_VIEW_ON,
46 "View",
47 "Align strokes to current view plane"},
49 "AXIS_Y",
50 ICON_AXIS_FRONT,
51 "Front (X-Z)",
52 "Project strokes to plane locked to Y"},
54 "AXIS_X",
55 ICON_AXIS_SIDE,
56 "Side (Y-Z)",
57 "Project strokes to plane locked to X"},
58 {GP_LOCKAXIS_Z, "AXIS_Z", ICON_AXIS_TOP, "Top (X-Y)", "Project strokes to plane locked to Z"},
60 "CURSOR",
61 ICON_PIVOT_CURSOR,
62 "Cursor",
63 "Align strokes to current 3D cursor orientation"},
64 {0, nullptr, 0, nullptr, nullptr},
65};
66
69 "MATERIAL",
70 0,
71 "Material",
72 "Paint using the active material base color"},
74 "VERTEXCOLOR",
75 0,
76 "Color Attribute",
77 "Paint the material with a color attribute"},
78 {0, nullptr, 0, nullptr, nullptr},
79};
80#endif
81
83 {PAINT_CANVAS_SOURCE_COLOR_ATTRIBUTE, "COLOR_ATTRIBUTE", 0, "Color Attribute", ""},
84 {PAINT_CANVAS_SOURCE_MATERIAL, "MATERIAL", 0, "Material", ""},
85 {PAINT_CANVAS_SOURCE_IMAGE, "IMAGE", 0, "Image", ""},
86 {0, nullptr, 0, nullptr, nullptr},
87};
88
90 {BMO_SYMMETRIZE_NEGATIVE_X, "NEGATIVE_X", 0, "-X to +X", ""},
91 {BMO_SYMMETRIZE_POSITIVE_X, "POSITIVE_X", 0, "+X to -X", ""},
92
93 {BMO_SYMMETRIZE_NEGATIVE_Y, "NEGATIVE_Y", 0, "-Y to +Y", ""},
94 {BMO_SYMMETRIZE_POSITIVE_Y, "POSITIVE_Y", 0, "+Y to -Y", ""},
95
96 {BMO_SYMMETRIZE_NEGATIVE_Z, "NEGATIVE_Z", 0, "-Z to +Z", ""},
97 {BMO_SYMMETRIZE_POSITIVE_Z, "POSITIVE_Z", 0, "+Z to -Z", ""},
98 {0, nullptr, 0, nullptr, nullptr},
99};
100
101#ifdef RNA_RUNTIME
102# include "MEM_guardedalloc.h"
103
104# include "BKE_brush.hh"
105# include "BKE_collection.hh"
106# include "BKE_colortools.hh"
107# include "BKE_context.hh"
108# include "BKE_gpencil_legacy.h"
109# include "BKE_layer.hh"
110# include "BKE_material.hh"
111# include "BKE_object.hh"
112# include "BKE_paint.hh"
113# include "BKE_paint_types.hh"
114# include "BKE_particle.h"
115# include "BKE_pointcache.h"
116
117# include "DEG_depsgraph.hh"
118
119# include "ED_gpencil_legacy.hh"
120# include "ED_image.hh"
121# include "ED_paint.hh"
122# include "ED_particle.hh"
123
124const EnumPropertyItem rna_enum_particle_edit_disconnected_hair_brush_items[] = {
125 {PE_BRUSH_COMB, "COMB", 0, "Comb", "Comb hairs"},
126 {PE_BRUSH_SMOOTH, "SMOOTH", 0, "Smooth", "Smooth hairs"},
127 {PE_BRUSH_LENGTH, "LENGTH", 0, "Length", "Make hairs longer or shorter"},
128 {PE_BRUSH_CUT, "CUT", 0, "Cut", "Cut hairs"},
129 {PE_BRUSH_WEIGHT, "WEIGHT", 0, "Weight", "Weight hair particles"},
130 {0, nullptr, 0, nullptr, nullptr},
131};
132
133static const EnumPropertyItem particle_edit_cache_brush_items[] = {
134 {PE_BRUSH_COMB, "COMB", 0, "Comb", "Comb paths"},
135 {PE_BRUSH_SMOOTH, "SMOOTH", 0, "Smooth", "Smooth paths"},
136 {PE_BRUSH_LENGTH, "LENGTH", 0, "Length", "Make paths longer or shorter"},
137 {0, nullptr, 0, nullptr, nullptr},
138};
139
140static PointerRNA rna_ParticleEdit_brush_get(PointerRNA *ptr)
141{
143 ParticleBrushData *brush = nullptr;
144
145 brush = &pset->brush[pset->brushtype];
146
147 return RNA_pointer_create_with_parent(*ptr, &RNA_ParticleBrush, brush);
148}
149
150static PointerRNA rna_ParticleBrush_curve_get(PointerRNA * /*ptr*/)
151{
152 return PointerRNA_NULL;
153}
154
155static void rna_ParticleEdit_redo(bContext *C, PointerRNA * /*ptr*/)
156{
158 Scene *scene = CTX_data_scene(C);
159 ViewLayer *view_layer = CTX_data_view_layer(C);
160 BKE_view_layer_synced_ensure(scene, view_layer);
162 PTCacheEdit *edit = PE_get_current(depsgraph, scene, ob);
163
164 if (!edit) {
165 return;
166 }
167
168 if (ob) {
170 }
171
172 if (edit->psys) {
174 psys_free_path_cache(edit->psys, edit);
175 }
177}
178
179static void rna_ParticleEdit_update(bContext *C, PointerRNA * /*ptr*/)
180{
181 Scene *scene = CTX_data_scene(C);
182 ViewLayer *view_layer = CTX_data_view_layer(C);
183 BKE_view_layer_synced_ensure(scene, view_layer);
185
186 if (ob) {
188 }
189
190 /* Sync tool setting changes from original to evaluated scenes. */
192}
193
194static void rna_ParticleEdit_tool_set(PointerRNA *ptr, int value)
195{
197
198 /* redraw hair completely if weight brush is/was used */
199 if ((pset->brushtype == PE_BRUSH_WEIGHT || value == PE_BRUSH_WEIGHT) && pset->object) {
200 Object *ob = pset->object;
201 if (ob) {
204 }
205 }
206
207 pset->brushtype = value;
208}
209static const EnumPropertyItem *rna_ParticleEdit_tool_itemf(bContext *C,
210 PointerRNA * /*ptr*/,
211 PropertyRNA * /*prop*/,
212 bool * /*r_free*/)
213{
214 const Scene *scene = CTX_data_scene(C);
215 ViewLayer *view_layer = CTX_data_view_layer(C);
216 BKE_view_layer_synced_ensure(scene, view_layer);
218# if 0
220 Scene *scene = CTX_data_scene(C);
221 PTCacheEdit *edit = PE_get_current(depsgraph, scene, ob);
222 ParticleSystem *psys = edit ? edit->psys : nullptr;
223# else
224 /* use this rather than PE_get_current() - because the editing cache is
225 * dependent on the cache being updated which can happen after this UI
226 * draws causing a glitch #28883. */
228# endif
229
230 if (psys) {
231 if (psys->flag & PSYS_GLOBAL_HAIR) {
232 return rna_enum_particle_edit_disconnected_hair_brush_items;
233 }
234 else {
236 }
237 }
238
239 return particle_edit_cache_brush_items;
240}
241
242static bool rna_ParticleEdit_editable_get(PointerRNA *ptr)
243{
245
246 return (pset->object && pset->scene && PE_get_current(nullptr, pset->scene, pset->object));
247}
248static bool rna_ParticleEdit_hair_get(PointerRNA *ptr)
249{
251
252 if (pset->scene) {
253 PTCacheEdit *edit = PE_get_current(nullptr, pset->scene, pset->object);
254
255 return (edit && edit->psys);
256 }
257
258 return 0;
259}
260
261static std::optional<std::string> rna_ParticleEdit_path(const PointerRNA * /*ptr*/)
262{
263 return "tool_settings.particle_edit";
264}
265
266static PointerRNA rna_Paint_brush_get(PointerRNA *ptr)
267{
268 Paint *paint = static_cast<Paint *>(ptr->data);
269 Brush *brush = BKE_paint_brush(paint);
270 if (!brush) {
271 return PointerRNA_NULL;
272 }
273 return RNA_id_pointer_create(&brush->id);
274}
275
276static bool rna_Paint_brush_poll(PointerRNA *ptr, PointerRNA value)
277{
278 const Paint *paint = static_cast<Paint *>(ptr->data);
279 const Brush *brush = static_cast<Brush *>(value.data);
280
281 return (brush == nullptr) || (paint->runtime->ob_mode & brush->ob_mode) != 0;
282}
283
284static PointerRNA rna_Paint_eraser_brush_get(PointerRNA *ptr)
285{
286 Paint *paint = static_cast<Paint *>(ptr->data);
287 Brush *brush = BKE_paint_eraser_brush(paint);
288 if (!brush) {
289 return PointerRNA_NULL;
290 }
291 return RNA_id_pointer_create(&brush->id);
292}
293
294static void rna_Paint_eraser_brush_set(PointerRNA *ptr, PointerRNA value, ReportList * /*reports*/)
295{
296 Paint *paint = static_cast<Paint *>(ptr->data);
297 Brush *brush = static_cast<Brush *>(value.data);
298 BKE_paint_eraser_brush_set(paint, brush);
300}
301
302static bool rna_Paint_eraser_brush_poll(PointerRNA *ptr, PointerRNA value)
303{
304 const Paint *paint = static_cast<Paint *>(ptr->data);
305 const Brush *brush = static_cast<Brush *>(value.data);
306
307 return (brush == nullptr) || (paint->runtime->ob_mode & brush->ob_mode) != 0;
308}
309
310static void rna_Sculpt_update(bContext *C, PointerRNA * /*ptr*/)
311{
312 Scene *scene = CTX_data_scene(C);
313 ViewLayer *view_layer = CTX_data_view_layer(C);
314 BKE_view_layer_synced_ensure(scene, view_layer);
316
317 if (ob) {
320 }
321}
322
323static std::optional<std::string> rna_Sculpt_path(const PointerRNA * /*ptr*/)
324{
325 return "tool_settings.sculpt";
326}
327
328static std::optional<std::string> rna_VertexPaint_path(const PointerRNA *ptr)
329{
330 const Scene *scene = (Scene *)ptr->owner_id;
331 const ToolSettings *ts = scene->toolsettings;
332 if (ptr->data == ts->vpaint) {
333 return "tool_settings.vertex_paint";
334 }
335 return "tool_settings.weight_paint";
336}
337
338static std::optional<std::string> rna_ImagePaintSettings_path(const PointerRNA * /*ptr*/)
339{
340 return "tool_settings.image_paint";
341}
342
343static std::optional<std::string> rna_PaintModeSettings_path(const PointerRNA * /*ptr*/)
344{
345 return "tool_settings.paint_mode";
346}
347
348static std::optional<std::string> rna_UvSculpt_path(const PointerRNA * /*ptr*/)
349{
350 return "tool_settings.uv_sculpt";
351}
352
353static std::optional<std::string> rna_CurvesSculpt_path(const PointerRNA * /*ptr*/)
354{
355 return "tool_settings.curves_sculpt";
356}
357
358static std::optional<std::string> rna_GpPaint_path(const PointerRNA * /*ptr*/)
359{
360 return "tool_settings.gpencil_paint";
361}
362
363static std::optional<std::string> rna_GpVertexPaint_path(const PointerRNA * /*ptr*/)
364{
365 return "tool_settings.gpencil_vertex_paint";
366}
367
368static std::optional<std::string> rna_GpSculptPaint_path(const PointerRNA * /*ptr*/)
369{
370 return "tool_settings.gpencil_sculpt_paint";
371}
372
373static std::optional<std::string> rna_GpWeightPaint_path(const PointerRNA * /*ptr*/)
374{
375 return "tool_settings.gpencil_weight_paint";
376}
377
378static std::optional<std::string> rna_ParticleBrush_path(const PointerRNA * /*ptr*/)
379{
380 return "tool_settings.particle_edit.brush";
381}
382
383static void rna_ImaPaint_viewport_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA * /*ptr*/)
384{
385 /* not the best solution maybe, but will refresh the 3D viewport */
387}
388
389static void rna_ImaPaint_mode_update(bContext *C, PointerRNA * /*ptr*/)
390{
391 Scene *scene = CTX_data_scene(C);
392 ViewLayer *view_layer = CTX_data_view_layer(C);
393 BKE_view_layer_synced_ensure(scene, view_layer);
395
396 if (ob && ob->type == OB_MESH) {
397 /* of course we need to invalidate here */
399
400 /* We assume that changing the current mode will invalidate the uv layers
401 * so we need to refresh display. */
402 ED_paint_proj_mesh_data_check(*scene, *ob, nullptr, nullptr, nullptr, nullptr);
404 }
405}
406
407static void rna_ImaPaint_stencil_update(bContext *C, PointerRNA * /*ptr*/)
408{
409 Scene *scene = CTX_data_scene(C);
410 ViewLayer *view_layer = CTX_data_view_layer(C);
411 BKE_view_layer_synced_ensure(scene, view_layer);
413
414 if (ob && ob->type == OB_MESH) {
415 ED_paint_proj_mesh_data_check(*scene, *ob, nullptr, nullptr, nullptr, nullptr);
417 }
418}
419
420static bool rna_ImaPaint_imagetype_poll(PointerRNA * /*ptr*/, PointerRNA value)
421{
422 Image *image = (Image *)value.owner_id;
423 return image->type != IMA_TYPE_R_RESULT && image->type != IMA_TYPE_COMPOSITE;
424}
425
426static void rna_ImaPaint_canvas_update(bContext *C, PointerRNA * /*ptr*/)
427{
428 Main *bmain = CTX_data_main(C);
429 Scene *scene = CTX_data_scene(C);
430 ViewLayer *view_layer = CTX_data_view_layer(C);
431 BKE_view_layer_synced_ensure(scene, view_layer);
433 Image *ima = scene->toolsettings->imapaint.canvas;
434
435 ED_space_image_sync(bmain, ima, false);
436
437 if (ob && ob->type == OB_MESH) {
438 ED_paint_proj_mesh_data_check(*scene, *ob, nullptr, nullptr, nullptr, nullptr);
440 }
441}
442
443static void rna_UvSculpt_curve_preset_set(PointerRNA *ptr, int value)
444{
445 Scene *scene = reinterpret_cast<Scene *>(ptr->owner_id);
446 if (value == BRUSH_CURVE_CUSTOM) {
449 1, 0.0f, 0.0f, 1.0f, 1.0f);
450 }
451 }
453}
454
457
458static bool rna_PaintModeSettings_canvas_image_poll(PointerRNA * /*ptr*/, PointerRNA value)
459{
460 Image *image = (Image *)value.owner_id;
461 return !ELEM(image->type, IMA_TYPE_COMPOSITE, IMA_TYPE_R_RESULT);
462}
463
464static void rna_PaintModeSettings_canvas_source_update(bContext *C, PointerRNA * /*ptr*/)
465{
466 Scene *scene = CTX_data_scene(C);
468 /* When canvas source changes the #pbvh::Tree would require updates when switching between color
469 * attributes. */
470 if (ob && ob->type == OB_MESH) {
472 DEG_id_tag_update(&ob->id, 0);
474 }
475}
476
478
479static bool rna_ImaPaint_detect_data(ImagePaintSettings *imapaint)
480{
481 return imapaint->missing_data == 0;
482}
483
484static std::optional<std::string> rna_GPencilSculptSettings_path(const PointerRNA * /*ptr*/)
485{
486 return "tool_settings.gpencil_sculpt";
487}
488
489static std::optional<std::string> rna_GPencilSculptGuide_path(const PointerRNA * /*ptr*/)
490{
491 return "tool_settings.gpencil_sculpt.guide";
492}
493
494static void rna_Sculpt_automasking_invert_cavity_set(PointerRNA *ptr, bool val)
495{
496 Sculpt *sd = (Sculpt *)ptr->data;
497
498 if (val) {
499 sd->automasking_flags &= ~BRUSH_AUTOMASKING_CAVITY_NORMAL;
500 sd->automasking_flags |= BRUSH_AUTOMASKING_CAVITY_INVERTED;
501 }
502 else {
503 sd->automasking_flags &= ~BRUSH_AUTOMASKING_CAVITY_INVERTED;
504 }
505}
506
507static void rna_Sculpt_automasking_cavity_set(PointerRNA *ptr, bool val)
508{
509 Sculpt *sd = (Sculpt *)ptr->data;
510
511 if (val) {
512 sd->automasking_flags &= ~BRUSH_AUTOMASKING_CAVITY_INVERTED;
513 sd->automasking_flags |= BRUSH_AUTOMASKING_CAVITY_NORMAL;
514 }
515 else {
516 sd->automasking_flags &= ~BRUSH_AUTOMASKING_CAVITY_NORMAL;
517 }
518}
519
520static void rna_UnifiedPaintSettings_update(bContext *C, PointerRNA * /*ptr*/)
521{
522 Scene *scene = CTX_data_scene(C);
523 ViewLayer *view_layer = CTX_data_view_layer(C);
524 Brush *br = BKE_paint_brush(BKE_paint_get_active(scene, view_layer));
525 /* TODO: Verify if tagging the brush for these settings being changed is correct. */
528}
529
530static void rna_UnifiedPaintSettings_color_update(bContext *C, PointerRNA *ptr)
531{
532 UnifiedPaintSettings *ups = static_cast<UnifiedPaintSettings *>(ptr->data);
533 rna_UnifiedPaintSettings_update(C, ptr);
535}
536
537static void rna_UnifiedPaintSettings_size_set(PointerRNA *ptr, int value)
538{
539 UnifiedPaintSettings *ups = static_cast<UnifiedPaintSettings *>(ptr->data);
540
541 /* scale unprojected size so it stays consistent with brush size */
543 ups->size = value;
544}
545
546static void rna_UnifiedPaintSettings_unprojected_size_set(PointerRNA *ptr, float value)
547{
548 UnifiedPaintSettings *ups = static_cast<UnifiedPaintSettings *>(ptr->data);
549
550 /* scale brush size so it stays consistent with unprojected_size */
551 BKE_brush_scale_size(&ups->size, value, ups->unprojected_size);
552 ups->unprojected_size = value;
553}
554
555static void rna_UnifiedPaintSettings_size_update(bContext *C, PointerRNA *ptr)
556{
557 /* changing the unified size should invalidate the overlay but also update the brush */
559 rna_UnifiedPaintSettings_update(C, ptr);
560}
561
562static const UnifiedPaintSettings *rna_UnifiedPaintSettings_address_get(const Paint *paint)
563{
564 if (!paint) {
565 return nullptr;
566 }
567
568 return &paint->unified_paint_settings;
569}
570
571static std::optional<std::string> rna_UnifiedPaintSettings_path(const PointerRNA *ptr)
572{
573 const Scene *scene = reinterpret_cast<Scene *>(ptr->owner_id);
574 const ToolSettings *tool_settings = scene ? scene->toolsettings : nullptr;
575 if (tool_settings == nullptr) {
576 return std::nullopt;
577 }
578 if (rna_UnifiedPaintSettings_address_get(reinterpret_cast<Paint *>(tool_settings->vpaint)) ==
579 ptr->data)
580 {
581 return "tool_settings.vertex_paint.unified_paint_settings";
582 }
583 if (rna_UnifiedPaintSettings_address_get(reinterpret_cast<Paint *>(tool_settings->wpaint)) ==
584 ptr->data)
585 {
586 return "tool_settings.weight_paint.unified_paint_settings";
587 }
588 if (rna_UnifiedPaintSettings_address_get(reinterpret_cast<Paint *>(tool_settings->sculpt)) ==
589 ptr->data)
590 {
591 return "tool_settings.sculpt.unified_paint_settings";
592 }
593 if (rna_UnifiedPaintSettings_address_get(reinterpret_cast<Paint *>(tool_settings->gp_paint)) ==
594 ptr->data)
595 {
596 return "tool_settings.gpencil_paint.unified_paint_settings";
597 }
598 if (rna_UnifiedPaintSettings_address_get(
599 reinterpret_cast<Paint *>(tool_settings->gp_vertexpaint)) == ptr->data)
600 {
601 return "tool_settings.gpencil_vertex_paint.unified_paint_settings";
602 }
603 if (rna_UnifiedPaintSettings_address_get(
604 reinterpret_cast<Paint *>(tool_settings->gp_sculptpaint)) == ptr->data)
605 {
606 return "tool_settings.gpencil_sculpt_paint.unified_paint_settings";
607 }
608 if (rna_UnifiedPaintSettings_address_get(
609 reinterpret_cast<Paint *>(tool_settings->gp_weightpaint)) == ptr->data)
610 {
611 return "tool_settings.gpencil_weight_paint.unified_paint_settings";
612 }
613 if (rna_UnifiedPaintSettings_address_get(
614 reinterpret_cast<Paint *>(tool_settings->curves_sculpt)) == ptr->data)
615 {
616 return "tool_settings.curves_sculpt.unified_paint_settings";
617 }
618 return std::nullopt;
619}
620#else
621
623{
624 StructRNA *srna;
625
626 srna = RNA_def_struct(brna, "PaintCurve", "ID");
627 RNA_def_struct_ui_text(srna, "Paint Curve", "");
628 RNA_def_struct_ui_icon(srna, ICON_CURVE_BEZCURVE);
629}
630
632 const char *prop_name,
633 const char *ui_name,
634 const int64_t flag)
635{
636 PropertyRNA *prop;
637
638 prop = RNA_def_property(srna, prop_name, PROP_BOOLEAN, PROP_NONE);
639 RNA_def_property_boolean_sdna(prop, nullptr, "curve_visibility_flags", flag);
640 RNA_def_property_ui_text(prop, ui_name, nullptr);
642}
643
644static void rna_def_paint(BlenderRNA *brna)
645{
646 StructRNA *srna;
647 PropertyRNA *prop;
648
649 srna = RNA_def_struct(brna, "Paint", nullptr);
650 RNA_def_struct_ui_text(srna, "Paint", "");
651
652 /* Global Settings */
653 prop = RNA_def_property(srna, "brush", PROP_POINTER, PROP_NONE);
655 RNA_def_property_struct_type(prop, "Brush");
657 prop, "rna_Paint_brush_get", nullptr, nullptr, "rna_Paint_brush_poll");
658 RNA_def_property_ui_text(prop, "Brush", "Active brush");
660
661 prop = RNA_def_property(srna, "brush_asset_reference", PROP_POINTER, PROP_NONE);
664 "Brush Asset Reference",
665 "A weak reference to the matching brush asset, used e.g. to restore "
666 "the last used brush on file load");
667
668 prop = RNA_def_property(srna, "eraser_brush", PROP_POINTER, PROP_NONE);
671 RNA_def_property_struct_type(prop, "Brush");
673 "rna_Paint_eraser_brush_get",
674 "rna_Paint_eraser_brush_set",
675 nullptr,
676 "rna_Paint_eraser_brush_poll");
678 "Default Eraser Brush",
679 "Default eraser brush for quickly alternating with the main brush");
681
682 prop = RNA_def_property(srna, "eraser_brush_asset_reference", PROP_POINTER, PROP_NONE);
685 "Eraser Brush Asset Reference",
686 "A weak reference to the matching brush asset, used e.g. to restore "
687 "the last used brush on file load");
688
689 prop = RNA_def_property(srna, "palette", PROP_POINTER, PROP_NONE);
691 RNA_def_property_pointer_funcs(prop, nullptr, nullptr, nullptr, nullptr);
692 RNA_def_property_ui_text(prop, "Palette", "Active Palette");
693
694 prop = RNA_def_property(srna, "show_brush", PROP_BOOLEAN, PROP_NONE);
695 RNA_def_property_boolean_sdna(prop, nullptr, "flags", PAINT_SHOW_BRUSH);
696 RNA_def_property_ui_text(prop, "Show Brush", "");
698
699 prop = RNA_def_property(srna, "show_brush_on_surface", PROP_BOOLEAN, PROP_NONE);
701 RNA_def_property_ui_text(prop, "Show Brush On Surface", "");
703
704 prop = RNA_def_property(srna, "show_low_resolution", PROP_BOOLEAN, PROP_NONE);
705 RNA_def_property_boolean_sdna(prop, nullptr, "flags", PAINT_FAST_NAVIGATE);
707 prop, "Fast Navigate", "For multires, show low resolution while navigating the view");
709
710 prop = RNA_def_property(srna, "use_sculpt_delay_updates", PROP_BOOLEAN, PROP_NONE);
713 prop,
714 "Delay Viewport Updates",
715 "Update the geometry when it enters the view, providing faster view navigation");
717
718 prop = RNA_def_property(srna, "use_symmetry_x", PROP_BOOLEAN, PROP_NONE);
719 RNA_def_property_boolean_sdna(prop, nullptr, "symmetry_flags", PAINT_SYMM_X);
720 RNA_def_property_ui_text(prop, "Symmetry X", "Mirror brush across the X axis");
722
723 prop = RNA_def_property(srna, "use_symmetry_y", PROP_BOOLEAN, PROP_NONE);
724 RNA_def_property_boolean_sdna(prop, nullptr, "symmetry_flags", PAINT_SYMM_Y);
725 RNA_def_property_ui_text(prop, "Symmetry Y", "Mirror brush across the Y axis");
727
728 prop = RNA_def_property(srna, "use_symmetry_z", PROP_BOOLEAN, PROP_NONE);
729 RNA_def_property_boolean_sdna(prop, nullptr, "symmetry_flags", PAINT_SYMM_Z);
730 RNA_def_property_ui_text(prop, "Symmetry Z", "Mirror brush across the Z axis");
732
733 prop = RNA_def_property(srna, "use_symmetry_feather", PROP_BOOLEAN, PROP_NONE);
734 RNA_def_property_boolean_sdna(prop, nullptr, "symmetry_flags", PAINT_SYMMETRY_FEATHER);
736 "Symmetry Feathering",
737 "Reduce the strength of the brush where it overlaps symmetrical daubs");
739
740 prop = RNA_def_property(srna, "cavity_curve", PROP_POINTER, PROP_NONE);
742 RNA_def_property_ui_text(prop, "Curve", "Editable cavity curve");
744
745 prop = RNA_def_property(srna, "use_cavity", PROP_BOOLEAN, PROP_NONE);
747 RNA_def_property_ui_text(prop, "Cavity Mask", "Mask painting according to mesh geometry cavity");
749
750 prop = RNA_def_property(srna, "tile_offset", PROP_FLOAT, PROP_XYZ_LENGTH);
751 RNA_def_property_float_sdna(prop, nullptr, "tile_offset");
752 RNA_def_property_array(prop, 3);
753 RNA_def_property_range(prop, 0.01, FLT_MAX);
754 RNA_def_property_ui_range(prop, 0.01, 100, 1 * 100, 2);
756 prop, "Tiling offset for the X Axis", "Stride at which tiled strokes are copied");
757
758 prop = RNA_def_property(srna, "tile_x", PROP_BOOLEAN, PROP_NONE);
759 RNA_def_property_boolean_sdna(prop, nullptr, "symmetry_flags", PAINT_TILE_X);
760 RNA_def_property_ui_text(prop, "Tile X", "Tile along X axis");
762
763 prop = RNA_def_property(srna, "tile_y", PROP_BOOLEAN, PROP_NONE);
764 RNA_def_property_boolean_sdna(prop, nullptr, "symmetry_flags", PAINT_TILE_Y);
765 RNA_def_property_ui_text(prop, "Tile Y", "Tile along Y axis");
767
768 prop = RNA_def_property(srna, "tile_z", PROP_BOOLEAN, PROP_NONE);
769 RNA_def_property_boolean_sdna(prop, nullptr, "symmetry_flags", PAINT_TILE_Z);
770 RNA_def_property_ui_text(prop, "Tile Z", "Tile along Z axis");
772
774 srna, "show_strength_curve", "Show Strength Curve", PAINT_CURVE_SHOW_STRENGTH);
776 srna, "show_size_curve", "Show Size Curve", PAINT_CURVE_SHOW_SIZE);
778 srna, "show_jitter_curve", "Show Jitter Curve", PAINT_CURVE_SHOW_JITTER);
779
780 /* Unified Paint Settings */
781 prop = RNA_def_property(srna, "unified_paint_settings", PROP_POINTER, PROP_NONE);
783 RNA_def_property_struct_type(prop, "UnifiedPaintSettings");
784 RNA_def_property_ui_text(prop, "Unified Paint Settings", nullptr);
785}
786
788{
789 StructRNA *srna;
790 PropertyRNA *prop;
791
792 static const EnumPropertyItem brush_size_unit_items[] = {
793 {0, "VIEW", 0, "View", "Measure brush size relative to the view"},
795 "SCENE",
796 0,
797 "Scene",
798 "Measure brush size relative to the scene"},
799 {0, nullptr, 0, nullptr, nullptr},
800 };
801
802 srna = RNA_def_struct(brna, "UnifiedPaintSettings", nullptr);
803 RNA_def_struct_path_func(srna, "rna_UnifiedPaintSettings_path");
805 srna, "Unified Paint Settings", "Overrides for some of the active brush's settings");
807
808 /* high-level flags to enable or disable unified paint settings */
809 prop = RNA_def_property(srna, "use_unified_size", PROP_BOOLEAN, PROP_NONE);
812 prop, "Use Unified Size", "Instead of per-brush size, the size is shared across brushes");
814
815 prop = RNA_def_property(srna, "use_unified_strength", PROP_BOOLEAN, PROP_NONE);
818 "Use Unified Strength",
819 "Instead of per-brush strength, the strength is shared across brushes");
821
822 prop = RNA_def_property(srna, "use_unified_weight", PROP_BOOLEAN, PROP_NONE);
825 "Use Unified Weight",
826 "Instead of per-brush weight, the weight is shared across brushes");
828
829 prop = RNA_def_property(srna, "use_unified_color", PROP_BOOLEAN, PROP_NONE);
832 prop, "Use Unified Color", "Instead of per-brush color, the color is shared across brushes");
834
835 prop = RNA_def_property(srna, "use_unified_input_samples", PROP_BOOLEAN, PROP_NONE);
838 prop,
839 "Use Unified Input Samples",
840 "Instead of per-brush input samples, the value is shared across brushes");
842
843 /* unified paint settings that override the equivalent settings
844 * from the active brush */
845 prop = RNA_def_property(srna, "size", PROP_INT, PROP_PIXEL_DIAMETER);
846 RNA_def_property_int_funcs(prop, nullptr, "rna_UnifiedPaintSettings_size_set", nullptr);
850 RNA_def_property_ui_text(prop, "Size", "Diameter of the brush");
851 RNA_def_property_update(prop, 0, "rna_UnifiedPaintSettings_size_update");
852
853 prop = RNA_def_property(srna, "unprojected_size", PROP_FLOAT, PROP_DISTANCE_DIAMETER);
855 prop, nullptr, "rna_UnifiedPaintSettings_unprojected_size_set", nullptr);
857 RNA_def_property_range(prop, 0.001, FLT_MAX);
858 RNA_def_property_ui_range(prop, 0.001, 1, 1, -1);
859 RNA_def_property_ui_text(prop, "Unprojected Size", "Diameter of brush in Blender units");
860 RNA_def_property_update(prop, 0, "rna_UnifiedPaintSettings_size_update");
861
862 prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_FACTOR);
863 RNA_def_property_float_sdna(prop, nullptr, "alpha");
865 RNA_def_property_range(prop, 0.0f, 10.0f);
866 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
868 prop, "Strength", "How powerful the effect of the brush is when applied");
869 RNA_def_property_update(prop, 0, "rna_UnifiedPaintSettings_update");
870
871 prop = RNA_def_property(srna, "weight", PROP_FLOAT, PROP_FACTOR);
872 RNA_def_property_float_sdna(prop, nullptr, "weight");
874 RNA_def_property_range(prop, 0.0f, 1.0f);
875 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
876 RNA_def_property_ui_text(prop, "Weight", "Weight to assign in vertex groups");
877 RNA_def_property_update(prop, 0, "rna_UnifiedPaintSettings_update");
878
879 prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
881 RNA_def_property_range(prop, 0.0, 1.0);
882 RNA_def_property_float_sdna(prop, nullptr, "color");
883 RNA_def_property_ui_text(prop, "Color", "");
884 RNA_def_property_update(prop, 0, "rna_UnifiedPaintSettings_color_update");
885
886 prop = RNA_def_property(srna, "secondary_color", PROP_FLOAT, PROP_COLOR);
888 RNA_def_property_range(prop, 0.0, 1.0);
889 RNA_def_property_float_sdna(prop, nullptr, "secondary_color");
890 RNA_def_property_ui_text(prop, "Secondary Color", "");
891 RNA_def_property_update(prop, 0, "rna_UnifiedPaintSettings_color_update");
892
893 prop = RNA_def_property(srna, "use_color_jitter", PROP_BOOLEAN, PROP_NONE);
896 RNA_def_property_ui_text(prop, "Use Color Jitter", "Jitter brush color");
897 RNA_def_property_update(prop, 0, "rna_UnifiedPaintSettings_update");
898
899 prop = RNA_def_property(srna, "hue_jitter", PROP_FLOAT, PROP_NONE);
901 RNA_def_property_float_sdna(prop, nullptr, "hsv_jitter[0]");
902 RNA_def_property_range(prop, 0, 1.0f);
903 RNA_def_property_ui_range(prop, 0, 1, 0.05, 2);
904 RNA_def_property_ui_text(prop, "Hue Jitter", "Color jitter effect on hue");
905 RNA_def_property_update(prop, 0, "rna_UnifiedPaintSettings_update");
906
907 prop = RNA_def_property(srna, "saturation_jitter", PROP_FLOAT, PROP_NONE);
909 RNA_def_property_float_sdna(prop, nullptr, "hsv_jitter[1]");
910 RNA_def_property_range(prop, 0, 1.0f);
911 RNA_def_property_ui_range(prop, 0, 1, 0.05, 2);
912 RNA_def_property_ui_text(prop, "Saturation Jitter", "Color jitter effect on saturation");
913 RNA_def_property_update(prop, 0, "rna_UnifiedPaintSettings_update");
914
915 prop = RNA_def_property(srna, "value_jitter", PROP_FLOAT, PROP_NONE);
917 RNA_def_property_float_sdna(prop, nullptr, "hsv_jitter[2]");
918 RNA_def_property_range(prop, 0, 1.0f);
919 RNA_def_property_ui_range(prop, 0, 1, 0.05, 2);
920 RNA_def_property_ui_text(prop, "Value Jitter", "Color jitter effect on value");
921 RNA_def_property_update(prop, 0, "rna_UnifiedPaintSettings_update");
922
923 prop = RNA_def_property(srna, "use_stroke_random_hue", PROP_BOOLEAN, PROP_NONE);
926 prop, nullptr, "color_jitter_flag", BRUSH_COLOR_JITTER_USE_HUE_AT_STROKE);
927 RNA_def_property_ui_icon(prop, ICON_GP_SELECT_STROKES, 0);
928 RNA_def_property_ui_text(prop, "Stroke Random", "Use randomness at stroke level");
929 RNA_def_property_update(prop, 0, "rna_UnifiedPaintSettings_update");
930
931 prop = RNA_def_property(srna, "use_stroke_random_sat", PROP_BOOLEAN, PROP_NONE);
934 prop, nullptr, "color_jitter_flag", BRUSH_COLOR_JITTER_USE_SAT_AT_STROKE);
935 RNA_def_property_ui_icon(prop, ICON_GP_SELECT_STROKES, 0);
936 RNA_def_property_ui_text(prop, "Stroke Random", "Use randomness at stroke level");
937 RNA_def_property_update(prop, 0, "rna_UnifiedPaintSettings_update");
938
939 prop = RNA_def_property(srna, "use_stroke_random_val", PROP_BOOLEAN, PROP_NONE);
942 prop, nullptr, "color_jitter_flag", BRUSH_COLOR_JITTER_USE_VAL_AT_STROKE);
943 RNA_def_property_ui_icon(prop, ICON_GP_SELECT_STROKES, 0);
944 RNA_def_property_ui_text(prop, "Stroke Random", "Use randomness at stroke level");
945 RNA_def_property_update(prop, 0, "rna_UnifiedPaintSettings_update");
946
947 prop = RNA_def_property(srna, "use_random_press_hue", PROP_BOOLEAN, PROP_NONE);
950 prop, nullptr, "color_jitter_flag", BRUSH_COLOR_JITTER_USE_HUE_RAND_PRESS);
951 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
952 RNA_def_property_ui_text(prop, "Use Pressure", "Use pressure to modulate randomness");
953 RNA_def_property_update(prop, 0, "rna_UnifiedPaintSettings_update");
954
955 prop = RNA_def_property(srna, "use_random_press_sat", PROP_BOOLEAN, PROP_NONE);
958 prop, nullptr, "color_jitter_flag", BRUSH_COLOR_JITTER_USE_SAT_RAND_PRESS);
959 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
960 RNA_def_property_ui_text(prop, "Use Pressure", "Use pressure to modulate randomness");
961 RNA_def_property_update(prop, 0, "rna_UnifiedPaintSettings_update");
962
963 prop = RNA_def_property(srna, "use_random_press_val", PROP_BOOLEAN, PROP_NONE);
966 prop, nullptr, "color_jitter_flag", BRUSH_COLOR_JITTER_USE_VAL_RAND_PRESS);
967 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
968 RNA_def_property_ui_text(prop, "Use Pressure", "Use pressure to modulate randomness");
969 RNA_def_property_update(prop, 0, "rna_UnifiedPaintSettings_update");
970
971 prop = RNA_def_property(srna, "input_samples", PROP_INT, PROP_UNSIGNED);
972 RNA_def_property_int_sdna(prop, nullptr, "input_samples");
977 prop,
978 "Input Samples",
979 "Number of input samples to average together to smooth the brush stroke");
980 RNA_def_property_update(prop, 0, "rna_UnifiedPaintSettings_update");
981
982 prop = RNA_def_property(srna, "use_locked_size", PROP_ENUM, PROP_NONE); /* as an enum */
984 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flag");
985 RNA_def_property_enum_items(prop, brush_size_unit_items);
987 prop, "Size Unit", "Measure brush size relative to the view or the scene");
988 RNA_def_property_update(prop, 0, "rna_UnifiedPaintSettings_update");
989}
990
991static void rna_def_sculpt(BlenderRNA *brna)
992{
993 static const EnumPropertyItem detail_refine_items[] = {
995 "SUBDIVIDE",
996 0,
997 "Subdivide Edges",
998 "Subdivide long edges to add mesh detail where needed"},
1000 "COLLAPSE",
1001 0,
1002 "Collapse Edges",
1003 "Collapse short edges to remove mesh detail where possible"},
1005 "SUBDIVIDE_COLLAPSE",
1006 0,
1007 "Subdivide Collapse",
1008 "Both subdivide long edges and collapse short edges to refine mesh detail"},
1009 {0, nullptr, 0, nullptr, nullptr},
1010 };
1011
1012 static const EnumPropertyItem detail_type_items[] = {
1013 {0,
1014 "RELATIVE",
1015 0,
1016 "Relative Detail",
1017 "Mesh detail is relative to the brush size and detail size"},
1019 "CONSTANT",
1020 0,
1021 "Constant Detail",
1022 "Mesh detail is constant in world space according to detail size"},
1024 "BRUSH",
1025 0,
1026 "Brush Detail",
1027 "Mesh detail is relative to brush size"},
1029 "MANUAL",
1030 0,
1031 "Manual Detail",
1032 "Mesh detail does not change on each stroke, only when using Flood Fill"},
1033 {0, nullptr, 0, nullptr, nullptr},
1034 };
1035
1036 static const EnumPropertyItem sculpt_transform_mode_items[] = {
1038 "ALL_VERTICES",
1039 0,
1040 "All Vertices",
1041 "Applies the transformation to all vertices in the mesh"},
1043 "RADIUS_ELASTIC",
1044 0,
1045 "Elastic",
1046 "Applies the transformation simulating elasticity using the radius of the cursor"},
1047 {0, nullptr, 0, nullptr, nullptr},
1048 };
1049
1050 StructRNA *srna;
1051 PropertyRNA *prop;
1052
1053 srna = RNA_def_struct(brna, "Sculpt", "Paint");
1054 RNA_def_struct_path_func(srna, "rna_Sculpt_path");
1055 RNA_def_struct_ui_text(srna, "Sculpt", "");
1057
1058 prop = RNA_def_property(srna, "lock_x", PROP_BOOLEAN, PROP_NONE);
1059 RNA_def_property_boolean_sdna(prop, nullptr, "flags", SCULPT_LOCK_X);
1060 RNA_def_property_ui_text(prop, "Lock X", "Disallow changes to the X axis of vertices");
1062
1063 prop = RNA_def_property(srna, "lock_y", PROP_BOOLEAN, PROP_NONE);
1064 RNA_def_property_boolean_sdna(prop, nullptr, "flags", SCULPT_LOCK_Y);
1065 RNA_def_property_ui_text(prop, "Lock Y", "Disallow changes to the Y axis of vertices");
1067
1068 prop = RNA_def_property(srna, "lock_z", PROP_BOOLEAN, PROP_NONE);
1069 RNA_def_property_boolean_sdna(prop, nullptr, "flags", SCULPT_LOCK_Z);
1070 RNA_def_property_ui_text(prop, "Lock Z", "Disallow changes to the Z axis of vertices");
1072
1073 prop = RNA_def_property(srna, "use_deform_only", PROP_BOOLEAN, PROP_NONE);
1074 RNA_def_property_boolean_sdna(prop, nullptr, "flags", SCULPT_ONLY_DEFORM);
1076 "Use Deform Only",
1077 "Use only deformation modifiers (temporary disable all "
1078 "constructive modifiers except multi-resolution)");
1080 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Sculpt_update");
1081
1082 prop = RNA_def_property(srna, "detail_size", PROP_FLOAT, PROP_PIXEL);
1083 RNA_def_property_range(prop, 0.5, 40.0);
1084 RNA_def_property_ui_range(prop, 0.5, 40.0, 0.1, 2);
1087 prop, "Detail Size", "Maximum edge length for dynamic topology sculpting (in pixels)");
1089
1090 prop = RNA_def_property(srna, "detail_percent", PROP_FLOAT, PROP_PERCENTAGE);
1091 RNA_def_property_range(prop, 0.5, 100.0);
1092 RNA_def_property_ui_range(prop, 0.5, 100.0, 10, 2);
1094 prop,
1095 "Detail Percentage",
1096 "Maximum edge length for dynamic topology sculpting (in brush percentage)");
1098
1099 prop = RNA_def_property(srna, "constant_detail_resolution", PROP_FLOAT, PROP_NONE);
1100 RNA_def_property_float_sdna(prop, nullptr, "constant_detail");
1101 RNA_def_property_range(prop, 0.0001, FLT_MAX);
1102 RNA_def_property_ui_range(prop, 0.001, 1000.0, 10, 2);
1104 "Resolution",
1105 "Maximum edge length for dynamic topology sculpting (as divisor "
1106 "of Blender unit - higher value means smaller edge length)");
1108
1110 do {
1111 prop = RNA_def_property(srna, entry->identifier, PROP_BOOLEAN, PROP_NONE);
1112 RNA_def_property_boolean_sdna(prop, nullptr, "automasking_flags", entry->value);
1113 RNA_def_property_ui_text(prop, entry->name, entry->description);
1114
1115 if (entry->value == BRUSH_AUTOMASKING_CAVITY_NORMAL) {
1116 RNA_def_property_boolean_funcs(prop, nullptr, "rna_Sculpt_automasking_cavity_set");
1117 }
1118 else if (entry->value == BRUSH_AUTOMASKING_CAVITY_INVERTED) {
1119 RNA_def_property_boolean_funcs(prop, nullptr, "rna_Sculpt_automasking_invert_cavity_set");
1120 }
1121
1123 } while ((++entry)->identifier);
1124
1125 prop = RNA_def_property(
1126 srna, "automasking_boundary_edges_propagation_steps", PROP_INT, PROP_UNSIGNED);
1127 RNA_def_property_int_sdna(prop, nullptr, "automasking_boundary_edges_propagation_steps");
1131 "Propagation Steps",
1132 "Distance where boundary edge automasking is going to protect vertices "
1133 "from the fully masked edge");
1135
1136 prop = RNA_def_property(srna, "automasking_cavity_factor", PROP_FLOAT, PROP_FACTOR);
1137 RNA_def_property_float_sdna(prop, nullptr, "automasking_cavity_factor");
1138 RNA_def_property_ui_text(prop, "Cavity Factor", "The contrast of the cavity mask");
1140 RNA_def_property_range(prop, 0.0f, 5.0f);
1141 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
1143
1144 prop = RNA_def_property(srna, "automasking_cavity_blur_steps", PROP_INT, PROP_NONE);
1145 RNA_def_property_int_sdna(prop, nullptr, "automasking_cavity_blur_steps");
1146 RNA_def_property_ui_text(prop, "Blur Steps", "The number of times the cavity mask is blurred");
1148 RNA_def_property_range(prop, 0, 25);
1149 RNA_def_property_ui_range(prop, 0, 10, 1, 1);
1151
1152 prop = RNA_def_property(srna, "automasking_cavity_curve", PROP_POINTER, PROP_NONE);
1153 RNA_def_property_pointer_sdna(prop, nullptr, "automasking_cavity_curve");
1154 RNA_def_property_struct_type(prop, "CurveMapping");
1155 RNA_def_property_ui_text(prop, "Cavity Curve", "Curve used for the sensitivity");
1158
1159 prop = RNA_def_property(srna, "automasking_cavity_curve_op", PROP_POINTER, PROP_NONE);
1160 RNA_def_property_pointer_sdna(prop, nullptr, "automasking_cavity_curve_op");
1161 RNA_def_property_struct_type(prop, "CurveMapping");
1162 RNA_def_property_ui_text(prop, "Cavity Curve", "Curve used for the sensitivity");
1165
1166 prop = RNA_def_property(srna, "use_automasking_start_normal", PROP_BOOLEAN, PROP_NONE);
1168 prop, nullptr, "automasking_flags", BRUSH_AUTOMASKING_BRUSH_NORMAL);
1170 prop,
1171 "Area Normal",
1172 "Affect only vertices with a similar normal to where the stroke starts");
1174
1175 prop = RNA_def_property(srna, "use_automasking_view_normal", PROP_BOOLEAN, PROP_NONE);
1176 RNA_def_property_boolean_sdna(prop, nullptr, "automasking_flags", BRUSH_AUTOMASKING_VIEW_NORMAL);
1178 prop, "View Normal", "Affect only vertices with a normal that faces the viewer");
1180
1181 prop = RNA_def_property(srna, "use_automasking_view_occlusion", PROP_BOOLEAN, PROP_NONE);
1183 prop, nullptr, "automasking_flags", BRUSH_AUTOMASKING_VIEW_OCCLUSION);
1185 prop,
1186 "Occlusion",
1187 "Only affect vertices that are not occluded by other faces (slower performance)");
1189
1190 prop = RNA_def_property(srna, "automasking_start_normal_limit", PROP_FLOAT, PROP_ANGLE);
1191 RNA_def_property_float_sdna(prop, nullptr, "automasking_start_normal_limit");
1192 RNA_def_property_range(prop, 0.0001f, M_PI);
1193 RNA_def_property_ui_text(prop, "Area Normal Limit", "The range of angles that will be affected");
1195
1196 prop = RNA_def_property(srna, "automasking_start_normal_falloff", PROP_FLOAT, PROP_FACTOR);
1197 RNA_def_property_float_sdna(prop, nullptr, "automasking_start_normal_falloff");
1198 RNA_def_property_range(prop, 0.0001f, 1.0f);
1200 prop, "Area Normal Falloff", "Extend the angular range with a falloff gradient");
1202
1203 prop = RNA_def_property(srna, "automasking_view_normal_limit", PROP_FLOAT, PROP_ANGLE);
1204 RNA_def_property_float_sdna(prop, nullptr, "automasking_view_normal_limit");
1205 RNA_def_property_range(prop, 0.0001f, M_PI);
1206 RNA_def_property_ui_text(prop, "View Normal Limit", "The range of angles that will be affected");
1208
1209 prop = RNA_def_property(srna, "automasking_view_normal_falloff", PROP_FLOAT, PROP_FACTOR);
1210 RNA_def_property_float_sdna(prop, nullptr, "automasking_view_normal_falloff");
1211 RNA_def_property_range(prop, 0.0001f, 1.0f);
1213 prop, "View Normal Falloff", "Extend the angular range with a falloff gradient");
1215
1216 prop = RNA_def_property(srna, "symmetrize_direction", PROP_ENUM, PROP_NONE);
1218 RNA_def_property_ui_text(prop, "Direction", "Source and destination for symmetrize operator");
1219
1220 prop = RNA_def_property(srna, "detail_refine_method", PROP_ENUM, PROP_NONE);
1221 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flags");
1222 RNA_def_property_enum_items(prop, detail_refine_items);
1224 prop, "Detail Refine Method", "In dynamic-topology mode, how to add or remove mesh detail");
1226
1227 prop = RNA_def_property(srna, "detail_type_method", PROP_ENUM, PROP_NONE);
1228 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flags");
1229 RNA_def_property_enum_items(prop, detail_type_items);
1231 prop, "Detail Type Method", "In dynamic-topology mode, how mesh detail size is calculated");
1233
1234 prop = RNA_def_property(srna, "gravity", PROP_FLOAT, PROP_FACTOR);
1235 RNA_def_property_float_sdna(prop, nullptr, "gravity_factor");
1236 RNA_def_property_range(prop, 0.0f, 1.0f);
1237 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
1238 RNA_def_property_ui_text(prop, "Gravity", "Amount of gravity after each dab");
1240
1241 prop = RNA_def_property(srna, "transform_mode", PROP_ENUM, PROP_NONE);
1242 RNA_def_property_enum_items(prop, sculpt_transform_mode_items);
1244 prop, "Transform Mode", "How the transformation is going to be applied to the target");
1246
1247 prop = RNA_def_property(srna, "gravity_object", PROP_POINTER, PROP_NONE);
1250 prop, "Orientation", "Object whose Z axis defines orientation of gravity");
1252}
1253
1255{
1256 StructRNA *srna;
1257 PropertyRNA *prop;
1258
1259 srna = RNA_def_struct(brna, "UvSculpt", nullptr);
1260 RNA_def_struct_path_func(srna, "rna_UvSculpt_path");
1261 RNA_def_struct_ui_text(srna, "UV Sculpting", "");
1263
1264 prop = RNA_def_property(srna, "size", PROP_INT, PROP_PIXEL_DIAMETER);
1267 RNA_def_property_ui_text(prop, "Size", "");
1269
1270 prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_FACTOR);
1271 RNA_def_property_range(prop, 0.0f, 1.0f);
1272 RNA_def_property_ui_text(prop, "Strength", "");
1275
1276 prop = RNA_def_property(srna, "curve_distance_falloff", PROP_POINTER, PROP_NONE);
1277 RNA_def_property_struct_type(prop, "CurveMapping");
1278 RNA_def_property_pointer_funcs(prop, nullptr, nullptr, nullptr, nullptr);
1279 RNA_def_property_ui_text(prop, "Falloff Curve", "");
1281
1282 prop = RNA_def_property(srna, "curve_distance_falloff_preset", PROP_ENUM, PROP_NONE);
1284 RNA_def_property_ui_text(prop, "Falloff Curve Preset", "");
1286 RNA_def_property_enum_funcs(prop, nullptr, "rna_UvSculpt_curve_preset_set", nullptr);
1288}
1289
1291{
1292 StructRNA *srna;
1293 PropertyRNA *prop;
1294
1295 srna = RNA_def_struct(brna, "GpPaint", "Paint");
1296 RNA_def_struct_path_func(srna, "rna_GpPaint_path");
1297 RNA_def_struct_ui_text(srna, "Grease Pencil Paint", "");
1299
1300 /* Use vertex color (main switch). */
1301 prop = RNA_def_property(srna, "color_mode", PROP_ENUM, PROP_NONE);
1302 RNA_def_property_enum_sdna(prop, nullptr, "mode");
1304 RNA_def_property_ui_text(prop, "Mode", "Paint Mode");
1307}
1308
1310{
1311 StructRNA *srna;
1312
1313 srna = RNA_def_struct(brna, "GpVertexPaint", "Paint");
1314 RNA_def_struct_path_func(srna, "rna_GpVertexPaint_path");
1315 RNA_def_struct_ui_text(srna, "Grease Pencil Vertex Paint", "");
1317}
1318
1320{
1321 StructRNA *srna;
1322
1323 srna = RNA_def_struct(brna, "GpSculptPaint", "Paint");
1324 RNA_def_struct_path_func(srna, "rna_GpSculptPaint_path");
1325 RNA_def_struct_ui_text(srna, "Grease Pencil Sculpt Paint", "");
1327}
1328
1330{
1331 StructRNA *srna;
1332
1333 srna = RNA_def_struct(brna, "GpWeightPaint", "Paint");
1334 RNA_def_struct_path_func(srna, "rna_GpWeightPaint_path");
1335 RNA_def_struct_ui_text(srna, "Grease Pencil Weight Paint", "");
1337}
1338
1339/* use for weight paint too */
1341{
1342 StructRNA *srna;
1343 PropertyRNA *prop;
1344
1345 srna = RNA_def_struct(brna, "VertexPaint", "Paint");
1346 RNA_def_struct_sdna(srna, "VPaint");
1347 RNA_def_struct_path_func(srna, "rna_VertexPaint_path");
1348 RNA_def_struct_ui_text(srna, "Vertex Paint", "Properties of vertex and weight paint mode");
1350
1351 /* weight paint only */
1352 prop = RNA_def_property(srna, "use_group_restrict", PROP_BOOLEAN, PROP_NONE);
1354 RNA_def_property_ui_text(prop, "Restrict", "Restrict painting to vertices in the group");
1356}
1357
1359{
1360 StructRNA *srna;
1361 PropertyRNA *prop;
1362
1363 srna = RNA_def_struct(brna, "PaintModeSettings", nullptr);
1364 RNA_def_struct_sdna(srna, "PaintModeSettings");
1365 RNA_def_struct_path_func(srna, "rna_PaintModeSettings_path");
1366 RNA_def_struct_ui_text(srna, "Paint Mode", "Properties of paint mode");
1368
1369 prop = RNA_def_property(srna, "canvas_source", PROP_ENUM, PROP_NONE);
1372 RNA_def_property_ui_text(prop, "Source", "Source to select canvas from");
1373 RNA_def_property_update(prop, 0, "rna_PaintModeSettings_canvas_source_update");
1374
1375 prop = RNA_def_property(srna, "canvas_image", PROP_POINTER, PROP_NONE);
1377 prop, nullptr, nullptr, nullptr, "rna_PaintModeSettings_canvas_image_poll");
1379 RNA_def_property_ui_text(prop, "Texture", "Image used as painting target");
1380}
1381
1383{
1384 StructRNA *srna;
1385 PropertyRNA *prop;
1386 FunctionRNA *func;
1387
1388 static const EnumPropertyItem paint_type_items[] = {
1390 "MATERIAL",
1391 0,
1392 "Material",
1393 "Detect image slots from the material"},
1395 "IMAGE",
1396 0,
1397 "Single Image",
1398 "Set image for texture painting directly"},
1399 {0, nullptr, 0, nullptr, nullptr},
1400 };
1401
1402 static const EnumPropertyItem paint_interp_items[] = {
1403 {IMAGEPAINT_INTERP_LINEAR, "LINEAR", 0, "Linear", "Linear interpolation"},
1405 "CLOSEST",
1406 0,
1407 "Closest",
1408 "No interpolation (sample closest texel)"},
1409 {0, nullptr, 0, nullptr, nullptr},
1410 };
1411
1412 srna = RNA_def_struct(brna, "ImagePaint", "Paint");
1413 RNA_def_struct_sdna(srna, "ImagePaintSettings");
1414 RNA_def_struct_path_func(srna, "rna_ImagePaintSettings_path");
1415 RNA_def_struct_ui_text(srna, "Image Paint", "Properties of image and texture painting mode");
1417
1418 /* functions */
1419 func = RNA_def_function(srna, "detect_data", "rna_ImaPaint_detect_data");
1420 RNA_def_function_ui_description(func, "Check if required texpaint data exist");
1421
1422 /* return type */
1423 RNA_def_function_return(func, RNA_def_boolean(func, "ok", true, "", ""));
1424
1425 /* booleans */
1426 prop = RNA_def_property(srna, "use_occlude", PROP_BOOLEAN, PROP_NONE);
1429 prop, "Occlude", "Only paint onto the faces directly under the brush (slower)");
1431
1432 prop = RNA_def_property(srna, "use_backface_culling", PROP_BOOLEAN, PROP_NONE);
1434 RNA_def_property_ui_text(prop, "Cull", "Ignore faces pointing away from the view (faster)");
1436
1437 prop = RNA_def_property(srna, "use_normal_falloff", PROP_BOOLEAN, PROP_NONE);
1439 RNA_def_property_ui_text(prop, "Normal", "Paint most on faces pointing towards the view");
1441
1442 prop = RNA_def_property(srna, "use_stencil_layer", PROP_BOOLEAN, PROP_NONE);
1444 RNA_def_property_ui_text(prop, "Stencil Layer", "Set the mask layer from the UV map buttons");
1445 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_viewport_update");
1446
1447 prop = RNA_def_property(srna, "invert_stencil", PROP_BOOLEAN, PROP_NONE);
1449 RNA_def_property_ui_text(prop, "Invert", "Invert the stencil layer");
1450 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_viewport_update");
1451
1452 prop = RNA_def_property(srna, "stencil_image", PROP_POINTER, PROP_NONE);
1453 RNA_def_property_pointer_sdna(prop, nullptr, "stencil");
1455 RNA_def_property_ui_text(prop, "Stencil Image", "Image used as stencil");
1456 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_stencil_update");
1457 RNA_def_property_pointer_funcs(prop, nullptr, nullptr, nullptr, "rna_ImaPaint_imagetype_poll");
1458
1459 prop = RNA_def_property(srna, "canvas", PROP_POINTER, PROP_NONE);
1461 RNA_def_property_ui_text(prop, "Canvas", "Image used as canvas");
1462 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_canvas_update");
1463 RNA_def_property_pointer_funcs(prop, nullptr, nullptr, nullptr, "rna_ImaPaint_imagetype_poll");
1464
1465 prop = RNA_def_property(srna, "clone_image", PROP_POINTER, PROP_NONE);
1466 RNA_def_property_pointer_sdna(prop, nullptr, "clone");
1468 RNA_def_property_ui_text(prop, "Clone Image", "Image used as clone source");
1470 RNA_def_property_pointer_funcs(prop, nullptr, nullptr, nullptr, "rna_ImaPaint_imagetype_poll");
1471
1472 prop = RNA_def_property(srna, "stencil_color", PROP_FLOAT, PROP_COLOR_GAMMA);
1473 RNA_def_property_range(prop, 0.0, 1.0);
1474 RNA_def_property_float_sdna(prop, nullptr, "stencil_col");
1475 RNA_def_property_ui_text(prop, "Stencil Color", "Stencil color in the viewport");
1476 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_viewport_update");
1477
1478 prop = RNA_def_property(srna, "dither", PROP_FLOAT, PROP_NONE);
1479 RNA_def_property_range(prop, 0.0, 2.0);
1480 RNA_def_property_ui_text(prop, "Dither", "Amount of dithering when painting on byte images");
1482
1483 prop = RNA_def_property(srna, "use_clone_layer", PROP_BOOLEAN, PROP_NONE);
1486 prop,
1487 "Clone Map",
1488 "Use another UV map as clone source, otherwise use the 3D cursor as the source");
1489 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_viewport_update");
1490
1491 /* integers */
1492
1493 prop = RNA_def_property(srna, "seam_bleed", PROP_INT, PROP_PIXEL);
1494 RNA_def_property_ui_range(prop, 0, 8, 1, -1);
1496 prop, "Bleed", "Extend paint beyond the faces' UVs to reduce seams (in pixels, slower)");
1497
1498 prop = RNA_def_property(srna, "normal_angle", PROP_INT, PROP_UNSIGNED);
1499 RNA_def_property_range(prop, 0, 90);
1501 prop, "Angle", "Paint most on faces pointing towards the view according to this angle");
1502
1503 prop = RNA_def_int_array(srna,
1504 "screen_grab_size",
1505 2,
1506 nullptr,
1507 0,
1508 0,
1509 "Screen Grab Size",
1510 "Size to capture the image for re-projecting",
1511 0,
1512 0);
1513 RNA_def_property_range(prop, 512, 16384);
1515
1516 prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
1518 RNA_def_property_enum_items(prop, paint_type_items);
1519 RNA_def_property_ui_text(prop, "Mode", "Mode of operation for projection painting");
1520 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_mode_update");
1521
1522 prop = RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE);
1523 RNA_def_property_enum_sdna(prop, nullptr, "interp");
1525 RNA_def_property_enum_items(prop, paint_interp_items);
1526 RNA_def_property_ui_text(prop, "Interpolation", "Texture filtering type");
1527 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_mode_update");
1528
1529 /* Missing data */
1530 prop = RNA_def_property(srna, "missing_uvs", PROP_BOOLEAN, PROP_NONE);
1531 RNA_def_property_boolean_sdna(prop, nullptr, "missing_data", IMAGEPAINT_MISSING_UVS);
1532 RNA_def_property_ui_text(prop, "Missing UVs", "A UV layer is missing on the mesh");
1534
1535 prop = RNA_def_property(srna, "missing_materials", PROP_BOOLEAN, PROP_NONE);
1536 RNA_def_property_boolean_sdna(prop, nullptr, "missing_data", IMAGEPAINT_MISSING_MATERIAL);
1537 RNA_def_property_ui_text(prop, "Missing Materials", "The mesh is missing materials");
1539
1540 prop = RNA_def_property(srna, "missing_stencil", PROP_BOOLEAN, PROP_NONE);
1541 RNA_def_property_boolean_sdna(prop, nullptr, "missing_data", IMAGEPAINT_MISSING_STENCIL);
1542 RNA_def_property_ui_text(prop, "Missing Stencil", "Image Painting does not have a stencil");
1544
1545 prop = RNA_def_property(srna, "missing_texture", PROP_BOOLEAN, PROP_NONE);
1546 RNA_def_property_boolean_sdna(prop, nullptr, "missing_data", IMAGEPAINT_MISSING_TEX);
1548 prop, "Missing Texture", "Image Painting does not have a texture to paint on");
1550
1551 prop = RNA_def_property(srna, "clone_alpha", PROP_FLOAT, PROP_FACTOR);
1552 RNA_def_property_float_sdna(prop, nullptr, "clone_alpha");
1553 RNA_def_property_range(prop, 0.0f, 1.0f);
1554 RNA_def_property_ui_text(prop, "Clone Alpha", "Opacity of clone image display");
1556
1557 prop = RNA_def_property(srna, "clone_offset", PROP_FLOAT, PROP_XYZ);
1558 RNA_def_property_float_sdna(prop, nullptr, "clone_offset");
1559 RNA_def_property_ui_text(prop, "Clone Offset", "");
1560 RNA_def_property_ui_range(prop, -1.0f, 1.0f, 10.0f, 3);
1562}
1563
1565{
1566 StructRNA *srna;
1567 PropertyRNA *prop;
1568
1569 static const EnumPropertyItem select_mode_items[] = {
1570 {SCE_SELECT_PATH, "PATH", ICON_PARTICLE_PATH, "Path", "Path edit mode"},
1571 {SCE_SELECT_POINT, "POINT", ICON_PARTICLE_POINT, "Point", "Point select mode"},
1572 {SCE_SELECT_END, "TIP", ICON_PARTICLE_TIP, "Tip", "Tip select mode"},
1573 {0, nullptr, 0, nullptr, nullptr},
1574 };
1575
1576 static const EnumPropertyItem puff_mode[] = {
1577 {0, "ADD", 0, "Add", "Make hairs more puffy"},
1578 {1, "SUB", 0, "Sub", "Make hairs less puffy"},
1579 {0, nullptr, 0, nullptr, nullptr},
1580 };
1581
1582 static const EnumPropertyItem length_mode[] = {
1583 {0, "GROW", 0, "Grow", "Make hairs longer"},
1584 {1, "SHRINK", 0, "Shrink", "Make hairs shorter"},
1585 {0, nullptr, 0, nullptr, nullptr},
1586 };
1587
1588 static const EnumPropertyItem edit_type_items[] = {
1589 {PE_TYPE_PARTICLES, "PARTICLES", 0, "Particles", ""},
1590 {PE_TYPE_SOFTBODY, "SOFT_BODY", 0, "Soft Body", ""},
1591 {PE_TYPE_CLOTH, "CLOTH", 0, "Cloth", ""},
1592 {0, nullptr, 0, nullptr, nullptr},
1593 };
1594
1595 /* edit */
1596
1597 srna = RNA_def_struct(brna, "ParticleEdit", nullptr);
1598 RNA_def_struct_sdna(srna, "ParticleEditSettings");
1599 RNA_def_struct_path_func(srna, "rna_ParticleEdit_path");
1600 RNA_def_struct_ui_text(srna, "Particle Edit", "Properties of particle editing mode");
1602
1603 prop = RNA_def_property(srna, "tool", PROP_ENUM, PROP_NONE);
1604 RNA_def_property_enum_sdna(prop, nullptr, "brushtype");
1607 prop, nullptr, "rna_ParticleEdit_tool_set", "rna_ParticleEdit_tool_itemf");
1609 RNA_def_property_ui_text(prop, "Tool", "");
1610
1611 prop = RNA_def_property(srna, "select_mode", PROP_ENUM, PROP_NONE);
1612 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "selectmode");
1613 RNA_def_property_enum_items(prop, select_mode_items);
1614 RNA_def_property_ui_text(prop, "Selection Mode", "Particle select and display mode");
1616 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ParticleEdit_update");
1617
1618 prop = RNA_def_property(srna, "use_preserve_length", PROP_BOOLEAN, PROP_NONE);
1619 RNA_def_property_boolean_sdna(prop, nullptr, "flag", PE_KEEP_LENGTHS);
1620 RNA_def_property_ui_text(prop, "Keep Lengths", "Keep path lengths constant");
1621
1622 prop = RNA_def_property(srna, "use_preserve_root", PROP_BOOLEAN, PROP_NONE);
1623 RNA_def_property_boolean_sdna(prop, nullptr, "flag", PE_LOCK_FIRST);
1624 RNA_def_property_ui_text(prop, "Keep Root", "Keep root keys unmodified");
1625
1626 prop = RNA_def_property(srna, "use_emitter_deflect", PROP_BOOLEAN, PROP_NONE);
1627 RNA_def_property_boolean_sdna(prop, nullptr, "flag", PE_DEFLECT_EMITTER);
1628 RNA_def_property_ui_text(prop, "Deflect Emitter", "Keep paths from intersecting the emitter");
1629
1630 prop = RNA_def_property(srna, "emitter_distance", PROP_FLOAT, PROP_DISTANCE);
1631 RNA_def_property_float_sdna(prop, nullptr, "emitterdist");
1632 RNA_def_property_ui_range(prop, 0.0f, 10.0f, 10, 3);
1634 prop, "Emitter Distance", "Distance to keep particles away from the emitter");
1635
1636 prop = RNA_def_property(srna, "use_fade_time", PROP_BOOLEAN, PROP_NONE);
1637 RNA_def_property_boolean_sdna(prop, nullptr, "flag", PE_FADE_TIME);
1639 prop, "Fade Time", "Fade paths and keys further away from current frame");
1641 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ParticleEdit_update");
1642
1643 prop = RNA_def_property(srna, "use_auto_velocity", PROP_BOOLEAN, PROP_NONE);
1644 RNA_def_property_boolean_sdna(prop, nullptr, "flag", PE_AUTO_VELOCITY);
1645 RNA_def_property_ui_text(prop, "Auto Velocity", "Calculate point velocities automatically");
1646
1647 prop = RNA_def_property(srna, "show_particles", PROP_BOOLEAN, PROP_NONE);
1649 RNA_def_property_boolean_sdna(prop, nullptr, "flag", PE_DRAW_PART);
1650 RNA_def_property_ui_text(prop, "Display Particles", "Display actual particles");
1651 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ParticleEdit_redo");
1652
1653 prop = RNA_def_property(srna, "use_default_interpolate", PROP_BOOLEAN, PROP_NONE);
1656 prop, "Interpolate", "Interpolate new particles from the existing ones");
1658
1659 prop = RNA_def_property(srna, "default_key_count", PROP_INT, PROP_NONE);
1660 RNA_def_property_int_sdna(prop, nullptr, "totaddkey");
1661 RNA_def_property_range(prop, 2, SHRT_MAX);
1662 RNA_def_property_ui_range(prop, 2, 20, 10, 3);
1663 RNA_def_property_ui_text(prop, "Keys", "How many keys to make new particles with");
1664
1665 prop = RNA_def_property(srna, "brush", PROP_POINTER, PROP_NONE);
1666 RNA_def_property_struct_type(prop, "ParticleBrush");
1667 RNA_def_property_pointer_funcs(prop, "rna_ParticleEdit_brush_get", nullptr, nullptr, nullptr);
1668 RNA_def_property_ui_text(prop, "Brush", "");
1669
1670 prop = RNA_def_property(srna, "display_step", PROP_INT, PROP_NONE);
1671 RNA_def_property_int_sdna(prop, nullptr, "draw_step");
1673 RNA_def_property_range(prop, 1, 10);
1674 RNA_def_property_ui_text(prop, "Steps", "How many steps to display the path with");
1675 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ParticleEdit_redo");
1676
1677 prop = RNA_def_property(srna, "fade_frames", PROP_INT, PROP_NONE);
1678 RNA_def_property_range(prop, 1, 100);
1679 RNA_def_property_ui_text(prop, "Frames", "How many frames to fade");
1681 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ParticleEdit_update");
1682
1683 prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
1685 RNA_def_property_enum_sdna(prop, nullptr, "edittype");
1686 RNA_def_property_enum_items(prop, edit_type_items);
1687 RNA_def_property_ui_text(prop, "Type", "");
1688 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ParticleEdit_redo");
1689
1690 prop = RNA_def_property(srna, "is_editable", PROP_BOOLEAN, PROP_NONE);
1691 RNA_def_property_boolean_funcs(prop, "rna_ParticleEdit_editable_get", nullptr);
1693 RNA_def_property_ui_text(prop, "Editable", "A valid edit mode exists");
1694
1695 prop = RNA_def_property(srna, "is_hair", PROP_BOOLEAN, PROP_NONE);
1696 RNA_def_property_boolean_funcs(prop, "rna_ParticleEdit_hair_get", nullptr);
1698 RNA_def_property_ui_text(prop, "Hair", "Editing hair");
1699
1700 prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
1702 RNA_def_property_ui_text(prop, "Object", "The edited object");
1703
1704 prop = RNA_def_property(srna, "shape_object", PROP_POINTER, PROP_NONE);
1706 RNA_def_property_ui_text(prop, "Shape Object", "Outer shape to use for tools");
1707 RNA_def_property_pointer_funcs(prop, nullptr, nullptr, nullptr, "rna_Mesh_object_poll");
1708 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ParticleEdit_redo");
1709
1710 /* brush */
1711
1712 srna = RNA_def_struct(brna, "ParticleBrush", nullptr);
1713 RNA_def_struct_sdna(srna, "ParticleBrushData");
1714 RNA_def_struct_path_func(srna, "rna_ParticleBrush_path");
1715 RNA_def_struct_ui_text(srna, "Particle Brush", "Particle editing brush");
1716
1717 prop = RNA_def_property(srna, "size", PROP_INT, PROP_PIXEL);
1718 RNA_def_property_range(prop, 1, SHRT_MAX);
1720 RNA_def_property_ui_text(prop, "Radius", "Radius of the brush in pixels");
1721
1722 prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_FACTOR);
1723 RNA_def_property_range(prop, 0.001, 1.0);
1724 RNA_def_property_ui_text(prop, "Strength", "Brush strength");
1726
1727 prop = RNA_def_property(srna, "count", PROP_INT, PROP_NONE);
1728 RNA_def_property_range(prop, 1, 1000);
1729 RNA_def_property_ui_range(prop, 1, 100, 10, 3);
1730 RNA_def_property_ui_text(prop, "Count", "Particle count");
1731
1732 prop = RNA_def_property(srna, "steps", PROP_INT, PROP_NONE);
1733 RNA_def_property_int_sdna(prop, nullptr, "step");
1734 RNA_def_property_range(prop, 1, SHRT_MAX);
1735 RNA_def_property_ui_range(prop, 1, 50, 10, 3);
1736 RNA_def_property_ui_text(prop, "Steps", "Brush steps");
1737
1738 prop = RNA_def_property(srna, "puff_mode", PROP_ENUM, PROP_NONE);
1739 RNA_def_property_enum_sdna(prop, nullptr, "invert");
1740 RNA_def_property_enum_items(prop, puff_mode);
1741 RNA_def_property_ui_text(prop, "Puff Mode", "");
1742
1743 prop = RNA_def_property(srna, "use_puff_volume", PROP_BOOLEAN, PROP_NONE);
1746 prop,
1747 "Puff Volume",
1748 "Apply puff to unselected end-points (helps maintain hair volume when puffing root)");
1749
1750 prop = RNA_def_property(srna, "length_mode", PROP_ENUM, PROP_NONE);
1751 RNA_def_property_enum_sdna(prop, nullptr, "invert");
1752 RNA_def_property_enum_items(prop, length_mode);
1753 RNA_def_property_ui_text(prop, "Length Mode", "");
1754
1755 /* dummy */
1756 prop = RNA_def_property(srna, "curve", PROP_POINTER, PROP_NONE);
1757 RNA_def_property_struct_type(prop, "CurveMapping");
1758 RNA_def_property_pointer_funcs(prop, "rna_ParticleBrush_curve_get", nullptr, nullptr, nullptr);
1759 RNA_def_property_ui_text(prop, "Curve", "");
1760}
1761
1762/* srna -- gpencil speed guides */
1764{
1765 StructRNA *srna;
1766 PropertyRNA *prop;
1767
1768 srna = RNA_def_struct(brna, "GPencilSculptGuide", nullptr);
1769 RNA_def_struct_sdna(srna, "GP_Sculpt_Guide");
1770 RNA_def_struct_path_func(srna, "rna_GPencilSculptGuide_path");
1771 RNA_def_struct_ui_text(srna, "Grease Pencil Sculpt Guide", "Guides for drawing");
1772
1773 static const EnumPropertyItem prop_gpencil_guidetypes[] = {
1774 {GP_GUIDE_CIRCULAR, "CIRCULAR", 0, "Circular", "Use single point to create rings"},
1775 {GP_GUIDE_RADIAL, "RADIAL", 0, "Radial", "Use single point as direction"},
1776 {GP_GUIDE_PARALLEL, "PARALLEL", 0, "Parallel", "Parallel lines"},
1777 {GP_GUIDE_GRID, "GRID", 0, "Grid", "Grid allows horizontal and vertical lines"},
1778 {GP_GUIDE_ISO, "ISO", 0, "Isometric", "Grid allows isometric and vertical lines"},
1779 {0, nullptr, 0, nullptr, nullptr},
1780 };
1781
1782 static const EnumPropertyItem prop_gpencil_guide_references[] = {
1783 {GP_GUIDE_REF_CURSOR, "CURSOR", 0, "Cursor", "Use cursor as reference point"},
1784 {GP_GUIDE_REF_CUSTOM, "CUSTOM", 0, "Custom", "Use custom reference point"},
1785 {GP_GUIDE_REF_OBJECT, "OBJECT", 0, "Object", "Use object as reference point"},
1786 {0, nullptr, 0, nullptr, nullptr},
1787 };
1788
1789 prop = RNA_def_property(srna, "use_guide", PROP_BOOLEAN, PROP_NONE);
1790 RNA_def_property_boolean_sdna(prop, nullptr, "use_guide", false);
1792 RNA_def_property_ui_text(prop, "Use Guides", "Enable speed guides");
1795
1796 prop = RNA_def_property(srna, "use_snapping", PROP_BOOLEAN, PROP_NONE);
1797 RNA_def_property_boolean_sdna(prop, nullptr, "use_snapping", false);
1800 prop, "Use Snapping", "Enable snapping to guides angle or spacing options");
1803
1804 prop = RNA_def_property(srna, "reference_object", PROP_POINTER, PROP_NONE);
1805 RNA_def_property_pointer_sdna(prop, nullptr, "reference_object");
1806 RNA_def_property_ui_text(prop, "Object", "Object used for reference point");
1808 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_viewport_update");
1809
1810 prop = RNA_def_property(srna, "reference_point", PROP_ENUM, PROP_NONE);
1811 RNA_def_property_enum_sdna(prop, nullptr, "reference_point");
1812 RNA_def_property_enum_items(prop, prop_gpencil_guide_references);
1813 RNA_def_property_ui_text(prop, "Type", "Type of speed guide");
1815 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_viewport_update");
1816
1817 prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
1818 RNA_def_property_enum_sdna(prop, nullptr, "type");
1819 RNA_def_property_enum_items(prop, prop_gpencil_guidetypes);
1820 RNA_def_property_ui_text(prop, "Type", "Type of speed guide");
1823
1824 prop = RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE);
1825 RNA_def_property_float_sdna(prop, nullptr, "angle");
1826 RNA_def_property_range(prop, -(M_PI * 2.0f), (M_PI * 2.0f));
1827 RNA_def_property_ui_text(prop, "Angle", "Direction of lines");
1830
1831 prop = RNA_def_property(srna, "angle_snap", PROP_FLOAT, PROP_ANGLE);
1832 RNA_def_property_float_sdna(prop, nullptr, "angle_snap");
1833 RNA_def_property_range(prop, -(M_PI * 2.0f), (M_PI * 2.0f));
1834 RNA_def_property_ui_text(prop, "Angle Snap", "Angle snapping");
1837
1838 prop = RNA_def_property(srna, "spacing", PROP_FLOAT, PROP_DISTANCE);
1839 RNA_def_property_float_sdna(prop, nullptr, "spacing");
1840 RNA_def_property_range(prop, 0.0f, FLT_MAX);
1841 RNA_def_property_ui_range(prop, 0.0f, FLT_MAX, 1, 3);
1842 RNA_def_property_ui_text(prop, "Spacing", "Guide spacing");
1845
1846 prop = RNA_def_property(srna, "location", PROP_FLOAT, PROP_DISTANCE);
1847 RNA_def_property_float_sdna(prop, nullptr, "location");
1848 RNA_def_property_array(prop, 3);
1850 RNA_def_property_ui_text(prop, "Location", "Custom reference point for guides");
1853 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_viewport_update");
1854}
1855
1857{
1858 StructRNA *srna;
1859 PropertyRNA *prop;
1860
1861 /* == Settings == */
1862 srna = RNA_def_struct(brna, "GPencilSculptSettings", nullptr);
1863 RNA_def_struct_sdna(srna, "GP_Sculpt_Settings");
1864 RNA_def_struct_path_func(srna, "rna_GPencilSculptSettings_path");
1866 "GPencil Sculpt Settings",
1867 "General properties for Grease Pencil stroke sculpting tools");
1869
1870 prop = RNA_def_property(srna, "guide", PROP_POINTER, PROP_NONE);
1871 RNA_def_property_struct_type(prop, "GPencilSculptGuide");
1873 RNA_def_property_ui_text(prop, "Guide", "");
1874
1875 prop = RNA_def_property(srna, "use_multiframe_falloff", PROP_BOOLEAN, PROP_NONE);
1878 prop,
1879 "Use Falloff",
1880 "Use falloff effect when edit in multiframe mode to compute brush effect by frame");
1883
1884 prop = RNA_def_property(srna, "use_thickness_curve", PROP_BOOLEAN, PROP_NONE);
1886 RNA_def_property_ui_text(prop, "Use Curve", "Use curve to define primitive stroke thickness");
1889
1890 prop = RNA_def_property(srna, "use_scale_thickness", PROP_BOOLEAN, PROP_NONE);
1893 prop, "Scale Stroke Thickness", "Scale the stroke thickness when transforming strokes");
1896
1897 prop = RNA_def_property(srna, "use_automasking_stroke", PROP_BOOLEAN, PROP_NONE);
1899 RNA_def_property_ui_text(prop, "Auto-Masking Strokes", "Affect only strokes below the cursor");
1902
1903 prop = RNA_def_property(srna, "use_automasking_layer_stroke", PROP_BOOLEAN, PROP_NONE);
1905 RNA_def_property_ui_text(prop, "Auto-Masking Layer", "Affect only strokes below the cursor");
1908
1909 prop = RNA_def_property(srna, "use_automasking_material_stroke", PROP_BOOLEAN, PROP_NONE);
1911 prop, nullptr, "flag", GP_SCULPT_SETT_FLAG_AUTOMASK_MATERIAL_STROKE);
1912 RNA_def_property_ui_text(prop, "Auto-Masking Material", "Affect only strokes below the cursor");
1915
1916 prop = RNA_def_property(srna, "use_automasking_layer_active", PROP_BOOLEAN, PROP_NONE);
1918 RNA_def_property_ui_text(prop, "Auto-Masking Layer", "Affect only the Active Layer");
1921
1922 prop = RNA_def_property(srna, "use_automasking_material_active", PROP_BOOLEAN, PROP_NONE);
1924 prop, nullptr, "flag", GP_SCULPT_SETT_FLAG_AUTOMASK_MATERIAL_ACTIVE);
1925 RNA_def_property_ui_text(prop, "Auto-Masking Material", "Affect only the Active Material");
1928
1929 /* custom falloff curve */
1930 prop = RNA_def_property(srna, "multiframe_falloff_curve", PROP_POINTER, PROP_NONE);
1931 RNA_def_property_pointer_sdna(prop, nullptr, "cur_falloff");
1932 RNA_def_property_struct_type(prop, "CurveMapping");
1934 prop, "Curve", "Custom curve to control falloff of brush effect by Grease Pencil frames");
1937
1938 /* custom primitive curve */
1939 prop = RNA_def_property(srna, "thickness_primitive_curve", PROP_POINTER, PROP_NONE);
1940 RNA_def_property_pointer_sdna(prop, nullptr, "cur_primitive");
1941 RNA_def_property_struct_type(prop, "CurveMapping");
1942 RNA_def_property_ui_text(prop, "Curve", "Custom curve to control primitive thickness");
1945
1946 /* lock axis */
1947 prop = RNA_def_property(srna, "lock_axis", PROP_ENUM, PROP_NONE);
1948 RNA_def_property_enum_sdna(prop, nullptr, "lock_axis");
1950 RNA_def_property_ui_text(prop, "Lock Axis", "");
1952 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, nullptr);
1953
1954 /* threshold for cutter */
1955 prop = RNA_def_property(srna, "intersection_threshold", PROP_FLOAT, PROP_NONE);
1956 RNA_def_property_float_sdna(prop, nullptr, "isect_threshold");
1957 RNA_def_property_range(prop, 0.0f, 10.0f);
1959 RNA_def_property_ui_text(prop, "Threshold", "Threshold for stroke intersections");
1961}
1962
1964{
1965 StructRNA *srna;
1966
1967 srna = RNA_def_struct(brna, "CurvesSculpt", "Paint");
1968 RNA_def_struct_path_func(srna, "rna_CurvesSculpt_path");
1969 RNA_def_struct_ui_text(srna, "Curves Sculpt Paint", "");
1971}
1972
1974{
1975 /* *** Non-Animated *** */
1977 rna_def_paint_curve(brna);
1978 rna_def_paint(brna);
1980 rna_def_sculpt(brna);
1981 rna_def_uv_sculpt(brna);
1982 rna_def_gp_paint(brna);
1987 rna_def_paint_mode(brna);
1988 rna_def_image_paint(brna);
1994}
1995
1996#endif
void BKE_brush_scale_unprojected_size(float *unprojected_size, int new_brush_size, int old_brush_size)
Definition brush.cc:1320
void BKE_brush_color_sync_legacy(Brush *brush)
Definition brush.cc:1227
void BKE_brush_scale_size(int *r_brush_size, float new_unprojected_size, float old_unprojected_size)
Definition brush.cc:1332
CurveMapping * BKE_curvemapping_add(int tot, float minx, float miny, float maxx, float maxy)
Definition colortools.cc:89
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(Scene *scene, Object *ob)
General operations, lookup, etc. for blender objects.
Brush * BKE_paint_eraser_brush(Paint *paint)
Definition paint.cc:1172
Paint * BKE_paint_get_active(Scene *sce, ViewLayer *view_layer)
Definition paint.cc:437
bool BKE_paint_eraser_brush_set(Paint *paint, Brush *brush)
Definition paint.cc:1182
Brush * BKE_paint_brush(Paint *paint)
Definition paint.cc:645
void BKE_paint_invalidate_overlay_all()
Definition paint.cc:292
struct ParticleSystem * psys_get_current(struct Object *ob)
Definition particle.cc:538
void psys_free_path_cache(struct ParticleSystem *psys, struct PTCacheEdit *edit)
Definition particle.cc:907
void BKE_particle_batch_cache_dirty_tag(struct ParticleSystem *psys, int mode)
Definition particle.cc:5288
@ BKE_PARTICLE_BATCH_DIRTY_ALL
#define M_PI
#define ELEM(...)
#define BLT_I18NCONTEXT_AMOUNT
#define BLT_I18NCONTEXT_ID_CURVE_LEGACY
#define BLT_I18NCONTEXT_OPERATOR_DEFAULT
void DEG_id_tag_update(ID *id, unsigned int flags)
@ ID_RECALC_SYNC_TO_EVAL
Definition DNA_ID.h:1118
@ ID_RECALC_GEOMETRY
Definition DNA_ID.h:1074
@ BRUSH_CURVE_CUSTOM
@ BRUSH_AUTOMASKING_BRUSH_NORMAL
@ BRUSH_AUTOMASKING_CAVITY_NORMAL
@ BRUSH_AUTOMASKING_VIEW_OCCLUSION
@ BRUSH_AUTOMASKING_VIEW_NORMAL
@ BRUSH_AUTOMASKING_CAVITY_INVERTED
@ BRUSH_COLOR_JITTER_USE_VAL_AT_STROKE
@ BRUSH_COLOR_JITTER_USE_HUE_AT_STROKE
@ BRUSH_COLOR_JITTER_USE_SAT_AT_STROKE
@ BRUSH_COLOR_JITTER_USE_SAT_RAND_PRESS
@ BRUSH_COLOR_JITTER_USE_VAL_RAND_PRESS
@ BRUSH_COLOR_JITTER_USE_HUE_RAND_PRESS
#define MAX_BRUSH_PIXEL_RADIUS
#define MAX_BRUSH_PIXEL_DIAMETER
#define AUTOMASKING_BOUNDARY_EDGES_MAX_PROPAGATION_STEPS
@ IMA_TYPE_R_RESULT
@ IMA_TYPE_COMPOSITE
@ OB_MESH
@ PSYS_GLOBAL_HAIR
@ PAINT_CURVE_SHOW_SIZE
@ PAINT_CURVE_SHOW_STRENGTH
@ PAINT_CURVE_SHOW_JITTER
@ UNIFIED_PAINT_COLOR_JITTER
@ UNIFIED_PAINT_WEIGHT
@ UNIFIED_PAINT_SIZE
@ UNIFIED_PAINT_BRUSH_LOCK_SIZE
@ UNIFIED_PAINT_ALPHA
@ UNIFIED_PAINT_COLOR
@ UNIFIED_PAINT_INPUT_SAMPLES
@ 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
@ PE_DRAW_PART
@ PE_LOCK_FIRST
@ PE_FADE_TIME
@ PE_INTERPOLATE_ADDED
@ PE_DEFLECT_EMITTER
@ PE_KEEP_LENGTHS
@ PE_AUTO_VELOCITY
@ GP_GUIDE_REF_OBJECT
@ GP_GUIDE_REF_CUSTOM
@ GP_GUIDE_REF_CURSOR
@ GPPAINT_FLAG_USE_VERTEXCOLOR
@ GPPAINT_FLAG_USE_MATERIAL
@ 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
#define IMAGEPAINT_MODE_IMAGE
@ GP_LOCKAXIS_X
@ GP_LOCKAXIS_VIEW
@ GP_LOCKAXIS_Y
@ GP_LOCKAXIS_Z
@ GP_LOCKAXIS_CURSOR
@ IMAGEPAINT_PROJECT_LAYER_STENCIL_INV
@ IMAGEPAINT_PROJECT_BACKFACE
@ IMAGEPAINT_PROJECT_XRAY
@ IMAGEPAINT_PROJECT_LAYER_STENCIL
@ IMAGEPAINT_PROJECT_LAYER_CLONE
@ IMAGEPAINT_PROJECT_FLAT
#define IMAGEPAINT_MODE_MATERIAL
@ PE_BRUSH_DATA_PUFF_VOLUME
@ PAINT_USE_CAVITY_MASK
@ PAINT_SCULPT_DELAY_UPDATES
@ PAINT_SHOW_BRUSH
@ PAINT_SHOW_BRUSH_ON_SURFACE
@ PAINT_FAST_NAVIGATE
@ VP_FLAG_VGROUP_RESTRICT
#define PAINT_MAX_INPUT_SAMPLES
@ 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_TYPE_CLOTH
@ PE_TYPE_PARTICLES
@ PE_TYPE_SOFTBODY
@ SCE_SELECT_PATH
@ SCE_SELECT_POINT
@ SCE_SELECT_END
@ 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
@ IMAGEPAINT_INTERP_LINEAR
@ IMAGEPAINT_INTERP_CLOSEST
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:215
@ STRUCT_UNDO
Definition RNA_types.hh:961
@ PROP_FLOAT
Definition RNA_types.hh:164
@ PROP_BOOLEAN
Definition RNA_types.hh:162
@ PROP_ENUM
Definition RNA_types.hh:166
@ PROP_INT
Definition RNA_types.hh:163
@ PROP_POINTER
Definition RNA_types.hh:167
@ PROP_CONTEXT_UPDATE
Definition RNA_types.hh:407
@ PROP_ANIMATABLE
Definition RNA_types.hh:319
@ PROP_NEVER_UNLINK
Definition RNA_types.hh:384
@ PROP_EDITABLE
Definition RNA_types.hh:306
@ PROP_NEVER_NULL
Definition RNA_types.hh:377
@ PROP_ID_SELF_CHECK
Definition RNA_types.hh:370
@ PROP_ID_REFCOUNT
Definition RNA_types.hh:364
@ PROP_XYZ
Definition RNA_types.hh:269
@ PROP_DISTANCE
Definition RNA_types.hh:256
@ PROP_COLOR
Definition RNA_types.hh:260
@ PROP_PIXEL
Definition RNA_types.hh:248
@ PROP_ANGLE
Definition RNA_types.hh:252
@ PROP_PIXEL_DIAMETER
Definition RNA_types.hh:293
@ PROP_NONE
Definition RNA_types.hh:233
@ PROP_PERCENTAGE
Definition RNA_types.hh:250
@ PROP_FACTOR
Definition RNA_types.hh:251
@ PROP_COLOR_GAMMA
Definition RNA_types.hh:272
@ PROP_XYZ_LENGTH
Definition RNA_types.hh:270
@ PROP_UNSIGNED
Definition RNA_types.hh:249
@ PROP_DISTANCE_DIAMETER
Definition RNA_types.hh:294
#define C
Definition RandGen.cpp:29
#define NC_GEOM
Definition WM_types.hh:393
#define ND_DRAW
Definition WM_types.hh:461
#define NC_BRUSH
Definition WM_types.hh:385
#define ND_DATA
Definition WM_types.hh:509
#define NC_SCENE
Definition WM_types.hh:378
#define ND_TOOLSETTINGS
Definition WM_types.hh:449
#define ND_MODIFIER
Definition WM_types.hh:462
#define NA_EDITED
Definition WM_types.hh:584
#define ND_PARTICLE
Definition WM_types.hh:465
#define NC_GPENCIL
Definition WM_types.hh:399
#define NC_OBJECT
Definition WM_types.hh:379
#define NA_SELECTED
Definition WM_types.hh:589
@ BMO_SYMMETRIZE_NEGATIVE_X
@ BMO_SYMMETRIZE_NEGATIVE_Y
@ BMO_SYMMETRIZE_POSITIVE_Z
@ BMO_SYMMETRIZE_NEGATIVE_Z
@ BMO_SYMMETRIZE_POSITIVE_Y
@ BMO_SYMMETRIZE_POSITIVE_X
BPy_StructRNA * depsgraph
long long int int64_t
const PointerRNA PointerRNA_NULL
PointerRNA RNA_pointer_create_with_parent(const PointerRNA &parent, StructRNA *type, void *data)
PointerRNA RNA_id_pointer_create(ID *id)
const EnumPropertyItem rna_enum_brush_automasking_flag_items[]
Definition rna_brush.cc:96
const EnumPropertyItem rna_enum_brush_curve_preset_items[]
Definition rna_brush.cc:80
void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
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_float_default(PropertyRNA *prop, float value)
void RNA_def_function_return(FunctionRNA *func, PropertyRNA *ret)
void RNA_def_property_float_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
void RNA_def_property_ui_icon(PropertyRNA *prop, int icon, int consecutive)
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
void RNA_def_property_boolean_default(PropertyRNA *prop, bool value)
void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const char *set)
void RNA_def_property_int_default(PropertyRNA *prop, int value)
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier, const char *call)
void RNA_def_struct_clear_flag(StructRNA *srna, int flag)
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_property_int_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
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_translation_context(PropertyRNA *prop, const char *context)
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_curve_visibility_flag(StructRNA *srna, const char *prop_name, const char *ui_name, const int64_t flag)
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_unified_paint_settings(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
short ob_mode
const char * identifier
Definition RNA_types.hh:657
const char * name
Definition RNA_types.hh:661
const char * description
Definition RNA_types.hh:663
struct Image * canvas
struct ParticleSystem * psys
struct UnifiedPaintSettings unified_paint_settings
PaintRuntimeHandle * runtime
ID * owner_id
Definition RNA_types.hh:51
void * data
Definition RNA_types.hh:53
struct ToolSettings * toolsettings
GpWeightPaint * gp_weightpaint
struct ImagePaintSettings imapaint
GpSculptPaint * gp_sculptpaint
CurvesSculpt * curves_sculpt
GpVertexPaint * gp_vertexpaint
struct CurveMapping * curve_distance_falloff
int8_t curve_distance_falloff_preset
void WM_main_add_notifier(uint type, void *reference)
PointerRNA * ptr
Definition wm_files.cc:4238
uint8_t flag
Definition wm_window.cc:145