Blender V4.5
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_collection.hh"
105# include "BKE_colortools.hh"
106# include "BKE_context.hh"
107# include "BKE_gpencil_legacy.h"
108# include "BKE_layer.hh"
109# include "BKE_material.hh"
110# include "BKE_object.hh"
111# include "BKE_paint.hh"
112# include "BKE_particle.h"
113# include "BKE_pointcache.h"
114
115# include "DEG_depsgraph.hh"
116
117# include "ED_gpencil_legacy.hh"
118# include "ED_image.hh"
119# include "ED_paint.hh"
120# include "ED_particle.hh"
121
122const EnumPropertyItem rna_enum_particle_edit_disconnected_hair_brush_items[] = {
123 {PE_BRUSH_COMB, "COMB", 0, "Comb", "Comb hairs"},
124 {PE_BRUSH_SMOOTH, "SMOOTH", 0, "Smooth", "Smooth hairs"},
125 {PE_BRUSH_LENGTH, "LENGTH", 0, "Length", "Make hairs longer or shorter"},
126 {PE_BRUSH_CUT, "CUT", 0, "Cut", "Cut hairs"},
127 {PE_BRUSH_WEIGHT, "WEIGHT", 0, "Weight", "Weight hair particles"},
128 {0, nullptr, 0, nullptr, nullptr},
129};
130
131static const EnumPropertyItem particle_edit_cache_brush_items[] = {
132 {PE_BRUSH_COMB, "COMB", 0, "Comb", "Comb paths"},
133 {PE_BRUSH_SMOOTH, "SMOOTH", 0, "Smooth", "Smooth paths"},
134 {PE_BRUSH_LENGTH, "LENGTH", 0, "Length", "Make paths longer or shorter"},
135 {0, nullptr, 0, nullptr, nullptr},
136};
137
138static PointerRNA rna_ParticleEdit_brush_get(PointerRNA *ptr)
139{
141 ParticleBrushData *brush = nullptr;
142
143 brush = &pset->brush[pset->brushtype];
144
145 return RNA_pointer_create_with_parent(*ptr, &RNA_ParticleBrush, brush);
146}
147
148static PointerRNA rna_ParticleBrush_curve_get(PointerRNA * /*ptr*/)
149{
150 return PointerRNA_NULL;
151}
152
153static void rna_ParticleEdit_redo(bContext *C, PointerRNA * /*ptr*/)
154{
156 Scene *scene = CTX_data_scene(C);
157 ViewLayer *view_layer = CTX_data_view_layer(C);
158 BKE_view_layer_synced_ensure(scene, view_layer);
160 PTCacheEdit *edit = PE_get_current(depsgraph, scene, ob);
161
162 if (!edit) {
163 return;
164 }
165
166 if (ob) {
168 }
169
170 if (edit->psys) {
172 psys_free_path_cache(edit->psys, edit);
173 }
175}
176
177static void rna_ParticleEdit_update(bContext *C, PointerRNA * /*ptr*/)
178{
179 Scene *scene = CTX_data_scene(C);
180 ViewLayer *view_layer = CTX_data_view_layer(C);
181 BKE_view_layer_synced_ensure(scene, view_layer);
183
184 if (ob) {
186 }
187
188 /* Sync tool setting changes from original to evaluated scenes. */
190}
191
192static void rna_ParticleEdit_tool_set(PointerRNA *ptr, int value)
193{
195
196 /* redraw hair completely if weight brush is/was used */
197 if ((pset->brushtype == PE_BRUSH_WEIGHT || value == PE_BRUSH_WEIGHT) && pset->object) {
198 Object *ob = pset->object;
199 if (ob) {
202 }
203 }
204
205 pset->brushtype = value;
206}
207static const EnumPropertyItem *rna_ParticleEdit_tool_itemf(bContext *C,
208 PointerRNA * /*ptr*/,
209 PropertyRNA * /*prop*/,
210 bool * /*r_free*/)
211{
212 const Scene *scene = CTX_data_scene(C);
213 ViewLayer *view_layer = CTX_data_view_layer(C);
214 BKE_view_layer_synced_ensure(scene, view_layer);
216# if 0
218 Scene *scene = CTX_data_scene(C);
219 PTCacheEdit *edit = PE_get_current(depsgraph, scene, ob);
220 ParticleSystem *psys = edit ? edit->psys : nullptr;
221# else
222 /* use this rather than PE_get_current() - because the editing cache is
223 * dependent on the cache being updated which can happen after this UI
224 * draws causing a glitch #28883. */
226# endif
227
228 if (psys) {
229 if (psys->flag & PSYS_GLOBAL_HAIR) {
230 return rna_enum_particle_edit_disconnected_hair_brush_items;
231 }
232 else {
234 }
235 }
236
237 return particle_edit_cache_brush_items;
238}
239
240static bool rna_ParticleEdit_editable_get(PointerRNA *ptr)
241{
243
244 return (pset->object && pset->scene && PE_get_current(nullptr, pset->scene, pset->object));
245}
246static bool rna_ParticleEdit_hair_get(PointerRNA *ptr)
247{
249
250 if (pset->scene) {
251 PTCacheEdit *edit = PE_get_current(nullptr, pset->scene, pset->object);
252
253 return (edit && edit->psys);
254 }
255
256 return 0;
257}
258
259static std::optional<std::string> rna_ParticleEdit_path(const PointerRNA * /*ptr*/)
260{
261 return "tool_settings.particle_edit";
262}
263
264static PointerRNA rna_Paint_brush_get(PointerRNA *ptr)
265{
266 Paint *paint = static_cast<Paint *>(ptr->data);
267 Brush *brush = BKE_paint_brush(paint);
268 if (!brush) {
269 return PointerRNA_NULL;
270 }
271 return RNA_id_pointer_create(&brush->id);
272}
273
274static bool rna_Paint_brush_poll(PointerRNA *ptr, PointerRNA value)
275{
276 const Paint *paint = static_cast<Paint *>(ptr->data);
277 const Brush *brush = static_cast<Brush *>(value.data);
278
279 return (brush == nullptr) || (paint->runtime.ob_mode & brush->ob_mode) != 0;
280}
281
282static PointerRNA rna_Paint_eraser_brush_get(PointerRNA *ptr)
283{
284 Paint *paint = static_cast<Paint *>(ptr->data);
285 Brush *brush = BKE_paint_eraser_brush(paint);
286 if (!brush) {
287 return PointerRNA_NULL;
288 }
289 return RNA_id_pointer_create(&brush->id);
290}
291
292static void rna_Paint_eraser_brush_set(PointerRNA *ptr, PointerRNA value, ReportList * /*reports*/)
293{
294 Paint *paint = static_cast<Paint *>(ptr->data);
295 Brush *brush = static_cast<Brush *>(value.data);
296 BKE_paint_eraser_brush_set(paint, brush);
298}
299
300static bool rna_Paint_eraser_brush_poll(PointerRNA *ptr, PointerRNA value)
301{
302 const Paint *paint = static_cast<Paint *>(ptr->data);
303 const Brush *brush = static_cast<Brush *>(value.data);
304
305 return (brush == nullptr) || (paint->runtime.ob_mode & brush->ob_mode) != 0;
306}
307
308static void rna_Sculpt_update(bContext *C, PointerRNA * /*ptr*/)
309{
310 Scene *scene = CTX_data_scene(C);
311 ViewLayer *view_layer = CTX_data_view_layer(C);
312 BKE_view_layer_synced_ensure(scene, view_layer);
314
315 if (ob) {
318 }
319}
320
321static std::optional<std::string> rna_Sculpt_path(const PointerRNA * /*ptr*/)
322{
323 return "tool_settings.sculpt";
324}
325
326static std::optional<std::string> rna_VertexPaint_path(const PointerRNA *ptr)
327{
328 const Scene *scene = (Scene *)ptr->owner_id;
329 const ToolSettings *ts = scene->toolsettings;
330 if (ptr->data == ts->vpaint) {
331 return "tool_settings.vertex_paint";
332 }
333 return "tool_settings.weight_paint";
334}
335
336static std::optional<std::string> rna_ImagePaintSettings_path(const PointerRNA * /*ptr*/)
337{
338 return "tool_settings.image_paint";
339}
340
341static std::optional<std::string> rna_PaintModeSettings_path(const PointerRNA * /*ptr*/)
342{
343 return "tool_settings.paint_mode";
344}
345
346static std::optional<std::string> rna_UvSculpt_path(const PointerRNA * /*ptr*/)
347{
348 return "tool_settings.uv_sculpt";
349}
350
351static std::optional<std::string> rna_CurvesSculpt_path(const PointerRNA * /*ptr*/)
352{
353 return "tool_settings.curves_sculpt";
354}
355
356static std::optional<std::string> rna_GpPaint_path(const PointerRNA * /*ptr*/)
357{
358 return "tool_settings.gpencil_paint";
359}
360
361static std::optional<std::string> rna_GpVertexPaint_path(const PointerRNA * /*ptr*/)
362{
363 return "tool_settings.gpencil_vertex_paint";
364}
365
366static std::optional<std::string> rna_GpSculptPaint_path(const PointerRNA * /*ptr*/)
367{
368 return "tool_settings.gpencil_sculpt_paint";
369}
370
371static std::optional<std::string> rna_GpWeightPaint_path(const PointerRNA * /*ptr*/)
372{
373 return "tool_settings.gpencil_weight_paint";
374}
375
376static std::optional<std::string> rna_ParticleBrush_path(const PointerRNA * /*ptr*/)
377{
378 return "tool_settings.particle_edit.brush";
379}
380
381static void rna_ImaPaint_viewport_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA * /*ptr*/)
382{
383 /* not the best solution maybe, but will refresh the 3D viewport */
385}
386
387static void rna_ImaPaint_mode_update(bContext *C, PointerRNA * /*ptr*/)
388{
389 Scene *scene = CTX_data_scene(C);
390 ViewLayer *view_layer = CTX_data_view_layer(C);
391 BKE_view_layer_synced_ensure(scene, view_layer);
393
394 if (ob && ob->type == OB_MESH) {
395 /* of course we need to invalidate here */
397
398 /* We assume that changing the current mode will invalidate the uv layers
399 * so we need to refresh display. */
400 ED_paint_proj_mesh_data_check(*scene, *ob, nullptr, nullptr, nullptr, nullptr);
402 }
403}
404
405static void rna_ImaPaint_stencil_update(bContext *C, PointerRNA * /*ptr*/)
406{
407 Scene *scene = CTX_data_scene(C);
408 ViewLayer *view_layer = CTX_data_view_layer(C);
409 BKE_view_layer_synced_ensure(scene, view_layer);
411
412 if (ob && ob->type == OB_MESH) {
413 ED_paint_proj_mesh_data_check(*scene, *ob, nullptr, nullptr, nullptr, nullptr);
415 }
416}
417
418static bool rna_ImaPaint_imagetype_poll(PointerRNA * /*ptr*/, PointerRNA value)
419{
420 Image *image = (Image *)value.owner_id;
421 return image->type != IMA_TYPE_R_RESULT && image->type != IMA_TYPE_COMPOSITE;
422}
423
424static void rna_ImaPaint_canvas_update(bContext *C, PointerRNA * /*ptr*/)
425{
426 Main *bmain = CTX_data_main(C);
427 Scene *scene = CTX_data_scene(C);
428 ViewLayer *view_layer = CTX_data_view_layer(C);
429 BKE_view_layer_synced_ensure(scene, view_layer);
431 Image *ima = scene->toolsettings->imapaint.canvas;
432
433 ED_space_image_sync(bmain, ima, false);
434
435 if (ob && ob->type == OB_MESH) {
436 ED_paint_proj_mesh_data_check(*scene, *ob, nullptr, nullptr, nullptr, nullptr);
438 }
439}
440
441static void rna_UvSculpt_curve_preset_set(PointerRNA *ptr, int value)
442{
443 Scene *scene = reinterpret_cast<Scene *>(ptr->owner_id);
444 if (value == BRUSH_CURVE_CUSTOM) {
445 if (!scene->toolsettings->uvsculpt.strength_curve) {
447 1, 0.0f, 0.0f, 1.0f, 1.0f);
448 }
449 }
450 scene->toolsettings->uvsculpt.curve_preset = int8_t(value);
451}
452
455
456static bool rna_PaintModeSettings_canvas_image_poll(PointerRNA * /*ptr*/, PointerRNA value)
457{
458 Image *image = (Image *)value.owner_id;
459 return !ELEM(image->type, IMA_TYPE_COMPOSITE, IMA_TYPE_R_RESULT);
460}
461
462static void rna_PaintModeSettings_canvas_source_update(bContext *C, PointerRNA * /*ptr*/)
463{
464 Scene *scene = CTX_data_scene(C);
466 /* When canvas source changes the #pbvh::Tree would require updates when switching between color
467 * attributes. */
468 if (ob && ob->type == OB_MESH) {
470 DEG_id_tag_update(&ob->id, 0);
472 }
473}
474
475/* \} */
476
477static bool rna_ImaPaint_detect_data(ImagePaintSettings *imapaint)
478{
479 return imapaint->missing_data == 0;
480}
481
482static std::optional<std::string> rna_GPencilSculptSettings_path(const PointerRNA * /*ptr*/)
483{
484 return "tool_settings.gpencil_sculpt";
485}
486
487static std::optional<std::string> rna_GPencilSculptGuide_path(const PointerRNA * /*ptr*/)
488{
489 return "tool_settings.gpencil_sculpt.guide";
490}
491
492static void rna_Sculpt_automasking_invert_cavity_set(PointerRNA *ptr, bool val)
493{
494 Sculpt *sd = (Sculpt *)ptr->data;
495
496 if (val) {
497 sd->automasking_flags &= ~BRUSH_AUTOMASKING_CAVITY_NORMAL;
498 sd->automasking_flags |= BRUSH_AUTOMASKING_CAVITY_INVERTED;
499 }
500 else {
501 sd->automasking_flags &= ~BRUSH_AUTOMASKING_CAVITY_INVERTED;
502 }
503}
504
505static void rna_Sculpt_automasking_cavity_set(PointerRNA *ptr, bool val)
506{
507 Sculpt *sd = (Sculpt *)ptr->data;
508
509 if (val) {
510 sd->automasking_flags &= ~BRUSH_AUTOMASKING_CAVITY_INVERTED;
511 sd->automasking_flags |= BRUSH_AUTOMASKING_CAVITY_NORMAL;
512 }
513 else {
514 sd->automasking_flags &= ~BRUSH_AUTOMASKING_CAVITY_NORMAL;
515 }
516}
517#else
518
520{
521 StructRNA *srna;
522
523 srna = RNA_def_struct(brna, "PaintCurve", "ID");
524 RNA_def_struct_ui_text(srna, "Paint Curve", "");
525 RNA_def_struct_ui_icon(srna, ICON_CURVE_BEZCURVE);
526}
527
528static void rna_def_paint(BlenderRNA *brna)
529{
530 StructRNA *srna;
531 PropertyRNA *prop;
532
533 srna = RNA_def_struct(brna, "Paint", nullptr);
534 RNA_def_struct_ui_text(srna, "Paint", "");
535
536 /* Global Settings */
537 prop = RNA_def_property(srna, "brush", PROP_POINTER, PROP_NONE);
539 RNA_def_property_struct_type(prop, "Brush");
541 prop, "rna_Paint_brush_get", nullptr, nullptr, "rna_Paint_brush_poll");
542 RNA_def_property_ui_text(prop, "Brush", "Active brush");
544
545 prop = RNA_def_property(srna, "brush_asset_reference", PROP_POINTER, PROP_NONE);
548 "Brush Asset Reference",
549 "A weak reference to the matching brush asset, used e.g. to restore "
550 "the last used brush on file load");
551
552 prop = RNA_def_property(srna, "eraser_brush", PROP_POINTER, PROP_NONE);
554 RNA_def_property_struct_type(prop, "Brush");
556 "rna_Paint_eraser_brush_get",
557 "rna_Paint_eraser_brush_set",
558 nullptr,
559 "rna_Paint_eraser_brush_poll");
561 "Default Eraser Brush",
562 "Default eraser brush for quickly alternating with the main brush");
564
565 prop = RNA_def_property(srna, "eraser_brush_asset_reference", PROP_POINTER, PROP_NONE);
568 "Eraser Brush Asset Reference",
569 "A weak reference to the matching brush asset, used e.g. to restore "
570 "the last used brush on file load");
571
572 prop = RNA_def_property(srna, "palette", PROP_POINTER, PROP_NONE);
574 RNA_def_property_pointer_funcs(prop, nullptr, nullptr, nullptr, nullptr);
575 RNA_def_property_ui_text(prop, "Palette", "Active Palette");
576
577 prop = RNA_def_property(srna, "show_brush", PROP_BOOLEAN, PROP_NONE);
578 RNA_def_property_boolean_sdna(prop, nullptr, "flags", PAINT_SHOW_BRUSH);
579 RNA_def_property_ui_text(prop, "Show Brush", "");
581
582 prop = RNA_def_property(srna, "show_brush_on_surface", PROP_BOOLEAN, PROP_NONE);
584 RNA_def_property_ui_text(prop, "Show Brush On Surface", "");
586
587 prop = RNA_def_property(srna, "show_low_resolution", PROP_BOOLEAN, PROP_NONE);
588 RNA_def_property_boolean_sdna(prop, nullptr, "flags", PAINT_FAST_NAVIGATE);
590 prop, "Fast Navigate", "For multires, show low resolution while navigating the view");
592
593 prop = RNA_def_property(srna, "use_sculpt_delay_updates", PROP_BOOLEAN, PROP_NONE);
596 prop,
597 "Delay Viewport Updates",
598 "Update the geometry when it enters the view, providing faster view navigation");
600
601 prop = RNA_def_property(srna, "use_symmetry_x", PROP_BOOLEAN, PROP_NONE);
602 RNA_def_property_boolean_sdna(prop, nullptr, "symmetry_flags", PAINT_SYMM_X);
603 RNA_def_property_ui_text(prop, "Symmetry X", "Mirror brush across the X axis");
605
606 prop = RNA_def_property(srna, "use_symmetry_y", PROP_BOOLEAN, PROP_NONE);
607 RNA_def_property_boolean_sdna(prop, nullptr, "symmetry_flags", PAINT_SYMM_Y);
608 RNA_def_property_ui_text(prop, "Symmetry Y", "Mirror brush across the Y axis");
610
611 prop = RNA_def_property(srna, "use_symmetry_z", PROP_BOOLEAN, PROP_NONE);
612 RNA_def_property_boolean_sdna(prop, nullptr, "symmetry_flags", PAINT_SYMM_Z);
613 RNA_def_property_ui_text(prop, "Symmetry Z", "Mirror brush across the Z axis");
615
616 prop = RNA_def_property(srna, "use_symmetry_feather", PROP_BOOLEAN, PROP_NONE);
617 RNA_def_property_boolean_sdna(prop, nullptr, "symmetry_flags", PAINT_SYMMETRY_FEATHER);
619 "Symmetry Feathering",
620 "Reduce the strength of the brush where it overlaps symmetrical daubs");
622
623 prop = RNA_def_property(srna, "cavity_curve", PROP_POINTER, PROP_NONE);
625 RNA_def_property_ui_text(prop, "Curve", "Editable cavity curve");
627
628 prop = RNA_def_property(srna, "use_cavity", PROP_BOOLEAN, PROP_NONE);
630 RNA_def_property_ui_text(prop, "Cavity Mask", "Mask painting according to mesh geometry cavity");
632
633 prop = RNA_def_property(srna, "tile_offset", PROP_FLOAT, PROP_XYZ_LENGTH);
634 RNA_def_property_float_sdna(prop, nullptr, "tile_offset");
635 RNA_def_property_array(prop, 3);
636 RNA_def_property_range(prop, 0.01, FLT_MAX);
637 RNA_def_property_ui_range(prop, 0.01, 100, 1 * 100, 2);
639 prop, "Tiling offset for the X Axis", "Stride at which tiled strokes are copied");
640
641 prop = RNA_def_property(srna, "tile_x", PROP_BOOLEAN, PROP_NONE);
642 RNA_def_property_boolean_sdna(prop, nullptr, "symmetry_flags", PAINT_TILE_X);
643 RNA_def_property_ui_text(prop, "Tile X", "Tile along X axis");
645
646 prop = RNA_def_property(srna, "tile_y", PROP_BOOLEAN, PROP_NONE);
647 RNA_def_property_boolean_sdna(prop, nullptr, "symmetry_flags", PAINT_TILE_Y);
648 RNA_def_property_ui_text(prop, "Tile Y", "Tile along Y axis");
650
651 prop = RNA_def_property(srna, "tile_z", PROP_BOOLEAN, PROP_NONE);
652 RNA_def_property_boolean_sdna(prop, nullptr, "symmetry_flags", PAINT_TILE_Z);
653 RNA_def_property_ui_text(prop, "Tile Z", "Tile along Z axis");
655}
656
657static void rna_def_sculpt(BlenderRNA *brna)
658{
659 static const EnumPropertyItem detail_refine_items[] = {
661 "SUBDIVIDE",
662 0,
663 "Subdivide Edges",
664 "Subdivide long edges to add mesh detail where needed"},
666 "COLLAPSE",
667 0,
668 "Collapse Edges",
669 "Collapse short edges to remove mesh detail where possible"},
671 "SUBDIVIDE_COLLAPSE",
672 0,
673 "Subdivide Collapse",
674 "Both subdivide long edges and collapse short edges to refine mesh detail"},
675 {0, nullptr, 0, nullptr, nullptr},
676 };
677
678 static const EnumPropertyItem detail_type_items[] = {
679 {0,
680 "RELATIVE",
681 0,
682 "Relative Detail",
683 "Mesh detail is relative to the brush size and detail size"},
685 "CONSTANT",
686 0,
687 "Constant Detail",
688 "Mesh detail is constant in world space according to detail size"},
690 "BRUSH",
691 0,
692 "Brush Detail",
693 "Mesh detail is relative to brush radius"},
695 "MANUAL",
696 0,
697 "Manual Detail",
698 "Mesh detail does not change on each stroke, only when using Flood Fill"},
699 {0, nullptr, 0, nullptr, nullptr},
700 };
701
702 static const EnumPropertyItem sculpt_transform_mode_items[] = {
704 "ALL_VERTICES",
705 0,
706 "All Vertices",
707 "Applies the transformation to all vertices in the mesh"},
709 "RADIUS_ELASTIC",
710 0,
711 "Elastic",
712 "Applies the transformation simulating elasticity using the radius of the cursor"},
713 {0, nullptr, 0, nullptr, nullptr},
714 };
715
716 StructRNA *srna;
717 PropertyRNA *prop;
718
719 srna = RNA_def_struct(brna, "Sculpt", "Paint");
720 RNA_def_struct_path_func(srna, "rna_Sculpt_path");
721 RNA_def_struct_ui_text(srna, "Sculpt", "");
723
724 prop = RNA_def_property(srna, "radial_symmetry", PROP_INT, PROP_XYZ);
725 RNA_def_property_int_sdna(prop, nullptr, "radial_symm");
727 RNA_def_property_range(prop, 1, 64);
728 RNA_def_property_ui_range(prop, 0, 32, 1, 1);
730 prop, "Radial Symmetry Count X Axis", "Number of times to copy strokes across the surface");
731
732 prop = RNA_def_property(srna, "lock_x", PROP_BOOLEAN, PROP_NONE);
733 RNA_def_property_boolean_sdna(prop, nullptr, "flags", SCULPT_LOCK_X);
734 RNA_def_property_ui_text(prop, "Lock X", "Disallow changes to the X axis of vertices");
736
737 prop = RNA_def_property(srna, "lock_y", PROP_BOOLEAN, PROP_NONE);
738 RNA_def_property_boolean_sdna(prop, nullptr, "flags", SCULPT_LOCK_Y);
739 RNA_def_property_ui_text(prop, "Lock Y", "Disallow changes to the Y axis of vertices");
741
742 prop = RNA_def_property(srna, "lock_z", PROP_BOOLEAN, PROP_NONE);
743 RNA_def_property_boolean_sdna(prop, nullptr, "flags", SCULPT_LOCK_Z);
744 RNA_def_property_ui_text(prop, "Lock Z", "Disallow changes to the Z axis of vertices");
746
747 prop = RNA_def_property(srna, "use_deform_only", PROP_BOOLEAN, PROP_NONE);
748 RNA_def_property_boolean_sdna(prop, nullptr, "flags", SCULPT_ONLY_DEFORM);
750 "Use Deform Only",
751 "Use only deformation modifiers (temporary disable all "
752 "constructive modifiers except multi-resolution)");
754 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Sculpt_update");
755
756 prop = RNA_def_property(srna, "detail_size", PROP_FLOAT, PROP_PIXEL);
757 RNA_def_property_range(prop, 0.5, 40.0);
758 RNA_def_property_ui_range(prop, 0.5, 40.0, 0.1, 2);
761 prop, "Detail Size", "Maximum edge length for dynamic topology sculpting (in pixels)");
763
764 prop = RNA_def_property(srna, "detail_percent", PROP_FLOAT, PROP_PERCENTAGE);
765 RNA_def_property_range(prop, 0.5, 100.0);
766 RNA_def_property_ui_range(prop, 0.5, 100.0, 10, 2);
768 prop,
769 "Detail Percentage",
770 "Maximum edge length for dynamic topology sculpting (in brush percentage)");
772
773 prop = RNA_def_property(srna, "constant_detail_resolution", PROP_FLOAT, PROP_NONE);
774 RNA_def_property_float_sdna(prop, nullptr, "constant_detail");
775 RNA_def_property_range(prop, 0.0001, FLT_MAX);
776 RNA_def_property_ui_range(prop, 0.001, 1000.0, 10, 2);
778 "Resolution",
779 "Maximum edge length for dynamic topology sculpting (as divisor "
780 "of Blender unit - higher value means smaller edge length)");
782
784 do {
785 prop = RNA_def_property(srna, entry->identifier, PROP_BOOLEAN, PROP_NONE);
786 RNA_def_property_boolean_sdna(prop, nullptr, "automasking_flags", entry->value);
787 RNA_def_property_ui_text(prop, entry->name, entry->description);
788
790 RNA_def_property_boolean_funcs(prop, nullptr, "rna_Sculpt_automasking_cavity_set");
791 }
792 else if (entry->value == BRUSH_AUTOMASKING_CAVITY_INVERTED) {
793 RNA_def_property_boolean_funcs(prop, nullptr, "rna_Sculpt_automasking_invert_cavity_set");
794 }
795
797 } while ((++entry)->identifier);
798
799 prop = RNA_def_property(
800 srna, "automasking_boundary_edges_propagation_steps", PROP_INT, PROP_UNSIGNED);
801 RNA_def_property_int_sdna(prop, nullptr, "automasking_boundary_edges_propagation_steps");
805 "Propagation Steps",
806 "Distance where boundary edge automasking is going to protect vertices "
807 "from the fully masked edge");
809
810 prop = RNA_def_property(srna, "automasking_cavity_factor", PROP_FLOAT, PROP_FACTOR);
811 RNA_def_property_float_sdna(prop, nullptr, "automasking_cavity_factor");
812 RNA_def_property_ui_text(prop, "Cavity Factor", "The contrast of the cavity mask");
814 RNA_def_property_range(prop, 0.0f, 5.0f);
815 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
817
818 prop = RNA_def_property(srna, "automasking_cavity_blur_steps", PROP_INT, PROP_NONE);
819 RNA_def_property_int_sdna(prop, nullptr, "automasking_cavity_blur_steps");
820 RNA_def_property_ui_text(prop, "Blur Steps", "The number of times the cavity mask is blurred");
822 RNA_def_property_range(prop, 0, 25);
823 RNA_def_property_ui_range(prop, 0, 10, 1, 1);
825
826 prop = RNA_def_property(srna, "automasking_cavity_curve", PROP_POINTER, PROP_NONE);
827 RNA_def_property_pointer_sdna(prop, nullptr, "automasking_cavity_curve");
828 RNA_def_property_struct_type(prop, "CurveMapping");
829 RNA_def_property_ui_text(prop, "Cavity Curve", "Curve used for the sensitivity");
832
833 prop = RNA_def_property(srna, "automasking_cavity_curve_op", PROP_POINTER, PROP_NONE);
834 RNA_def_property_pointer_sdna(prop, nullptr, "automasking_cavity_curve_op");
835 RNA_def_property_struct_type(prop, "CurveMapping");
836 RNA_def_property_ui_text(prop, "Cavity Curve", "Curve used for the sensitivity");
839
840 prop = RNA_def_property(srna, "use_automasking_start_normal", PROP_BOOLEAN, PROP_NONE);
842 prop, nullptr, "automasking_flags", BRUSH_AUTOMASKING_BRUSH_NORMAL);
844 prop,
845 "Area Normal",
846 "Affect only vertices with a similar normal to where the stroke starts");
848
849 prop = RNA_def_property(srna, "use_automasking_view_normal", PROP_BOOLEAN, PROP_NONE);
850 RNA_def_property_boolean_sdna(prop, nullptr, "automasking_flags", BRUSH_AUTOMASKING_VIEW_NORMAL);
852 prop, "View Normal", "Affect only vertices with a normal that faces the viewer");
854
855 prop = RNA_def_property(srna, "use_automasking_view_occlusion", PROP_BOOLEAN, PROP_NONE);
857 prop, nullptr, "automasking_flags", BRUSH_AUTOMASKING_VIEW_OCCLUSION);
859 prop,
860 "Occlusion",
861 "Only affect vertices that are not occluded by other faces (slower performance)");
863
864 prop = RNA_def_property(srna, "automasking_start_normal_limit", PROP_FLOAT, PROP_ANGLE);
865 RNA_def_property_float_sdna(prop, nullptr, "automasking_start_normal_limit");
866 RNA_def_property_range(prop, 0.0001f, M_PI);
867 RNA_def_property_ui_text(prop, "Area Normal Limit", "The range of angles that will be affected");
869
870 prop = RNA_def_property(srna, "automasking_start_normal_falloff", PROP_FLOAT, PROP_FACTOR);
871 RNA_def_property_float_sdna(prop, nullptr, "automasking_start_normal_falloff");
872 RNA_def_property_range(prop, 0.0001f, 1.0f);
874 prop, "Area Normal Falloff", "Extend the angular range with a falloff gradient");
876
877 prop = RNA_def_property(srna, "automasking_view_normal_limit", PROP_FLOAT, PROP_ANGLE);
878 RNA_def_property_float_sdna(prop, nullptr, "automasking_view_normal_limit");
879 RNA_def_property_range(prop, 0.0001f, M_PI);
880 RNA_def_property_ui_text(prop, "View Normal Limit", "The range of angles that will be affected");
882
883 prop = RNA_def_property(srna, "automasking_view_normal_falloff", PROP_FLOAT, PROP_FACTOR);
884 RNA_def_property_float_sdna(prop, nullptr, "automasking_view_normal_falloff");
885 RNA_def_property_range(prop, 0.0001f, 1.0f);
887 prop, "View Normal Falloff", "Extend the angular range with a falloff gradient");
889
890 prop = RNA_def_property(srna, "symmetrize_direction", PROP_ENUM, PROP_NONE);
892 RNA_def_property_ui_text(prop, "Direction", "Source and destination for symmetrize operator");
893
894 prop = RNA_def_property(srna, "detail_refine_method", PROP_ENUM, PROP_NONE);
895 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flags");
896 RNA_def_property_enum_items(prop, detail_refine_items);
898 prop, "Detail Refine Method", "In dynamic-topology mode, how to add or remove mesh detail");
900
901 prop = RNA_def_property(srna, "detail_type_method", PROP_ENUM, PROP_NONE);
902 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flags");
903 RNA_def_property_enum_items(prop, detail_type_items);
905 prop, "Detail Type Method", "In dynamic-topology mode, how mesh detail size is calculated");
907
908 prop = RNA_def_property(srna, "gravity", PROP_FLOAT, PROP_FACTOR);
909 RNA_def_property_float_sdna(prop, nullptr, "gravity_factor");
910 RNA_def_property_range(prop, 0.0f, 1.0f);
911 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
912 RNA_def_property_ui_text(prop, "Gravity", "Amount of gravity after each dab");
914
915 prop = RNA_def_property(srna, "transform_mode", PROP_ENUM, PROP_NONE);
916 RNA_def_property_enum_items(prop, sculpt_transform_mode_items);
918 prop, "Transform Mode", "How the transformation is going to be applied to the target");
920
921 prop = RNA_def_property(srna, "gravity_object", PROP_POINTER, PROP_NONE);
924 prop, "Orientation", "Object whose Z axis defines orientation of gravity");
926}
927
929{
930 StructRNA *srna;
931 PropertyRNA *prop;
932
933 srna = RNA_def_struct(brna, "UvSculpt", nullptr);
934 RNA_def_struct_path_func(srna, "rna_UvSculpt_path");
935 RNA_def_struct_ui_text(srna, "UV Sculpting", "");
937
938 prop = RNA_def_property(srna, "size", PROP_INT, PROP_PIXEL);
939 RNA_def_property_ui_range(prop, 1, 500, 1, 1);
940 RNA_def_property_range(prop, 1, 5000);
941 RNA_def_property_ui_text(prop, "Size", "");
943
944 prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_FACTOR);
945 RNA_def_property_range(prop, 0.0f, 1.0f);
946 RNA_def_property_ui_text(prop, "Strength", "");
949
950 prop = RNA_def_property(srna, "strength_curve", PROP_POINTER, PROP_NONE);
951 RNA_def_property_struct_type(prop, "CurveMapping");
952 RNA_def_property_pointer_funcs(prop, nullptr, nullptr, nullptr, nullptr);
953 RNA_def_property_ui_text(prop, "Strength Curve", "");
955
956 prop = RNA_def_property(srna, "curve_preset", PROP_ENUM, PROP_NONE);
958 RNA_def_property_ui_text(prop, "Strength Curve Preset", "");
960 RNA_def_property_enum_funcs(prop, nullptr, "rna_UvSculpt_curve_preset_set", nullptr);
962}
963
964static void rna_def_gp_paint(BlenderRNA *brna)
965{
966 StructRNA *srna;
967 PropertyRNA *prop;
968
969 srna = RNA_def_struct(brna, "GpPaint", "Paint");
970 RNA_def_struct_path_func(srna, "rna_GpPaint_path");
971 RNA_def_struct_ui_text(srna, "Grease Pencil Paint", "");
973
974 /* Use vertex color (main switch). */
975 prop = RNA_def_property(srna, "color_mode", PROP_ENUM, PROP_NONE);
976 RNA_def_property_enum_sdna(prop, nullptr, "mode");
978 RNA_def_property_ui_text(prop, "Mode", "Paint Mode");
981}
982
984{
985 StructRNA *srna;
986
987 srna = RNA_def_struct(brna, "GpVertexPaint", "Paint");
988 RNA_def_struct_path_func(srna, "rna_GpVertexPaint_path");
989 RNA_def_struct_ui_text(srna, "Grease Pencil Vertex Paint", "");
991}
992
994{
995 StructRNA *srna;
996
997 srna = RNA_def_struct(brna, "GpSculptPaint", "Paint");
998 RNA_def_struct_path_func(srna, "rna_GpSculptPaint_path");
999 RNA_def_struct_ui_text(srna, "Grease Pencil Sculpt Paint", "");
1001}
1002
1004{
1005 StructRNA *srna;
1006
1007 srna = RNA_def_struct(brna, "GpWeightPaint", "Paint");
1008 RNA_def_struct_path_func(srna, "rna_GpWeightPaint_path");
1009 RNA_def_struct_ui_text(srna, "Grease Pencil Weight Paint", "");
1011}
1012
1013/* use for weight paint too */
1015{
1016 StructRNA *srna;
1017 PropertyRNA *prop;
1018
1019 srna = RNA_def_struct(brna, "VertexPaint", "Paint");
1020 RNA_def_struct_sdna(srna, "VPaint");
1021 RNA_def_struct_path_func(srna, "rna_VertexPaint_path");
1022 RNA_def_struct_ui_text(srna, "Vertex Paint", "Properties of vertex and weight paint mode");
1024
1025 /* weight paint only */
1026 prop = RNA_def_property(srna, "use_group_restrict", PROP_BOOLEAN, PROP_NONE);
1028 RNA_def_property_ui_text(prop, "Restrict", "Restrict painting to vertices in the group");
1030
1031 /* Mirroring */
1032 prop = RNA_def_property(srna, "radial_symmetry", PROP_INT, PROP_XYZ);
1033 RNA_def_property_int_sdna(prop, nullptr, "radial_symm");
1035 RNA_def_property_range(prop, 1, 64);
1036 RNA_def_property_ui_range(prop, 1, 32, 1, 1);
1038 prop, "Radial Symmetry Count X Axis", "Number of times to copy strokes across the surface");
1039}
1040
1042{
1043 StructRNA *srna;
1044 PropertyRNA *prop;
1045
1046 srna = RNA_def_struct(brna, "PaintModeSettings", nullptr);
1047 RNA_def_struct_sdna(srna, "PaintModeSettings");
1048 RNA_def_struct_path_func(srna, "rna_PaintModeSettings_path");
1049 RNA_def_struct_ui_text(srna, "Paint Mode", "Properties of paint mode");
1051
1052 prop = RNA_def_property(srna, "canvas_source", PROP_ENUM, PROP_NONE);
1055 RNA_def_property_ui_text(prop, "Source", "Source to select canvas from");
1056 RNA_def_property_update(prop, 0, "rna_PaintModeSettings_canvas_source_update");
1057
1058 prop = RNA_def_property(srna, "canvas_image", PROP_POINTER, PROP_NONE);
1060 prop, nullptr, nullptr, nullptr, "rna_PaintModeSettings_canvas_image_poll");
1062 RNA_def_property_ui_text(prop, "Texture", "Image used as painting target");
1063}
1064
1066{
1067 StructRNA *srna;
1068 PropertyRNA *prop;
1069 FunctionRNA *func;
1070
1071 static const EnumPropertyItem paint_type_items[] = {
1073 "MATERIAL",
1074 0,
1075 "Material",
1076 "Detect image slots from the material"},
1078 "IMAGE",
1079 0,
1080 "Single Image",
1081 "Set image for texture painting directly"},
1082 {0, nullptr, 0, nullptr, nullptr},
1083 };
1084
1085 static const EnumPropertyItem paint_interp_items[] = {
1086 {IMAGEPAINT_INTERP_LINEAR, "LINEAR", 0, "Linear", "Linear interpolation"},
1088 "CLOSEST",
1089 0,
1090 "Closest",
1091 "No interpolation (sample closest texel)"},
1092 {0, nullptr, 0, nullptr, nullptr},
1093 };
1094
1095 srna = RNA_def_struct(brna, "ImagePaint", "Paint");
1096 RNA_def_struct_sdna(srna, "ImagePaintSettings");
1097 RNA_def_struct_path_func(srna, "rna_ImagePaintSettings_path");
1098 RNA_def_struct_ui_text(srna, "Image Paint", "Properties of image and texture painting mode");
1100
1101 /* functions */
1102 func = RNA_def_function(srna, "detect_data", "rna_ImaPaint_detect_data");
1103 RNA_def_function_ui_description(func, "Check if required texpaint data exist");
1104
1105 /* return type */
1106 RNA_def_function_return(func, RNA_def_boolean(func, "ok", true, "", ""));
1107
1108 /* booleans */
1109 prop = RNA_def_property(srna, "use_occlude", PROP_BOOLEAN, PROP_NONE);
1112 prop, "Occlude", "Only paint onto the faces directly under the brush (slower)");
1114
1115 prop = RNA_def_property(srna, "use_backface_culling", PROP_BOOLEAN, PROP_NONE);
1117 RNA_def_property_ui_text(prop, "Cull", "Ignore faces pointing away from the view (faster)");
1119
1120 prop = RNA_def_property(srna, "use_normal_falloff", PROP_BOOLEAN, PROP_NONE);
1122 RNA_def_property_ui_text(prop, "Normal", "Paint most on faces pointing towards the view");
1124
1125 prop = RNA_def_property(srna, "use_stencil_layer", PROP_BOOLEAN, PROP_NONE);
1127 RNA_def_property_ui_text(prop, "Stencil Layer", "Set the mask layer from the UV map buttons");
1128 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_viewport_update");
1129
1130 prop = RNA_def_property(srna, "invert_stencil", PROP_BOOLEAN, PROP_NONE);
1132 RNA_def_property_ui_text(prop, "Invert", "Invert the stencil layer");
1133 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_viewport_update");
1134
1135 prop = RNA_def_property(srna, "stencil_image", PROP_POINTER, PROP_NONE);
1136 RNA_def_property_pointer_sdna(prop, nullptr, "stencil");
1138 RNA_def_property_ui_text(prop, "Stencil Image", "Image used as stencil");
1139 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_stencil_update");
1140 RNA_def_property_pointer_funcs(prop, nullptr, nullptr, nullptr, "rna_ImaPaint_imagetype_poll");
1141
1142 prop = RNA_def_property(srna, "canvas", PROP_POINTER, PROP_NONE);
1144 RNA_def_property_ui_text(prop, "Canvas", "Image used as canvas");
1145 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_canvas_update");
1146 RNA_def_property_pointer_funcs(prop, nullptr, nullptr, nullptr, "rna_ImaPaint_imagetype_poll");
1147
1148 prop = RNA_def_property(srna, "clone_image", PROP_POINTER, PROP_NONE);
1149 RNA_def_property_pointer_sdna(prop, nullptr, "clone");
1151 RNA_def_property_ui_text(prop, "Clone Image", "Image used as clone source");
1153 RNA_def_property_pointer_funcs(prop, nullptr, nullptr, nullptr, "rna_ImaPaint_imagetype_poll");
1154
1155 prop = RNA_def_property(srna, "stencil_color", PROP_FLOAT, PROP_COLOR_GAMMA);
1156 RNA_def_property_range(prop, 0.0, 1.0);
1157 RNA_def_property_float_sdna(prop, nullptr, "stencil_col");
1158 RNA_def_property_ui_text(prop, "Stencil Color", "Stencil color in the viewport");
1159 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_viewport_update");
1160
1161 prop = RNA_def_property(srna, "dither", PROP_FLOAT, PROP_NONE);
1162 RNA_def_property_range(prop, 0.0, 2.0);
1163 RNA_def_property_ui_text(prop, "Dither", "Amount of dithering when painting on byte images");
1165
1166 prop = RNA_def_property(srna, "use_clone_layer", PROP_BOOLEAN, PROP_NONE);
1169 prop,
1170 "Clone Map",
1171 "Use another UV map as clone source, otherwise use the 3D cursor as the source");
1172 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_viewport_update");
1173
1174 /* integers */
1175
1176 prop = RNA_def_property(srna, "seam_bleed", PROP_INT, PROP_PIXEL);
1177 RNA_def_property_ui_range(prop, 0, 8, 1, -1);
1179 prop, "Bleed", "Extend paint beyond the faces' UVs to reduce seams (in pixels, slower)");
1180
1181 prop = RNA_def_property(srna, "normal_angle", PROP_INT, PROP_UNSIGNED);
1182 RNA_def_property_range(prop, 0, 90);
1184 prop, "Angle", "Paint most on faces pointing towards the view according to this angle");
1185
1186 prop = RNA_def_int_array(srna,
1187 "screen_grab_size",
1188 2,
1189 nullptr,
1190 0,
1191 0,
1192 "Screen Grab Size",
1193 "Size to capture the image for re-projecting",
1194 0,
1195 0);
1196 RNA_def_property_range(prop, 512, 16384);
1198
1199 prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
1201 RNA_def_property_enum_items(prop, paint_type_items);
1202 RNA_def_property_ui_text(prop, "Mode", "Mode of operation for projection painting");
1203 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_mode_update");
1204
1205 prop = RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE);
1206 RNA_def_property_enum_sdna(prop, nullptr, "interp");
1208 RNA_def_property_enum_items(prop, paint_interp_items);
1209 RNA_def_property_ui_text(prop, "Interpolation", "Texture filtering type");
1210 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_mode_update");
1211
1212 /* Missing data */
1213 prop = RNA_def_property(srna, "missing_uvs", PROP_BOOLEAN, PROP_NONE);
1214 RNA_def_property_boolean_sdna(prop, nullptr, "missing_data", IMAGEPAINT_MISSING_UVS);
1215 RNA_def_property_ui_text(prop, "Missing UVs", "A UV layer is missing on the mesh");
1217
1218 prop = RNA_def_property(srna, "missing_materials", PROP_BOOLEAN, PROP_NONE);
1219 RNA_def_property_boolean_sdna(prop, nullptr, "missing_data", IMAGEPAINT_MISSING_MATERIAL);
1220 RNA_def_property_ui_text(prop, "Missing Materials", "The mesh is missing materials");
1222
1223 prop = RNA_def_property(srna, "missing_stencil", PROP_BOOLEAN, PROP_NONE);
1224 RNA_def_property_boolean_sdna(prop, nullptr, "missing_data", IMAGEPAINT_MISSING_STENCIL);
1225 RNA_def_property_ui_text(prop, "Missing Stencil", "Image Painting does not have a stencil");
1227
1228 prop = RNA_def_property(srna, "missing_texture", PROP_BOOLEAN, PROP_NONE);
1229 RNA_def_property_boolean_sdna(prop, nullptr, "missing_data", IMAGEPAINT_MISSING_TEX);
1231 prop, "Missing Texture", "Image Painting does not have a texture to paint on");
1233
1234 prop = RNA_def_property(srna, "clone_alpha", PROP_FLOAT, PROP_FACTOR);
1235 RNA_def_property_float_sdna(prop, nullptr, "clone_alpha");
1236 RNA_def_property_range(prop, 0.0f, 1.0f);
1237 RNA_def_property_ui_text(prop, "Clone Alpha", "Opacity of clone image display");
1239
1240 prop = RNA_def_property(srna, "clone_offset", PROP_FLOAT, PROP_XYZ);
1241 RNA_def_property_float_sdna(prop, nullptr, "clone_offset");
1242 RNA_def_property_ui_text(prop, "Clone Offset", "");
1243 RNA_def_property_ui_range(prop, -1.0f, 1.0f, 10.0f, 3);
1245}
1246
1248{
1249 StructRNA *srna;
1250 PropertyRNA *prop;
1251
1252 static const EnumPropertyItem select_mode_items[] = {
1253 {SCE_SELECT_PATH, "PATH", ICON_PARTICLE_PATH, "Path", "Path edit mode"},
1254 {SCE_SELECT_POINT, "POINT", ICON_PARTICLE_POINT, "Point", "Point select mode"},
1255 {SCE_SELECT_END, "TIP", ICON_PARTICLE_TIP, "Tip", "Tip select mode"},
1256 {0, nullptr, 0, nullptr, nullptr},
1257 };
1258
1259 static const EnumPropertyItem puff_mode[] = {
1260 {0, "ADD", 0, "Add", "Make hairs more puffy"},
1261 {1, "SUB", 0, "Sub", "Make hairs less puffy"},
1262 {0, nullptr, 0, nullptr, nullptr},
1263 };
1264
1265 static const EnumPropertyItem length_mode[] = {
1266 {0, "GROW", 0, "Grow", "Make hairs longer"},
1267 {1, "SHRINK", 0, "Shrink", "Make hairs shorter"},
1268 {0, nullptr, 0, nullptr, nullptr},
1269 };
1270
1271 static const EnumPropertyItem edit_type_items[] = {
1272 {PE_TYPE_PARTICLES, "PARTICLES", 0, "Particles", ""},
1273 {PE_TYPE_SOFTBODY, "SOFT_BODY", 0, "Soft Body", ""},
1274 {PE_TYPE_CLOTH, "CLOTH", 0, "Cloth", ""},
1275 {0, nullptr, 0, nullptr, nullptr},
1276 };
1277
1278 /* edit */
1279
1280 srna = RNA_def_struct(brna, "ParticleEdit", nullptr);
1281 RNA_def_struct_sdna(srna, "ParticleEditSettings");
1282 RNA_def_struct_path_func(srna, "rna_ParticleEdit_path");
1283 RNA_def_struct_ui_text(srna, "Particle Edit", "Properties of particle editing mode");
1285
1286 prop = RNA_def_property(srna, "tool", PROP_ENUM, PROP_NONE);
1287 RNA_def_property_enum_sdna(prop, nullptr, "brushtype");
1290 prop, nullptr, "rna_ParticleEdit_tool_set", "rna_ParticleEdit_tool_itemf");
1292 RNA_def_property_ui_text(prop, "Tool", "");
1293
1294 prop = RNA_def_property(srna, "select_mode", PROP_ENUM, PROP_NONE);
1295 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "selectmode");
1296 RNA_def_property_enum_items(prop, select_mode_items);
1297 RNA_def_property_ui_text(prop, "Selection Mode", "Particle select and display mode");
1299 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ParticleEdit_update");
1300
1301 prop = RNA_def_property(srna, "use_preserve_length", PROP_BOOLEAN, PROP_NONE);
1302 RNA_def_property_boolean_sdna(prop, nullptr, "flag", PE_KEEP_LENGTHS);
1303 RNA_def_property_ui_text(prop, "Keep Lengths", "Keep path lengths constant");
1304
1305 prop = RNA_def_property(srna, "use_preserve_root", PROP_BOOLEAN, PROP_NONE);
1306 RNA_def_property_boolean_sdna(prop, nullptr, "flag", PE_LOCK_FIRST);
1307 RNA_def_property_ui_text(prop, "Keep Root", "Keep root keys unmodified");
1308
1309 prop = RNA_def_property(srna, "use_emitter_deflect", PROP_BOOLEAN, PROP_NONE);
1310 RNA_def_property_boolean_sdna(prop, nullptr, "flag", PE_DEFLECT_EMITTER);
1311 RNA_def_property_ui_text(prop, "Deflect Emitter", "Keep paths from intersecting the emitter");
1312
1313 prop = RNA_def_property(srna, "emitter_distance", PROP_FLOAT, PROP_DISTANCE);
1314 RNA_def_property_float_sdna(prop, nullptr, "emitterdist");
1315 RNA_def_property_ui_range(prop, 0.0f, 10.0f, 10, 3);
1317 prop, "Emitter Distance", "Distance to keep particles away from the emitter");
1318
1319 prop = RNA_def_property(srna, "use_fade_time", PROP_BOOLEAN, PROP_NONE);
1320 RNA_def_property_boolean_sdna(prop, nullptr, "flag", PE_FADE_TIME);
1322 prop, "Fade Time", "Fade paths and keys further away from current frame");
1324 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ParticleEdit_update");
1325
1326 prop = RNA_def_property(srna, "use_auto_velocity", PROP_BOOLEAN, PROP_NONE);
1327 RNA_def_property_boolean_sdna(prop, nullptr, "flag", PE_AUTO_VELOCITY);
1328 RNA_def_property_ui_text(prop, "Auto Velocity", "Calculate point velocities automatically");
1329
1330 prop = RNA_def_property(srna, "show_particles", PROP_BOOLEAN, PROP_NONE);
1332 RNA_def_property_boolean_sdna(prop, nullptr, "flag", PE_DRAW_PART);
1333 RNA_def_property_ui_text(prop, "Display Particles", "Display actual particles");
1334 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ParticleEdit_redo");
1335
1336 prop = RNA_def_property(srna, "use_default_interpolate", PROP_BOOLEAN, PROP_NONE);
1339 prop, "Interpolate", "Interpolate new particles from the existing ones");
1341
1342 prop = RNA_def_property(srna, "default_key_count", PROP_INT, PROP_NONE);
1343 RNA_def_property_int_sdna(prop, nullptr, "totaddkey");
1344 RNA_def_property_range(prop, 2, SHRT_MAX);
1345 RNA_def_property_ui_range(prop, 2, 20, 10, 3);
1346 RNA_def_property_ui_text(prop, "Keys", "How many keys to make new particles with");
1347
1348 prop = RNA_def_property(srna, "brush", PROP_POINTER, PROP_NONE);
1349 RNA_def_property_struct_type(prop, "ParticleBrush");
1350 RNA_def_property_pointer_funcs(prop, "rna_ParticleEdit_brush_get", nullptr, nullptr, nullptr);
1351 RNA_def_property_ui_text(prop, "Brush", "");
1352
1353 prop = RNA_def_property(srna, "display_step", PROP_INT, PROP_NONE);
1354 RNA_def_property_int_sdna(prop, nullptr, "draw_step");
1356 RNA_def_property_range(prop, 1, 10);
1357 RNA_def_property_ui_text(prop, "Steps", "How many steps to display the path with");
1358 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ParticleEdit_redo");
1359
1360 prop = RNA_def_property(srna, "fade_frames", PROP_INT, PROP_NONE);
1361 RNA_def_property_range(prop, 1, 100);
1362 RNA_def_property_ui_text(prop, "Frames", "How many frames to fade");
1364 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ParticleEdit_update");
1365
1366 prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
1368 RNA_def_property_enum_sdna(prop, nullptr, "edittype");
1369 RNA_def_property_enum_items(prop, edit_type_items);
1370 RNA_def_property_ui_text(prop, "Type", "");
1371 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ParticleEdit_redo");
1372
1373 prop = RNA_def_property(srna, "is_editable", PROP_BOOLEAN, PROP_NONE);
1374 RNA_def_property_boolean_funcs(prop, "rna_ParticleEdit_editable_get", nullptr);
1376 RNA_def_property_ui_text(prop, "Editable", "A valid edit mode exists");
1377
1378 prop = RNA_def_property(srna, "is_hair", PROP_BOOLEAN, PROP_NONE);
1379 RNA_def_property_boolean_funcs(prop, "rna_ParticleEdit_hair_get", nullptr);
1381 RNA_def_property_ui_text(prop, "Hair", "Editing hair");
1382
1383 prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
1385 RNA_def_property_ui_text(prop, "Object", "The edited object");
1386
1387 prop = RNA_def_property(srna, "shape_object", PROP_POINTER, PROP_NONE);
1389 RNA_def_property_ui_text(prop, "Shape Object", "Outer shape to use for tools");
1390 RNA_def_property_pointer_funcs(prop, nullptr, nullptr, nullptr, "rna_Mesh_object_poll");
1391 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ParticleEdit_redo");
1392
1393 /* brush */
1394
1395 srna = RNA_def_struct(brna, "ParticleBrush", nullptr);
1396 RNA_def_struct_sdna(srna, "ParticleBrushData");
1397 RNA_def_struct_path_func(srna, "rna_ParticleBrush_path");
1398 RNA_def_struct_ui_text(srna, "Particle Brush", "Particle editing brush");
1399
1400 prop = RNA_def_property(srna, "size", PROP_INT, PROP_PIXEL);
1401 RNA_def_property_range(prop, 1, SHRT_MAX);
1403 RNA_def_property_ui_text(prop, "Radius", "Radius of the brush in pixels");
1404
1405 prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_FACTOR);
1406 RNA_def_property_range(prop, 0.001, 1.0);
1407 RNA_def_property_ui_text(prop, "Strength", "Brush strength");
1409
1410 prop = RNA_def_property(srna, "count", PROP_INT, PROP_NONE);
1411 RNA_def_property_range(prop, 1, 1000);
1412 RNA_def_property_ui_range(prop, 1, 100, 10, 3);
1413 RNA_def_property_ui_text(prop, "Count", "Particle count");
1414
1415 prop = RNA_def_property(srna, "steps", PROP_INT, PROP_NONE);
1416 RNA_def_property_int_sdna(prop, nullptr, "step");
1417 RNA_def_property_range(prop, 1, SHRT_MAX);
1418 RNA_def_property_ui_range(prop, 1, 50, 10, 3);
1419 RNA_def_property_ui_text(prop, "Steps", "Brush steps");
1420
1421 prop = RNA_def_property(srna, "puff_mode", PROP_ENUM, PROP_NONE);
1422 RNA_def_property_enum_sdna(prop, nullptr, "invert");
1423 RNA_def_property_enum_items(prop, puff_mode);
1424 RNA_def_property_ui_text(prop, "Puff Mode", "");
1425
1426 prop = RNA_def_property(srna, "use_puff_volume", PROP_BOOLEAN, PROP_NONE);
1429 prop,
1430 "Puff Volume",
1431 "Apply puff to unselected end-points (helps maintain hair volume when puffing root)");
1432
1433 prop = RNA_def_property(srna, "length_mode", PROP_ENUM, PROP_NONE);
1434 RNA_def_property_enum_sdna(prop, nullptr, "invert");
1435 RNA_def_property_enum_items(prop, length_mode);
1436 RNA_def_property_ui_text(prop, "Length Mode", "");
1437
1438 /* dummy */
1439 prop = RNA_def_property(srna, "curve", PROP_POINTER, PROP_NONE);
1440 RNA_def_property_struct_type(prop, "CurveMapping");
1441 RNA_def_property_pointer_funcs(prop, "rna_ParticleBrush_curve_get", nullptr, nullptr, nullptr);
1442 RNA_def_property_ui_text(prop, "Curve", "");
1443}
1444
1445/* srna -- gpencil speed guides */
1447{
1448 StructRNA *srna;
1449 PropertyRNA *prop;
1450
1451 srna = RNA_def_struct(brna, "GPencilSculptGuide", nullptr);
1452 RNA_def_struct_sdna(srna, "GP_Sculpt_Guide");
1453 RNA_def_struct_path_func(srna, "rna_GPencilSculptGuide_path");
1454 RNA_def_struct_ui_text(srna, "Grease Pencil Sculpt Guide", "Guides for drawing");
1455
1456 static const EnumPropertyItem prop_gpencil_guidetypes[] = {
1457 {GP_GUIDE_CIRCULAR, "CIRCULAR", 0, "Circular", "Use single point to create rings"},
1458 {GP_GUIDE_RADIAL, "RADIAL", 0, "Radial", "Use single point as direction"},
1459 {GP_GUIDE_PARALLEL, "PARALLEL", 0, "Parallel", "Parallel lines"},
1460 {GP_GUIDE_GRID, "GRID", 0, "Grid", "Grid allows horizontal and vertical lines"},
1461 {GP_GUIDE_ISO, "ISO", 0, "Isometric", "Grid allows isometric and vertical lines"},
1462 {0, nullptr, 0, nullptr, nullptr},
1463 };
1464
1465 static const EnumPropertyItem prop_gpencil_guide_references[] = {
1466 {GP_GUIDE_REF_CURSOR, "CURSOR", 0, "Cursor", "Use cursor as reference point"},
1467 {GP_GUIDE_REF_CUSTOM, "CUSTOM", 0, "Custom", "Use custom reference point"},
1468 {GP_GUIDE_REF_OBJECT, "OBJECT", 0, "Object", "Use object as reference point"},
1469 {0, nullptr, 0, nullptr, nullptr},
1470 };
1471
1472 prop = RNA_def_property(srna, "use_guide", PROP_BOOLEAN, PROP_NONE);
1473 RNA_def_property_boolean_sdna(prop, nullptr, "use_guide", false);
1475 RNA_def_property_ui_text(prop, "Use Guides", "Enable speed guides");
1478
1479 prop = RNA_def_property(srna, "use_snapping", PROP_BOOLEAN, PROP_NONE);
1480 RNA_def_property_boolean_sdna(prop, nullptr, "use_snapping", false);
1483 prop, "Use Snapping", "Enable snapping to guides angle or spacing options");
1486
1487 prop = RNA_def_property(srna, "reference_object", PROP_POINTER, PROP_NONE);
1488 RNA_def_property_pointer_sdna(prop, nullptr, "reference_object");
1489 RNA_def_property_ui_text(prop, "Object", "Object used for reference point");
1491 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_viewport_update");
1492
1493 prop = RNA_def_property(srna, "reference_point", PROP_ENUM, PROP_NONE);
1494 RNA_def_property_enum_sdna(prop, nullptr, "reference_point");
1495 RNA_def_property_enum_items(prop, prop_gpencil_guide_references);
1496 RNA_def_property_ui_text(prop, "Type", "Type of speed guide");
1498 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_viewport_update");
1499
1500 prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
1501 RNA_def_property_enum_sdna(prop, nullptr, "type");
1502 RNA_def_property_enum_items(prop, prop_gpencil_guidetypes);
1503 RNA_def_property_ui_text(prop, "Type", "Type of speed guide");
1506
1507 prop = RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE);
1508 RNA_def_property_float_sdna(prop, nullptr, "angle");
1509 RNA_def_property_range(prop, -(M_PI * 2.0f), (M_PI * 2.0f));
1510 RNA_def_property_ui_text(prop, "Angle", "Direction of lines");
1513
1514 prop = RNA_def_property(srna, "angle_snap", PROP_FLOAT, PROP_ANGLE);
1515 RNA_def_property_float_sdna(prop, nullptr, "angle_snap");
1516 RNA_def_property_range(prop, -(M_PI * 2.0f), (M_PI * 2.0f));
1517 RNA_def_property_ui_text(prop, "Angle Snap", "Angle snapping");
1520
1521 prop = RNA_def_property(srna, "spacing", PROP_FLOAT, PROP_DISTANCE);
1522 RNA_def_property_float_sdna(prop, nullptr, "spacing");
1523 RNA_def_property_range(prop, 0.0f, FLT_MAX);
1524 RNA_def_property_ui_range(prop, 0.0f, FLT_MAX, 1, 3);
1525 RNA_def_property_ui_text(prop, "Spacing", "Guide spacing");
1528
1529 prop = RNA_def_property(srna, "location", PROP_FLOAT, PROP_DISTANCE);
1530 RNA_def_property_float_sdna(prop, nullptr, "location");
1531 RNA_def_property_array(prop, 3);
1533 RNA_def_property_ui_text(prop, "Location", "Custom reference point for guides");
1536 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_viewport_update");
1537}
1538
1540{
1541 StructRNA *srna;
1542 PropertyRNA *prop;
1543
1544 /* == Settings == */
1545 srna = RNA_def_struct(brna, "GPencilSculptSettings", nullptr);
1546 RNA_def_struct_sdna(srna, "GP_Sculpt_Settings");
1547 RNA_def_struct_path_func(srna, "rna_GPencilSculptSettings_path");
1549 "GPencil Sculpt Settings",
1550 "General properties for Grease Pencil stroke sculpting tools");
1552
1553 prop = RNA_def_property(srna, "guide", PROP_POINTER, PROP_NONE);
1554 RNA_def_property_struct_type(prop, "GPencilSculptGuide");
1556 RNA_def_property_ui_text(prop, "Guide", "");
1557
1558 prop = RNA_def_property(srna, "use_multiframe_falloff", PROP_BOOLEAN, PROP_NONE);
1561 prop,
1562 "Use Falloff",
1563 "Use falloff effect when edit in multiframe mode to compute brush effect by frame");
1566
1567 prop = RNA_def_property(srna, "use_thickness_curve", PROP_BOOLEAN, PROP_NONE);
1569 RNA_def_property_ui_text(prop, "Use Curve", "Use curve to define primitive stroke thickness");
1572
1573 prop = RNA_def_property(srna, "use_scale_thickness", PROP_BOOLEAN, PROP_NONE);
1576 prop, "Scale Stroke Thickness", "Scale the stroke thickness when transforming strokes");
1579
1580 prop = RNA_def_property(srna, "use_automasking_stroke", PROP_BOOLEAN, PROP_NONE);
1582 RNA_def_property_ui_text(prop, "Auto-Masking Strokes", "Affect only strokes below the cursor");
1585
1586 prop = RNA_def_property(srna, "use_automasking_layer_stroke", PROP_BOOLEAN, PROP_NONE);
1588 RNA_def_property_ui_text(prop, "Auto-Masking Layer", "Affect only strokes below the cursor");
1591
1592 prop = RNA_def_property(srna, "use_automasking_material_stroke", PROP_BOOLEAN, PROP_NONE);
1594 prop, nullptr, "flag", GP_SCULPT_SETT_FLAG_AUTOMASK_MATERIAL_STROKE);
1595 RNA_def_property_ui_text(prop, "Auto-Masking Material", "Affect only strokes below the cursor");
1598
1599 prop = RNA_def_property(srna, "use_automasking_layer_active", PROP_BOOLEAN, PROP_NONE);
1601 RNA_def_property_ui_text(prop, "Auto-Masking Layer", "Affect only the Active Layer");
1604
1605 prop = RNA_def_property(srna, "use_automasking_material_active", PROP_BOOLEAN, PROP_NONE);
1607 prop, nullptr, "flag", GP_SCULPT_SETT_FLAG_AUTOMASK_MATERIAL_ACTIVE);
1608 RNA_def_property_ui_text(prop, "Auto-Masking Material", "Affect only the Active Material");
1611
1612 /* custom falloff curve */
1613 prop = RNA_def_property(srna, "multiframe_falloff_curve", PROP_POINTER, PROP_NONE);
1614 RNA_def_property_pointer_sdna(prop, nullptr, "cur_falloff");
1615 RNA_def_property_struct_type(prop, "CurveMapping");
1617 prop, "Curve", "Custom curve to control falloff of brush effect by Grease Pencil frames");
1620
1621 /* custom primitive curve */
1622 prop = RNA_def_property(srna, "thickness_primitive_curve", PROP_POINTER, PROP_NONE);
1623 RNA_def_property_pointer_sdna(prop, nullptr, "cur_primitive");
1624 RNA_def_property_struct_type(prop, "CurveMapping");
1625 RNA_def_property_ui_text(prop, "Curve", "Custom curve to control primitive thickness");
1628
1629 /* lock axis */
1630 prop = RNA_def_property(srna, "lock_axis", PROP_ENUM, PROP_NONE);
1631 RNA_def_property_enum_sdna(prop, nullptr, "lock_axis");
1633 RNA_def_property_ui_text(prop, "Lock Axis", "");
1635 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, nullptr);
1636
1637 /* threshold for cutter */
1638 prop = RNA_def_property(srna, "intersection_threshold", PROP_FLOAT, PROP_NONE);
1639 RNA_def_property_float_sdna(prop, nullptr, "isect_threshold");
1640 RNA_def_property_range(prop, 0.0f, 10.0f);
1642 RNA_def_property_ui_text(prop, "Threshold", "Threshold for stroke intersections");
1644}
1645
1647{
1648 StructRNA *srna;
1649
1650 srna = RNA_def_struct(brna, "CurvesSculpt", "Paint");
1651 RNA_def_struct_path_func(srna, "rna_CurvesSculpt_path");
1652 RNA_def_struct_ui_text(srna, "Curves Sculpt Paint", "");
1654}
1655
1657{
1658 /* *** Non-Animated *** */
1660 rna_def_paint_curve(brna);
1661 rna_def_paint(brna);
1662 rna_def_sculpt(brna);
1663 rna_def_uv_sculpt(brna);
1664 rna_def_gp_paint(brna);
1669 rna_def_paint_mode(brna);
1670 rna_def_image_paint(brna);
1676}
1677
1678#endif
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:1156
bool BKE_paint_eraser_brush_set(Paint *paint, Brush *brush)
Definition paint.cc:1166
Brush * BKE_paint_brush(Paint *paint)
Definition paint.cc:636
void BKE_paint_invalidate_overlay_all()
Definition paint.cc:283
struct ParticleSystem * psys_get_current(struct Object *ob)
Definition particle.cc:537
void psys_free_path_cache(struct ParticleSystem *psys, struct PTCacheEdit *edit)
Definition particle.cc:906
void BKE_particle_batch_cache_dirty_tag(struct ParticleSystem *psys, int mode)
Definition particle.cc:5286
@ 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:1026
@ ID_RECALC_GEOMETRY
Definition DNA_ID.h:982
@ BRUSH_CURVE_CUSTOM
@ BRUSH_AUTOMASKING_BRUSH_NORMAL
@ BRUSH_AUTOMASKING_CAVITY_NORMAL
@ BRUSH_AUTOMASKING_VIEW_OCCLUSION
@ BRUSH_AUTOMASKING_VIEW_NORMAL
@ BRUSH_AUTOMASKING_CAVITY_INVERTED
#define MAX_BRUSH_PIXEL_RADIUS
#define AUTOMASKING_BOUNDARY_EDGES_MAX_PROPAGATION_STEPS
@ IMA_TYPE_R_RESULT
@ IMA_TYPE_COMPOSITE
@ OB_MESH
@ PSYS_GLOBAL_HAIR
@ PAINT_TILE_Z
@ PAINT_SYMM_Y
@ PAINT_TILE_Y
@ PAINT_SYMMETRY_FEATHER
@ PAINT_TILE_X
@ PAINT_SYMM_X
@ PAINT_SYMM_Z
@ IMAGEPAINT_PROJECT_LAYER_STENCIL_INV
@ IMAGEPAINT_PROJECT_BACKFACE
@ IMAGEPAINT_PROJECT_XRAY
@ IMAGEPAINT_PROJECT_LAYER_STENCIL
@ IMAGEPAINT_PROJECT_LAYER_CLONE
@ IMAGEPAINT_PROJECT_FLAT
@ GP_GUIDE_CIRCULAR
@ GP_GUIDE_ISO
@ GP_GUIDE_PARALLEL
@ GP_GUIDE_RADIAL
@ GP_GUIDE_GRID
@ GP_GUIDE_REF_OBJECT
@ GP_GUIDE_REF_CUSTOM
@ GP_GUIDE_REF_CURSOR
@ SCULPT_ONLY_DEFORM
@ SCULPT_DYNTOPO_SUBDIVIDE
@ SCULPT_DYNTOPO_DETAIL_MANUAL
@ SCULPT_LOCK_X
@ SCULPT_LOCK_Z
@ SCULPT_DYNTOPO_DETAIL_CONSTANT
@ SCULPT_DYNTOPO_COLLAPSE
@ SCULPT_DYNTOPO_DETAIL_BRUSH
@ SCULPT_LOCK_Y
@ GP_SCULPT_SETT_FLAG_PRIMITIVE_CURVE
@ GP_SCULPT_SETT_FLAG_FRAME_FALLOFF
@ GP_SCULPT_SETT_FLAG_AUTOMASK_LAYER_ACTIVE
@ GP_SCULPT_SETT_FLAG_AUTOMASK_STROKE
@ GP_SCULPT_SETT_FLAG_AUTOMASK_MATERIAL_STROKE
@ GP_SCULPT_SETT_FLAG_AUTOMASK_MATERIAL_ACTIVE
@ GP_SCULPT_SETT_FLAG_SCALE_THICKNESS
@ GP_SCULPT_SETT_FLAG_AUTOMASK_LAYER_STROKE
#define IMAGEPAINT_MODE_IMAGE
@ VP_FLAG_VGROUP_RESTRICT
@ GP_LOCKAXIS_X
@ GP_LOCKAXIS_VIEW
@ GP_LOCKAXIS_Y
@ GP_LOCKAXIS_Z
@ GP_LOCKAXIS_CURSOR
@ PE_DRAW_PART
@ PE_LOCK_FIRST
@ PE_FADE_TIME
@ PE_INTERPOLATE_ADDED
@ PE_DEFLECT_EMITTER
@ PE_KEEP_LENGTHS
@ PE_AUTO_VELOCITY
#define IMAGEPAINT_MODE_MATERIAL
@ PAINT_USE_CAVITY_MASK
@ PAINT_SCULPT_DELAY_UPDATES
@ PAINT_SHOW_BRUSH
@ PAINT_SHOW_BRUSH_ON_SURFACE
@ PAINT_FAST_NAVIGATE
@ PE_TYPE_CLOTH
@ PE_TYPE_PARTICLES
@ PE_TYPE_SOFTBODY
@ PAINT_CANVAS_SOURCE_COLOR_ATTRIBUTE
@ PAINT_CANVAS_SOURCE_IMAGE
@ PAINT_CANVAS_SOURCE_MATERIAL
@ PE_BRUSH_COMB
@ PE_BRUSH_CUT
@ PE_BRUSH_PUFF
@ PE_BRUSH_LENGTH
@ PE_BRUSH_WEIGHT
@ PE_BRUSH_ADD
@ PE_BRUSH_SMOOTH
@ GPPAINT_FLAG_USE_VERTEXCOLOR
@ GPPAINT_FLAG_USE_MATERIAL
@ PE_BRUSH_DATA_PUFF_VOLUME
@ SCE_SELECT_PATH
@ SCE_SELECT_POINT
@ SCE_SELECT_END
@ SCULPT_TRANSFORM_MODE_RADIUS_ELASTIC
@ SCULPT_TRANSFORM_MODE_ALL_VERTICES
@ IMAGEPAINT_MISSING_TEX
@ IMAGEPAINT_MISSING_MATERIAL
@ IMAGEPAINT_MISSING_UVS
@ IMAGEPAINT_MISSING_STENCIL
@ 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:203
@ STRUCT_UNDO
Definition RNA_types.hh:847
@ PROP_FLOAT
Definition RNA_types.hh:152
@ PROP_BOOLEAN
Definition RNA_types.hh:150
@ PROP_ENUM
Definition RNA_types.hh:154
@ PROP_INT
Definition RNA_types.hh:151
@ PROP_POINTER
Definition RNA_types.hh:155
@ PROP_CONTEXT_UPDATE
Definition RNA_types.hh:381
@ PROP_ANIMATABLE
Definition RNA_types.hh:305
@ PROP_NEVER_UNLINK
Definition RNA_types.hh:358
@ PROP_EDITABLE
Definition RNA_types.hh:292
@ PROP_NEVER_NULL
Definition RNA_types.hh:351
@ PROP_ID_SELF_CHECK
Definition RNA_types.hh:344
@ PROP_XYZ
Definition RNA_types.hh:257
@ PROP_DISTANCE
Definition RNA_types.hh:244
@ PROP_PIXEL
Definition RNA_types.hh:236
@ PROP_ANGLE
Definition RNA_types.hh:240
@ PROP_NONE
Definition RNA_types.hh:221
@ PROP_PERCENTAGE
Definition RNA_types.hh:238
@ PROP_FACTOR
Definition RNA_types.hh:239
@ PROP_COLOR_GAMMA
Definition RNA_types.hh:260
@ PROP_XYZ_LENGTH
Definition RNA_types.hh:258
@ PROP_UNSIGNED
Definition RNA_types.hh:237
#define C
Definition RandGen.cpp:29
#define NC_GEOM
Definition WM_types.hh:390
#define ND_DRAW
Definition WM_types.hh:458
#define NC_BRUSH
Definition WM_types.hh:382
#define ND_DATA
Definition WM_types.hh:506
#define NC_SCENE
Definition WM_types.hh:375
#define ND_TOOLSETTINGS
Definition WM_types.hh:446
#define ND_MODIFIER
Definition WM_types.hh:459
#define NA_EDITED
Definition WM_types.hh:581
#define ND_PARTICLE
Definition WM_types.hh:462
#define NC_GPENCIL
Definition WM_types.hh:396
#define NC_OBJECT
Definition WM_types.hh:376
#define NA_SELECTED
Definition WM_types.hh:586
@ 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
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:111
const EnumPropertyItem rna_enum_brush_curve_preset_items[]
Definition rna_brush.cc:95
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_ui_text(PropertyRNA *prop, const char *name, const char *description)
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
void RNA_def_property_boolean_default(PropertyRNA *prop, bool value)
void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const char *set)
void RNA_def_property_int_default(PropertyRNA *prop, int value)
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier, const char *call)
void RNA_def_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_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_mode(BlenderRNA *brna)
static void rna_def_gp_weightpaint(BlenderRNA *brna)
static void rna_def_gp_vertexpaint(BlenderRNA *brna)
static void rna_def_image_paint(BlenderRNA *brna)
static void rna_def_paint_curve(BlenderRNA *brna)
static void rna_def_gpencil_sculpt(BlenderRNA *brna)
static void rna_def_particle_edit(BlenderRNA *brna)
static void rna_def_gpencil_guides(BlenderRNA *brna)
#define FLT_MAX
Definition stdcycles.h:14
short ob_mode
const char * identifier
Definition RNA_types.hh:623
const char * name
Definition RNA_types.hh:627
const char * description
Definition RNA_types.hh:629
struct Image * canvas
struct ParticleSystem * psys
unsigned short ob_mode
struct Paint_Runtime runtime
ID * owner_id
Definition RNA_types.hh:51
void * data
Definition RNA_types.hh:53
struct ToolSettings * toolsettings
struct ImagePaintSettings imapaint
int8_t curve_preset
struct CurveMapping * strength_curve
void WM_main_add_notifier(uint type, void *reference)
PointerRNA * ptr
Definition wm_files.cc:4227