2 * This program is free software; you can redistribute it and/or
3 * modify it under the terms of the GNU General Public License
4 * as published by the Free Software Foundation; either version 2
5 * of the License, or (at your option) any later version.
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software Foundation,
14 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 #include "BLI_utildefines.h"
26 #include "RNA_define.h"
27 #include "RNA_enum_types.h"
29 #include "rna_internal.h"
32 #include "DNA_brush_types.h"
33 #include "DNA_gpencil_types.h"
34 #include "DNA_scene_types.h"
35 #include "DNA_screen_types.h"
36 #include "DNA_space_types.h"
38 #include "BKE_brush.h"
39 #include "BKE_material.h"
40 #include "BKE_paint.h"
49 const EnumPropertyItem rna_enum_particle_edit_hair_brush_items[] = {
50 {PE_BRUSH_COMB, "COMB", 0, "Comb", "Comb hairs"},
51 {PE_BRUSH_SMOOTH, "SMOOTH", 0, "Smooth", "Smooth hairs"},
52 {PE_BRUSH_ADD, "ADD", 0, "Add", "Add hairs"},
53 {PE_BRUSH_LENGTH, "LENGTH", 0, "Length", "Make hairs longer or shorter"},
54 {PE_BRUSH_PUFF, "PUFF", 0, "Puff", "Make hairs stand up"},
55 {PE_BRUSH_CUT, "CUT", 0, "Cut", "Cut hairs"},
56 {PE_BRUSH_WEIGHT, "WEIGHT", 0, "Weight", "Weight hair particles"},
57 {0, NULL, 0, NULL, NULL},
61 static const EnumPropertyItem rna_enum_gpencil_lock_axis_items[] = {
64 ICON_RESTRICT_VIEW_ON,
66 "Align strokes to current view plane"},
71 "Project strokes to plane locked to Y"},
76 "Project strokes to plane locked to X"},
77 {GP_LOCKAXIS_Z, "AXIS_Z", ICON_AXIS_TOP, "Top (X-Y)", "Project strokes to plane locked to Z"},
82 "Align strokes to current 3D cursor orientation"},
83 {0, NULL, 0, NULL, NULL},
86 static const EnumPropertyItem rna_enum_gpencil_paint_mode[] = {
87 {GPPAINT_FLAG_USE_MATERIAL,
91 "Paint using the active material base color"},
92 {GPPAINT_FLAG_USE_VERTEXCOLOR,
96 "Paint the material with custom vertex color"},
97 {0, NULL, 0, NULL, NULL},
101 const EnumPropertyItem rna_enum_symmetrize_direction_items[] = {
102 {BMO_SYMMETRIZE_NEGATIVE_X, "NEGATIVE_X", 0, "-X to +X", ""},
103 {BMO_SYMMETRIZE_POSITIVE_X, "POSITIVE_X", 0, "+X to -X", ""},
105 {BMO_SYMMETRIZE_NEGATIVE_Y, "NEGATIVE_Y", 0, "-Y to +Y", ""},
106 {BMO_SYMMETRIZE_POSITIVE_Y, "POSITIVE_Y", 0, "+Y to -Y", ""},
108 {BMO_SYMMETRIZE_NEGATIVE_Z, "NEGATIVE_Z", 0, "-Z to +Z", ""},
109 {BMO_SYMMETRIZE_POSITIVE_Z, "POSITIVE_Z", 0, "+Z to -Z", ""},
110 {0, NULL, 0, NULL, NULL},
114 # include "MEM_guardedalloc.h"
116 # include "BKE_collection.h"
117 # include "BKE_context.h"
118 # include "BKE_gpencil.h"
119 # include "BKE_object.h"
120 # include "BKE_particle.h"
121 # include "BKE_pbvh.h"
122 # include "BKE_pointcache.h"
124 # include "DEG_depsgraph.h"
126 # include "ED_gpencil.h"
127 # include "ED_paint.h"
128 # include "ED_particle.h"
130 static void rna_GPencil_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr))
132 /* mark all grease pencil datablocks of the scene */
133 ED_gpencil_tag_scene_gpencil(scene);
136 const EnumPropertyItem rna_enum_particle_edit_disconnected_hair_brush_items[] = {
137 {PE_BRUSH_COMB, "COMB", 0, "Comb", "Comb hairs"},
138 {PE_BRUSH_SMOOTH, "SMOOTH", 0, "Smooth", "Smooth hairs"},
139 {PE_BRUSH_LENGTH, "LENGTH", 0, "Length", "Make hairs longer or shorter"},
140 {PE_BRUSH_CUT, "CUT", 0, "Cut", "Cut hairs"},
141 {PE_BRUSH_WEIGHT, "WEIGHT", 0, "Weight", "Weight hair particles"},
142 {0, NULL, 0, NULL, NULL},
145 static const EnumPropertyItem particle_edit_cache_brush_items[] = {
146 {PE_BRUSH_COMB, "COMB", 0, "Comb", "Comb paths"},
147 {PE_BRUSH_SMOOTH, "SMOOTH", 0, "Smooth", "Smooth paths"},
148 {PE_BRUSH_LENGTH, "LENGTH", 0, "Length", "Make paths longer or shorter"},
149 {0, NULL, 0, NULL, NULL},
152 static PointerRNA rna_ParticleEdit_brush_get(PointerRNA *ptr)
154 ParticleEditSettings *pset = (ParticleEditSettings *)ptr->data;
155 ParticleBrushData *brush = NULL;
157 brush = &pset->brush[pset->brushtype];
159 return rna_pointer_inherit_refine(ptr, &RNA_ParticleBrush, brush);
162 static PointerRNA rna_ParticleBrush_curve_get(PointerRNA *ptr)
164 return rna_pointer_inherit_refine(ptr, &RNA_CurveMapping, NULL);
167 static void rna_ParticleEdit_redo(bContext *C, PointerRNA *UNUSED(ptr))
169 Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C);
170 Scene *scene = CTX_data_scene(C);
171 ViewLayer *view_layer = CTX_data_view_layer(C);
172 Object *ob = OBACT(view_layer);
173 PTCacheEdit *edit = PE_get_current(depsgraph, scene, ob);
180 DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY);
183 BKE_particle_batch_cache_dirty_tag(edit->psys, BKE_PARTICLE_BATCH_DIRTY_ALL);
184 psys_free_path_cache(edit->psys, edit);
185 DEG_id_tag_update(&scene->id, ID_RECALC_COPY_ON_WRITE);
188 static void rna_ParticleEdit_update(bContext *C, PointerRNA *UNUSED(ptr))
190 Scene *scene = CTX_data_scene(C);
191 ViewLayer *view_layer = CTX_data_view_layer(C);
192 Object *ob = OBACT(view_layer);
195 DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY);
198 /* Sync tool setting changes from original to evaluated scenes. */
199 DEG_id_tag_update(&scene->id, ID_RECALC_COPY_ON_WRITE);
202 static void rna_ParticleEdit_tool_set(PointerRNA *ptr, int value)
204 ParticleEditSettings *pset = (ParticleEditSettings *)ptr->data;
206 /* redraw hair completely if weight brush is/was used */
207 if ((pset->brushtype == PE_BRUSH_WEIGHT || value == PE_BRUSH_WEIGHT) && pset->object) {
208 Object *ob = pset->object;
210 DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY);
211 WM_main_add_notifier(NC_OBJECT | ND_PARTICLE | NA_EDITED, NULL);
215 pset->brushtype = value;
217 static const EnumPropertyItem *rna_ParticleEdit_tool_itemf(bContext *C,
218 PointerRNA *UNUSED(ptr),
219 PropertyRNA *UNUSED(prop),
220 bool *UNUSED(r_free))
222 ViewLayer *view_layer = CTX_data_view_layer(C);
223 Object *ob = OBACT(view_layer);
225 Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C);
226 Scene *scene = CTX_data_scene(C);
227 PTCacheEdit *edit = PE_get_current(depsgraph, scene, ob);
228 ParticleSystem *psys = edit ? edit->psys : NULL;
230 /* use this rather than PE_get_current() - because the editing cache is
231 * dependent on the cache being updated which can happen after this UI
232 * draws causing a glitch T28883. */
233 ParticleSystem *psys = psys_get_current(ob);
237 if (psys->flag & PSYS_GLOBAL_HAIR) {
238 return rna_enum_particle_edit_disconnected_hair_brush_items;
241 return rna_enum_particle_edit_hair_brush_items;
245 return particle_edit_cache_brush_items;
248 static bool rna_ParticleEdit_editable_get(PointerRNA *ptr)
250 ParticleEditSettings *pset = (ParticleEditSettings *)ptr->data;
252 return (pset->object && pset->scene && PE_get_current(NULL, pset->scene, pset->object));
254 static bool rna_ParticleEdit_hair_get(PointerRNA *ptr)
256 ParticleEditSettings *pset = (ParticleEditSettings *)ptr->data;
259 PTCacheEdit *edit = PE_get_current(NULL, pset->scene, pset->object);
261 return (edit && edit->psys);
267 static char *rna_ParticleEdit_path(PointerRNA *UNUSED(ptr))
269 return BLI_strdup("tool_settings.particle_edit");
272 static bool rna_Brush_mode_poll(PointerRNA *ptr, PointerRNA value)
274 const Paint *paint = ptr->data;
275 Brush *brush = (Brush *)value.owner_id;
276 const uint tool_offset = paint->runtime.tool_offset;
277 const eObjectMode ob_mode = paint->runtime.ob_mode;
278 UNUSED_VARS_NDEBUG(tool_offset);
279 BLI_assert(tool_offset && ob_mode);
281 if (brush->ob_mode & ob_mode) {
283 if (BKE_brush_tool_get(paint->brush, paint) == BKE_brush_tool_get(brush, paint)) {
295 static bool paint_contains_brush_slot(const Paint *paint, const PaintToolSlot *tslot, int *r_index)
297 if ((tslot >= paint->tool_slots) && (tslot < (paint->tool_slots + paint->tool_slots_len))) {
298 *r_index = (int)(tslot - paint->tool_slots);
304 static bool rna_Brush_mode_with_tool_poll(PointerRNA *ptr, PointerRNA value)
306 Scene *scene = (Scene *)ptr->owner_id;
307 const PaintToolSlot *tslot = ptr->data;
308 ToolSettings *ts = scene->toolsettings;
309 Brush *brush = (Brush *)value.owner_id;
313 if (paint_contains_brush_slot(&ts->imapaint.paint, tslot, &slot_index)) {
314 if (slot_index != brush->imagepaint_tool) {
317 mode = OB_MODE_TEXTURE_PAINT;
319 else if (paint_contains_brush_slot(&ts->sculpt->paint, tslot, &slot_index)) {
320 if (slot_index != brush->sculpt_tool) {
323 mode = OB_MODE_SCULPT;
325 else if (paint_contains_brush_slot(&ts->uvsculpt->paint, tslot, &slot_index)) {
326 if (slot_index != brush->uv_sculpt_tool) {
331 else if (paint_contains_brush_slot(&ts->vpaint->paint, tslot, &slot_index)) {
332 if (slot_index != brush->vertexpaint_tool) {
335 mode = OB_MODE_VERTEX_PAINT;
337 else if (paint_contains_brush_slot(&ts->wpaint->paint, tslot, &slot_index)) {
338 if (slot_index != brush->weightpaint_tool) {
341 mode = OB_MODE_WEIGHT_PAINT;
343 else if (paint_contains_brush_slot(&ts->gp_paint->paint, tslot, &slot_index)) {
344 if (slot_index != brush->gpencil_tool) {
347 mode = OB_MODE_PAINT_GPENCIL;
349 else if (paint_contains_brush_slot(&ts->gp_vertexpaint->paint, tslot, &slot_index)) {
350 if (slot_index != brush->gpencil_vertex_tool) {
353 mode = OB_MODE_VERTEX_GPENCIL;
355 else if (paint_contains_brush_slot(&ts->gp_sculptpaint->paint, tslot, &slot_index)) {
356 if (slot_index != brush->gpencil_sculpt_tool) {
359 mode = OB_MODE_SCULPT_GPENCIL;
361 else if (paint_contains_brush_slot(&ts->gp_weightpaint->paint, tslot, &slot_index)) {
362 if (slot_index != brush->gpencil_weight_tool) {
365 mode = OB_MODE_WEIGHT_GPENCIL;
368 return brush->ob_mode & mode;
371 static void rna_Sculpt_update(bContext *C, PointerRNA *UNUSED(ptr))
373 Scene *scene = CTX_data_scene(C);
374 ViewLayer *view_layer = CTX_data_view_layer(C);
375 Object *ob = OBACT(view_layer);
378 DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY);
379 WM_main_add_notifier(NC_OBJECT | ND_MODIFIER, ob);
382 ob->sculpt->bm_smooth_shading = ((scene->toolsettings->sculpt->flags &
383 SCULPT_DYNTOPO_SMOOTH_SHADING) != 0);
388 static void rna_Sculpt_ShowMask_update(bContext *C, PointerRNA *UNUSED(ptr))
390 ViewLayer *view_layer = CTX_data_view_layer(C);
391 Object *object = OBACT(view_layer);
392 if (object == NULL || object->sculpt == NULL) {
395 Scene *scene = CTX_data_scene(C);
396 Sculpt *sd = scene->toolsettings->sculpt;
397 object->sculpt->show_mask = ((sd->flags & SCULPT_HIDE_MASK) == 0);
398 if (object->sculpt->pbvh != NULL) {
399 pbvh_show_mask_set(object->sculpt->pbvh, object->sculpt->show_mask);
401 DEG_id_tag_update(&object->id, ID_RECALC_GEOMETRY);
402 WM_main_add_notifier(NC_OBJECT | ND_MODIFIER, object);
405 static char *rna_Sculpt_path(PointerRNA *UNUSED(ptr))
407 return BLI_strdup("tool_settings.sculpt");
410 static char *rna_VertexPaint_path(PointerRNA *ptr)
412 Scene *scene = (Scene *)ptr->owner_id;
413 ToolSettings *ts = scene->toolsettings;
414 if (ptr->data == ts->vpaint) {
415 return BLI_strdup("tool_settings.vertex_paint");
418 return BLI_strdup("tool_settings.weight_paint");
422 static char *rna_ImagePaintSettings_path(PointerRNA *UNUSED(ptr))
424 return BLI_strdup("tool_settings.image_paint");
427 static char *rna_UvSculpt_path(PointerRNA *UNUSED(ptr))
429 return BLI_strdup("tool_settings.uv_sculpt");
432 static char *rna_GpPaint_path(PointerRNA *UNUSED(ptr))
434 return BLI_strdup("tool_settings.gpencil_paint");
437 static char *rna_GpVertexPaint_path(PointerRNA *UNUSED(ptr))
439 return BLI_strdup("tool_settings.gpencil_vertex_paint");
442 static char *rna_GpSculptPaint_path(PointerRNA *UNUSED(ptr))
444 return BLI_strdup("tool_settings.gpencil_sculpt_paint");
447 static char *rna_GpWeightPaint_path(PointerRNA *UNUSED(ptr))
449 return BLI_strdup("tool_settings.gpencil_weight_paint");
452 static char *rna_ParticleBrush_path(PointerRNA *UNUSED(ptr))
454 return BLI_strdup("tool_settings.particle_edit.brush");
457 static void rna_Paint_brush_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
459 Paint *paint = ptr->data;
460 Brush *br = paint->brush;
461 BKE_paint_invalidate_overlay_all();
462 /* Needed because we're not calling 'BKE_paint_brush_set' which handles this. */
463 BKE_paint_toolslots_brush_update(paint);
464 WM_main_add_notifier(NC_BRUSH | NA_SELECTED, br);
467 static void rna_ImaPaint_viewport_update(Main *UNUSED(bmain),
468 Scene *UNUSED(scene),
469 PointerRNA *UNUSED(ptr))
471 /* not the best solution maybe, but will refresh the 3D viewport */
472 WM_main_add_notifier(NC_OBJECT | ND_DRAW, NULL);
475 static void rna_ImaPaint_mode_update(bContext *C, PointerRNA *UNUSED(ptr))
477 Scene *scene = CTX_data_scene(C);
478 ViewLayer *view_layer = CTX_data_view_layer(C);
479 Object *ob = OBACT(view_layer);
481 if (ob && ob->type == OB_MESH) {
482 /* of course we need to invalidate here */
483 BKE_texpaint_slots_refresh_object(scene, ob);
485 /* We assume that changing the current mode will invalidate the uv layers
486 * so we need to refresh display. */
487 ED_paint_proj_mesh_data_check(scene, ob, NULL, NULL, NULL, NULL);
488 WM_main_add_notifier(NC_OBJECT | ND_DRAW, NULL);
492 static void rna_ImaPaint_stencil_update(bContext *C, PointerRNA *UNUSED(ptr))
494 Scene *scene = CTX_data_scene(C);
495 ViewLayer *view_layer = CTX_data_view_layer(C);
496 Object *ob = OBACT(view_layer);
498 if (ob && ob->type == OB_MESH) {
499 ED_paint_proj_mesh_data_check(scene, ob, NULL, NULL, NULL, NULL);
500 WM_main_add_notifier(NC_OBJECT | ND_DRAW, NULL);
504 static void rna_ImaPaint_canvas_update(bContext *C, PointerRNA *UNUSED(ptr))
506 Main *bmain = CTX_data_main(C);
507 Scene *scene = CTX_data_scene(C);
508 ViewLayer *view_layer = CTX_data_view_layer(C);
509 Object *ob = OBACT(view_layer);
510 Object *obedit = OBEDIT_FROM_OBACT(ob);
512 Image *ima = scene->toolsettings->imapaint.canvas;
514 for (screen = bmain->screens.first; screen; screen = screen->id.next) {
516 for (area = screen->areabase.first; area; area = area->next) {
518 for (slink = area->spacedata.first; slink; slink = slink->next) {
519 if (slink->spacetype == SPACE_IMAGE) {
520 SpaceImage *sima = (SpaceImage *)slink;
523 ED_space_image_set(bmain, sima, obedit, ima, true);
530 if (ob && ob->type == OB_MESH) {
531 ED_paint_proj_mesh_data_check(scene, ob, NULL, NULL, NULL, NULL);
532 WM_main_add_notifier(NC_OBJECT | ND_DRAW, NULL);
536 static bool rna_ImaPaint_detect_data(ImagePaintSettings *imapaint)
538 return imapaint->missing_data == 0;
541 static char *rna_GPencilSculptSettings_path(PointerRNA *UNUSED(ptr))
543 return BLI_strdup("tool_settings.gpencil_sculpt");
546 static char *rna_GPencilSculptGuide_path(PointerRNA *UNUSED(ptr))
548 return BLI_strdup("tool_settings.gpencil_sculpt.guide");
553 static void rna_def_paint_curve(BlenderRNA *brna)
557 srna = RNA_def_struct(brna, "PaintCurve", "ID");
558 RNA_def_struct_ui_text(srna, "Paint Curve", "");
559 RNA_def_struct_ui_icon(srna, ICON_CURVE_BEZCURVE);
562 static void rna_def_paint_tool_slot(BlenderRNA *brna)
567 srna = RNA_def_struct(brna, "PaintToolSlot", NULL);
568 RNA_def_struct_ui_text(srna, "Paint Tool Slot", "");
570 prop = RNA_def_property(srna, "brush", PROP_POINTER, PROP_NONE);
571 RNA_def_property_flag(prop, PROP_EDITABLE);
572 RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Brush_mode_with_tool_poll");
573 RNA_def_property_ui_text(prop, "Brush", "");
576 static void rna_def_paint(BlenderRNA *brna)
581 srna = RNA_def_struct(brna, "Paint", NULL);
582 RNA_def_struct_ui_text(srna, "Paint", "");
584 /* Global Settings */
585 prop = RNA_def_property(srna, "brush", PROP_POINTER, PROP_NONE);
586 RNA_def_property_flag(prop, PROP_EDITABLE);
587 RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Brush_mode_poll");
588 RNA_def_property_ui_text(prop, "Brush", "Active Brush");
589 RNA_def_property_update(prop, 0, "rna_Paint_brush_update");
591 /* paint_tool_slots */
592 prop = RNA_def_property(srna, "tool_slots", PROP_COLLECTION, PROP_NONE);
593 RNA_def_property_collection_sdna(prop, NULL, "tool_slots", "tool_slots_len");
594 RNA_def_property_struct_type(prop, "PaintToolSlot");
595 /* don't dereference pointer! */
596 RNA_def_property_collection_funcs(
597 prop, NULL, NULL, NULL, "rna_iterator_array_get", NULL, NULL, NULL, NULL);
598 RNA_def_property_ui_text(prop, "Paint Tool Slots", "");
600 prop = RNA_def_property(srna, "palette", PROP_POINTER, PROP_NONE);
601 RNA_def_property_flag(prop, PROP_EDITABLE);
602 RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, NULL);
603 RNA_def_property_ui_text(prop, "Palette", "Active Palette");
605 prop = RNA_def_property(srna, "show_brush", PROP_BOOLEAN, PROP_NONE);
606 RNA_def_property_boolean_sdna(prop, NULL, "flags", PAINT_SHOW_BRUSH);
607 RNA_def_property_ui_text(prop, "Show Brush", "");
608 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
610 prop = RNA_def_property(srna, "show_brush_on_surface", PROP_BOOLEAN, PROP_NONE);
611 RNA_def_property_boolean_sdna(prop, NULL, "flags", PAINT_SHOW_BRUSH_ON_SURFACE);
612 RNA_def_property_ui_text(prop, "Show Brush On Surface", "");
613 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
615 prop = RNA_def_property(srna, "show_low_resolution", PROP_BOOLEAN, PROP_NONE);
616 RNA_def_property_boolean_sdna(prop, NULL, "flags", PAINT_FAST_NAVIGATE);
617 RNA_def_property_ui_text(
618 prop, "Fast Navigate", "For multires, show low resolution while navigating the view");
619 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
621 prop = RNA_def_property(srna, "use_sculpt_delay_updates", PROP_BOOLEAN, PROP_NONE);
622 RNA_def_property_boolean_sdna(prop, NULL, "flags", PAINT_SCULPT_DELAY_UPDATES);
623 RNA_def_property_ui_text(
625 "Delay Viewport Updates",
626 "Update the geometry when it enters the view, providing faster view navigation");
627 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
629 prop = RNA_def_property(srna, "input_samples", PROP_INT, PROP_UNSIGNED);
630 RNA_def_property_int_sdna(prop, NULL, "num_input_samples");
631 RNA_def_property_ui_range(prop, 1, PAINT_MAX_INPUT_SAMPLES, 1, -1);
632 RNA_def_property_ui_text(
633 prop, "Input Samples", "Average multiple input samples together to smooth the brush stroke");
634 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
636 prop = RNA_def_property(srna, "use_symmetry_x", PROP_BOOLEAN, PROP_NONE);
637 RNA_def_property_boolean_sdna(prop, NULL, "symmetry_flags", PAINT_SYMM_X);
638 RNA_def_property_ui_text(prop, "Symmetry X", "Mirror brush across the X axis");
639 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
641 prop = RNA_def_property(srna, "use_symmetry_y", PROP_BOOLEAN, PROP_NONE);
642 RNA_def_property_boolean_sdna(prop, NULL, "symmetry_flags", PAINT_SYMM_Y);
643 RNA_def_property_ui_text(prop, "Symmetry Y", "Mirror brush across the Y axis");
644 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
646 prop = RNA_def_property(srna, "use_symmetry_z", PROP_BOOLEAN, PROP_NONE);
647 RNA_def_property_boolean_sdna(prop, NULL, "symmetry_flags", PAINT_SYMM_Z);
648 RNA_def_property_ui_text(prop, "Symmetry Z", "Mirror brush across the Z axis");
649 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
651 prop = RNA_def_property(srna, "use_symmetry_feather", PROP_BOOLEAN, PROP_NONE);
652 RNA_def_property_boolean_sdna(prop, NULL, "symmetry_flags", PAINT_SYMMETRY_FEATHER);
653 RNA_def_property_ui_text(prop,
654 "Symmetry Feathering",
655 "Reduce the strength of the brush where it overlaps symmetrical daubs");
656 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
658 prop = RNA_def_property(srna, "cavity_curve", PROP_POINTER, PROP_NONE);
659 RNA_def_property_flag(prop, PROP_NEVER_NULL);
660 RNA_def_property_ui_text(prop, "Curve", "Editable cavity curve");
661 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
663 prop = RNA_def_property(srna, "use_cavity", PROP_BOOLEAN, PROP_NONE);
664 RNA_def_property_boolean_sdna(prop, NULL, "flags", PAINT_USE_CAVITY_MASK);
665 RNA_def_property_ui_text(prop, "Cavity Mask", "Mask painting according to mesh geometry cavity");
666 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
668 prop = RNA_def_property(srna, "tile_offset", PROP_FLOAT, PROP_XYZ);
669 RNA_def_property_float_sdna(prop, NULL, "tile_offset");
670 RNA_def_property_array(prop, 3);
671 RNA_def_property_range(prop, 0.01, FLT_MAX);
672 RNA_def_property_ui_range(prop, 0.01, 100, 1 * 100, 2);
673 RNA_def_property_ui_text(
674 prop, "Tiling offset for the X Axis", "Stride at which tiled strokes are copied");
676 prop = RNA_def_property(srna, "tile_x", PROP_BOOLEAN, PROP_NONE);
677 RNA_def_property_boolean_sdna(prop, NULL, "symmetry_flags", PAINT_TILE_X);
678 RNA_def_property_ui_text(prop, "Tile X", "Tile along X axis");
679 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
681 prop = RNA_def_property(srna, "tile_y", PROP_BOOLEAN, PROP_NONE);
682 RNA_def_property_boolean_sdna(prop, NULL, "symmetry_flags", PAINT_TILE_Y);
683 RNA_def_property_ui_text(prop, "Tile Y", "Tile along Y axis");
684 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
686 prop = RNA_def_property(srna, "tile_z", PROP_BOOLEAN, PROP_NONE);
687 RNA_def_property_boolean_sdna(prop, NULL, "symmetry_flags", PAINT_TILE_Z);
688 RNA_def_property_ui_text(prop, "Tile Z", "Tile along Z axis");
689 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
692 static void rna_def_sculpt(BlenderRNA *brna)
694 static const EnumPropertyItem detail_refine_items[] = {
695 {SCULPT_DYNTOPO_SUBDIVIDE,
699 "Subdivide long edges to add mesh detail where needed"},
700 {SCULPT_DYNTOPO_COLLAPSE,
704 "Collapse short edges to remove mesh detail where possible"},
705 {SCULPT_DYNTOPO_SUBDIVIDE | SCULPT_DYNTOPO_COLLAPSE,
706 "SUBDIVIDE_COLLAPSE",
708 "Subdivide Collapse",
709 "Both subdivide long edges and collapse short edges to refine mesh detail"},
710 {0, NULL, 0, NULL, NULL},
713 static const EnumPropertyItem detail_type_items[] = {
718 "Mesh detail is relative to the brush size and detail size"},
719 {SCULPT_DYNTOPO_DETAIL_CONSTANT,
723 "Mesh detail is constant in world space according to detail size"},
724 {SCULPT_DYNTOPO_DETAIL_BRUSH,
728 "Mesh detail is relative to brush radius"},
729 {SCULPT_DYNTOPO_DETAIL_MANUAL,
733 "Mesh detail does not change on each stroke, only when using Flood Fill"},
734 {0, NULL, 0, NULL, NULL},
740 srna = RNA_def_struct(brna, "Sculpt", "Paint");
741 RNA_def_struct_path_func(srna, "rna_Sculpt_path");
742 RNA_def_struct_ui_text(srna, "Sculpt", "");
744 prop = RNA_def_property(srna, "radial_symmetry", PROP_INT, PROP_XYZ);
745 RNA_def_property_int_sdna(prop, NULL, "radial_symm");
746 RNA_def_property_int_default(prop, 1);
747 RNA_def_property_range(prop, 1, 64);
748 RNA_def_property_ui_range(prop, 0, 32, 1, 1);
749 RNA_def_property_ui_text(
750 prop, "Radial Symmetry Count X Axis", "Number of times to copy strokes across the surface");
752 prop = RNA_def_property(srna, "lock_x", PROP_BOOLEAN, PROP_NONE);
753 RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_LOCK_X);
754 RNA_def_property_ui_text(prop, "Lock X", "Disallow changes to the X axis of vertices");
755 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
757 prop = RNA_def_property(srna, "lock_y", PROP_BOOLEAN, PROP_NONE);
758 RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_LOCK_Y);
759 RNA_def_property_ui_text(prop, "Lock Y", "Disallow changes to the Y axis of vertices");
760 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
762 prop = RNA_def_property(srna, "lock_z", PROP_BOOLEAN, PROP_NONE);
763 RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_LOCK_Z);
764 RNA_def_property_ui_text(prop, "Lock Z", "Disallow changes to the Z axis of vertices");
765 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
767 prop = RNA_def_property(srna, "use_deform_only", PROP_BOOLEAN, PROP_NONE);
768 RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_ONLY_DEFORM);
769 RNA_def_property_ui_text(prop,
771 "Use only deformation modifiers (temporary disable all "
772 "constructive modifiers except multi-resolution)");
773 RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
774 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Sculpt_update");
776 prop = RNA_def_property(srna, "show_mask", PROP_BOOLEAN, PROP_NONE);
777 RNA_def_property_boolean_negative_sdna(prop, NULL, "flags", SCULPT_HIDE_MASK);
778 RNA_def_property_ui_text(prop, "Show Mask", "Show mask as overlay on object");
779 RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
780 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Sculpt_ShowMask_update");
782 prop = RNA_def_property(srna, "show_face_sets", PROP_BOOLEAN, PROP_NONE);
783 RNA_def_property_boolean_negative_sdna(prop, NULL, "flags", SCULPT_HIDE_FACE_SETS);
784 RNA_def_property_ui_text(prop, "Show Face Sets", "Show Face Sets as overlay on object");
785 RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
786 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Sculpt_ShowMask_update");
788 prop = RNA_def_property(srna, "detail_size", PROP_FLOAT, PROP_PIXEL);
789 RNA_def_property_ui_range(prop, 0.5, 40.0, 10, 2);
790 RNA_def_property_ui_text(
791 prop, "Detail Size", "Maximum edge length for dynamic topology sculpting (in pixels)");
792 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
794 prop = RNA_def_property(srna, "detail_percent", PROP_FLOAT, PROP_PERCENTAGE);
795 RNA_def_property_ui_range(prop, 0.5, 100.0, 10, 2);
796 RNA_def_property_ui_text(
799 "Maximum edge length for dynamic topology sculpting (in brush percenage)");
800 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
802 prop = RNA_def_property(srna, "constant_detail_resolution", PROP_FLOAT, PROP_NONE);
803 RNA_def_property_float_sdna(prop, NULL, "constant_detail");
804 RNA_def_property_range(prop, 0.0001, FLT_MAX);
805 RNA_def_property_ui_range(prop, 0.001, 1000.0, 10, 2);
806 RNA_def_property_ui_text(prop,
808 "Maximum edge length for dynamic topology sculpting (as divisor "
809 "of blender unit - higher value means smaller edge length)");
810 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
812 prop = RNA_def_property(srna, "use_smooth_shading", PROP_BOOLEAN, PROP_NONE);
813 RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_DYNTOPO_SMOOTH_SHADING);
814 RNA_def_property_ui_text(prop,
816 "Show faces in dynamic-topology mode with smooth "
817 "shading rather than flat shaded");
818 RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
819 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Sculpt_update");
821 prop = RNA_def_property(srna, "use_automasking_topology", PROP_BOOLEAN, PROP_NONE);
822 RNA_def_property_boolean_sdna(prop, NULL, "automasking_flags", BRUSH_AUTOMASKING_TOPOLOGY);
823 RNA_def_property_ui_text(prop,
824 "Topology Auto-Masking",
825 "Affect only vertices connected to the active vertex under the brush");
826 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
828 prop = RNA_def_property(srna, "use_automasking_face_sets", PROP_BOOLEAN, PROP_NONE);
829 RNA_def_property_boolean_sdna(prop, NULL, "automasking_flags", BRUSH_AUTOMASKING_FACE_SETS);
830 RNA_def_property_ui_text(prop,
831 "Face Sets Auto-Masking",
832 "Affect only vertices that share Face Sets with the active vertex");
833 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
835 prop = RNA_def_property(srna, "use_automasking_boundary_edges", PROP_BOOLEAN, PROP_NONE);
836 RNA_def_property_boolean_sdna(prop, NULL, "automasking_flags", BRUSH_AUTOMASKING_BOUNDARY_EDGES);
837 RNA_def_property_ui_text(
838 prop, "Mesh Boundary Auto-Masking", "Do not affect non manifold boundary edges");
839 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
841 prop = RNA_def_property(srna, "use_automasking_boundary_face_sets", PROP_BOOLEAN, PROP_NONE);
842 RNA_def_property_boolean_sdna(
843 prop, NULL, "automasking_flags", BRUSH_AUTOMASKING_BOUNDARY_FACE_SETS);
844 RNA_def_property_ui_text(prop,
845 "Face Sets Boundary Auto-Masking",
846 "Do not affect vertices that belong to a Face Set boundary");
847 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
849 prop = RNA_def_property(srna, "symmetrize_direction", PROP_ENUM, PROP_NONE);
850 RNA_def_property_enum_items(prop, rna_enum_symmetrize_direction_items);
851 RNA_def_property_ui_text(prop, "Direction", "Source and destination for symmetrize operator");
853 prop = RNA_def_property(srna, "detail_refine_method", PROP_ENUM, PROP_NONE);
854 RNA_def_property_enum_bitflag_sdna(prop, NULL, "flags");
855 RNA_def_property_enum_items(prop, detail_refine_items);
856 RNA_def_property_ui_text(
857 prop, "Detail Refine Method", "In dynamic-topology mode, how to add or remove mesh detail");
858 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
860 prop = RNA_def_property(srna, "detail_type_method", PROP_ENUM, PROP_NONE);
861 RNA_def_property_enum_bitflag_sdna(prop, NULL, "flags");
862 RNA_def_property_enum_items(prop, detail_type_items);
863 RNA_def_property_ui_text(
864 prop, "Detail Type Method", "In dynamic-topology mode, how mesh detail size is calculated");
865 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
867 prop = RNA_def_property(srna, "gravity", PROP_FLOAT, PROP_FACTOR);
868 RNA_def_property_float_sdna(prop, NULL, "gravity_factor");
869 RNA_def_property_range(prop, 0.0f, 1.0f);
870 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
871 RNA_def_property_ui_text(prop, "Gravity", "Amount of gravity after each dab");
872 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
874 prop = RNA_def_property(srna, "gravity_object", PROP_POINTER, PROP_NONE);
875 RNA_def_property_flag(prop, PROP_EDITABLE);
876 RNA_def_property_ui_text(
877 prop, "Orientation", "Object whose Z axis defines orientation of gravity");
878 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
881 static void rna_def_uv_sculpt(BlenderRNA *brna)
885 srna = RNA_def_struct(brna, "UvSculpt", "Paint");
886 RNA_def_struct_path_func(srna, "rna_UvSculpt_path");
887 RNA_def_struct_ui_text(srna, "UV Sculpting", "");
890 static void rna_def_gp_paint(BlenderRNA *brna)
895 srna = RNA_def_struct(brna, "GpPaint", "Paint");
896 RNA_def_struct_path_func(srna, "rna_GpPaint_path");
897 RNA_def_struct_ui_text(srna, "Grease Pencil Paint", "");
899 /* Use vertex color (main swith). */
900 prop = RNA_def_property(srna, "color_mode", PROP_ENUM, PROP_NONE);
901 RNA_def_property_enum_sdna(prop, NULL, "mode");
902 RNA_def_property_enum_items(prop, rna_enum_gpencil_paint_mode);
903 RNA_def_property_ui_text(prop, "Mode", "Paint Mode");
904 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
905 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
908 static void rna_def_gp_vertexpaint(BlenderRNA *brna)
912 srna = RNA_def_struct(brna, "GpVertexPaint", "Paint");
913 RNA_def_struct_path_func(srna, "rna_GpVertexPaint_path");
914 RNA_def_struct_ui_text(srna, "Grease Pencil Vertex Paint", "");
917 static void rna_def_gp_sculptpaint(BlenderRNA *brna)
921 srna = RNA_def_struct(brna, "GpSculptPaint", "Paint");
922 RNA_def_struct_path_func(srna, "rna_GpSculptPaint_path");
923 RNA_def_struct_ui_text(srna, "Grease Pencil Sculpt Paint", "");
926 static void rna_def_gp_weightpaint(BlenderRNA *brna)
930 srna = RNA_def_struct(brna, "GpWeightPaint", "Paint");
931 RNA_def_struct_path_func(srna, "rna_GpWeightPaint_path");
932 RNA_def_struct_ui_text(srna, "Grease Pencil Weight Paint", "");
935 /* use for weight paint too */
936 static void rna_def_vertex_paint(BlenderRNA *brna)
941 srna = RNA_def_struct(brna, "VertexPaint", "Paint");
942 RNA_def_struct_sdna(srna, "VPaint");
943 RNA_def_struct_path_func(srna, "rna_VertexPaint_path");
944 RNA_def_struct_ui_text(srna, "Vertex Paint", "Properties of vertex and weight paint mode");
946 /* weight paint only */
947 prop = RNA_def_property(srna, "use_group_restrict", PROP_BOOLEAN, PROP_NONE);
948 RNA_def_property_boolean_sdna(prop, NULL, "flag", VP_FLAG_VGROUP_RESTRICT);
949 RNA_def_property_ui_text(prop, "Restrict", "Restrict painting to vertices in the group");
950 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
953 prop = RNA_def_property(srna, "radial_symmetry", PROP_INT, PROP_XYZ);
954 RNA_def_property_int_sdna(prop, NULL, "radial_symm");
955 RNA_def_property_int_default(prop, 1);
956 RNA_def_property_range(prop, 1, 64);
957 RNA_def_property_ui_range(prop, 1, 32, 1, 1);
958 RNA_def_property_ui_text(
959 prop, "Radial Symmetry Count X Axis", "Number of times to copy strokes across the surface");
962 static void rna_def_image_paint(BlenderRNA *brna)
968 static const EnumPropertyItem paint_type_items[] = {
969 {IMAGEPAINT_MODE_MATERIAL,
973 "Detect image slots from the material"},
974 {IMAGEPAINT_MODE_IMAGE,
978 "Set image for texture painting directly"},
979 {0, NULL, 0, NULL, NULL},
982 static const EnumPropertyItem paint_interp_items[] = {
983 {IMAGEPAINT_INTERP_LINEAR, "LINEAR", 0, "Linear", "Linear interpolation"},
984 {IMAGEPAINT_INTERP_CLOSEST,
988 "No interpolation (sample closest texel)"},
989 {0, NULL, 0, NULL, NULL},
992 srna = RNA_def_struct(brna, "ImagePaint", "Paint");
993 RNA_def_struct_sdna(srna, "ImagePaintSettings");
994 RNA_def_struct_path_func(srna, "rna_ImagePaintSettings_path");
995 RNA_def_struct_ui_text(srna, "Image Paint", "Properties of image and texture painting mode");
998 func = RNA_def_function(srna, "detect_data", "rna_ImaPaint_detect_data");
999 RNA_def_function_ui_description(func, "Check if required texpaint data exist");
1002 RNA_def_function_return(func, RNA_def_boolean(func, "ok", 1, "", ""));
1005 prop = RNA_def_property(srna, "use_occlude", PROP_BOOLEAN, PROP_NONE);
1006 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", IMAGEPAINT_PROJECT_XRAY);
1007 RNA_def_property_ui_text(
1008 prop, "Occlude", "Only paint onto the faces directly under the brush (slower)");
1009 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
1011 prop = RNA_def_property(srna, "use_backface_culling", PROP_BOOLEAN, PROP_NONE);
1012 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", IMAGEPAINT_PROJECT_BACKFACE);
1013 RNA_def_property_ui_text(prop, "Cull", "Ignore faces pointing away from the view (faster)");
1014 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
1016 prop = RNA_def_property(srna, "use_normal_falloff", PROP_BOOLEAN, PROP_NONE);
1017 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", IMAGEPAINT_PROJECT_FLAT);
1018 RNA_def_property_ui_text(prop, "Normal", "Paint most on faces pointing towards the view");
1019 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
1021 prop = RNA_def_property(srna, "use_stencil_layer", PROP_BOOLEAN, PROP_NONE);
1022 RNA_def_property_boolean_sdna(prop, NULL, "flag", IMAGEPAINT_PROJECT_LAYER_STENCIL);
1023 RNA_def_property_ui_text(prop, "Stencil Layer", "Set the mask layer from the UV map buttons");
1024 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_viewport_update");
1026 prop = RNA_def_property(srna, "invert_stencil", PROP_BOOLEAN, PROP_NONE);
1027 RNA_def_property_boolean_sdna(prop, NULL, "flag", IMAGEPAINT_PROJECT_LAYER_STENCIL_INV);
1028 RNA_def_property_ui_text(prop, "Invert", "Invert the stencil layer");
1029 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_viewport_update");
1031 prop = RNA_def_property(srna, "stencil_image", PROP_POINTER, PROP_NONE);
1032 RNA_def_property_pointer_sdna(prop, NULL, "stencil");
1033 RNA_def_property_flag(prop, PROP_EDITABLE | PROP_CONTEXT_UPDATE);
1034 RNA_def_property_ui_text(prop, "Stencil Image", "Image used as stencil");
1035 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_stencil_update");
1037 prop = RNA_def_property(srna, "canvas", PROP_POINTER, PROP_NONE);
1038 RNA_def_property_flag(prop, PROP_EDITABLE | PROP_CONTEXT_UPDATE);
1039 RNA_def_property_ui_text(prop, "Canvas", "Image used as canvas");
1040 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_canvas_update");
1042 prop = RNA_def_property(srna, "clone_image", PROP_POINTER, PROP_NONE);
1043 RNA_def_property_pointer_sdna(prop, NULL, "clone");
1044 RNA_def_property_flag(prop, PROP_EDITABLE);
1045 RNA_def_property_ui_text(prop, "Clone Image", "Image used as clone source");
1046 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
1048 prop = RNA_def_property(srna, "stencil_color", PROP_FLOAT, PROP_COLOR_GAMMA);
1049 RNA_def_property_range(prop, 0.0, 1.0);
1050 RNA_def_property_float_sdna(prop, NULL, "stencil_col");
1051 RNA_def_property_ui_text(prop, "Stencil Color", "Stencil color in the viewport");
1052 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_viewport_update");
1054 prop = RNA_def_property(srna, "dither", PROP_FLOAT, PROP_NONE);
1055 RNA_def_property_range(prop, 0.0, 2.0);
1056 RNA_def_property_ui_text(prop, "Dither", "Amount of dithering when painting on byte images");
1057 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
1059 prop = RNA_def_property(srna, "use_clone_layer", PROP_BOOLEAN, PROP_NONE);
1060 RNA_def_property_boolean_sdna(prop, NULL, "flag", IMAGEPAINT_PROJECT_LAYER_CLONE);
1061 RNA_def_property_ui_text(
1064 "Use another UV map as clone source, otherwise use the 3D cursor as the source");
1065 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_viewport_update");
1069 prop = RNA_def_property(srna, "seam_bleed", PROP_INT, PROP_PIXEL);
1070 RNA_def_property_ui_range(prop, 0, 8, 1, -1);
1071 RNA_def_property_ui_text(
1072 prop, "Bleed", "Extend paint beyond the faces UVs to reduce seams (in pixels, slower)");
1074 prop = RNA_def_property(srna, "normal_angle", PROP_INT, PROP_UNSIGNED);
1075 RNA_def_property_range(prop, 0, 90);
1076 RNA_def_property_ui_text(
1077 prop, "Angle", "Paint most on faces pointing towards the view according to this angle");
1079 prop = RNA_def_int_array(srna,
1086 "Size to capture the image for re-projecting",
1089 RNA_def_property_range(prop, 512, 16384);
1090 RNA_def_property_subtype(prop, PROP_PIXEL);
1092 prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
1093 RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
1094 RNA_def_property_enum_items(prop, paint_type_items);
1095 RNA_def_property_ui_text(prop, "Mode", "Mode of operation for projection painting");
1096 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_mode_update");
1098 prop = RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE);
1099 RNA_def_property_enum_sdna(prop, NULL, "interp");
1100 RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
1101 RNA_def_property_enum_items(prop, paint_interp_items);
1102 RNA_def_property_ui_text(prop, "Interpolation", "Texture filtering type");
1103 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_mode_update");
1106 prop = RNA_def_property(srna, "missing_uvs", PROP_BOOLEAN, PROP_NONE);
1107 RNA_def_property_boolean_sdna(prop, NULL, "missing_data", IMAGEPAINT_MISSING_UVS);
1108 RNA_def_property_ui_text(prop, "Missing UVs", "A UV layer is missing on the mesh");
1109 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1111 prop = RNA_def_property(srna, "missing_materials", PROP_BOOLEAN, PROP_NONE);
1112 RNA_def_property_boolean_sdna(prop, NULL, "missing_data", IMAGEPAINT_MISSING_MATERIAL);
1113 RNA_def_property_ui_text(prop, "Missing Materials", "The mesh is missing materials");
1114 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1116 prop = RNA_def_property(srna, "missing_stencil", PROP_BOOLEAN, PROP_NONE);
1117 RNA_def_property_boolean_sdna(prop, NULL, "missing_data", IMAGEPAINT_MISSING_STENCIL);
1118 RNA_def_property_ui_text(prop, "Missing Stencil", "Image Painting does not have a stencil");
1119 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1121 prop = RNA_def_property(srna, "missing_texture", PROP_BOOLEAN, PROP_NONE);
1122 RNA_def_property_boolean_sdna(prop, NULL, "missing_data", IMAGEPAINT_MISSING_TEX);
1123 RNA_def_property_ui_text(
1124 prop, "Missing Texture", "Image Painting does not have a texture to paint on");
1125 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1128 static void rna_def_particle_edit(BlenderRNA *brna)
1133 static const EnumPropertyItem select_mode_items[] = {
1134 {SCE_SELECT_PATH, "PATH", ICON_PARTICLE_PATH, "Path", "Path edit mode"},
1135 {SCE_SELECT_POINT, "POINT", ICON_PARTICLE_POINT, "Point", "Point select mode"},
1136 {SCE_SELECT_END, "TIP", ICON_PARTICLE_TIP, "Tip", "Tip select mode"},
1137 {0, NULL, 0, NULL, NULL},
1140 static const EnumPropertyItem puff_mode[] = {
1141 {0, "ADD", 0, "Add", "Make hairs more puffy"},
1142 {1, "SUB", 0, "Sub", "Make hairs less puffy"},
1143 {0, NULL, 0, NULL, NULL},
1146 static const EnumPropertyItem length_mode[] = {
1147 {0, "GROW", 0, "Grow", "Make hairs longer"},
1148 {1, "SHRINK", 0, "Shrink", "Make hairs shorter"},
1149 {0, NULL, 0, NULL, NULL},
1152 static const EnumPropertyItem edit_type_items[] = {
1153 {PE_TYPE_PARTICLES, "PARTICLES", 0, "Particles", ""},
1154 {PE_TYPE_SOFTBODY, "SOFT_BODY", 0, "Soft Body", ""},
1155 {PE_TYPE_CLOTH, "CLOTH", 0, "Cloth", ""},
1156 {0, NULL, 0, NULL, NULL},
1161 srna = RNA_def_struct(brna, "ParticleEdit", NULL);
1162 RNA_def_struct_sdna(srna, "ParticleEditSettings");
1163 RNA_def_struct_path_func(srna, "rna_ParticleEdit_path");
1164 RNA_def_struct_ui_text(srna, "Particle Edit", "Properties of particle editing mode");
1166 prop = RNA_def_property(srna, "tool", PROP_ENUM, PROP_NONE);
1167 RNA_def_property_enum_sdna(prop, NULL, "brushtype");
1168 RNA_def_property_enum_items(prop, rna_enum_particle_edit_hair_brush_items);
1169 RNA_def_property_enum_funcs(
1170 prop, NULL, "rna_ParticleEdit_tool_set", "rna_ParticleEdit_tool_itemf");
1171 RNA_def_property_ui_text(prop, "Tool", "");
1173 prop = RNA_def_property(srna, "select_mode", PROP_ENUM, PROP_NONE);
1174 RNA_def_property_enum_bitflag_sdna(prop, NULL, "selectmode");
1175 RNA_def_property_enum_items(prop, select_mode_items);
1176 RNA_def_property_ui_text(prop, "Selection Mode", "Particle select and display mode");
1177 RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
1178 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ParticleEdit_update");
1180 prop = RNA_def_property(srna, "use_preserve_length", PROP_BOOLEAN, PROP_NONE);
1181 RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_KEEP_LENGTHS);
1182 RNA_def_property_ui_text(prop, "Keep Lengths", "Keep path lengths constant");
1184 prop = RNA_def_property(srna, "use_preserve_root", PROP_BOOLEAN, PROP_NONE);
1185 RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_LOCK_FIRST);
1186 RNA_def_property_ui_text(prop, "Keep Root", "Keep root keys unmodified");
1188 prop = RNA_def_property(srna, "use_emitter_deflect", PROP_BOOLEAN, PROP_NONE);
1189 RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_DEFLECT_EMITTER);
1190 RNA_def_property_ui_text(prop, "Deflect Emitter", "Keep paths from intersecting the emitter");
1192 prop = RNA_def_property(srna, "emitter_distance", PROP_FLOAT, PROP_DISTANCE);
1193 RNA_def_property_float_sdna(prop, NULL, "emitterdist");
1194 RNA_def_property_ui_range(prop, 0.0f, 10.0f, 10, 3);
1195 RNA_def_property_ui_text(
1196 prop, "Emitter Distance", "Distance to keep particles away from the emitter");
1198 prop = RNA_def_property(srna, "use_fade_time", PROP_BOOLEAN, PROP_NONE);
1199 RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_FADE_TIME);
1200 RNA_def_property_ui_text(
1201 prop, "Fade Time", "Fade paths and keys further away from current frame");
1202 RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
1203 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ParticleEdit_update");
1205 prop = RNA_def_property(srna, "use_auto_velocity", PROP_BOOLEAN, PROP_NONE);
1206 RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_AUTO_VELOCITY);
1207 RNA_def_property_ui_text(prop, "Auto Velocity", "Calculate point velocities automatically");
1209 prop = RNA_def_property(srna, "show_particles", PROP_BOOLEAN, PROP_NONE);
1210 RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
1211 RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_DRAW_PART);
1212 RNA_def_property_ui_text(prop, "Display Particles", "Display actual particles");
1213 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ParticleEdit_redo");
1215 prop = RNA_def_property(srna, "use_default_interpolate", PROP_BOOLEAN, PROP_NONE);
1216 RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_INTERPOLATE_ADDED);
1217 RNA_def_property_ui_text(
1218 prop, "Interpolate", "Interpolate new particles from the existing ones");
1220 prop = RNA_def_property(srna, "default_key_count", PROP_INT, PROP_NONE);
1221 RNA_def_property_int_sdna(prop, NULL, "totaddkey");
1222 RNA_def_property_range(prop, 2, SHRT_MAX);
1223 RNA_def_property_ui_range(prop, 2, 20, 10, 3);
1224 RNA_def_property_ui_text(prop, "Keys", "How many keys to make new particles with");
1226 prop = RNA_def_property(srna, "brush", PROP_POINTER, PROP_NONE);
1227 RNA_def_property_struct_type(prop, "ParticleBrush");
1228 RNA_def_property_pointer_funcs(prop, "rna_ParticleEdit_brush_get", NULL, NULL, NULL);
1229 RNA_def_property_ui_text(prop, "Brush", "");
1231 prop = RNA_def_property(srna, "display_step", PROP_INT, PROP_NONE);
1232 RNA_def_property_int_sdna(prop, NULL, "draw_step");
1233 RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
1234 RNA_def_property_range(prop, 1, 10);
1235 RNA_def_property_ui_text(prop, "Steps", "How many steps to display the path with");
1236 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ParticleEdit_redo");
1238 prop = RNA_def_property(srna, "fade_frames", PROP_INT, PROP_NONE);
1239 RNA_def_property_range(prop, 1, 100);
1240 RNA_def_property_ui_text(prop, "Frames", "How many frames to fade");
1241 RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
1242 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ParticleEdit_update");
1244 prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
1245 RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
1246 RNA_def_property_enum_sdna(prop, NULL, "edittype");
1247 RNA_def_property_enum_items(prop, edit_type_items);
1248 RNA_def_property_ui_text(prop, "Type", "");
1249 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ParticleEdit_redo");
1251 prop = RNA_def_property(srna, "is_editable", PROP_BOOLEAN, PROP_NONE);
1252 RNA_def_property_boolean_funcs(prop, "rna_ParticleEdit_editable_get", NULL);
1253 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1254 RNA_def_property_ui_text(prop, "Editable", "A valid edit mode exists");
1256 prop = RNA_def_property(srna, "is_hair", PROP_BOOLEAN, PROP_NONE);
1257 RNA_def_property_boolean_funcs(prop, "rna_ParticleEdit_hair_get", NULL);
1258 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1259 RNA_def_property_ui_text(prop, "Hair", "Editing hair");
1261 prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
1262 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1263 RNA_def_property_ui_text(prop, "Object", "The edited object");
1265 prop = RNA_def_property(srna, "shape_object", PROP_POINTER, PROP_NONE);
1266 RNA_def_property_flag(prop, PROP_EDITABLE | PROP_CONTEXT_UPDATE);
1267 RNA_def_property_ui_text(prop, "Shape Object", "Outer shape to use for tools");
1268 RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Mesh_object_poll");
1269 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ParticleEdit_redo");
1273 srna = RNA_def_struct(brna, "ParticleBrush", NULL);
1274 RNA_def_struct_sdna(srna, "ParticleBrushData");
1275 RNA_def_struct_path_func(srna, "rna_ParticleBrush_path");
1276 RNA_def_struct_ui_text(srna, "Particle Brush", "Particle editing brush");
1278 prop = RNA_def_property(srna, "size", PROP_INT, PROP_PIXEL);
1279 RNA_def_property_range(prop, 1, SHRT_MAX);
1280 RNA_def_property_ui_range(prop, 1, MAX_BRUSH_PIXEL_RADIUS, 10, 3);
1281 RNA_def_property_ui_text(prop, "Radius", "Radius of the brush in pixels");
1283 prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_FACTOR);
1284 RNA_def_property_range(prop, 0.001, 1.0);
1285 RNA_def_property_ui_text(prop, "Strength", "Brush strength");
1287 prop = RNA_def_property(srna, "count", PROP_INT, PROP_NONE);
1288 RNA_def_property_range(prop, 1, 1000);
1289 RNA_def_property_ui_range(prop, 1, 100, 10, 3);
1290 RNA_def_property_ui_text(prop, "Count", "Particle count");
1292 prop = RNA_def_property(srna, "steps", PROP_INT, PROP_NONE);
1293 RNA_def_property_int_sdna(prop, NULL, "step");
1294 RNA_def_property_range(prop, 1, SHRT_MAX);
1295 RNA_def_property_ui_range(prop, 1, 50, 10, 3);
1296 RNA_def_property_ui_text(prop, "Steps", "Brush steps");
1298 prop = RNA_def_property(srna, "puff_mode", PROP_ENUM, PROP_NONE);
1299 RNA_def_property_enum_sdna(prop, NULL, "invert");
1300 RNA_def_property_enum_items(prop, puff_mode);
1301 RNA_def_property_ui_text(prop, "Puff Mode", "");
1303 prop = RNA_def_property(srna, "use_puff_volume", PROP_BOOLEAN, PROP_NONE);
1304 RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_BRUSH_DATA_PUFF_VOLUME);
1305 RNA_def_property_ui_text(
1308 "Apply puff to unselected end-points (helps maintain hair volume when puffing root)");
1310 prop = RNA_def_property(srna, "length_mode", PROP_ENUM, PROP_NONE);
1311 RNA_def_property_enum_sdna(prop, NULL, "invert");
1312 RNA_def_property_enum_items(prop, length_mode);
1313 RNA_def_property_ui_text(prop, "Length Mode", "");
1316 prop = RNA_def_property(srna, "curve", PROP_POINTER, PROP_NONE);
1317 RNA_def_property_struct_type(prop, "CurveMapping");
1318 RNA_def_property_pointer_funcs(prop, "rna_ParticleBrush_curve_get", NULL, NULL, NULL);
1319 RNA_def_property_ui_text(prop, "Curve", "");
1322 /* srna -- gpencil speed guides */
1323 static void rna_def_gpencil_guides(BlenderRNA *brna)
1328 srna = RNA_def_struct(brna, "GPencilSculptGuide", NULL);
1329 RNA_def_struct_sdna(srna, "GP_Sculpt_Guide");
1330 RNA_def_struct_path_func(srna, "rna_GPencilSculptGuide_path");
1331 RNA_def_struct_ui_text(srna, "GPencil Sculpt Guide", "Guides for drawing");
1333 static const EnumPropertyItem prop_gpencil_guidetypes[] = {
1334 {GP_GUIDE_CIRCULAR, "CIRCULAR", 0, "Circular", "Use single point to create rings"},
1335 {GP_GUIDE_RADIAL, "RADIAL", 0, "Radial", "Use single point as direction"},
1336 {GP_GUIDE_PARALLEL, "PARALLEL", 0, "Parallel", "Parallel lines"},
1337 {GP_GUIDE_GRID, "GRID", 0, "Grid", "Grid allows horizontal and vertical lines"},
1338 {GP_GUIDE_ISO, "ISO", 0, "Isometric", "Grid allows isometric and vertical lines"},
1339 {0, NULL, 0, NULL, NULL},
1342 static const EnumPropertyItem prop_gpencil_guide_references[] = {
1343 {GP_GUIDE_REF_CURSOR, "CURSOR", 0, "Cursor", "Use cursor as reference point"},
1344 {GP_GUIDE_REF_CUSTOM, "CUSTOM", 0, "Custom", "Use custom reference point"},
1345 {GP_GUIDE_REF_OBJECT, "OBJECT", 0, "Object", "Use object as reference point"},
1346 {0, NULL, 0, NULL, NULL},
1349 prop = RNA_def_property(srna, "use_guide", PROP_BOOLEAN, PROP_NONE);
1350 RNA_def_property_boolean_sdna(prop, NULL, "use_guide", false);
1351 RNA_def_property_boolean_default(prop, false);
1352 RNA_def_property_ui_text(prop, "Use Guides", "Enable speed guides");
1353 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1354 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
1356 prop = RNA_def_property(srna, "use_snapping", PROP_BOOLEAN, PROP_NONE);
1357 RNA_def_property_boolean_sdna(prop, NULL, "use_snapping", false);
1358 RNA_def_property_boolean_default(prop, false);
1359 RNA_def_property_ui_text(
1360 prop, "Use Snapping", "Enable snapping to guides angle or spacing options");
1361 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1362 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
1364 prop = RNA_def_property(srna, "reference_object", PROP_POINTER, PROP_NONE);
1365 RNA_def_property_pointer_sdna(prop, NULL, "reference_object");
1366 RNA_def_property_ui_text(prop, "Object", "Object used for reference point");
1367 RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK);
1368 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_viewport_update");
1370 prop = RNA_def_property(srna, "reference_point", PROP_ENUM, PROP_NONE);
1371 RNA_def_property_enum_sdna(prop, NULL, "reference_point");
1372 RNA_def_property_enum_items(prop, prop_gpencil_guide_references);
1373 RNA_def_property_ui_text(prop, "Type", "Type of speed guide");
1374 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1375 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_viewport_update");
1377 prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
1378 RNA_def_property_enum_sdna(prop, NULL, "type");
1379 RNA_def_property_enum_items(prop, prop_gpencil_guidetypes);
1380 RNA_def_property_ui_text(prop, "Type", "Type of speed guide");
1381 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1382 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
1384 prop = RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE);
1385 RNA_def_property_float_sdna(prop, NULL, "angle");
1386 RNA_def_property_range(prop, -(M_PI * 2.0f), (M_PI * 2.0f));
1387 RNA_def_property_ui_text(prop, "Angle", "Direction of lines");
1388 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1389 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
1391 prop = RNA_def_property(srna, "angle_snap", PROP_FLOAT, PROP_ANGLE);
1392 RNA_def_property_float_sdna(prop, NULL, "angle_snap");
1393 RNA_def_property_range(prop, -(M_PI * 2.0f), (M_PI * 2.0f));
1394 RNA_def_property_ui_text(prop, "Angle Snap", "Angle snapping");
1395 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1396 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
1398 prop = RNA_def_property(srna, "spacing", PROP_FLOAT, PROP_DISTANCE);
1399 RNA_def_property_float_sdna(prop, NULL, "spacing");
1400 RNA_def_property_range(prop, 0.0f, FLT_MAX);
1401 RNA_def_property_ui_range(prop, 0.0f, FLT_MAX, 1, 3);
1402 RNA_def_property_ui_text(prop, "Spacing", "Guide spacing");
1403 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1404 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
1406 prop = RNA_def_property(srna, "location", PROP_FLOAT, PROP_DISTANCE);
1407 RNA_def_property_float_sdna(prop, NULL, "location");
1408 RNA_def_property_array(prop, 3);
1409 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1410 RNA_def_property_ui_text(prop, "Location", "Custom reference point for guides");
1411 RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
1412 RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, 3);
1413 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_viewport_update");
1416 static void rna_def_gpencil_sculpt(BlenderRNA *brna)
1418 static const EnumPropertyItem prop_direction_items[] = {
1419 {0, "ADD", ICON_ADD, "Add", "Add effect of brush"},
1420 {GP_SCULPT_FLAG_INVERT, "SUBTRACT", ICON_REMOVE, "Subtract", "Subtract effect of brush"},
1421 {0, NULL, 0, NULL, NULL},
1424 UNUSED_VARS(prop_direction_items);
1429 /* == Settings == */
1430 srna = RNA_def_struct(brna, "GPencilSculptSettings", NULL);
1431 RNA_def_struct_sdna(srna, "GP_Sculpt_Settings");
1432 RNA_def_struct_path_func(srna, "rna_GPencilSculptSettings_path");
1433 RNA_def_struct_ui_text(srna,
1434 "GPencil Sculpt Settings",
1435 "General properties for Grease Pencil stroke sculpting tools");
1437 prop = RNA_def_property(srna, "guide", PROP_POINTER, PROP_NONE);
1438 RNA_def_property_struct_type(prop, "GPencilSculptGuide");
1439 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1440 RNA_def_property_ui_text(prop, "Guide", "");
1442 prop = RNA_def_property(srna, "use_multiframe_falloff", PROP_BOOLEAN, PROP_NONE);
1443 RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_SCULPT_SETT_FLAG_FRAME_FALLOFF);
1444 RNA_def_property_ui_text(
1447 "Use falloff effect when edit in multiframe mode to compute brush effect by frame");
1448 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1449 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
1451 prop = RNA_def_property(srna, "use_thickness_curve", PROP_BOOLEAN, PROP_NONE);
1452 RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_SCULPT_SETT_FLAG_PRIMITIVE_CURVE);
1453 RNA_def_property_ui_text(prop, "Use Curve", "Use curve to define primitive stroke thickness");
1454 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1455 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
1457 prop = RNA_def_property(srna, "use_scale_thickness", PROP_BOOLEAN, PROP_NONE);
1458 RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_SCULPT_SETT_FLAG_SCALE_THICKNESS);
1459 RNA_def_property_ui_text(
1460 prop, "Scale Stroke Thickness", "Scale the stroke thickness when transforming strokes");
1461 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1462 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
1464 /* custom falloff curve */
1465 prop = RNA_def_property(srna, "multiframe_falloff_curve", PROP_POINTER, PROP_NONE);
1466 RNA_def_property_pointer_sdna(prop, NULL, "cur_falloff");
1467 RNA_def_property_struct_type(prop, "CurveMapping");
1468 RNA_def_property_ui_text(
1469 prop, "Curve", "Custom curve to control falloff of brush effect by Grease Pencil frames");
1470 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1471 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
1473 /* custom primitive curve */
1474 prop = RNA_def_property(srna, "thickness_primitive_curve", PROP_POINTER, PROP_NONE);
1475 RNA_def_property_pointer_sdna(prop, NULL, "cur_primitive");
1476 RNA_def_property_struct_type(prop, "CurveMapping");
1477 RNA_def_property_ui_text(prop, "Curve", "Custom curve to control primitive thickness");
1478 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1479 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
1482 prop = RNA_def_property(srna, "lock_axis", PROP_ENUM, PROP_NONE);
1483 RNA_def_property_enum_sdna(prop, NULL, "lock_axis");
1484 RNA_def_property_enum_items(prop, rna_enum_gpencil_lock_axis_items);
1485 RNA_def_property_ui_text(prop, "Lock Axis", "");
1486 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1487 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
1489 /* threshold for cutter */
1490 prop = RNA_def_property(srna, "intersection_threshold", PROP_FLOAT, PROP_NONE);
1491 RNA_def_property_float_sdna(prop, NULL, "isect_threshold");
1492 RNA_def_property_range(prop, 0.0f, 10.0f);
1493 RNA_def_property_float_default(prop, 0.1f);
1494 RNA_def_property_ui_text(prop, "Threshold", "Threshold for stroke intersections");
1495 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1498 void RNA_def_sculpt_paint(BlenderRNA *brna)
1500 /* *** Non-Animated *** */
1501 RNA_define_animate_sdna(false);
1502 rna_def_paint_curve(brna);
1503 rna_def_paint_tool_slot(brna);
1504 rna_def_paint(brna);
1505 rna_def_sculpt(brna);
1506 rna_def_uv_sculpt(brna);
1507 rna_def_gp_paint(brna);
1508 rna_def_gp_vertexpaint(brna);
1509 rna_def_gp_sculptpaint(brna);
1510 rna_def_gp_weightpaint(brna);
1511 rna_def_vertex_paint(brna);
1512 rna_def_image_paint(brna);
1513 rna_def_particle_edit(brna);
1514 rna_def_gpencil_guides(brna);
1515 rna_def_gpencil_sculpt(brna);
1516 RNA_define_animate_sdna(true);