Blender V5.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
8
9#include <cstdlib>
10
11#include "BLI_math_base_c.hh"
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
30namespace blender {
31
33 {PE_BRUSH_COMB, "COMB", 0, "Comb", "Comb hairs"},
34 {PE_BRUSH_SMOOTH, "SMOOTH", 0, "Smooth", "Smooth hairs"},
35 {PE_BRUSH_ADD, "ADD", 0, "Add", "Add hairs"},
36 {PE_BRUSH_LENGTH, "LENGTH", 0, "Length", "Make hairs longer or shorter"},
37 {PE_BRUSH_PUFF, "PUFF", 0, "Puff", "Make hairs stand up"},
38 {PE_BRUSH_CUT, "CUT", 0, "Cut", "Cut hairs"},
39 {PE_BRUSH_WEIGHT, "WEIGHT", 0, "Weight", "Weight hair particles"},
40 {0, nullptr, 0, nullptr, nullptr},
41};
42
43#ifndef RNA_RUNTIME
46 "VIEW",
47 ICON_RESTRICT_VIEW_ON,
48 "View",
49 "Align strokes to current view plane"},
51 "AXIS_Y",
52 ICON_AXIS_FRONT,
53 "Front (X-Z)",
54 "Project strokes to plane locked to Y"},
56 "AXIS_X",
57 ICON_AXIS_SIDE,
58 "Side (Y-Z)",
59 "Project strokes to plane locked to X"},
60 {GP_LOCKAXIS_Z, "AXIS_Z", ICON_AXIS_TOP, "Top (X-Y)", "Project strokes to plane locked to Z"},
62 "CURSOR",
63 ICON_PIVOT_CURSOR,
64 "Cursor",
65 "Align strokes to current 3D cursor orientation"},
66 {0, nullptr, 0, nullptr, nullptr},
67};
68
71 "MATERIAL",
72 0,
73 "Material",
74 "Paint using the active material base color"},
76 "VERTEXCOLOR",
77 0,
78 "Color Attribute",
79 "Paint the material with a color attribute"},
80 {0, nullptr, 0, nullptr, nullptr},
81};
82#endif
83
85 {PAINT_CANVAS_SOURCE_COLOR_ATTRIBUTE, "COLOR_ATTRIBUTE", 0, "Color Attribute", ""},
86 {PAINT_CANVAS_SOURCE_MATERIAL, "MATERIAL", 0, "Material", ""},
87 {PAINT_CANVAS_SOURCE_IMAGE, "IMAGE", 0, "Image", ""},
88 {0, nullptr, 0, nullptr, nullptr},
89};
90
92 {BMO_SYMMETRIZE_NEGATIVE_X, "NEGATIVE_X", 0, "-X to +X", ""},
93 {BMO_SYMMETRIZE_POSITIVE_X, "POSITIVE_X", 0, "+X to -X", ""},
94
95 {BMO_SYMMETRIZE_NEGATIVE_Y, "NEGATIVE_Y", 0, "-Y to +Y", ""},
96 {BMO_SYMMETRIZE_POSITIVE_Y, "POSITIVE_Y", 0, "+Y to -Y", ""},
97
98 {BMO_SYMMETRIZE_NEGATIVE_Z, "NEGATIVE_Z", 0, "-Z to +Z", ""},
99 {BMO_SYMMETRIZE_POSITIVE_Z, "POSITIVE_Z", 0, "+Z to -Z", ""},
100 {0, nullptr, 0, nullptr, nullptr},
101};
102
103} // namespace blender
104
105#ifdef RNA_RUNTIME
106# include "MEM_guardedalloc.h"
107
108# include "BKE_brush.hh"
109# include "BKE_collection.hh"
110# include "BKE_colortools.hh"
111# include "BKE_context.hh"
112# include "BKE_layer.hh"
113# include "BKE_material.hh"
114# include "BKE_object.hh"
115# include "BKE_paint.hh"
116# include "BKE_paint_types.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_image.hh"
124# include "ED_paint.hh"
125# include "ED_particle.hh"
126
127namespace blender {
128
129const EnumPropertyItem rna_enum_particle_edit_disconnected_hair_brush_items[] = {
130 {PE_BRUSH_COMB, "COMB", 0, "Comb", "Comb hairs"},
131 {PE_BRUSH_SMOOTH, "SMOOTH", 0, "Smooth", "Smooth hairs"},
132 {PE_BRUSH_LENGTH, "LENGTH", 0, "Length", "Make hairs longer or shorter"},
133 {PE_BRUSH_CUT, "CUT", 0, "Cut", "Cut hairs"},
134 {PE_BRUSH_WEIGHT, "WEIGHT", 0, "Weight", "Weight hair particles"},
135 {0, nullptr, 0, nullptr, nullptr},
136};
137
138static const EnumPropertyItem particle_edit_cache_brush_items[] = {
139 {PE_BRUSH_COMB, "COMB", 0, "Comb", "Comb paths"},
140 {PE_BRUSH_SMOOTH, "SMOOTH", 0, "Smooth", "Smooth paths"},
141 {PE_BRUSH_LENGTH, "LENGTH", 0, "Length", "Make paths longer or shorter"},
142 {0, nullptr, 0, nullptr, nullptr},
143};
144
145static PointerRNA rna_ParticleEdit_brush_get(PointerRNA *ptr)
146{
147 ParticleEditSettings *pset = static_cast<ParticleEditSettings *>(ptr->data);
148 ParticleBrushData *brush = nullptr;
149
150 brush = &pset->brush[pset->brushtype];
151
152 return RNA_pointer_create_with_parent(*ptr, RNA_ParticleBrush, brush);
153}
154
155static PointerRNA rna_ParticleBrush_curve_get(PointerRNA * /*ptr*/)
156{
157 return {};
158}
159
160static void rna_ParticleEdit_redo(bContext *C, PointerRNA * /*ptr*/)
161{
162 Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C);
163 const Main *bmain = CTX_data_main(C);
164 Scene *scene = CTX_data_scene(C);
165 ViewLayer *view_layer = CTX_data_view_layer(C);
166 BKE_view_layer_synced_ensure(*bmain, scene, view_layer);
168 PTCacheEdit *edit = PE_get_current(depsgraph, scene, ob);
169
170 if (!edit) {
171 return;
172 }
173
174 if (ob) {
176 }
177
178 if (edit->psys) {
180 psys_free_path_cache(edit->psys, edit);
181 }
183}
184
185static void rna_ParticleEdit_update(bContext *C, PointerRNA * /*ptr*/)
186{
187 const Main *bmain = CTX_data_main(C);
188 Scene *scene = CTX_data_scene(C);
189 ViewLayer *view_layer = CTX_data_view_layer(C);
190 BKE_view_layer_synced_ensure(*bmain, scene, view_layer);
192
193 if (ob) {
195 }
196
197 /* Sync tool setting changes from original to evaluated scenes. */
199}
200
201static void rna_ParticleEdit_tool_set(PointerRNA *ptr, int value)
202{
203 ParticleEditSettings *pset = static_cast<ParticleEditSettings *>(ptr->data);
204
205 /* redraw hair completely if weight brush is/was used */
206 if ((pset->brushtype == PE_BRUSH_WEIGHT || value == PE_BRUSH_WEIGHT) && pset->object) {
207 Object *ob = pset->object;
208 if (ob) {
211 }
212 }
213
214 pset->brushtype = value;
215}
216static const EnumPropertyItem *rna_ParticleEdit_tool_itemf(bContext *C,
217 PointerRNA * /*ptr*/,
218 PropertyRNA * /*prop*/,
219 bool * /*r_free*/)
220{
221 if (C) {
222 const Main *bmain = CTX_data_main(C);
223 const Scene *scene = CTX_data_scene(C);
224 ViewLayer *view_layer = CTX_data_view_layer(C);
225 BKE_view_layer_synced_ensure(*bmain, scene, view_layer);
227# if 0
228 Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C);
229 Scene *scene = CTX_data_scene(C);
230 PTCacheEdit *edit = PE_get_current(depsgraph, scene, ob);
231 ParticleSystem *psys = edit ? edit->psys : nullptr;
232# else
233 /* use this rather than PE_get_current() - because the editing cache is
234 * dependent on the cache being updated which can happen after this UI
235 * draws causing a glitch #28883. */
237# endif
238
239 if (psys) {
240 if (psys->flag & PSYS_GLOBAL_HAIR) {
241 return rna_enum_particle_edit_disconnected_hair_brush_items;
242 }
243 else {
245 }
246 }
247 }
248
249 return particle_edit_cache_brush_items;
250}
251
252static bool rna_ParticleEdit_editable_get(PointerRNA *ptr)
253{
254 ParticleEditSettings *pset = static_cast<ParticleEditSettings *>(ptr->data);
255
256 return (pset->object && pset->scene && PE_get_current(nullptr, pset->scene, pset->object));
257}
258static bool rna_ParticleEdit_hair_get(PointerRNA *ptr)
259{
260 ParticleEditSettings *pset = static_cast<ParticleEditSettings *>(ptr->data);
261
262 if (pset->scene) {
263 PTCacheEdit *edit = PE_get_current(nullptr, pset->scene, pset->object);
264
265 return (edit && edit->psys);
266 }
267
268 return 0;
269}
270
271static std::optional<std::string> rna_ParticleEdit_path(const PointerRNA * /*ptr*/)
272{
273 return "tool_settings.particle_edit";
274}
275
276static PointerRNA rna_Paint_brush_get(PointerRNA *ptr)
277{
278 Paint *paint = static_cast<Paint *>(ptr->data);
280 if (!brush) {
281 return {};
282 }
283 return RNA_id_pointer_create(&brush->id);
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 void rna_Sculpt_update(bContext *C, PointerRNA * /*ptr*/)
295{
296 const Main *bmain = CTX_data_main(C);
297 Scene *scene = CTX_data_scene(C);
298 ViewLayer *view_layer = CTX_data_view_layer(C);
299 BKE_view_layer_synced_ensure(*bmain, scene, view_layer);
301
302 if (ob) {
305 }
306}
307
308static void rna_Paint_update(bContext *C, PointerRNA * /*ptr*/)
309{
310 const Main *bmain = CTX_data_main(C);
311 Scene *scene = CTX_data_scene(C);
312 ViewLayer *view_layer = CTX_data_view_layer(C);
313 BKE_view_layer_synced_ensure(*bmain, scene, view_layer);
315
316 if (ob) {
319 }
320}
321
322static std::optional<std::string> rna_Sculpt_path(const PointerRNA * /*ptr*/)
323{
324 return "tool_settings.sculpt";
325}
326
327static std::optional<std::string> rna_VertexPaint_path(const PointerRNA *ptr)
328{
329 const Scene *scene = id_cast<Scene *>(ptr->owner_id);
330 const ToolSettings *ts = scene->toolsettings;
331 if (ptr->data == ts->vpaint) {
332 return "tool_settings.vertex_paint";
333 }
334 return "tool_settings.weight_paint";
335}
336
337static std::optional<std::string> rna_ImagePaintSettings_path(const PointerRNA * /*ptr*/)
338{
339 return "tool_settings.image_paint";
340}
341
342static std::optional<std::string> rna_PaintModeSettings_path(const PointerRNA * /*ptr*/)
343{
344 return "tool_settings.paint_mode";
345}
346
347static std::optional<std::string> rna_UvSculpt_path(const PointerRNA * /*ptr*/)
348{
349 return "tool_settings.uv_sculpt";
350}
351
352static std::optional<std::string> rna_CurvesSculpt_path(const PointerRNA * /*ptr*/)
353{
354 return "tool_settings.curves_sculpt";
355}
356
357static std::optional<std::string> rna_GpPaint_path(const PointerRNA * /*ptr*/)
358{
359 return "tool_settings.gpencil_paint";
360}
361
362static std::optional<std::string> rna_GpVertexPaint_path(const PointerRNA * /*ptr*/)
363{
364 return "tool_settings.gpencil_vertex_paint";
365}
366
367static std::optional<std::string> rna_GpSculptPaint_path(const PointerRNA * /*ptr*/)
368{
369 return "tool_settings.gpencil_sculpt_paint";
370}
371
372static std::optional<std::string> rna_GpWeightPaint_path(const PointerRNA * /*ptr*/)
373{
374 return "tool_settings.gpencil_weight_paint";
375}
376
377static std::optional<std::string> rna_ParticleBrush_path(const PointerRNA * /*ptr*/)
378{
379 return "tool_settings.particle_edit.brush";
380}
381
382static void rna_ImaPaint_viewport_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA * /*ptr*/)
383{
384 /* not the best solution maybe, but will refresh the 3D viewport */
386}
387
388static void rna_ImaPaint_mode_update(bContext *C, PointerRNA * /*ptr*/)
389{
390 const Main *bmain = CTX_data_main(C);
391 Scene *scene = CTX_data_scene(C);
392 ViewLayer *view_layer = CTX_data_view_layer(C);
393 BKE_view_layer_synced_ensure(*bmain, 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 const Main *bmain = CTX_data_main(C);
410 Scene *scene = CTX_data_scene(C);
411 ViewLayer *view_layer = CTX_data_view_layer(C);
412 BKE_view_layer_synced_ensure(*bmain, scene, view_layer);
414
415 if (ob && ob->type == OB_MESH) {
416 ED_paint_proj_mesh_data_check(*scene, *ob, nullptr, nullptr, nullptr, nullptr);
418 }
419}
420
421static void rna_ImaPaint_canvas_update(bContext *C, PointerRNA * /*ptr*/)
422{
423 Main *bmain = CTX_data_main(C);
424 Scene *scene = CTX_data_scene(C);
425 ViewLayer *view_layer = CTX_data_view_layer(C);
426 BKE_view_layer_synced_ensure(*bmain, scene, view_layer);
428 Image *ima = scene->toolsettings->imapaint.canvas;
429
430 ED_space_image_sync(bmain, ima, false);
431
432 if (ob && ob->type == OB_MESH) {
433 ED_paint_proj_mesh_data_check(*scene, *ob, nullptr, nullptr, nullptr, nullptr);
435 }
436}
437
438static void rna_UvSculpt_curve_preset_set(PointerRNA *ptr, int value)
439{
440 Scene *scene = reinterpret_cast<Scene *>(ptr->owner_id);
441 if (value == BRUSH_CURVE_CUSTOM) {
442 if (!scene->toolsettings->uvsculpt.curve_distance_falloff) {
443 scene->toolsettings->uvsculpt.curve_distance_falloff = BKE_curvemapping_add(
444 1, 0.0f, 0.0f, 1.0f, 1.0f);
445 }
446 }
447 scene->toolsettings->uvsculpt.curve_distance_falloff_preset = int8_t(value);
448}
449
450/* -------------------------------------------------------------------- */
453
454static void rna_PaintModeSettings_canvas_source_update(bContext *C, PointerRNA * /*ptr*/)
455{
456 Scene *scene = CTX_data_scene(C);
458 /* When canvas source changes the #pbvh::Tree would require updates when switching between color
459 * attributes. */
460 if (ob && ob->type == OB_MESH) {
462 DEG_id_tag_update(&ob->id, 0);
464 }
465}
466
468
469static bool rna_ImaPaint_detect_data(ImagePaintSettings *imapaint)
470{
471 return imapaint->missing_data == 0;
472}
473
474static std::optional<std::string> rna_GPencilSculptSettings_path(const PointerRNA * /*ptr*/)
475{
476 return "tool_settings.gpencil_sculpt";
477}
478
479static std::optional<std::string> rna_GPencilSculptGuide_path(const PointerRNA * /*ptr*/)
480{
481 return "tool_settings.gpencil_sculpt.guide";
482}
483
484static const MeshAutomaskingSettings *rna_MeshAutomaskingSettings_address_get(const Paint *paint)
485{
486 if (!paint) {
487 return nullptr;
488 }
489
490 return paint->mesh_automasking_settings;
491}
492
493static std::optional<std::string> rna_MeshAutomaskingSettings_path(const PointerRNA *ptr)
494{
495 switch (GS(ptr->owner_id->name)) {
496 case ID_SCE: {
497 const Scene *scene = reinterpret_cast<Scene *>(ptr->owner_id);
498 const ToolSettings *tool_settings = scene ? scene->toolsettings : nullptr;
499 if (tool_settings == nullptr) {
500 return std::nullopt;
501 }
502 if (rna_MeshAutomaskingSettings_address_get(
503 reinterpret_cast<Paint *>(tool_settings->sculpt)) == ptr->data)
504 {
505 return "tool_settings.sculpt.mesh_automasking_settings";
506 }
507 if (rna_MeshAutomaskingSettings_address_get(
508 reinterpret_cast<Paint *>(tool_settings->vpaint)) == ptr->data)
509 {
510 return "tool_settings.vertex_paint.mesh_automasking_settings";
511 }
512 if (rna_MeshAutomaskingSettings_address_get(
513 reinterpret_cast<Paint *>(tool_settings->wpaint)) == ptr->data)
514 {
515 return "tool_settings.weight_paint.mesh_automasking_settings";
516 }
517 return std::nullopt;
518 }
519 case ID_BR:
520 return "mesh_automasking_settings";
521 default:
523 return std::nullopt;
524 }
525}
526
527static void rna_MeshAutomaskingSettings_invert_cavity_set(PointerRNA *ptr, bool val)
528{
529 MeshAutomaskingSettings *automasking_settings = static_cast<MeshAutomaskingSettings *>(
530 ptr->data);
531
532 if (val) {
533 automasking_settings->flags &= ~BRUSH_AUTOMASKING_CAVITY_NORMAL;
534 automasking_settings->flags |= BRUSH_AUTOMASKING_CAVITY_INVERTED;
535 }
536 else {
537 automasking_settings->flags &= ~BRUSH_AUTOMASKING_CAVITY_INVERTED;
538 }
539}
540
541static void rna_MeshAutomaskingSettings_cavity_set(PointerRNA *ptr, bool val)
542{
543 MeshAutomaskingSettings *automasking_settings = static_cast<MeshAutomaskingSettings *>(
544 ptr->data);
545
546 if (val) {
547 automasking_settings->flags &= ~BRUSH_AUTOMASKING_CAVITY_INVERTED;
548 automasking_settings->flags |= BRUSH_AUTOMASKING_CAVITY_NORMAL;
549 }
550 else {
551 automasking_settings->flags &= ~BRUSH_AUTOMASKING_CAVITY_NORMAL;
552 }
553}
554
555static void rna_MeshAutomaskingSettings_update(bContext *C, PointerRNA *ptr)
556{
557 const Main *bmain = CTX_data_main(C);
558 Scene *scene = CTX_data_scene(C);
559 ViewLayer *view_layer = CTX_data_view_layer(C);
560 Brush *brush = BKE_paint_brush(BKE_paint_get_active(*bmain, scene, view_layer));
561
562 switch (GS(ptr->owner_id->name)) {
563 case ID_BR:
565 break;
566 case ID_SCE:
568 break;
569 default:
571 }
572}
573
574static void rna_UnifiedPaintSettings_update(bContext *C, PointerRNA * /*ptr*/)
575{
576 const Main *bmain = CTX_data_main(C);
577 Scene *scene = CTX_data_scene(C);
578 ViewLayer *view_layer = CTX_data_view_layer(C);
579 Brush *br = BKE_paint_brush(BKE_paint_get_active(*bmain, scene, view_layer));
580 /* TODO: Verify if tagging the brush for these settings being changed is correct. */
583}
584
585static void rna_UnifiedPaintSettings_color_update(bContext *C, PointerRNA *ptr)
586{
587 UnifiedPaintSettings *ups = static_cast<UnifiedPaintSettings *>(ptr->data);
588 rna_UnifiedPaintSettings_update(C, ptr);
590}
591
592static void rna_UnifiedPaintSettings_size_set(PointerRNA *ptr, int value)
593{
594 UnifiedPaintSettings *ups = static_cast<UnifiedPaintSettings *>(ptr->data);
595
596 /* scale unprojected size so it stays consistent with brush size */
597 BKE_brush_scale_unprojected_size(&ups->unprojected_size, value, ups->size);
598 ups->size = value;
599}
600
601static void rna_UnifiedPaintSettings_unprojected_size_set(PointerRNA *ptr, float value)
602{
603 UnifiedPaintSettings *ups = static_cast<UnifiedPaintSettings *>(ptr->data);
604
605 /* scale brush size so it stays consistent with unprojected_size */
606 BKE_brush_scale_size(&ups->size, value, ups->unprojected_size);
607 ups->unprojected_size = value;
608}
609
610static void rna_UnifiedPaintSettings_size_update(bContext *C, PointerRNA *ptr)
611{
612 /* changing the unified size should invalidate the overlay but also update the brush */
614 rna_UnifiedPaintSettings_update(C, ptr);
615}
616
617static const UnifiedPaintSettings *rna_UnifiedPaintSettings_address_get(const Paint *paint)
618{
619 if (!paint) {
620 return nullptr;
621 }
622
623 return &paint->unified_paint_settings;
624}
625
626static std::optional<std::string> rna_UnifiedPaintSettings_path(const PointerRNA *ptr)
627{
628 const Scene *scene = reinterpret_cast<Scene *>(ptr->owner_id);
629 const ToolSettings *tool_settings = scene ? scene->toolsettings : nullptr;
630 if (tool_settings == nullptr) {
631 return std::nullopt;
632 }
633 if (rna_UnifiedPaintSettings_address_get(reinterpret_cast<Paint *>(tool_settings->vpaint)) ==
634 ptr->data)
635 {
636 return "tool_settings.vertex_paint.unified_paint_settings";
637 }
638 if (rna_UnifiedPaintSettings_address_get(reinterpret_cast<Paint *>(tool_settings->wpaint)) ==
639 ptr->data)
640 {
641 return "tool_settings.weight_paint.unified_paint_settings";
642 }
643 if (rna_UnifiedPaintSettings_address_get(reinterpret_cast<Paint *>(tool_settings->sculpt)) ==
644 ptr->data)
645 {
646 return "tool_settings.sculpt.unified_paint_settings";
647 }
648 if (rna_UnifiedPaintSettings_address_get(reinterpret_cast<Paint *>(tool_settings->gp_paint)) ==
649 ptr->data)
650 {
651 return "tool_settings.gpencil_paint.unified_paint_settings";
652 }
653 if (rna_UnifiedPaintSettings_address_get(
654 reinterpret_cast<Paint *>(tool_settings->gp_vertexpaint)) == ptr->data)
655 {
656 return "tool_settings.gpencil_vertex_paint.unified_paint_settings";
657 }
658 if (rna_UnifiedPaintSettings_address_get(
659 reinterpret_cast<Paint *>(tool_settings->gp_sculptpaint)) == ptr->data)
660 {
661 return "tool_settings.gpencil_sculpt_paint.unified_paint_settings";
662 }
663 if (rna_UnifiedPaintSettings_address_get(
664 reinterpret_cast<Paint *>(tool_settings->gp_weightpaint)) == ptr->data)
665 {
666 return "tool_settings.gpencil_weight_paint.unified_paint_settings";
667 }
668 if (rna_UnifiedPaintSettings_address_get(
669 reinterpret_cast<Paint *>(tool_settings->curves_sculpt)) == ptr->data)
670 {
671 return "tool_settings.curves_sculpt.unified_paint_settings";
672 }
673 return std::nullopt;
674}
675
676} // namespace blender
677
678#else
679
680namespace blender {
681
683{
684 StructRNA *srna;
685
686 srna = RNA_def_struct(brna, "PaintCurve", "ID");
687 RNA_def_struct_ui_text(srna, "Paint Curve", "");
688 RNA_def_struct_ui_icon(srna, ICON_CURVE_BEZCURVE);
689}
690
692 const char *prop_name,
693 const char *ui_name,
694 const int64_t flag)
695{
696 PropertyRNA *prop;
697
698 prop = RNA_def_property(srna, prop_name, PROP_BOOLEAN, PROP_NONE);
699 RNA_def_property_boolean_sdna(prop, nullptr, "curve_visibility_flags", flag);
700 RNA_def_property_ui_text(prop, ui_name, nullptr);
702}
703
704static void rna_def_paint(BlenderRNA *brna)
705{
706 StructRNA *srna;
707 PropertyRNA *prop;
708
709 srna = RNA_def_struct(brna, "Paint", nullptr);
710 RNA_def_struct_ui_text(srna, "Paint", "");
711
712 /* Global Settings */
713 prop = RNA_def_property(srna, "brush", PROP_POINTER, PROP_NONE);
715 RNA_def_property_struct_type(prop, "Brush");
717 prop, "rna_Paint_brush_get", nullptr, nullptr, "rna_Paint_brush_poll");
718 RNA_def_property_ui_text(prop, "Brush", "Active brush");
720
721 prop = RNA_def_property(srna, "brush_asset_reference", PROP_POINTER, PROP_NONE);
724 "Brush Asset Reference",
725 "A weak reference to the matching brush asset, used e.g. to restore "
726 "the last used brush on file load");
727
728 prop = RNA_def_property(srna, "palette", PROP_POINTER, PROP_NONE);
730 RNA_def_property_pointer_funcs(prop, nullptr, nullptr, nullptr, nullptr);
731 RNA_def_property_ui_text(prop, "Palette", "Active Palette");
732
733 prop = RNA_def_property(srna, "show_brush", PROP_BOOLEAN, PROP_NONE);
734 RNA_def_property_boolean_sdna(prop, nullptr, "flags", PAINT_SHOW_BRUSH);
735 RNA_def_property_ui_text(prop, "Show Brush", "");
737
738 prop = RNA_def_property(srna, "show_brush_on_surface", PROP_BOOLEAN, PROP_NONE);
740 RNA_def_property_ui_text(prop, "Show Brush On Surface", "");
742
743 prop = RNA_def_property(srna, "show_low_resolution", PROP_BOOLEAN, PROP_NONE);
744 RNA_def_property_boolean_sdna(prop, nullptr, "flags", PAINT_FAST_NAVIGATE);
746 prop, "Fast Navigate", "For multires, show low resolution while navigating the view");
748
749 prop = RNA_def_property(srna, "use_sculpt_delay_updates", PROP_BOOLEAN, PROP_NONE);
752 prop,
753 "Delay Viewport Updates",
754 "Update the geometry when it enters the view, providing faster view navigation");
756
757 prop = RNA_def_property(srna, "show_bvh_nodes", PROP_BOOLEAN, PROP_NONE);
758 RNA_def_property_boolean_sdna(prop, nullptr, "debug_flags", PAINT_DEBUG_SHOW_BVH_NODES);
760 prop, "Show BVH Nodes", "Show the underlying BVH nodes as differently colored faces");
762 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Paint_update");
763
764 prop = RNA_def_property(srna, "use_symmetry_x", PROP_BOOLEAN, PROP_NONE);
765 RNA_def_property_boolean_sdna(prop, nullptr, "symmetry_flags", PAINT_SYMM_X);
766 RNA_def_property_ui_text(prop, "Symmetry X", "Mirror brush across the X axis");
768
769 prop = RNA_def_property(srna, "use_symmetry_y", PROP_BOOLEAN, PROP_NONE);
770 RNA_def_property_boolean_sdna(prop, nullptr, "symmetry_flags", PAINT_SYMM_Y);
771 RNA_def_property_ui_text(prop, "Symmetry Y", "Mirror brush across the Y axis");
773
774 prop = RNA_def_property(srna, "use_symmetry_z", PROP_BOOLEAN, PROP_NONE);
775 RNA_def_property_boolean_sdna(prop, nullptr, "symmetry_flags", PAINT_SYMM_Z);
776 RNA_def_property_ui_text(prop, "Symmetry Z", "Mirror brush across the Z axis");
778
779 prop = RNA_def_property(srna, "use_symmetry_feather", PROP_BOOLEAN, PROP_NONE);
780 RNA_def_property_boolean_sdna(prop, nullptr, "symmetry_flags", PAINT_SYMMETRY_FEATHER);
782 "Symmetry Feathering",
783 "Reduce the strength of the brush where it overlaps symmetrical daubs");
785
786 prop = RNA_def_property(srna, "cavity_curve", PROP_POINTER, PROP_NONE);
788 RNA_def_property_ui_text(prop, "Curve", "Editable cavity curve");
790
791 prop = RNA_def_property(srna, "use_cavity", PROP_BOOLEAN, PROP_NONE);
793 RNA_def_property_ui_text(prop, "Cavity Mask", "Mask painting according to mesh geometry cavity");
795
796 prop = RNA_def_property(srna, "tile_offset", PROP_FLOAT, PROP_XYZ_LENGTH);
797 RNA_def_property_float_sdna(prop, nullptr, "tile_offset");
798 RNA_def_property_array(prop, 3);
799 RNA_def_property_range(prop, 0.01, FLT_MAX);
800 RNA_def_property_ui_range(prop, 0.01, 100, 1 * 100, 2);
802 prop, "Tiling offset for the X Axis", "Stride at which tiled strokes are copied");
803
804 prop = RNA_def_property(srna, "tile_x", PROP_BOOLEAN, PROP_NONE);
805 RNA_def_property_boolean_sdna(prop, nullptr, "symmetry_flags", PAINT_TILE_X);
806 RNA_def_property_ui_text(prop, "Tile X", "Tile along X axis");
808
809 prop = RNA_def_property(srna, "tile_y", PROP_BOOLEAN, PROP_NONE);
810 RNA_def_property_boolean_sdna(prop, nullptr, "symmetry_flags", PAINT_TILE_Y);
811 RNA_def_property_ui_text(prop, "Tile Y", "Tile along Y axis");
813
814 prop = RNA_def_property(srna, "tile_z", PROP_BOOLEAN, PROP_NONE);
815 RNA_def_property_boolean_sdna(prop, nullptr, "symmetry_flags", PAINT_TILE_Z);
816 RNA_def_property_ui_text(prop, "Tile Z", "Tile along Z axis");
818
820 srna, "show_strength_curve", "Show Strength Curve", PAINT_CURVE_SHOW_STRENGTH);
822 srna, "show_size_curve", "Show Size Curve", PAINT_CURVE_SHOW_SIZE);
824 srna, "show_jitter_curve", "Show Jitter Curve", PAINT_CURVE_SHOW_JITTER);
826 srna, "show_hardness_curve", "Show Hardness Curve", PAINT_CURVE_SHOW_HARDNESS);
828 srna, "show_auto_smooth_curve", "Show Auto-Smooth Curve", PAINT_CURVE_SHOW_AUTO_SMOOTH);
830 srna, "show_spacing_curve", "Show Spacing Curve", PAINT_CURVE_SHOW_SPACING);
831
832 /* Unified Paint Settings */
833 prop = RNA_def_property(srna, "unified_paint_settings", PROP_POINTER, PROP_NONE);
835 RNA_def_property_struct_type(prop, "UnifiedPaintSettings");
836 RNA_def_property_ui_text(prop, "Unified Paint Settings", nullptr);
837
838 prop = RNA_def_property(srna, "mesh_automasking_settings", PROP_POINTER, PROP_NONE);
840 RNA_def_property_struct_type(prop, "MeshAutomaskingSettings");
841 RNA_def_property_ui_text(prop, "Mesh Automasking Settings", nullptr);
842}
843
845{
846 StructRNA *srna;
847 PropertyRNA *prop;
848
849 static const EnumPropertyItem brush_size_unit_items[] = {
850 {0, "VIEW", 0, "View", "Measure brush size relative to the view"},
852 "SCENE",
853 0,
854 "Scene",
855 "Measure brush size relative to the scene"},
856 {0, nullptr, 0, nullptr, nullptr},
857 };
858
859 srna = RNA_def_struct(brna, "UnifiedPaintSettings", nullptr);
860 RNA_def_struct_path_func(srna, "rna_UnifiedPaintSettings_path");
862 srna, "Unified Paint Settings", "Overrides for some of the active brush's settings");
864
865 /* high-level flags to enable or disable unified paint settings */
866 prop = RNA_def_property(srna, "use_unified_size", PROP_BOOLEAN, PROP_NONE);
869 prop, "Use Unified Size", "Instead of per-brush size, the size is shared across brushes");
871 RNA_def_property_deprecated(prop, "Replaced by per-brush unified settings", 503, 600);
872
873 prop = RNA_def_property(srna, "use_unified_strength", PROP_BOOLEAN, PROP_NONE);
876 "Use Unified Strength",
877 "Instead of per-brush strength, the strength is shared across brushes");
879 RNA_def_property_deprecated(prop, "Replaced by per-brush unified settings", 503, 600);
880
881 prop = RNA_def_property(srna, "use_unified_weight", PROP_BOOLEAN, PROP_NONE);
884 "Use Unified Weight",
885 "Instead of per-brush weight, the weight is shared across brushes");
887 RNA_def_property_deprecated(prop, "Replaced by per-brush unified settings", 503, 600);
888
889 prop = RNA_def_property(srna, "use_unified_color", PROP_BOOLEAN, PROP_NONE);
892 prop, "Use Unified Color", "Instead of per-brush color, the color is shared across brushes");
894 RNA_def_property_deprecated(prop, "Replaced by per-brush unified settings", 503, 600);
895
896 prop = RNA_def_property(srna, "use_unified_input_samples", PROP_BOOLEAN, PROP_NONE);
899 prop,
900 "Use Unified Input Samples",
901 "Instead of per-brush input samples, the value is shared across brushes");
903 RNA_def_property_deprecated(prop, "Replaced by per-brush unified settings", 503, 600);
904
905 /* unified paint settings that override the equivalent settings
906 * from the active brush */
907 prop = RNA_def_property(srna, "size", PROP_INT, PROP_PIXEL_DIAMETER);
908 RNA_def_property_int_funcs(prop, nullptr, "rna_UnifiedPaintSettings_size_set", nullptr);
912 RNA_def_property_ui_text(prop, "Size", "Diameter of the brush");
913 RNA_def_property_update(prop, 0, "rna_UnifiedPaintSettings_size_update");
914
915 prop = RNA_def_property(srna, "unprojected_size", PROP_FLOAT, PROP_DISTANCE_DIAMETER);
917 prop, nullptr, "rna_UnifiedPaintSettings_unprojected_size_set", nullptr);
919 RNA_def_property_range(prop, 0.001, FLT_MAX);
920 RNA_def_property_ui_range(prop, 0.001, 1, 1, -1);
921 RNA_def_property_ui_text(prop, "Unprojected Size", "Diameter of brush in Blender units");
922 RNA_def_property_update(prop, 0, "rna_UnifiedPaintSettings_size_update");
923
924 prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_FACTOR);
925 RNA_def_property_float_sdna(prop, nullptr, "alpha");
927 RNA_def_property_range(prop, 0.0f, 10.0f);
928 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
930 prop, "Strength", "How powerful the effect of the brush is when applied");
931 RNA_def_property_update(prop, 0, "rna_UnifiedPaintSettings_update");
932
933 prop = RNA_def_property(srna, "weight", PROP_FLOAT, PROP_FACTOR);
934 RNA_def_property_float_sdna(prop, nullptr, "weight");
936 RNA_def_property_range(prop, 0.0f, 1.0f);
937 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
938 RNA_def_property_ui_text(prop, "Weight", "Weight to assign in vertex groups");
939 RNA_def_property_update(prop, 0, "rna_UnifiedPaintSettings_update");
940
941 prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
943 RNA_def_property_range(prop, 0.0, 1.0);
944 RNA_def_property_float_sdna(prop, nullptr, "color");
945 RNA_def_property_ui_text(prop, "Color", "");
946 RNA_def_property_update(prop, 0, "rna_UnifiedPaintSettings_color_update");
947
948 prop = RNA_def_property(srna, "secondary_color", PROP_FLOAT, PROP_COLOR);
950 RNA_def_property_range(prop, 0.0, 1.0);
951 RNA_def_property_float_sdna(prop, nullptr, "secondary_color");
952 RNA_def_property_ui_text(prop, "Secondary Color", "");
953 RNA_def_property_update(prop, 0, "rna_UnifiedPaintSettings_color_update");
954
955 prop = RNA_def_property(srna, "use_color_jitter", PROP_BOOLEAN, PROP_NONE);
958 RNA_def_property_ui_text(prop, "Use Color Jitter", "Jitter brush color");
959 RNA_def_property_update(prop, 0, "rna_UnifiedPaintSettings_update");
960
961 prop = RNA_def_property(srna, "hue_jitter", PROP_FLOAT, PROP_NONE);
963 RNA_def_property_float_sdna(prop, nullptr, "hsv_jitter[0]");
964 RNA_def_property_range(prop, 0, 1.0f);
965 RNA_def_property_ui_range(prop, 0, 1, 0.05, 2);
966 RNA_def_property_ui_text(prop, "Hue Jitter", "Color jitter effect on hue");
967 RNA_def_property_update(prop, 0, "rna_UnifiedPaintSettings_update");
968
969 prop = RNA_def_property(srna, "saturation_jitter", PROP_FLOAT, PROP_NONE);
971 RNA_def_property_float_sdna(prop, nullptr, "hsv_jitter[1]");
972 RNA_def_property_range(prop, 0, 1.0f);
973 RNA_def_property_ui_range(prop, 0, 1, 0.05, 2);
974 RNA_def_property_ui_text(prop, "Saturation Jitter", "Color jitter effect on saturation");
975 RNA_def_property_update(prop, 0, "rna_UnifiedPaintSettings_update");
976
977 prop = RNA_def_property(srna, "value_jitter", PROP_FLOAT, PROP_NONE);
979 RNA_def_property_float_sdna(prop, nullptr, "hsv_jitter[2]");
980 RNA_def_property_range(prop, 0, 1.0f);
981 RNA_def_property_ui_range(prop, 0, 1, 0.05, 2);
982 RNA_def_property_ui_text(prop, "Value Jitter", "Color jitter effect on value");
983 RNA_def_property_update(prop, 0, "rna_UnifiedPaintSettings_update");
984
985 prop = RNA_def_property(srna, "use_stroke_random_hue", PROP_BOOLEAN, PROP_NONE);
988 prop, nullptr, "color_jitter_flag", BRUSH_COLOR_JITTER_USE_HUE_AT_STROKE);
989 RNA_def_property_ui_icon(prop, ICON_GP_SELECT_STROKES, 0);
990 RNA_def_property_ui_text(prop, "Stroke Random", "Use randomness at stroke level");
991 RNA_def_property_update(prop, 0, "rna_UnifiedPaintSettings_update");
992
993 prop = RNA_def_property(srna, "use_stroke_random_sat", PROP_BOOLEAN, PROP_NONE);
996 prop, nullptr, "color_jitter_flag", BRUSH_COLOR_JITTER_USE_SAT_AT_STROKE);
997 RNA_def_property_ui_icon(prop, ICON_GP_SELECT_STROKES, 0);
998 RNA_def_property_ui_text(prop, "Stroke Random", "Use randomness at stroke level");
999 RNA_def_property_update(prop, 0, "rna_UnifiedPaintSettings_update");
1000
1001 prop = RNA_def_property(srna, "use_stroke_random_val", PROP_BOOLEAN, PROP_NONE);
1004 prop, nullptr, "color_jitter_flag", BRUSH_COLOR_JITTER_USE_VAL_AT_STROKE);
1005 RNA_def_property_ui_icon(prop, ICON_GP_SELECT_STROKES, 0);
1006 RNA_def_property_ui_text(prop, "Stroke Random", "Use randomness at stroke level");
1007 RNA_def_property_update(prop, 0, "rna_UnifiedPaintSettings_update");
1008
1009 prop = RNA_def_property(srna, "use_random_press_hue", PROP_BOOLEAN, PROP_NONE);
1012 prop, nullptr, "color_jitter_flag", BRUSH_COLOR_JITTER_USE_HUE_RAND_PRESS);
1013 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
1014 RNA_def_property_ui_text(prop, "Use Pressure", "Use pressure to modulate randomness");
1015 RNA_def_property_update(prop, 0, "rna_UnifiedPaintSettings_update");
1016
1017 prop = RNA_def_property(srna, "use_random_press_sat", PROP_BOOLEAN, PROP_NONE);
1020 prop, nullptr, "color_jitter_flag", BRUSH_COLOR_JITTER_USE_SAT_RAND_PRESS);
1021 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
1022 RNA_def_property_ui_text(prop, "Use Pressure", "Use pressure to modulate randomness");
1023 RNA_def_property_update(prop, 0, "rna_UnifiedPaintSettings_update");
1024
1025 prop = RNA_def_property(srna, "use_random_press_val", PROP_BOOLEAN, PROP_NONE);
1028 prop, nullptr, "color_jitter_flag", BRUSH_COLOR_JITTER_USE_VAL_RAND_PRESS);
1029 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
1030 RNA_def_property_ui_text(prop, "Use Pressure", "Use pressure to modulate randomness");
1031 RNA_def_property_update(prop, 0, "rna_UnifiedPaintSettings_update");
1032
1033 prop = RNA_def_property(srna, "input_samples", PROP_INT, PROP_UNSIGNED);
1034 RNA_def_property_int_sdna(prop, nullptr, "input_samples");
1039 prop,
1040 "Input Samples",
1041 "Number of input samples to average together to smooth the brush stroke");
1042 RNA_def_property_update(prop, 0, "rna_UnifiedPaintSettings_update");
1043
1044 prop = RNA_def_property(srna, "use_locked_size", PROP_ENUM, PROP_NONE); /* as an enum */
1046 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flag");
1047 RNA_def_property_enum_items(prop, brush_size_unit_items);
1049 prop, "Size Unit", "Measure brush size relative to the view or the scene");
1050 RNA_def_property_update(prop, 0, "rna_UnifiedPaintSettings_update");
1051}
1052
1054{
1055 StructRNA *srna;
1056 PropertyRNA *prop;
1057
1058 srna = RNA_def_struct(brna, "MeshAutomaskingSettings", nullptr);
1059 RNA_def_struct_path_func(srna, "rna_MeshAutomaskingSettings_path");
1061 srna, "Automasking Settings", "Automasking settings for mesh painting & sculpting.");
1063
1065 do {
1066 prop = RNA_def_property(srna, entry->identifier, PROP_BOOLEAN, PROP_NONE);
1068 RNA_def_property_boolean_sdna(prop, nullptr, "flags", entry->value);
1069 RNA_def_property_ui_text(prop, entry->name, entry->description);
1070
1071 if (entry->value == BRUSH_AUTOMASKING_CAVITY_NORMAL) {
1072 RNA_def_property_boolean_funcs(prop, nullptr, "rna_MeshAutomaskingSettings_cavity_set");
1073 }
1074 else if (entry->value == BRUSH_AUTOMASKING_CAVITY_INVERTED) {
1076 prop, nullptr, "rna_MeshAutomaskingSettings_invert_cavity_set");
1077 }
1078
1079 RNA_def_property_update(prop, 0, "rna_MeshAutomaskingSettings_update");
1080 } while ((++entry)->identifier);
1081
1082 prop = RNA_def_property(srna, "boundary_edges_propagation_steps", PROP_INT, PROP_UNSIGNED);
1084 RNA_def_property_int_sdna(prop, nullptr, "boundary_edges_propagation_steps");
1088 "Propagation Steps",
1089 "Distance where boundary edge automasking is going to protect vertices "
1090 "from the fully masked edge");
1091 RNA_def_property_update(prop, 0, "rna_MeshAutomaskingSettings_update");
1092
1093 prop = RNA_def_property(srna, "cavity_factor", PROP_FLOAT, PROP_FACTOR);
1095 RNA_def_property_float_sdna(prop, nullptr, "cavity_factor");
1096 RNA_def_property_ui_text(prop, "Cavity Factor", "The contrast of the cavity mask");
1097 RNA_def_property_range(prop, 0.0f, 5.0f);
1098 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
1099 RNA_def_property_update(prop, 0, "rna_MeshAutomaskingSettings_update");
1100
1101 prop = RNA_def_property(srna, "cavity_blur_steps", PROP_INT, PROP_NONE);
1103 RNA_def_property_int_sdna(prop, nullptr, "cavity_blur_steps");
1104 RNA_def_property_ui_text(prop, "Blur Steps", "The number of times the cavity mask is blurred");
1105 RNA_def_property_range(prop, 0, 25);
1106 RNA_def_property_ui_range(prop, 0, 10, 1, 1);
1107 RNA_def_property_update(prop, 0, "rna_MeshAutomaskingSettings_update");
1108
1109 prop = RNA_def_property(srna, "cavity_curve", PROP_POINTER, PROP_NONE);
1111 RNA_def_property_pointer_sdna(prop, nullptr, "cavity_curve");
1112 RNA_def_property_struct_type(prop, "CurveMapping");
1113 RNA_def_property_ui_text(prop, "Cavity Curve", "Curve used for the sensitivity");
1115 RNA_def_property_update(prop, 0, "rna_MeshAutomaskingSettings_update");
1116
1117 prop = RNA_def_property(srna, "cavity_curve_op", PROP_POINTER, PROP_NONE);
1119 RNA_def_property_pointer_sdna(prop, nullptr, "cavity_curve_op");
1120 RNA_def_property_struct_type(prop, "CurveMapping");
1121 RNA_def_property_ui_text(prop, "Cavity Curve", "Curve used for the sensitivity");
1123 RNA_def_property_update(prop, 0, "rna_MeshAutomaskingSettings_update");
1124
1125 prop = RNA_def_property(srna, "start_normal_limit", PROP_FLOAT, PROP_ANGLE);
1127 RNA_def_property_float_sdna(prop, nullptr, "start_normal_limit");
1128 RNA_def_property_range(prop, 0.0001f, M_PI);
1129 RNA_def_property_ui_text(prop, "Area Normal Limit", "The range of angles that will be affected");
1130 RNA_def_property_update(prop, 0, "rna_MeshAutomaskingSettings_update");
1131
1132 prop = RNA_def_property(srna, "start_normal_falloff", PROP_FLOAT, PROP_FACTOR);
1134 RNA_def_property_float_sdna(prop, nullptr, "start_normal_falloff");
1135 RNA_def_property_range(prop, 0.0001f, 1.0f);
1137 prop, "Area Normal Falloff", "Extend the angular range with a falloff gradient");
1138 RNA_def_property_update(prop, 0, "rna_MeshAutomaskingSettings_update");
1139
1140 prop = RNA_def_property(srna, "view_normal_limit", PROP_FLOAT, PROP_ANGLE);
1142 RNA_def_property_float_sdna(prop, nullptr, "view_normal_limit");
1143 RNA_def_property_range(prop, 0.0001f, M_PI);
1144 RNA_def_property_ui_text(prop, "View Normal Limit", "The range of angles that will be affected");
1145 RNA_def_property_update(prop, 0, "rna_MeshAutomaskingSettings_update");
1146
1147 prop = RNA_def_property(srna, "view_normal_falloff", PROP_FLOAT, PROP_FACTOR);
1149 RNA_def_property_float_sdna(prop, nullptr, "view_normal_falloff");
1150 RNA_def_property_range(prop, 0.0001f, 1.0f);
1152 prop, "View Normal Falloff", "Extend the angular range with a falloff gradient");
1153 RNA_def_property_update(prop, 0, "rna_MeshAutomaskingSettings_update");
1154}
1155
1156static void rna_def_sculpt(BlenderRNA *brna)
1157{
1158 static const EnumPropertyItem detail_refine_items[] = {
1160 "SUBDIVIDE",
1161 0,
1162 "Subdivide Edges",
1163 "Subdivide long edges to add mesh detail where needed"},
1165 "COLLAPSE",
1166 0,
1167 "Collapse Edges",
1168 "Collapse short edges to remove mesh detail where possible"},
1170 "SUBDIVIDE_COLLAPSE",
1171 0,
1172 "Subdivide Collapse",
1173 "Both subdivide long edges and collapse short edges to refine mesh detail"},
1174 {0, nullptr, 0, nullptr, nullptr},
1175 };
1176
1177 static const EnumPropertyItem detail_type_items[] = {
1178 {0,
1179 "RELATIVE",
1180 0,
1181 "Relative Detail",
1182 "Mesh detail is relative to the brush size and detail size"},
1184 "CONSTANT",
1185 0,
1186 "Constant Detail",
1187 "Mesh detail is constant in world space according to detail size"},
1189 "BRUSH",
1190 0,
1191 "Brush Detail",
1192 "Mesh detail is relative to brush size"},
1194 "MANUAL",
1195 0,
1196 "Manual Detail",
1197 "Mesh detail does not change on each stroke, only when using Flood Fill"},
1198 {0, nullptr, 0, nullptr, nullptr},
1199 };
1200
1201 static const EnumPropertyItem sculpt_transform_mode_items[] = {
1203 "ALL_VERTICES",
1204 0,
1205 "All Vertices",
1206 "Applies the transformation to all vertices in the mesh"},
1208 "RADIUS_ELASTIC",
1209 0,
1210 "Elastic",
1211 "Applies the transformation simulating elasticity using the radius of the cursor"},
1212 {0, nullptr, 0, nullptr, nullptr},
1213 };
1214
1215 StructRNA *srna;
1216 PropertyRNA *prop;
1217
1218 srna = RNA_def_struct(brna, "Sculpt", "Paint");
1219 RNA_def_struct_path_func(srna, "rna_Sculpt_path");
1220 RNA_def_struct_ui_text(srna, "Sculpt", "");
1222
1223 prop = RNA_def_property(srna, "lock_x", PROP_BOOLEAN, PROP_NONE);
1224 RNA_def_property_boolean_sdna(prop, nullptr, "flags", SCULPT_LOCK_X);
1225 RNA_def_property_ui_text(prop, "Lock X", "Disallow changes to the X axis of vertices");
1227
1228 prop = RNA_def_property(srna, "lock_y", PROP_BOOLEAN, PROP_NONE);
1229 RNA_def_property_boolean_sdna(prop, nullptr, "flags", SCULPT_LOCK_Y);
1230 RNA_def_property_ui_text(prop, "Lock Y", "Disallow changes to the Y axis of vertices");
1232
1233 prop = RNA_def_property(srna, "lock_z", PROP_BOOLEAN, PROP_NONE);
1234 RNA_def_property_boolean_sdna(prop, nullptr, "flags", SCULPT_LOCK_Z);
1235 RNA_def_property_ui_text(prop, "Lock Z", "Disallow changes to the Z axis of vertices");
1237
1238 prop = RNA_def_property(srna, "use_deform_only", PROP_BOOLEAN, PROP_NONE);
1239 RNA_def_property_boolean_sdna(prop, nullptr, "flags", SCULPT_ONLY_DEFORM);
1241 "Use Deform Only",
1242 "Use only deformation modifiers (temporary disable all "
1243 "constructive modifiers except multi-resolution)");
1245 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Sculpt_update");
1246
1247 prop = RNA_def_property(srna, "detail_size", PROP_FLOAT, PROP_PIXEL);
1248 RNA_def_property_range(prop, 0.5, 40.0);
1249 RNA_def_property_ui_range(prop, 0.5, 40.0, 0.1, 2);
1252 prop, "Detail Size", "Maximum edge length for dynamic topology sculpting (in pixels)");
1254
1255 prop = RNA_def_property(srna, "detail_percent", PROP_FLOAT, PROP_PERCENTAGE);
1256 RNA_def_property_range(prop, 0.5, 100.0);
1257 RNA_def_property_ui_range(prop, 0.5, 100.0, 10, 2);
1259 prop,
1260 "Detail Percentage",
1261 "Maximum edge length for dynamic topology sculpting (in brush percentage)");
1263
1264 prop = RNA_def_property(srna, "constant_detail_resolution", PROP_FLOAT, PROP_NONE);
1265 RNA_def_property_float_sdna(prop, nullptr, "constant_detail");
1266 RNA_def_property_range(prop, 0.0001, FLT_MAX);
1267 RNA_def_property_ui_range(prop, 0.001, 1000.0, 10, 2);
1269 "Resolution",
1270 "Maximum edge length for dynamic topology sculpting (as divisor "
1271 "of Blender unit - higher value means smaller edge length)");
1273
1274 prop = RNA_def_property(srna, "symmetrize_direction", PROP_ENUM, PROP_NONE);
1276 RNA_def_property_ui_text(prop, "Direction", "Source and destination for symmetrize operator");
1277
1278 prop = RNA_def_property(srna, "detail_refine_method", PROP_ENUM, PROP_NONE);
1279 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flags");
1280 RNA_def_property_enum_items(prop, detail_refine_items);
1282 prop, "Detail Refine Method", "In dynamic-topology mode, how to add or remove mesh detail");
1284
1285 prop = RNA_def_property(srna, "detail_type_method", PROP_ENUM, PROP_NONE);
1286 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flags");
1287 RNA_def_property_enum_items(prop, detail_type_items);
1289 prop, "Detail Type Method", "In dynamic-topology mode, how mesh detail size is calculated");
1291
1292 prop = RNA_def_property(srna, "gravity", PROP_FLOAT, PROP_FACTOR);
1293 RNA_def_property_float_sdna(prop, nullptr, "gravity_factor");
1294 RNA_def_property_range(prop, 0.0f, 1.0f);
1295 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
1296 RNA_def_property_ui_text(prop, "Gravity", "Amount of gravity after each dab");
1298
1299 prop = RNA_def_property(srna, "transform_mode", PROP_ENUM, PROP_NONE);
1300 RNA_def_property_enum_items(prop, sculpt_transform_mode_items);
1302 prop, "Transform Mode", "How the transformation is going to be applied to the target");
1304
1305 prop = RNA_def_property(srna, "gravity_object", PROP_POINTER, PROP_NONE);
1308 prop, "Orientation", "Object whose Z axis defines orientation of gravity");
1310}
1311
1313{
1314 StructRNA *srna;
1315 PropertyRNA *prop;
1316
1317 srna = RNA_def_struct(brna, "UvSculpt", nullptr);
1318 RNA_def_struct_path_func(srna, "rna_UvSculpt_path");
1319 RNA_def_struct_ui_text(srna, "UV Sculpting", "");
1321
1322 prop = RNA_def_property(srna, "size", PROP_INT, PROP_PIXEL_DIAMETER);
1325 RNA_def_property_ui_text(prop, "Size", "");
1327
1328 prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_FACTOR);
1329 RNA_def_property_range(prop, 0.0f, 1.0f);
1330 RNA_def_property_ui_text(prop, "Strength", "");
1333
1334 prop = RNA_def_property(srna, "curve_distance_falloff", PROP_POINTER, PROP_NONE);
1335 RNA_def_property_struct_type(prop, "CurveMapping");
1336 RNA_def_property_pointer_funcs(prop, nullptr, nullptr, nullptr, nullptr);
1337 RNA_def_property_ui_text(prop, "Falloff Curve", "");
1339
1340 prop = RNA_def_property(srna, "curve_distance_falloff_preset", PROP_ENUM, PROP_NONE);
1342 RNA_def_property_ui_text(prop, "Falloff Curve Preset", "");
1344 RNA_def_property_enum_funcs(prop, nullptr, "rna_UvSculpt_curve_preset_set", nullptr);
1346}
1347
1349{
1350 StructRNA *srna;
1351 PropertyRNA *prop;
1352
1353 srna = RNA_def_struct(brna, "GpPaint", "Paint");
1354 RNA_def_struct_path_func(srna, "rna_GpPaint_path");
1355 RNA_def_struct_ui_text(srna, "Grease Pencil Paint", "");
1357
1358 /* Use vertex color (main switch). */
1359 prop = RNA_def_property(srna, "color_mode", PROP_ENUM, PROP_NONE);
1360 RNA_def_property_enum_sdna(prop, nullptr, "mode");
1362 RNA_def_property_ui_text(prop, "Mode", "Paint Mode");
1365}
1366
1368{
1369 StructRNA *srna;
1370
1371 srna = RNA_def_struct(brna, "GpVertexPaint", "Paint");
1372 RNA_def_struct_path_func(srna, "rna_GpVertexPaint_path");
1373 RNA_def_struct_ui_text(srna, "Grease Pencil Vertex Paint", "");
1375}
1376
1378{
1379 StructRNA *srna;
1380
1381 srna = RNA_def_struct(brna, "GpSculptPaint", "Paint");
1382 RNA_def_struct_path_func(srna, "rna_GpSculptPaint_path");
1383 RNA_def_struct_ui_text(srna, "Grease Pencil Sculpt Paint", "");
1385}
1386
1388{
1389 StructRNA *srna;
1390
1391 srna = RNA_def_struct(brna, "GpWeightPaint", "Paint");
1392 RNA_def_struct_path_func(srna, "rna_GpWeightPaint_path");
1393 RNA_def_struct_ui_text(srna, "Grease Pencil Weight Paint", "");
1395}
1396
1397/* use for weight paint too */
1399{
1400 StructRNA *srna;
1401 PropertyRNA *prop;
1402
1403 srna = RNA_def_struct(brna, "VertexPaint", "Paint");
1404 RNA_def_struct_sdna(srna, "VPaint");
1405 RNA_def_struct_path_func(srna, "rna_VertexPaint_path");
1406 RNA_def_struct_ui_text(srna, "Vertex Paint", "Properties of vertex and weight paint mode");
1408
1409 /* weight paint only */
1410 prop = RNA_def_property(srna, "use_group_restrict", PROP_BOOLEAN, PROP_NONE);
1412 RNA_def_property_ui_text(prop, "Restrict", "Restrict painting to vertices in the group");
1414}
1415
1417{
1418 StructRNA *srna;
1419 PropertyRNA *prop;
1420
1421 srna = RNA_def_struct(brna, "PaintModeSettings", nullptr);
1422 RNA_def_struct_sdna(srna, "PaintModeSettings");
1423 RNA_def_struct_path_func(srna, "rna_PaintModeSettings_path");
1424 RNA_def_struct_ui_text(srna, "Paint Mode", "Properties of paint mode");
1426
1427 prop = RNA_def_property(srna, "canvas_source", PROP_ENUM, PROP_NONE);
1430 RNA_def_property_ui_text(prop, "Source", "Source to select canvas from");
1431 RNA_def_property_update(prop, 0, "rna_PaintModeSettings_canvas_source_update");
1432
1433 prop = RNA_def_property(srna, "canvas_image", PROP_POINTER, PROP_NONE);
1435 prop, nullptr, nullptr, nullptr, "rna_Image_no_renderresult_or_viewer_poll");
1437 RNA_def_property_ui_text(prop, "Texture", "Image used as painting target");
1438}
1439
1441{
1442 StructRNA *srna;
1443 PropertyRNA *prop;
1444 FunctionRNA *func;
1445
1446 static const EnumPropertyItem paint_type_items[] = {
1448 "MATERIAL",
1449 0,
1450 "Material",
1451 "Detect image slots from the material"},
1453 "IMAGE",
1454 0,
1455 "Single Image",
1456 "Set image for texture painting directly"},
1457 {0, nullptr, 0, nullptr, nullptr},
1458 };
1459
1460 static const EnumPropertyItem paint_interp_items[] = {
1461 {IMAGEPAINT_INTERP_LINEAR, "LINEAR", 0, "Linear", "Linear interpolation"},
1463 "CLOSEST",
1464 0,
1465 "Closest",
1466 "No interpolation (sample closest texel)"},
1467 {0, nullptr, 0, nullptr, nullptr},
1468 };
1469
1470 srna = RNA_def_struct(brna, "ImagePaint", "Paint");
1471 RNA_def_struct_sdna(srna, "ImagePaintSettings");
1472 RNA_def_struct_path_func(srna, "rna_ImagePaintSettings_path");
1473 RNA_def_struct_ui_text(srna, "Image Paint", "Properties of image and texture painting mode");
1475
1476 /* functions */
1477 func = RNA_def_function(srna, "detect_data", "rna_ImaPaint_detect_data");
1478 RNA_def_function_ui_description(func, "Check if required texpaint data exist");
1479
1480 /* return type */
1481 RNA_def_function_return(func, RNA_def_boolean(func, "ok", true, "", ""));
1482
1483 /* booleans */
1484 prop = RNA_def_property(srna, "use_occlude", PROP_BOOLEAN, PROP_NONE);
1487 prop, "Occlude", "Only paint onto the faces directly under the brush (slower)");
1489
1490 prop = RNA_def_property(srna, "use_backface_culling", PROP_BOOLEAN, PROP_NONE);
1492 RNA_def_property_ui_text(prop, "Cull", "Ignore faces pointing away from the view (faster)");
1494
1495 prop = RNA_def_property(srna, "use_normal_falloff", PROP_BOOLEAN, PROP_NONE);
1497 RNA_def_property_ui_text(prop, "Normal", "Paint most on faces pointing towards the view");
1499
1500 prop = RNA_def_property(srna, "use_stencil_layer", PROP_BOOLEAN, PROP_NONE);
1502 RNA_def_property_ui_text(prop, "Stencil Layer", "Set the mask layer from the UV map buttons");
1503 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_viewport_update");
1504
1505 prop = RNA_def_property(srna, "invert_stencil", PROP_BOOLEAN, PROP_NONE);
1507 RNA_def_property_ui_text(prop, "Invert", "Invert the stencil layer");
1508 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_viewport_update");
1509
1510 prop = RNA_def_property(srna, "stencil_image", PROP_POINTER, PROP_NONE);
1511 RNA_def_property_pointer_sdna(prop, nullptr, "stencil");
1513 RNA_def_property_ui_text(prop, "Stencil Image", "Image used as stencil");
1514 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_stencil_update");
1516 prop, nullptr, nullptr, nullptr, "rna_Image_no_renderresult_or_viewer_poll");
1517
1518 prop = RNA_def_property(srna, "canvas", PROP_POINTER, PROP_NONE);
1520 RNA_def_property_ui_text(prop, "Canvas", "Image used as canvas");
1521 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_canvas_update");
1523 prop, nullptr, nullptr, nullptr, "rna_Image_no_renderresult_or_viewer_poll");
1524
1525 prop = RNA_def_property(srna, "clone_image", PROP_POINTER, PROP_NONE);
1526 RNA_def_property_pointer_sdna(prop, nullptr, "clone");
1528 RNA_def_property_ui_text(prop, "Clone Image", "Image used as clone source");
1531 prop, nullptr, nullptr, nullptr, "rna_Image_no_renderresult_or_viewer_poll");
1532
1533 prop = RNA_def_property(srna, "stencil_color", PROP_FLOAT, PROP_COLOR_GAMMA);
1534 RNA_def_property_range(prop, 0.0, 1.0);
1535 RNA_def_property_float_sdna(prop, nullptr, "stencil_col");
1536 RNA_def_property_ui_text(prop, "Stencil Color", "Stencil color in the viewport");
1537 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_viewport_update");
1538
1539 prop = RNA_def_property(srna, "dither", PROP_FLOAT, PROP_NONE);
1540 RNA_def_property_range(prop, 0.0, 2.0);
1541 RNA_def_property_ui_text(prop, "Dither", "Amount of dithering when painting on byte images");
1543
1544 prop = RNA_def_property(srna, "use_clone_layer", PROP_BOOLEAN, PROP_NONE);
1547 prop,
1548 "Clone Map",
1549 "Use another UV map as clone source, otherwise use the 3D cursor as the source");
1550 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_viewport_update");
1551
1552 /* integers */
1553
1554 prop = RNA_def_property(srna, "seam_bleed", PROP_INT, PROP_PIXEL);
1555 RNA_def_property_ui_range(prop, 0, 8, 1, -1);
1557 prop, "Bleed", "Extend paint beyond the faces' UVs to reduce seams (in pixels, slower)");
1558
1559 prop = RNA_def_property(srna, "normal_angle", PROP_INT, PROP_UNSIGNED);
1560 RNA_def_property_range(prop, 0, 90);
1562 prop, "Angle", "Paint most on faces pointing towards the view according to this angle");
1563
1564 prop = RNA_def_int_array(srna,
1565 "screen_grab_size",
1566 2,
1567 nullptr,
1568 0,
1569 0,
1570 "Screen Grab Size",
1571 "Size to capture the image for re-projecting",
1572 0,
1573 0);
1574 RNA_def_property_range(prop, 512, 16384);
1576
1577 prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
1579 RNA_def_property_enum_items(prop, paint_type_items);
1580 RNA_def_property_ui_text(prop, "Mode", "Mode of operation for projection painting");
1581 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_mode_update");
1582
1583 prop = RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE);
1584 RNA_def_property_enum_sdna(prop, nullptr, "interp");
1586 RNA_def_property_enum_items(prop, paint_interp_items);
1587 RNA_def_property_ui_text(prop, "Interpolation", "Texture filtering type");
1588 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_mode_update");
1589
1590 /* Missing data */
1591 prop = RNA_def_property(srna, "missing_uvs", PROP_BOOLEAN, PROP_NONE);
1592 RNA_def_property_boolean_sdna(prop, nullptr, "missing_data", IMAGEPAINT_MISSING_UVS);
1593 RNA_def_property_ui_text(prop, "Missing UVs", "A UV layer is missing on the mesh");
1595
1596 prop = RNA_def_property(srna, "missing_materials", PROP_BOOLEAN, PROP_NONE);
1597 RNA_def_property_boolean_sdna(prop, nullptr, "missing_data", IMAGEPAINT_MISSING_MATERIAL);
1598 RNA_def_property_ui_text(prop, "Missing Materials", "The mesh is missing materials");
1600
1601 prop = RNA_def_property(srna, "missing_stencil", PROP_BOOLEAN, PROP_NONE);
1602 RNA_def_property_boolean_sdna(prop, nullptr, "missing_data", IMAGEPAINT_MISSING_STENCIL);
1603 RNA_def_property_ui_text(prop, "Missing Stencil", "Image Painting does not have a stencil");
1605
1606 prop = RNA_def_property(srna, "missing_texture", PROP_BOOLEAN, PROP_NONE);
1607 RNA_def_property_boolean_sdna(prop, nullptr, "missing_data", IMAGEPAINT_MISSING_TEX);
1609 prop, "Missing Texture", "Image Painting does not have a texture to paint on");
1611
1612 prop = RNA_def_property(srna, "clone_alpha", PROP_FLOAT, PROP_FACTOR);
1613 RNA_def_property_float_sdna(prop, nullptr, "clone_alpha");
1614 RNA_def_property_range(prop, 0.0f, 1.0f);
1615 RNA_def_property_ui_text(prop, "Clone Alpha", "Opacity of clone image display");
1617
1618 prop = RNA_def_property(srna, "clone_offset", PROP_FLOAT, PROP_XYZ);
1619 RNA_def_property_float_sdna(prop, nullptr, "clone_offset");
1620 RNA_def_property_ui_text(prop, "Clone Offset", "");
1621 RNA_def_property_ui_range(prop, -1.0f, 1.0f, 10.0f, 3);
1623}
1624
1626{
1627 StructRNA *srna;
1628 PropertyRNA *prop;
1629
1630 static const EnumPropertyItem select_mode_items[] = {
1631 {SCE_SELECT_PATH, "PATH", ICON_PARTICLE_PATH, "Path", "Path edit mode"},
1632 {SCE_SELECT_POINT, "POINT", ICON_PARTICLE_POINT, "Point", "Point select mode"},
1633 {SCE_SELECT_END, "TIP", ICON_PARTICLE_TIP, "Tip", "Tip select mode"},
1634 {0, nullptr, 0, nullptr, nullptr},
1635 };
1636
1637 static const EnumPropertyItem puff_mode[] = {
1638 {0, "ADD", 0, "Add", "Make hairs more puffy"},
1639 {1, "SUB", 0, "Sub", "Make hairs less puffy"},
1640 {0, nullptr, 0, nullptr, nullptr},
1641 };
1642
1643 static const EnumPropertyItem length_mode[] = {
1644 {0, "GROW", 0, "Grow", "Make hairs longer"},
1645 {1, "SHRINK", 0, "Shrink", "Make hairs shorter"},
1646 {0, nullptr, 0, nullptr, nullptr},
1647 };
1648
1649 static const EnumPropertyItem edit_type_items[] = {
1650 {PE_TYPE_PARTICLES, "PARTICLES", 0, "Particles", ""},
1651 {PE_TYPE_SOFTBODY, "SOFT_BODY", 0, "Soft Body", ""},
1652 {PE_TYPE_CLOTH, "CLOTH", 0, "Cloth", ""},
1653 {0, nullptr, 0, nullptr, nullptr},
1654 };
1655
1656 /* edit */
1657
1658 srna = RNA_def_struct(brna, "ParticleEdit", nullptr);
1659 RNA_def_struct_sdna(srna, "ParticleEditSettings");
1660 RNA_def_struct_path_func(srna, "rna_ParticleEdit_path");
1661 RNA_def_struct_ui_text(srna, "Particle Edit", "Properties of particle editing mode");
1663
1664 prop = RNA_def_property(srna, "tool", PROP_ENUM, PROP_NONE);
1665 RNA_def_property_enum_sdna(prop, nullptr, "brushtype");
1668 prop, nullptr, "rna_ParticleEdit_tool_set", "rna_ParticleEdit_tool_itemf");
1670 RNA_def_property_ui_text(prop, "Tool", "");
1671
1672 prop = RNA_def_property(srna, "select_mode", PROP_ENUM, PROP_NONE);
1673 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "selectmode");
1674 RNA_def_property_enum_items(prop, select_mode_items);
1675 RNA_def_property_ui_text(prop, "Selection Mode", "Particle select and display mode");
1677 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ParticleEdit_update");
1678
1679 prop = RNA_def_property(srna, "use_preserve_length", PROP_BOOLEAN, PROP_NONE);
1680 RNA_def_property_boolean_sdna(prop, nullptr, "flag", PE_KEEP_LENGTHS);
1681 RNA_def_property_ui_text(prop, "Keep Lengths", "Keep path lengths constant");
1682
1683 prop = RNA_def_property(srna, "use_preserve_root", PROP_BOOLEAN, PROP_NONE);
1684 RNA_def_property_boolean_sdna(prop, nullptr, "flag", PE_LOCK_FIRST);
1685 RNA_def_property_ui_text(prop, "Keep Root", "Keep root keys unmodified");
1686
1687 prop = RNA_def_property(srna, "use_emitter_deflect", PROP_BOOLEAN, PROP_NONE);
1688 RNA_def_property_boolean_sdna(prop, nullptr, "flag", PE_DEFLECT_EMITTER);
1689 RNA_def_property_ui_text(prop, "Deflect Emitter", "Keep paths from intersecting the emitter");
1690
1691 prop = RNA_def_property(srna, "emitter_distance", PROP_FLOAT, PROP_DISTANCE);
1692 RNA_def_property_float_sdna(prop, nullptr, "emitterdist");
1693 RNA_def_property_ui_range(prop, 0.0f, 10.0f, 10, 3);
1695 prop, "Emitter Distance", "Distance to keep particles away from the emitter");
1696
1697 prop = RNA_def_property(srna, "use_fade_time", PROP_BOOLEAN, PROP_NONE);
1698 RNA_def_property_boolean_sdna(prop, nullptr, "flag", PE_FADE_TIME);
1700 prop, "Fade Time", "Fade paths and keys further away from current frame");
1702 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ParticleEdit_update");
1703
1704 prop = RNA_def_property(srna, "use_auto_velocity", PROP_BOOLEAN, PROP_NONE);
1705 RNA_def_property_boolean_sdna(prop, nullptr, "flag", PE_AUTO_VELOCITY);
1706 RNA_def_property_ui_text(prop, "Auto Velocity", "Calculate point velocities automatically");
1707
1708 prop = RNA_def_property(srna, "show_particles", PROP_BOOLEAN, PROP_NONE);
1710 RNA_def_property_boolean_sdna(prop, nullptr, "flag", PE_DRAW_PART);
1711 RNA_def_property_ui_text(prop, "Display Particles", "Display actual particles");
1712 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ParticleEdit_redo");
1713
1714 prop = RNA_def_property(srna, "use_default_interpolate", PROP_BOOLEAN, PROP_NONE);
1717 prop, "Interpolate", "Interpolate new particles from the existing ones");
1719
1720 prop = RNA_def_property(srna, "default_key_count", PROP_INT, PROP_NONE);
1721 RNA_def_property_int_sdna(prop, nullptr, "totaddkey");
1723 RNA_def_property_ui_range(prop, 2, 20, 10, 3);
1724 RNA_def_property_ui_text(prop, "Keys", "How many keys to make new particles with");
1725
1726 prop = RNA_def_property(srna, "brush", PROP_POINTER, PROP_NONE);
1727 RNA_def_property_struct_type(prop, "ParticleBrush");
1728 RNA_def_property_pointer_funcs(prop, "rna_ParticleEdit_brush_get", nullptr, nullptr, nullptr);
1729 RNA_def_property_ui_text(prop, "Brush", "");
1730
1731 prop = RNA_def_property(srna, "display_step", PROP_INT, PROP_NONE);
1732 RNA_def_property_int_sdna(prop, nullptr, "draw_step");
1734 RNA_def_property_range(prop, 1, 10);
1735 RNA_def_property_ui_text(prop, "Steps", "How many steps to display the path with");
1736 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ParticleEdit_redo");
1737
1738 prop = RNA_def_property(srna, "fade_frames", PROP_INT, PROP_NONE);
1739 RNA_def_property_range(prop, 1, 100);
1740 RNA_def_property_ui_text(prop, "Frames", "How many frames to fade");
1742 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ParticleEdit_update");
1743
1744 prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
1746 RNA_def_property_enum_sdna(prop, nullptr, "edittype");
1747 RNA_def_property_enum_items(prop, edit_type_items);
1748 RNA_def_property_ui_text(prop, "Type", "");
1749 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ParticleEdit_redo");
1750
1751 prop = RNA_def_property(srna, "is_editable", PROP_BOOLEAN, PROP_NONE);
1752 RNA_def_property_boolean_funcs(prop, "rna_ParticleEdit_editable_get", nullptr);
1754 RNA_def_property_ui_text(prop, "Editable", "A valid edit mode exists");
1755
1756 prop = RNA_def_property(srna, "is_hair", PROP_BOOLEAN, PROP_NONE);
1757 RNA_def_property_boolean_funcs(prop, "rna_ParticleEdit_hair_get", nullptr);
1759 RNA_def_property_ui_text(prop, "Hair", "Editing hair");
1760
1761 prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
1763 RNA_def_property_ui_text(prop, "Object", "The edited object");
1764
1765 prop = RNA_def_property(srna, "shape_object", PROP_POINTER, PROP_NONE);
1767 RNA_def_property_ui_text(prop, "Shape Object", "Outer shape to use for tools");
1768 RNA_def_property_pointer_funcs(prop, nullptr, nullptr, nullptr, "rna_Mesh_object_poll");
1769 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ParticleEdit_redo");
1770
1771 /* brush */
1772
1773 srna = RNA_def_struct(brna, "ParticleBrush", nullptr);
1774 RNA_def_struct_sdna(srna, "ParticleBrushData");
1775 RNA_def_struct_path_func(srna, "rna_ParticleBrush_path");
1776 RNA_def_struct_ui_text(srna, "Particle Brush", "Particle editing brush");
1777
1778 prop = RNA_def_property(srna, "size", PROP_INT, PROP_PIXEL);
1781 RNA_def_property_ui_text(prop, "Radius", "Radius of the brush in pixels");
1782
1783 prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_FACTOR);
1784 RNA_def_property_range(prop, 0.001, 1.0);
1785 RNA_def_property_ui_text(prop, "Strength", "Brush strength");
1787
1788 prop = RNA_def_property(srna, "count", PROP_INT, PROP_NONE);
1789 RNA_def_property_range(prop, 1, 1000);
1790 RNA_def_property_ui_range(prop, 1, 100, 10, 3);
1791 RNA_def_property_ui_text(prop, "Count", "Particle count");
1792
1793 prop = RNA_def_property(srna, "steps", PROP_INT, PROP_NONE);
1794 RNA_def_property_int_sdna(prop, nullptr, "step");
1796 RNA_def_property_ui_range(prop, 1, 50, 10, 3);
1797 RNA_def_property_ui_text(prop, "Steps", "Brush steps");
1798
1799 prop = RNA_def_property(srna, "puff_mode", PROP_ENUM, PROP_NONE);
1800 RNA_def_property_enum_sdna(prop, nullptr, "invert");
1801 RNA_def_property_enum_items(prop, puff_mode);
1802 RNA_def_property_ui_text(prop, "Puff Mode", "");
1803
1804 prop = RNA_def_property(srna, "use_puff_volume", PROP_BOOLEAN, PROP_NONE);
1807 prop,
1808 "Puff Volume",
1809 "Apply puff to unselected end-points (helps maintain hair volume when puffing root)");
1810
1811 prop = RNA_def_property(srna, "length_mode", PROP_ENUM, PROP_NONE);
1812 RNA_def_property_enum_sdna(prop, nullptr, "invert");
1813 RNA_def_property_enum_items(prop, length_mode);
1814 RNA_def_property_ui_text(prop, "Length Mode", "");
1815
1816 /* dummy */
1817 prop = RNA_def_property(srna, "curve", PROP_POINTER, PROP_NONE);
1818 RNA_def_property_struct_type(prop, "CurveMapping");
1819 RNA_def_property_pointer_funcs(prop, "rna_ParticleBrush_curve_get", nullptr, nullptr, nullptr);
1820 RNA_def_property_ui_text(prop, "Curve", "");
1821}
1822
1823/* srna -- gpencil speed guides */
1825{
1826 StructRNA *srna;
1827 PropertyRNA *prop;
1828
1829 srna = RNA_def_struct(brna, "GPencilSculptGuide", nullptr);
1830 RNA_def_struct_sdna(srna, "GP_Sculpt_Guide");
1831 RNA_def_struct_path_func(srna, "rna_GPencilSculptGuide_path");
1832 RNA_def_struct_ui_text(srna, "Grease Pencil Sculpt Guide", "Guides for drawing");
1833
1834 static const EnumPropertyItem prop_gpencil_guidetypes[] = {
1835 {GP_GUIDE_CIRCULAR, "CIRCULAR", 0, "Circular", "Use single point to create rings"},
1836 {GP_GUIDE_RADIAL, "RADIAL", 0, "Radial", "Use single point as direction"},
1837 {GP_GUIDE_PARALLEL, "PARALLEL", 0, "Parallel", "Parallel lines"},
1838 {GP_GUIDE_GRID, "GRID", 0, "Grid", "Grid allows horizontal and vertical lines"},
1839 {GP_GUIDE_ISO, "ISO", 0, "Isometric", "Grid allows isometric and vertical lines"},
1840 {0, nullptr, 0, nullptr, nullptr},
1841 };
1842
1843 static const EnumPropertyItem prop_gpencil_guide_references[] = {
1844 {GP_GUIDE_REF_CURSOR, "CURSOR", 0, "Cursor", "Use cursor as reference point"},
1845 {GP_GUIDE_REF_CUSTOM, "CUSTOM", 0, "Custom", "Use custom reference point"},
1846 {GP_GUIDE_REF_OBJECT, "OBJECT", 0, "Object", "Use object as reference point"},
1847 {0, nullptr, 0, nullptr, nullptr},
1848 };
1849
1850 prop = RNA_def_property(srna, "use_guide", PROP_BOOLEAN, PROP_NONE);
1851 RNA_def_property_boolean_sdna(prop, nullptr, "use_guide", false);
1853 RNA_def_property_ui_text(prop, "Use Guides", "Enable speed guides");
1856
1857 prop = RNA_def_property(srna, "use_snapping", PROP_BOOLEAN, PROP_NONE);
1858 RNA_def_property_boolean_sdna(prop, nullptr, "use_snapping", false);
1861 prop, "Use Snapping", "Enable snapping to guides angle or spacing options");
1864
1865 prop = RNA_def_property(srna, "reference_object", PROP_POINTER, PROP_NONE);
1866 RNA_def_property_pointer_sdna(prop, nullptr, "reference_object");
1867 RNA_def_property_ui_text(prop, "Object", "Object used for reference point");
1869 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_viewport_update");
1870
1871 prop = RNA_def_property(srna, "reference_point", PROP_ENUM, PROP_NONE);
1872 RNA_def_property_enum_sdna(prop, nullptr, "reference_point");
1873 RNA_def_property_enum_items(prop, prop_gpencil_guide_references);
1874 RNA_def_property_ui_text(prop, "Type", "Type of speed guide");
1876 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_viewport_update");
1877
1878 prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
1879 RNA_def_property_enum_sdna(prop, nullptr, "type");
1880 RNA_def_property_enum_items(prop, prop_gpencil_guidetypes);
1881 RNA_def_property_ui_text(prop, "Type", "Type of speed guide");
1884
1885 prop = RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE);
1886 RNA_def_property_float_sdna(prop, nullptr, "angle");
1887 RNA_def_property_range(prop, -(M_PI * 2.0f), (M_PI * 2.0f));
1888 RNA_def_property_ui_text(prop, "Angle", "Direction of lines");
1891
1892 prop = RNA_def_property(srna, "angle_snap", PROP_FLOAT, PROP_ANGLE);
1893 RNA_def_property_float_sdna(prop, nullptr, "angle_snap");
1894 RNA_def_property_range(prop, -(M_PI * 2.0f), (M_PI * 2.0f));
1895 RNA_def_property_ui_text(prop, "Angle Snap", "Angle snapping");
1898
1899 prop = RNA_def_property(srna, "spacing", PROP_FLOAT, PROP_DISTANCE);
1900 RNA_def_property_float_sdna(prop, nullptr, "spacing");
1901 RNA_def_property_range(prop, 0.0f, FLT_MAX);
1902 RNA_def_property_ui_range(prop, 0.0f, FLT_MAX, 1, 3);
1903 RNA_def_property_ui_text(prop, "Spacing", "Guide spacing");
1906
1907 prop = RNA_def_property(srna, "location", PROP_FLOAT, PROP_DISTANCE);
1908 RNA_def_property_float_sdna(prop, nullptr, "location");
1909 RNA_def_property_array(prop, 3);
1911 RNA_def_property_ui_text(prop, "Location", "Custom reference point for guides");
1914 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_viewport_update");
1915}
1916
1918{
1919 StructRNA *srna;
1920 PropertyRNA *prop;
1921
1922 /* == Settings == */
1923 srna = RNA_def_struct(brna, "GPencilSculptSettings", nullptr);
1924 RNA_def_struct_sdna(srna, "GP_Sculpt_Settings");
1925 RNA_def_struct_path_func(srna, "rna_GPencilSculptSettings_path");
1927 "GPencil Sculpt Settings",
1928 "General properties for Grease Pencil stroke sculpting tools");
1930
1931 prop = RNA_def_property(srna, "guide", PROP_POINTER, PROP_NONE);
1932 RNA_def_property_struct_type(prop, "GPencilSculptGuide");
1934 RNA_def_property_ui_text(prop, "Guide", "");
1935
1936 prop = RNA_def_property(srna, "use_multiframe_falloff", PROP_BOOLEAN, PROP_NONE);
1939 prop,
1940 "Use Falloff",
1941 "Use falloff effect when edit in multiframe mode to compute brush effect by frame");
1944
1945 prop = RNA_def_property(srna, "use_thickness_curve", PROP_BOOLEAN, PROP_NONE);
1947 RNA_def_property_ui_text(prop, "Use Curve", "Use curve to define primitive stroke thickness");
1950
1951 prop = RNA_def_property(srna, "use_scale_thickness", PROP_BOOLEAN, PROP_NONE);
1954 prop, "Scale Stroke Thickness", "Scale the stroke thickness when transforming strokes");
1957
1958 prop = RNA_def_property(srna, "use_automasking_stroke", PROP_BOOLEAN, PROP_NONE);
1960 RNA_def_property_ui_text(prop, "Auto-Masking Strokes", "Affect only strokes below the cursor");
1963
1964 prop = RNA_def_property(srna, "use_automasking_layer_stroke", PROP_BOOLEAN, PROP_NONE);
1966 RNA_def_property_ui_text(prop, "Auto-Masking Layer", "Affect only strokes below the cursor");
1969
1970 prop = RNA_def_property(srna, "use_automasking_material_stroke", PROP_BOOLEAN, PROP_NONE);
1972 prop, nullptr, "flag", GP_SCULPT_SETT_FLAG_AUTOMASK_MATERIAL_STROKE);
1973 RNA_def_property_ui_text(prop, "Auto-Masking Material", "Affect only strokes below the cursor");
1976
1977 prop = RNA_def_property(srna, "use_automasking_layer_active", PROP_BOOLEAN, PROP_NONE);
1979 RNA_def_property_ui_text(prop, "Auto-Masking Layer", "Affect only the Active Layer");
1982
1983 prop = RNA_def_property(srna, "use_automasking_material_active", PROP_BOOLEAN, PROP_NONE);
1985 prop, nullptr, "flag", GP_SCULPT_SETT_FLAG_AUTOMASK_MATERIAL_ACTIVE);
1986 RNA_def_property_ui_text(prop, "Auto-Masking Material", "Affect only the Active Material");
1989
1990 /* custom falloff curve */
1991 prop = RNA_def_property(srna, "multiframe_falloff_curve", PROP_POINTER, PROP_NONE);
1992 RNA_def_property_pointer_sdna(prop, nullptr, "cur_falloff");
1993 RNA_def_property_struct_type(prop, "CurveMapping");
1995 prop, "Curve", "Custom curve to control falloff of brush effect by Grease Pencil frames");
1998
1999 /* custom primitive curve */
2000 prop = RNA_def_property(srna, "thickness_primitive_curve", PROP_POINTER, PROP_NONE);
2001 RNA_def_property_pointer_sdna(prop, nullptr, "cur_primitive");
2002 RNA_def_property_struct_type(prop, "CurveMapping");
2003 RNA_def_property_ui_text(prop, "Curve", "Custom curve to control primitive thickness");
2006
2007 /* lock axis */
2008 prop = RNA_def_property(srna, "lock_axis", PROP_ENUM, PROP_NONE);
2009 RNA_def_property_enum_sdna(prop, nullptr, "lock_axis");
2011 RNA_def_property_ui_text(prop, "Lock Axis", "");
2013 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, nullptr);
2014
2015 /* threshold for cutter */
2016 prop = RNA_def_property(srna, "intersection_threshold", PROP_FLOAT, PROP_NONE);
2017 RNA_def_property_float_sdna(prop, nullptr, "isect_threshold");
2018 RNA_def_property_range(prop, 0.0f, 10.0f);
2020 RNA_def_property_ui_text(prop, "Threshold", "Threshold for stroke intersections");
2022}
2023
2025{
2026 StructRNA *srna;
2027
2028 srna = RNA_def_struct(brna, "CurvesSculpt", "Paint");
2029 RNA_def_struct_path_func(srna, "rna_CurvesSculpt_path");
2030 RNA_def_struct_ui_text(srna, "Curves Sculpt Paint", "");
2032}
2033
2035{
2036 /* *** Non-Animated *** */
2038 rna_def_paint_curve(brna);
2039 rna_def_paint(brna);
2042 rna_def_sculpt(brna);
2043 rna_def_uv_sculpt(brna);
2044 rna_def_gp_paint(brna);
2049 rna_def_paint_mode(brna);
2050 rna_def_image_paint(brna);
2056}
2057
2058} // namespace blender
2059
2060#endif
General operations, lookup, etc. for materials.
General operations, lookup, etc. for blender objects.
#define M_PI
#define BLT_I18NCONTEXT_AMOUNT
#define BLT_I18NCONTEXT_ID_CURVE_LEGACY
#define BLT_I18NCONTEXT_OPERATOR_DEFAULT
#define MAX_BRUSH_PIXEL_RADIUS
#define MAX_BRUSH_PIXEL_DIAMETER
#define AUTOMASKING_BOUNDARY_EDGES_MAX_PROPAGATION_STEPS
#define IMAGEPAINT_MODE_IMAGE
#define IMAGEPAINT_MODE_MATERIAL
#define PAINT_MAX_INPUT_SAMPLES
Read Blender memory allocation and freeing.
#define C
Definition RandGen.cpp:29
#define NC_GEOM
Definition WM_types.hh:406
#define ND_DRAW
Definition WM_types.hh:502
#define NC_BRUSH
Definition WM_types.hh:398
#define ND_DATA
Definition WM_types.hh:552
#define NC_SCENE
Definition WM_types.hh:391
#define ND_TOOLSETTINGS
Definition WM_types.hh:468
#define ND_MODIFIER
Definition WM_types.hh:503
#define NA_EDITED
Definition WM_types.hh:634
#define ND_PARTICLE
Definition WM_types.hh:506
#define NC_GPENCIL
Definition WM_types.hh:412
#define ND_OB_SHADING
Definition WM_types.hh:476
#define NC_OBJECT
Definition WM_types.hh:392
#define NA_SELECTED
Definition WM_types.hh:639
#define BLI_assert_unreachable()
#define SHRT_MAX
#define FLT_MAX
void invalidate_overlay_all(Scene &scene)
BMesh Iterators.
void psys_free_path_cache(struct ParticleSystem *psys, struct PTCacheEdit *edit)
Definition particle.cc:938
void WM_main_add_notifier(uint type, void *reference)
static const EnumPropertyItem rna_enum_gpencil_paint_mode[]
CurveMapping * BKE_curvemapping_add(int tot, float minx, float miny, float maxx, float maxy)
Definition colortools.cc:99
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
@ GP_SCULPT_SETT_FLAG_AUTOMASK_LAYER_ACTIVE
@ GP_SCULPT_SETT_FLAG_FRAME_FALLOFF
@ GP_SCULPT_SETT_FLAG_AUTOMASK_STROKE
@ GP_SCULPT_SETT_FLAG_AUTOMASK_MATERIAL_ACTIVE
@ GP_SCULPT_SETT_FLAG_PRIMITIVE_CURVE
@ GP_SCULPT_SETT_FLAG_AUTOMASK_LAYER_STROKE
@ GP_SCULPT_SETT_FLAG_AUTOMASK_MATERIAL_STROKE
@ GP_SCULPT_SETT_FLAG_SCALE_THICKNESS
@ PAINT_SHOW_BRUSH_ON_SURFACE
@ PAINT_SCULPT_DELAY_UPDATES
__int64 int64_t
Definition BKE_text.h:90
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
void RNA_def_property_deprecated(PropertyRNA *prop, const char *note, const short version, const short removal_version)
const EnumPropertyItem rna_enum_shared_automasking_flag_items[]
Definition rna_brush.cc:95
void RNA_def_struct_ui_icon(StructRNA *srna, int icon)
Object * BKE_view_layer_active_object_get(const ViewLayer *view_layer)
@ IMAGEPAINT_MISSING_STENCIL
@ IMAGEPAINT_MISSING_MATERIAL
void RNA_def_property_boolean_negative_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
void BKE_particle_batch_cache_dirty_tag(struct ParticleSystem *psys, int mode)
Definition particle.cc:5580
@ VP_FLAG_VGROUP_RESTRICT
const EnumPropertyItem rna_enum_particle_edit_hair_brush_items[]
@ IMAGEPAINT_PROJECT_LAYER_STENCIL_INV
@ IMAGEPAINT_PROJECT_LAYER_STENCIL
@ IMAGEPAINT_PROJECT_FLAT
@ IMAGEPAINT_PROJECT_XRAY
@ IMAGEPAINT_PROJECT_LAYER_CLONE
@ IMAGEPAINT_PROJECT_BACKFACE
void RNA_def_property_ui_scale_type(PropertyRNA *prop, PropertyScaleType ui_scale_type)
static const EnumPropertyItem rna_enum_canvas_source_items[]
void RNA_def_property_float_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
void RNA_def_property_pointer_sdna(PropertyRNA *prop, const char *structname, const char *propname)
struct ParticleSystem * psys_get_current(struct Object *ob)
Definition particle.cc:571
static void rna_def_particle_edit(BlenderRNA *brna)
void ED_space_image_sync(Main *bmain, Image *image, bool ignore_render_viewer)
Definition image_edit.cc:79
void RNA_def_property_pointer_funcs(PropertyRNA *prop, const char *get, const char *set, const char *type_fn, const char *poll)
PointerRNA RNA_id_pointer_create(ID *id)
Depsgraph * CTX_data_depsgraph_pointer(const bContext *C)
void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const char *set)
@ BRUSH_COLOR_JITTER_USE_SAT_RAND_PRESS
@ BRUSH_COLOR_JITTER_USE_HUE_AT_STROKE
@ BRUSH_COLOR_JITTER_USE_VAL_AT_STROKE
@ BRUSH_COLOR_JITTER_USE_HUE_RAND_PRESS
@ BRUSH_COLOR_JITTER_USE_SAT_AT_STROKE
@ BRUSH_COLOR_JITTER_USE_VAL_RAND_PRESS
@ IMAGEPAINT_INTERP_CLOSEST
@ IMAGEPAINT_INTERP_LINEAR
void RNA_def_function_ui_description(FunctionRNA *func, const char *description)
static void rna_def_gp_sculptpaint(BlenderRNA *brna)
const EnumPropertyItem rna_enum_symmetrize_direction_items[]
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
void BKE_brush_scale_size(int *r_brush_size, float new_unprojected_size, float old_unprojected_size)
Definition brush.cc:1429
void RNA_def_property_enum_bitflag_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_define_animate_sdna(bool animate)
ViewLayer * CTX_data_view_layer(const bContext *C)
void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double step, int precision)
@ PE_BRUSH_DATA_PUFF_VOLUME
void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_float_default(PropertyRNA *prop, float value)
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_sculpt(BlenderRNA *brna)
static void rna_def_gp_weightpaint(BlenderRNA *brna)
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier_c_str, int type, int subtype)
static void rna_def_unified_paint_settings(BlenderRNA *brna)
void RNA_def_sculpt_paint(BlenderRNA *brna)
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
@ PROP_SCALE_CUBIC
Definition RNA_types.hh:263
PTCacheEdit * PE_get_current(Depsgraph *depsgraph, Scene *scene, Object *ob)
@ PROP_BOOLEAN
Definition RNA_types.hh:210
@ PROP_POINTER
Definition RNA_types.hh:215
void RNA_def_property_int_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
void DEG_id_tag_update(ID *id, unsigned int flags)
void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
void RNA_def_property_range(PropertyRNA *prop, double min, double max)
static void rna_def_gp_vertexpaint(BlenderRNA *brna)
static void rna_def_vertex_paint(BlenderRNA *brna)
void RNA_def_struct_path_func(StructRNA *srna, const char *path)
static void rna_def_curves_sculpt(BlenderRNA *brna)
void RNA_def_property_subtype(PropertyRNA *prop, PropertySubType subtype)
void RNA_def_function_return(FunctionRNA *func, PropertyRNA *ret)
@ SCULPT_TRANSFORM_MODE_RADIUS_ELASTIC
@ SCULPT_TRANSFORM_MODE_ALL_VERTICES
bool BKE_view_layer_synced_ensure(const Main &bmain, const Scene *scene, ViewLayer *view_layer)
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)
static void rna_def_paint_curve(BlenderRNA *brna)
@ SCULPT_DYNTOPO_DETAIL_CONSTANT
@ SCULPT_DYNTOPO_COLLAPSE
@ SCULPT_DYNTOPO_SUBDIVIDE
@ SCULPT_DYNTOPO_DETAIL_MANUAL
@ SCULPT_DYNTOPO_DETAIL_BRUSH
static void rna_def_paint_mode(BlenderRNA *brna)
void RNA_def_struct_clear_flag(StructRNA *srna, StructFlag flag)
void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char *set, const char *item)
static void rna_def_paint(BlenderRNA *brna)
void BKE_brush_color_sync_legacy(Brush *brush)
Definition brush.cc:1319
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier_c_str, const char *call)
static void rna_def_gpencil_guides(BlenderRNA *brna)
void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void BKE_brush_scale_unprojected_size(float *unprojected_size, int new_brush_size, int old_brush_size)
Definition brush.cc:1417
void RNA_def_property_boolean_default(PropertyRNA *prop, bool value)
@ BRUSH_AUTOMASKING_CAVITY_NORMAL
@ BRUSH_AUTOMASKING_CAVITY_INVERTED
void RNA_def_property_translation_context(PropertyRNA *prop, const char *context)
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
Main * CTX_data_main(const bContext *C)
@ PAINT_CANVAS_SOURCE_IMAGE
@ PAINT_CANVAS_SOURCE_MATERIAL
@ PAINT_CANVAS_SOURCE_COLOR_ATTRIBUTE
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
@ ID_RECALC_SHADING
Definition DNA_ID.h:1094
@ ID_RECALC_SYNC_TO_EVAL
Definition DNA_ID.h:1118
@ ID_RECALC_GEOMETRY
Definition DNA_ID.h:1074
ID_Type GS(const char *name)
Definition DNA_ID.h:410
@ PROP_CONTEXT_UPDATE
Definition RNA_types.hh:477
@ PROP_EDITABLE
Definition RNA_types.hh:376
@ PROP_ID_SELF_CHECK
Definition RNA_types.hh:440
@ PROP_NEVER_NULL
Definition RNA_types.hh:447
@ PROP_ANIMATABLE
Definition RNA_types.hh:389
void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const char *propname)
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)
static void rna_def_uv_sculpt(BlenderRNA *brna)
Brush * BKE_paint_brush(Paint *paint)
void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *func)
PointerRNA RNA_pointer_create_with_parent(const PointerRNA &parent, StructRNA *type, void *data)
@ GPPAINT_FLAG_USE_VERTEXCOLOR
@ GPPAINT_FLAG_USE_MATERIAL
void BKE_texpaint_slots_refresh_object(Scene *scene, Object *ob)
Scene * CTX_data_scene(const bContext *C)
const EnumPropertyItem rna_enum_brush_curve_preset_items[]
Definition rna_brush.cc:79
@ UNIFIED_PAINT_INPUT_SAMPLES_DEPRECATED
@ UNIFIED_PAINT_SIZE_DEPRECATED
@ UNIFIED_PAINT_COLOR_DEPRECATED
@ UNIFIED_PAINT_BRUSH_LOCK_SIZE
@ UNIFIED_PAINT_COLOR_JITTER
@ UNIFIED_PAINT_ALPHA_DEPRECATED
@ UNIFIED_PAINT_WEIGHT_DEPRECATED
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
@ PROP_PERCENTAGE
Definition RNA_types.hh:307
@ PROP_XYZ_LENGTH
Definition RNA_types.hh:327
@ PROP_FACTOR
Definition RNA_types.hh:308
@ PROP_DISTANCE_DIAMETER
Definition RNA_types.hh:351
@ PROP_DISTANCE
Definition RNA_types.hh:313
@ PROP_PIXEL_DIAMETER
Definition RNA_types.hh:350
@ PROP_COLOR_GAMMA
Definition RNA_types.hh:329
@ PROP_UNSIGNED
Definition RNA_types.hh:306
static const EnumPropertyItem rna_enum_gpencil_lock_axis_items[]
static void rna_def_gp_paint(BlenderRNA *brna)
@ PAINT_SYMMETRY_FEATHER
Object * CTX_data_active_object(const bContext *C)
static void rna_def_mesh_automasking_settings(BlenderRNA *brna)
void RNA_def_property_array(PropertyRNA *prop, int length)
void RNA_def_property_ui_icon(PropertyRNA *prop, int icon, int consecutive)
Paint * BKE_paint_get_active(const Main &bmain, Scene *sce, ViewLayer *view_layer)
@ PAINT_DEBUG_SHOW_BVH_NODES
signed char int8_t
Definition BKE_text.h:76
static void rna_def_gpencil_sculpt(BlenderRNA *brna)
@ PAINT_CURVE_SHOW_STRENGTH
@ PAINT_CURVE_SHOW_AUTO_SMOOTH
@ PAINT_CURVE_SHOW_JITTER
@ PAINT_CURVE_SHOW_SIZE
@ PAINT_CURVE_SHOW_HARDNESS
@ PAINT_CURVE_SHOW_SPACING
static void rna_def_image_paint(BlenderRNA *brna)
@ BKE_PARTICLE_BATCH_DIRTY_ALL
const NodeType * type
Definition graph/node.h:179