Blender  V3.3
rna_sculpt_paint.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
7 #include <stdlib.h>
8 
9 #include "BLI_math.h"
10 #include "BLI_utildefines.h"
11 
12 #include "RNA_define.h"
13 #include "RNA_enum_types.h"
14 
15 #include "rna_internal.h"
16 
17 #include "DNA_ID.h"
18 #include "DNA_brush_types.h"
19 #include "DNA_gpencil_types.h"
20 #include "DNA_scene_types.h"
21 #include "DNA_screen_types.h"
22 #include "DNA_space_types.h"
23 
24 #include "BKE_brush.h"
25 #include "BKE_material.h"
26 #include "BKE_paint.h"
27 
28 #include "ED_image.h"
29 
30 #include "WM_api.h"
31 #include "WM_types.h"
32 
33 #include "bmesh.h"
34 
36  {PE_BRUSH_COMB, "COMB", 0, "Comb", "Comb hairs"},
37  {PE_BRUSH_SMOOTH, "SMOOTH", 0, "Smooth", "Smooth hairs"},
38  {PE_BRUSH_ADD, "ADD", 0, "Add", "Add hairs"},
39  {PE_BRUSH_LENGTH, "LENGTH", 0, "Length", "Make hairs longer or shorter"},
40  {PE_BRUSH_PUFF, "PUFF", 0, "Puff", "Make hairs stand up"},
41  {PE_BRUSH_CUT, "CUT", 0, "Cut", "Cut hairs"},
42  {PE_BRUSH_WEIGHT, "WEIGHT", 0, "Weight", "Weight hair particles"},
43  {0, NULL, 0, NULL, NULL},
44 };
45 
46 #ifndef RNA_RUNTIME
49  "VIEW",
50  ICON_RESTRICT_VIEW_ON,
51  "View",
52  "Align strokes to current view plane"},
54  "AXIS_Y",
55  ICON_AXIS_FRONT,
56  "Front (X-Z)",
57  "Project strokes to plane locked to Y"},
59  "AXIS_X",
60  ICON_AXIS_SIDE,
61  "Side (Y-Z)",
62  "Project strokes to plane locked to X"},
63  {GP_LOCKAXIS_Z, "AXIS_Z", ICON_AXIS_TOP, "Top (X-Y)", "Project strokes to plane locked to Z"},
65  "CURSOR",
66  ICON_PIVOT_CURSOR,
67  "Cursor",
68  "Align strokes to current 3D cursor orientation"},
69  {0, NULL, 0, NULL, NULL},
70 };
71 
74  "MATERIAL",
75  0,
76  "Material",
77  "Paint using the active material base color"},
79  "VERTEXCOLOR",
80  0,
81  "Color Attribute",
82  "Paint the material with a color attribute"},
83  {0, NULL, 0, NULL, NULL},
84 };
85 #endif
86 
88  {PAINT_CANVAS_SOURCE_COLOR_ATTRIBUTE, "COLOR_ATTRIBUTE", 0, "Color Attribute", ""},
89  {PAINT_CANVAS_SOURCE_MATERIAL, "MATERIAL", 0, "Material", ""},
90  {PAINT_CANVAS_SOURCE_IMAGE, "IMAGE", 0, "Image", ""},
91  {0, NULL, 0, NULL, NULL},
92 };
93 
95  {BMO_SYMMETRIZE_NEGATIVE_X, "NEGATIVE_X", 0, "-X to +X", ""},
96  {BMO_SYMMETRIZE_POSITIVE_X, "POSITIVE_X", 0, "+X to -X", ""},
97 
98  {BMO_SYMMETRIZE_NEGATIVE_Y, "NEGATIVE_Y", 0, "-Y to +Y", ""},
99  {BMO_SYMMETRIZE_POSITIVE_Y, "POSITIVE_Y", 0, "+Y to -Y", ""},
100 
101  {BMO_SYMMETRIZE_NEGATIVE_Z, "NEGATIVE_Z", 0, "-Z to +Z", ""},
102  {BMO_SYMMETRIZE_POSITIVE_Z, "POSITIVE_Z", 0, "+Z to -Z", ""},
103  {0, NULL, 0, NULL, NULL},
104 };
105 
106 #ifdef RNA_RUNTIME
107 # include "MEM_guardedalloc.h"
108 
109 # include "BKE_collection.h"
110 # include "BKE_context.h"
111 # include "BKE_gpencil.h"
112 # include "BKE_object.h"
113 # include "BKE_particle.h"
114 # include "BKE_pbvh.h"
115 # include "BKE_pointcache.h"
116 
117 # include "DEG_depsgraph.h"
118 
119 # include "ED_gpencil.h"
120 # include "ED_paint.h"
121 # include "ED_particle.h"
122 
123 static void rna_GPencil_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr))
124 {
125  /* mark all grease pencil datablocks of the scene */
126  if (scene != NULL) {
128  }
129 }
130 
131 const EnumPropertyItem rna_enum_particle_edit_disconnected_hair_brush_items[] = {
132  {PE_BRUSH_COMB, "COMB", 0, "Comb", "Comb hairs"},
133  {PE_BRUSH_SMOOTH, "SMOOTH", 0, "Smooth", "Smooth hairs"},
134  {PE_BRUSH_LENGTH, "LENGTH", 0, "Length", "Make hairs longer or shorter"},
135  {PE_BRUSH_CUT, "CUT", 0, "Cut", "Cut hairs"},
136  {PE_BRUSH_WEIGHT, "WEIGHT", 0, "Weight", "Weight hair particles"},
137  {0, NULL, 0, NULL, NULL},
138 };
139 
140 static const EnumPropertyItem particle_edit_cache_brush_items[] = {
141  {PE_BRUSH_COMB, "COMB", 0, "Comb", "Comb paths"},
142  {PE_BRUSH_SMOOTH, "SMOOTH", 0, "Smooth", "Smooth paths"},
143  {PE_BRUSH_LENGTH, "LENGTH", 0, "Length", "Make paths longer or shorter"},
144  {0, NULL, 0, NULL, NULL},
145 };
146 
147 static PointerRNA rna_ParticleEdit_brush_get(PointerRNA *ptr)
148 {
150  ParticleBrushData *brush = NULL;
151 
152  brush = &pset->brush[pset->brushtype];
153 
154  return rna_pointer_inherit_refine(ptr, &RNA_ParticleBrush, brush);
155 }
156 
157 static PointerRNA rna_ParticleBrush_curve_get(PointerRNA *ptr)
158 {
159  return rna_pointer_inherit_refine(ptr, &RNA_CurveMapping, NULL);
160 }
161 
162 static void rna_ParticleEdit_redo(bContext *C, PointerRNA *UNUSED(ptr))
163 {
166  ViewLayer *view_layer = CTX_data_view_layer(C);
167  Object *ob = OBACT(view_layer);
169 
170  if (!edit) {
171  return;
172  }
173 
174  if (ob) {
176  }
177 
179  psys_free_path_cache(edit->psys, edit);
181 }
182 
183 static void rna_ParticleEdit_update(bContext *C, PointerRNA *UNUSED(ptr))
184 {
186  ViewLayer *view_layer = CTX_data_view_layer(C);
187  Object *ob = OBACT(view_layer);
188 
189  if (ob) {
191  }
192 
193  /* Sync tool setting changes from original to evaluated scenes. */
195 }
196 
197 static void rna_ParticleEdit_tool_set(PointerRNA *ptr, int value)
198 {
200 
201  /* redraw hair completely if weight brush is/was used */
202  if ((pset->brushtype == PE_BRUSH_WEIGHT || value == PE_BRUSH_WEIGHT) && pset->object) {
203  Object *ob = pset->object;
204  if (ob) {
207  }
208  }
209 
210  pset->brushtype = value;
211 }
212 static const EnumPropertyItem *rna_ParticleEdit_tool_itemf(bContext *C,
214  PropertyRNA *UNUSED(prop),
215  bool *UNUSED(r_free))
216 {
217  ViewLayer *view_layer = CTX_data_view_layer(C);
218  Object *ob = OBACT(view_layer);
219 # if 0
223  ParticleSystem *psys = edit ? edit->psys : NULL;
224 # else
225  /* use this rather than PE_get_current() - because the editing cache is
226  * dependent on the cache being updated which can happen after this UI
227  * draws causing a glitch T28883. */
228  ParticleSystem *psys = psys_get_current(ob);
229 # endif
230 
231  if (psys) {
232  if (psys->flag & PSYS_GLOBAL_HAIR) {
233  return rna_enum_particle_edit_disconnected_hair_brush_items;
234  }
235  else {
237  }
238  }
239 
240  return particle_edit_cache_brush_items;
241 }
242 
243 static bool rna_ParticleEdit_editable_get(PointerRNA *ptr)
244 {
246 
247  return (pset->object && pset->scene && PE_get_current(NULL, pset->scene, pset->object));
248 }
249 static bool rna_ParticleEdit_hair_get(PointerRNA *ptr)
250 {
252 
253  if (pset->scene) {
254  PTCacheEdit *edit = PE_get_current(NULL, pset->scene, pset->object);
255 
256  return (edit && edit->psys);
257  }
258 
259  return 0;
260 }
261 
262 static char *rna_ParticleEdit_path(const PointerRNA *UNUSED(ptr))
263 {
264  return BLI_strdup("tool_settings.particle_edit");
265 }
266 
267 static bool rna_Brush_mode_poll(PointerRNA *ptr, PointerRNA value)
268 {
269  const Paint *paint = ptr->data;
270  Brush *brush = (Brush *)value.owner_id;
271  const uint tool_offset = paint->runtime.tool_offset;
272  const eObjectMode ob_mode = paint->runtime.ob_mode;
273  UNUSED_VARS_NDEBUG(tool_offset);
274  BLI_assert(tool_offset && ob_mode);
275 
276  if (brush->ob_mode & ob_mode) {
277  if (paint->brush) {
278  if (BKE_brush_tool_get(paint->brush, paint) == BKE_brush_tool_get(brush, paint)) {
279  return true;
280  }
281  }
282  else {
283  return true;
284  }
285  }
286 
287  return false;
288 }
289 
290 static bool paint_contains_brush_slot(const Paint *paint, const PaintToolSlot *tslot, int *r_index)
291 {
292  if ((tslot >= paint->tool_slots) && (tslot < (paint->tool_slots + paint->tool_slots_len))) {
293  *r_index = (int)(tslot - paint->tool_slots);
294  return true;
295  }
296  return false;
297 }
298 
299 static bool rna_Brush_mode_with_tool_poll(PointerRNA *ptr, PointerRNA value)
300 {
301  Scene *scene = (Scene *)ptr->owner_id;
302  const PaintToolSlot *tslot = ptr->data;
304  Brush *brush = (Brush *)value.owner_id;
305  int mode = 0;
306  int slot_index = 0;
307 
308  if (paint_contains_brush_slot(&ts->imapaint.paint, tslot, &slot_index)) {
309  if (slot_index != brush->imagepaint_tool) {
310  return false;
311  }
312  mode = OB_MODE_TEXTURE_PAINT;
313  }
314  else if (paint_contains_brush_slot(&ts->sculpt->paint, tslot, &slot_index)) {
315  if (slot_index != brush->sculpt_tool) {
316  return false;
317  }
318  mode = OB_MODE_SCULPT;
319  }
320  else if (paint_contains_brush_slot(&ts->uvsculpt->paint, tslot, &slot_index)) {
321  if (slot_index != brush->uv_sculpt_tool) {
322  return false;
323  }
324  mode = OB_MODE_EDIT;
325  }
326  else if (paint_contains_brush_slot(&ts->vpaint->paint, tslot, &slot_index)) {
327  if (slot_index != brush->vertexpaint_tool) {
328  return false;
329  }
330  mode = OB_MODE_VERTEX_PAINT;
331  }
332  else if (paint_contains_brush_slot(&ts->wpaint->paint, tslot, &slot_index)) {
333  if (slot_index != brush->weightpaint_tool) {
334  return false;
335  }
336  mode = OB_MODE_WEIGHT_PAINT;
337  }
338  else if (paint_contains_brush_slot(&ts->gp_paint->paint, tslot, &slot_index)) {
339  if (slot_index != brush->gpencil_tool) {
340  return false;
341  }
342  mode = OB_MODE_PAINT_GPENCIL;
343  }
344  else if (paint_contains_brush_slot(&ts->gp_vertexpaint->paint, tslot, &slot_index)) {
345  if (slot_index != brush->gpencil_vertex_tool) {
346  return false;
347  }
348  mode = OB_MODE_VERTEX_GPENCIL;
349  }
350  else if (paint_contains_brush_slot(&ts->gp_sculptpaint->paint, tslot, &slot_index)) {
351  if (slot_index != brush->gpencil_sculpt_tool) {
352  return false;
353  }
354  mode = OB_MODE_SCULPT_GPENCIL;
355  }
356  else if (paint_contains_brush_slot(&ts->gp_weightpaint->paint, tslot, &slot_index)) {
357  if (slot_index != brush->gpencil_weight_tool) {
358  return false;
359  }
360  mode = OB_MODE_WEIGHT_GPENCIL;
361  }
362  else if (paint_contains_brush_slot(&ts->curves_sculpt->paint, tslot, &slot_index)) {
363  if (slot_index != brush->curves_sculpt_tool) {
364  return false;
365  }
366  mode = OB_MODE_SCULPT_CURVES;
367  }
368 
369  return brush->ob_mode & mode;
370 }
371 
372 static void rna_Sculpt_update(bContext *C, PointerRNA *UNUSED(ptr))
373 {
375  ViewLayer *view_layer = CTX_data_view_layer(C);
376  Object *ob = OBACT(view_layer);
377 
378  if (ob) {
381 
382  if (ob->sculpt) {
385  }
386  }
387 }
388 
389 static void rna_Sculpt_ShowMask_update(bContext *C, PointerRNA *UNUSED(ptr))
390 {
391  ViewLayer *view_layer = CTX_data_view_layer(C);
392  Object *object = OBACT(view_layer);
393  if (object == NULL || object->sculpt == NULL) {
394  return;
395  }
398  object->sculpt->show_mask = ((sd->flags & SCULPT_HIDE_MASK) == 0);
399  if (object->sculpt->pbvh != NULL) {
400  pbvh_show_mask_set(object->sculpt->pbvh, object->sculpt->show_mask);
401  }
404 }
405 
406 static char *rna_Sculpt_path(const PointerRNA *UNUSED(ptr))
407 {
408  return BLI_strdup("tool_settings.sculpt");
409 }
410 
411 static char *rna_VertexPaint_path(const PointerRNA *ptr)
412 {
413  const Scene *scene = (Scene *)ptr->owner_id;
414  const ToolSettings *ts = scene->toolsettings;
415  if (ptr->data == ts->vpaint) {
416  return BLI_strdup("tool_settings.vertex_paint");
417  }
418  else {
419  return BLI_strdup("tool_settings.weight_paint");
420  }
421 }
422 
423 static char *rna_ImagePaintSettings_path(const PointerRNA *UNUSED(ptr))
424 {
425  return BLI_strdup("tool_settings.image_paint");
426 }
427 
428 static char *rna_PaintModeSettings_path(const PointerRNA *UNUSED(ptr))
429 {
430  return BLI_strdup("tool_settings.paint_mode");
431 }
432 
433 static char *rna_UvSculpt_path(const PointerRNA *UNUSED(ptr))
434 {
435  return BLI_strdup("tool_settings.uv_sculpt");
436 }
437 
438 static char *rna_CurvesSculpt_path(const PointerRNA *UNUSED(ptr))
439 {
440  return BLI_strdup("tool_settings.curves_sculpt");
441 }
442 
443 static char *rna_GpPaint_path(const PointerRNA *UNUSED(ptr))
444 {
445  return BLI_strdup("tool_settings.gpencil_paint");
446 }
447 
448 static char *rna_GpVertexPaint_path(const PointerRNA *UNUSED(ptr))
449 {
450  return BLI_strdup("tool_settings.gpencil_vertex_paint");
451 }
452 
453 static char *rna_GpSculptPaint_path(const PointerRNA *UNUSED(ptr))
454 {
455  return BLI_strdup("tool_settings.gpencil_sculpt_paint");
456 }
457 
458 static char *rna_GpWeightPaint_path(const PointerRNA *UNUSED(ptr))
459 {
460  return BLI_strdup("tool_settings.gpencil_weight_paint");
461 }
462 
463 static char *rna_ParticleBrush_path(const PointerRNA *UNUSED(ptr))
464 {
465  return BLI_strdup("tool_settings.particle_edit.brush");
466 }
467 
468 static void rna_Paint_brush_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
469 {
470  Paint *paint = ptr->data;
471  Brush *br = paint->brush;
473  /* Needed because we're not calling 'BKE_paint_brush_set' which handles this. */
476 }
477 
478 static void rna_ImaPaint_viewport_update(Main *UNUSED(bmain),
479  Scene *UNUSED(scene),
481 {
482  /* not the best solution maybe, but will refresh the 3D viewport */
484 }
485 
486 static void rna_ImaPaint_mode_update(bContext *C, PointerRNA *UNUSED(ptr))
487 {
489  ViewLayer *view_layer = CTX_data_view_layer(C);
490  Object *ob = OBACT(view_layer);
491 
492  if (ob && ob->type == OB_MESH) {
493  /* of course we need to invalidate here */
495 
496  /* We assume that changing the current mode will invalidate the uv layers
497  * so we need to refresh display. */
500  }
501 }
502 
503 static void rna_ImaPaint_stencil_update(bContext *C, PointerRNA *UNUSED(ptr))
504 {
506  ViewLayer *view_layer = CTX_data_view_layer(C);
507  Object *ob = OBACT(view_layer);
508 
509  if (ob && ob->type == OB_MESH) {
512  }
513 }
514 
515 static bool rna_ImaPaint_imagetype_poll(PointerRNA *UNUSED(ptr), PointerRNA value)
516 {
517  Image *image = (Image *)value.owner_id;
518  return image->type != IMA_TYPE_R_RESULT && image->type != IMA_TYPE_COMPOSITE;
519 }
520 
521 static void rna_ImaPaint_canvas_update(bContext *C, PointerRNA *UNUSED(ptr))
522 {
523  Main *bmain = CTX_data_main(C);
525  ViewLayer *view_layer = CTX_data_view_layer(C);
526  Object *ob = OBACT(view_layer);
527  bScreen *screen;
529 
530  for (screen = bmain->screens.first; screen; screen = screen->id.next) {
531  ScrArea *area;
532  for (area = screen->areabase.first; area; area = area->next) {
533  SpaceLink *slink;
534  for (slink = area->spacedata.first; slink; slink = slink->next) {
535  if (slink->spacetype == SPACE_IMAGE) {
536  SpaceImage *sima = (SpaceImage *)slink;
537 
538  if (!sima->pin) {
539  ED_space_image_set(bmain, sima, ima, true);
540  }
541  }
542  }
543  }
544  }
545 
546  if (ob && ob->type == OB_MESH) {
549  }
550 }
551 
555 static bool rna_PaintModeSettings_canvas_image_poll(PointerRNA *UNUSED(ptr), PointerRNA value)
556 {
557  Image *image = (Image *)value.owner_id;
559 }
560 
561 static void rna_PaintModeSettings_canvas_source_update(bContext *C, PointerRNA *UNUSED(ptr))
562 {
565  /* When canvas source changes the PBVH would require updates when switching between color
566  * attributes. */
567  if (ob && ob->type == OB_MESH) {
569  DEG_id_tag_update(&ob->id, 0);
571  }
572 }
573 
574 /* \} */
575 
576 static bool rna_ImaPaint_detect_data(ImagePaintSettings *imapaint)
577 {
578  return imapaint->missing_data == 0;
579 }
580 
581 static char *rna_GPencilSculptSettings_path(const PointerRNA *UNUSED(ptr))
582 {
583  return BLI_strdup("tool_settings.gpencil_sculpt");
584 }
585 
586 static char *rna_GPencilSculptGuide_path(const PointerRNA *UNUSED(ptr))
587 {
588  return BLI_strdup("tool_settings.gpencil_sculpt.guide");
589 }
590 
591 #else
592 
593 static void rna_def_paint_curve(BlenderRNA *brna)
594 {
595  StructRNA *srna;
596 
597  srna = RNA_def_struct(brna, "PaintCurve", "ID");
598  RNA_def_struct_ui_text(srna, "Paint Curve", "");
599  RNA_def_struct_ui_icon(srna, ICON_CURVE_BEZCURVE);
600 }
601 
603 {
604  StructRNA *srna;
605  PropertyRNA *prop;
606 
607  srna = RNA_def_struct(brna, "PaintToolSlot", NULL);
608  RNA_def_struct_ui_text(srna, "Paint Tool Slot", "");
609 
610  prop = RNA_def_property(srna, "brush", PROP_POINTER, PROP_NONE);
612  RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Brush_mode_with_tool_poll");
613  RNA_def_property_ui_text(prop, "Brush", "");
614 }
615 
616 static void rna_def_paint(BlenderRNA *brna)
617 {
618  StructRNA *srna;
619  PropertyRNA *prop;
620 
621  srna = RNA_def_struct(brna, "Paint", NULL);
622  RNA_def_struct_ui_text(srna, "Paint", "");
623 
624  /* Global Settings */
625  prop = RNA_def_property(srna, "brush", PROP_POINTER, PROP_NONE);
627  RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Brush_mode_poll");
628  RNA_def_property_ui_text(prop, "Brush", "Active Brush");
629  RNA_def_property_update(prop, 0, "rna_Paint_brush_update");
630 
631  /* paint_tool_slots */
632  prop = RNA_def_property(srna, "tool_slots", PROP_COLLECTION, PROP_NONE);
633  RNA_def_property_collection_sdna(prop, NULL, "tool_slots", "tool_slots_len");
634  RNA_def_property_struct_type(prop, "PaintToolSlot");
635  /* don't dereference pointer! */
637  prop, NULL, NULL, NULL, "rna_iterator_array_get", NULL, NULL, NULL, NULL);
638  RNA_def_property_ui_text(prop, "Paint Tool Slots", "");
639 
640  prop = RNA_def_property(srna, "palette", PROP_POINTER, PROP_NONE);
643  RNA_def_property_ui_text(prop, "Palette", "Active Palette");
644 
645  prop = RNA_def_property(srna, "show_brush", PROP_BOOLEAN, PROP_NONE);
647  RNA_def_property_ui_text(prop, "Show Brush", "");
649 
650  prop = RNA_def_property(srna, "show_brush_on_surface", PROP_BOOLEAN, PROP_NONE);
652  RNA_def_property_ui_text(prop, "Show Brush On Surface", "");
654 
655  prop = RNA_def_property(srna, "show_low_resolution", PROP_BOOLEAN, PROP_NONE);
658  prop, "Fast Navigate", "For multires, show low resolution while navigating the view");
660 
661  prop = RNA_def_property(srna, "use_sculpt_delay_updates", PROP_BOOLEAN, PROP_NONE);
664  prop,
665  "Delay Viewport Updates",
666  "Update the geometry when it enters the view, providing faster view navigation");
668 
669  prop = RNA_def_property(srna, "input_samples", PROP_INT, PROP_UNSIGNED);
670  RNA_def_property_int_sdna(prop, NULL, "num_input_samples");
673  prop, "Input Samples", "Average multiple input samples together to smooth the brush stroke");
675 
676  prop = RNA_def_property(srna, "use_symmetry_x", PROP_BOOLEAN, PROP_NONE);
677  RNA_def_property_boolean_sdna(prop, NULL, "symmetry_flags", PAINT_SYMM_X);
678  RNA_def_property_ui_text(prop, "Symmetry X", "Mirror brush across the X axis");
680 
681  prop = RNA_def_property(srna, "use_symmetry_y", PROP_BOOLEAN, PROP_NONE);
682  RNA_def_property_boolean_sdna(prop, NULL, "symmetry_flags", PAINT_SYMM_Y);
683  RNA_def_property_ui_text(prop, "Symmetry Y", "Mirror brush across the Y axis");
685 
686  prop = RNA_def_property(srna, "use_symmetry_z", PROP_BOOLEAN, PROP_NONE);
687  RNA_def_property_boolean_sdna(prop, NULL, "symmetry_flags", PAINT_SYMM_Z);
688  RNA_def_property_ui_text(prop, "Symmetry Z", "Mirror brush across the Z axis");
690 
691  prop = RNA_def_property(srna, "use_symmetry_feather", PROP_BOOLEAN, PROP_NONE);
694  "Symmetry Feathering",
695  "Reduce the strength of the brush where it overlaps symmetrical daubs");
697 
698  prop = RNA_def_property(srna, "cavity_curve", PROP_POINTER, PROP_NONE);
700  RNA_def_property_ui_text(prop, "Curve", "Editable cavity curve");
702 
703  prop = RNA_def_property(srna, "use_cavity", PROP_BOOLEAN, PROP_NONE);
705  RNA_def_property_ui_text(prop, "Cavity Mask", "Mask painting according to mesh geometry cavity");
707 
708  prop = RNA_def_property(srna, "tile_offset", PROP_FLOAT, PROP_XYZ_LENGTH);
709  RNA_def_property_float_sdna(prop, NULL, "tile_offset");
710  RNA_def_property_array(prop, 3);
711  RNA_def_property_range(prop, 0.01, FLT_MAX);
712  RNA_def_property_ui_range(prop, 0.01, 100, 1 * 100, 2);
714  prop, "Tiling offset for the X Axis", "Stride at which tiled strokes are copied");
715 
716  prop = RNA_def_property(srna, "tile_x", PROP_BOOLEAN, PROP_NONE);
717  RNA_def_property_boolean_sdna(prop, NULL, "symmetry_flags", PAINT_TILE_X);
718  RNA_def_property_ui_text(prop, "Tile X", "Tile along X axis");
720 
721  prop = RNA_def_property(srna, "tile_y", PROP_BOOLEAN, PROP_NONE);
722  RNA_def_property_boolean_sdna(prop, NULL, "symmetry_flags", PAINT_TILE_Y);
723  RNA_def_property_ui_text(prop, "Tile Y", "Tile along Y axis");
725 
726  prop = RNA_def_property(srna, "tile_z", PROP_BOOLEAN, PROP_NONE);
727  RNA_def_property_boolean_sdna(prop, NULL, "symmetry_flags", PAINT_TILE_Z);
728  RNA_def_property_ui_text(prop, "Tile Z", "Tile along Z axis");
730 }
731 
732 static void rna_def_sculpt(BlenderRNA *brna)
733 {
734  static const EnumPropertyItem detail_refine_items[] = {
736  "SUBDIVIDE",
737  0,
738  "Subdivide Edges",
739  "Subdivide long edges to add mesh detail where needed"},
741  "COLLAPSE",
742  0,
743  "Collapse Edges",
744  "Collapse short edges to remove mesh detail where possible"},
746  "SUBDIVIDE_COLLAPSE",
747  0,
748  "Subdivide Collapse",
749  "Both subdivide long edges and collapse short edges to refine mesh detail"},
750  {0, NULL, 0, NULL, NULL},
751  };
752 
753  static const EnumPropertyItem detail_type_items[] = {
754  {0,
755  "RELATIVE",
756  0,
757  "Relative Detail",
758  "Mesh detail is relative to the brush size and detail size"},
760  "CONSTANT",
761  0,
762  "Constant Detail",
763  "Mesh detail is constant in world space according to detail size"},
765  "BRUSH",
766  0,
767  "Brush Detail",
768  "Mesh detail is relative to brush radius"},
770  "MANUAL",
771  0,
772  "Manual Detail",
773  "Mesh detail does not change on each stroke, only when using Flood Fill"},
774  {0, NULL, 0, NULL, NULL},
775  };
776 
777  static const EnumPropertyItem sculpt_transform_mode_items[] = {
779  "ALL_VERTICES",
780  0,
781  "All Vertices",
782  "Applies the transformation to all vertices in the mesh"},
784  "RADIUS_ELASTIC",
785  0,
786  "Elastic",
787  "Applies the transformation simulating elasticity using the radius of the cursor"},
788  {0, NULL, 0, NULL, NULL},
789  };
790 
791  StructRNA *srna;
792  PropertyRNA *prop;
793 
794  srna = RNA_def_struct(brna, "Sculpt", "Paint");
795  RNA_def_struct_path_func(srna, "rna_Sculpt_path");
796  RNA_def_struct_ui_text(srna, "Sculpt", "");
797 
798  prop = RNA_def_property(srna, "radial_symmetry", PROP_INT, PROP_XYZ);
799  RNA_def_property_int_sdna(prop, NULL, "radial_symm");
801  RNA_def_property_range(prop, 1, 64);
802  RNA_def_property_ui_range(prop, 0, 32, 1, 1);
804  prop, "Radial Symmetry Count X Axis", "Number of times to copy strokes across the surface");
805 
806  prop = RNA_def_property(srna, "lock_x", PROP_BOOLEAN, PROP_NONE);
808  RNA_def_property_ui_text(prop, "Lock X", "Disallow changes to the X axis of vertices");
810 
811  prop = RNA_def_property(srna, "lock_y", PROP_BOOLEAN, PROP_NONE);
813  RNA_def_property_ui_text(prop, "Lock Y", "Disallow changes to the Y axis of vertices");
815 
816  prop = RNA_def_property(srna, "lock_z", PROP_BOOLEAN, PROP_NONE);
818  RNA_def_property_ui_text(prop, "Lock Z", "Disallow changes to the Z axis of vertices");
820 
821  prop = RNA_def_property(srna, "use_deform_only", PROP_BOOLEAN, PROP_NONE);
824  "Use Deform Only",
825  "Use only deformation modifiers (temporary disable all "
826  "constructive modifiers except multi-resolution)");
828  RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Sculpt_update");
829 
830  prop = RNA_def_property(srna, "show_mask", PROP_BOOLEAN, PROP_NONE);
832  RNA_def_property_ui_text(prop, "Show Mask", "Show mask as overlay on object");
834  RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Sculpt_ShowMask_update");
835 
836  prop = RNA_def_property(srna, "show_face_sets", PROP_BOOLEAN, PROP_NONE);
838  RNA_def_property_ui_text(prop, "Show Face Sets", "Show Face Sets as overlay on object");
840  RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Sculpt_ShowMask_update");
841 
842  prop = RNA_def_property(srna, "detail_size", PROP_FLOAT, PROP_PIXEL);
843  RNA_def_property_ui_range(prop, 0.5, 40.0, 0.1, 2);
846  prop, "Detail Size", "Maximum edge length for dynamic topology sculpting (in pixels)");
848 
849  prop = RNA_def_property(srna, "detail_percent", PROP_FLOAT, PROP_PERCENTAGE);
850  RNA_def_property_ui_range(prop, 0.5, 100.0, 10, 2);
852  prop,
853  "Detail Percentage",
854  "Maximum edge length for dynamic topology sculpting (in brush percenage)");
856 
857  prop = RNA_def_property(srna, "constant_detail_resolution", PROP_FLOAT, PROP_NONE);
858  RNA_def_property_float_sdna(prop, NULL, "constant_detail");
859  RNA_def_property_range(prop, 0.0001, FLT_MAX);
860  RNA_def_property_ui_range(prop, 0.001, 1000.0, 10, 2);
862  "Resolution",
863  "Maximum edge length for dynamic topology sculpting (as divisor "
864  "of blender unit - higher value means smaller edge length)");
866 
867  prop = RNA_def_property(srna, "use_smooth_shading", PROP_BOOLEAN, PROP_NONE);
870  "Smooth Shading",
871  "Show faces in dynamic-topology mode with smooth "
872  "shading rather than flat shaded");
874  RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Sculpt_update");
875 
876  prop = RNA_def_property(srna, "use_automasking_topology", PROP_BOOLEAN, PROP_NONE);
879  "Topology Auto-Masking",
880  "Affect only vertices connected to the active vertex under the brush");
882 
883  prop = RNA_def_property(srna, "use_automasking_face_sets", PROP_BOOLEAN, PROP_NONE);
886  "Face Sets Auto-Masking",
887  "Affect only vertices that share Face Sets with the active vertex");
889 
890  prop = RNA_def_property(srna, "use_automasking_boundary_edges", PROP_BOOLEAN, PROP_NONE);
893  prop, "Mesh Boundary Auto-Masking", "Do not affect non manifold boundary edges");
895 
896  prop = RNA_def_property(srna, "use_automasking_boundary_face_sets", PROP_BOOLEAN, PROP_NONE);
898  prop, NULL, "automasking_flags", BRUSH_AUTOMASKING_BOUNDARY_FACE_SETS);
900  "Face Sets Boundary Auto-Masking",
901  "Do not affect vertices that belong to a Face Set boundary");
903 
904  prop = RNA_def_property(srna, "symmetrize_direction", PROP_ENUM, PROP_NONE);
906  RNA_def_property_ui_text(prop, "Direction", "Source and destination for symmetrize operator");
907 
908  prop = RNA_def_property(srna, "detail_refine_method", PROP_ENUM, PROP_NONE);
910  RNA_def_property_enum_items(prop, detail_refine_items);
912  prop, "Detail Refine Method", "In dynamic-topology mode, how to add or remove mesh detail");
914 
915  prop = RNA_def_property(srna, "detail_type_method", PROP_ENUM, PROP_NONE);
917  RNA_def_property_enum_items(prop, detail_type_items);
919  prop, "Detail Type Method", "In dynamic-topology mode, how mesh detail size is calculated");
921 
922  prop = RNA_def_property(srna, "gravity", PROP_FLOAT, PROP_FACTOR);
923  RNA_def_property_float_sdna(prop, NULL, "gravity_factor");
924  RNA_def_property_range(prop, 0.0f, 1.0f);
925  RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
926  RNA_def_property_ui_text(prop, "Gravity", "Amount of gravity after each dab");
928 
929  prop = RNA_def_property(srna, "transform_mode", PROP_ENUM, PROP_NONE);
930  RNA_def_property_enum_items(prop, sculpt_transform_mode_items);
932  prop, "Transform Mode", "How the transformation is going to be applied to the target");
934 
935  prop = RNA_def_property(srna, "gravity_object", PROP_POINTER, PROP_NONE);
938  prop, "Orientation", "Object whose Z axis defines orientation of gravity");
940 }
941 
942 static void rna_def_uv_sculpt(BlenderRNA *brna)
943 {
944  StructRNA *srna;
945 
946  srna = RNA_def_struct(brna, "UvSculpt", "Paint");
947  RNA_def_struct_path_func(srna, "rna_UvSculpt_path");
948  RNA_def_struct_ui_text(srna, "UV Sculpting", "");
949 }
950 
951 static void rna_def_gp_paint(BlenderRNA *brna)
952 {
953  StructRNA *srna;
954  PropertyRNA *prop;
955 
956  srna = RNA_def_struct(brna, "GpPaint", "Paint");
957  RNA_def_struct_path_func(srna, "rna_GpPaint_path");
958  RNA_def_struct_ui_text(srna, "Grease Pencil Paint", "");
959 
960  /* Use vertex color (main switch). */
961  prop = RNA_def_property(srna, "color_mode", PROP_ENUM, PROP_NONE);
962  RNA_def_property_enum_sdna(prop, NULL, "mode");
964  RNA_def_property_ui_text(prop, "Mode", "Paint Mode");
967 }
968 
970 {
971  StructRNA *srna;
972 
973  srna = RNA_def_struct(brna, "GpVertexPaint", "Paint");
974  RNA_def_struct_path_func(srna, "rna_GpVertexPaint_path");
975  RNA_def_struct_ui_text(srna, "Grease Pencil Vertex Paint", "");
976 }
977 
979 {
980  StructRNA *srna;
981 
982  srna = RNA_def_struct(brna, "GpSculptPaint", "Paint");
983  RNA_def_struct_path_func(srna, "rna_GpSculptPaint_path");
984  RNA_def_struct_ui_text(srna, "Grease Pencil Sculpt Paint", "");
985 }
986 
988 {
989  StructRNA *srna;
990 
991  srna = RNA_def_struct(brna, "GpWeightPaint", "Paint");
992  RNA_def_struct_path_func(srna, "rna_GpWeightPaint_path");
993  RNA_def_struct_ui_text(srna, "Grease Pencil Weight Paint", "");
994 }
995 
996 /* use for weight paint too */
998 {
999  StructRNA *srna;
1000  PropertyRNA *prop;
1001 
1002  srna = RNA_def_struct(brna, "VertexPaint", "Paint");
1003  RNA_def_struct_sdna(srna, "VPaint");
1004  RNA_def_struct_path_func(srna, "rna_VertexPaint_path");
1005  RNA_def_struct_ui_text(srna, "Vertex Paint", "Properties of vertex and weight paint mode");
1006 
1007  /* weight paint only */
1008  prop = RNA_def_property(srna, "use_group_restrict", PROP_BOOLEAN, PROP_NONE);
1010  RNA_def_property_ui_text(prop, "Restrict", "Restrict painting to vertices in the group");
1012 
1013  /* Mirroring */
1014  prop = RNA_def_property(srna, "radial_symmetry", PROP_INT, PROP_XYZ);
1015  RNA_def_property_int_sdna(prop, NULL, "radial_symm");
1017  RNA_def_property_range(prop, 1, 64);
1018  RNA_def_property_ui_range(prop, 1, 32, 1, 1);
1020  prop, "Radial Symmetry Count X Axis", "Number of times to copy strokes across the surface");
1021 }
1022 
1023 static void rna_def_paint_mode(BlenderRNA *brna)
1024 {
1025  StructRNA *srna;
1026  PropertyRNA *prop;
1027 
1028  srna = RNA_def_struct(brna, "PaintModeSettings", NULL);
1029  RNA_def_struct_sdna(srna, "PaintModeSettings");
1030  RNA_def_struct_path_func(srna, "rna_PaintModeSettings_path");
1031  RNA_def_struct_ui_text(srna, "Paint Mode", "Properties of paint mode");
1032 
1033  prop = RNA_def_property(srna, "canvas_source", PROP_ENUM, PROP_NONE);
1036  RNA_def_property_ui_text(prop, "Source", "Source to select canvas from");
1037  RNA_def_property_update(prop, 0, "rna_PaintModeSettings_canvas_source_update");
1038 
1039  prop = RNA_def_property(srna, "canvas_image", PROP_POINTER, PROP_NONE);
1041  prop, NULL, NULL, NULL, "rna_PaintModeSettings_canvas_image_poll");
1043  RNA_def_property_ui_text(prop, "Texture", "Image used as as painting target");
1044 }
1045 
1047 {
1048  StructRNA *srna;
1049  PropertyRNA *prop;
1050  FunctionRNA *func;
1051 
1052  static const EnumPropertyItem paint_type_items[] = {
1054  "MATERIAL",
1055  0,
1056  "Material",
1057  "Detect image slots from the material"},
1059  "IMAGE",
1060  0,
1061  "Single Image",
1062  "Set image for texture painting directly"},
1063  {0, NULL, 0, NULL, NULL},
1064  };
1065 
1066  static const EnumPropertyItem paint_interp_items[] = {
1067  {IMAGEPAINT_INTERP_LINEAR, "LINEAR", 0, "Linear", "Linear interpolation"},
1069  "CLOSEST",
1070  0,
1071  "Closest",
1072  "No interpolation (sample closest texel)"},
1073  {0, NULL, 0, NULL, NULL},
1074  };
1075 
1076  srna = RNA_def_struct(brna, "ImagePaint", "Paint");
1077  RNA_def_struct_sdna(srna, "ImagePaintSettings");
1078  RNA_def_struct_path_func(srna, "rna_ImagePaintSettings_path");
1079  RNA_def_struct_ui_text(srna, "Image Paint", "Properties of image and texture painting mode");
1080 
1081  /* functions */
1082  func = RNA_def_function(srna, "detect_data", "rna_ImaPaint_detect_data");
1083  RNA_def_function_ui_description(func, "Check if required texpaint data exist");
1084 
1085  /* return type */
1086  RNA_def_function_return(func, RNA_def_boolean(func, "ok", 1, "", ""));
1087 
1088  /* booleans */
1089  prop = RNA_def_property(srna, "use_occlude", PROP_BOOLEAN, PROP_NONE);
1092  prop, "Occlude", "Only paint onto the faces directly under the brush (slower)");
1094 
1095  prop = RNA_def_property(srna, "use_backface_culling", PROP_BOOLEAN, PROP_NONE);
1097  RNA_def_property_ui_text(prop, "Cull", "Ignore faces pointing away from the view (faster)");
1099 
1100  prop = RNA_def_property(srna, "use_normal_falloff", PROP_BOOLEAN, PROP_NONE);
1102  RNA_def_property_ui_text(prop, "Normal", "Paint most on faces pointing towards the view");
1104 
1105  prop = RNA_def_property(srna, "use_stencil_layer", PROP_BOOLEAN, PROP_NONE);
1107  RNA_def_property_ui_text(prop, "Stencil Layer", "Set the mask layer from the UV map buttons");
1108  RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_viewport_update");
1109 
1110  prop = RNA_def_property(srna, "invert_stencil", PROP_BOOLEAN, PROP_NONE);
1112  RNA_def_property_ui_text(prop, "Invert", "Invert the stencil layer");
1113  RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_viewport_update");
1114 
1115  prop = RNA_def_property(srna, "stencil_image", PROP_POINTER, PROP_NONE);
1116  RNA_def_property_pointer_sdna(prop, NULL, "stencil");
1118  RNA_def_property_ui_text(prop, "Stencil Image", "Image used as stencil");
1119  RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_stencil_update");
1120  RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_ImaPaint_imagetype_poll");
1121 
1122  prop = RNA_def_property(srna, "canvas", PROP_POINTER, PROP_NONE);
1124  RNA_def_property_ui_text(prop, "Canvas", "Image used as canvas");
1125  RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_canvas_update");
1126  RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_ImaPaint_imagetype_poll");
1127 
1128  prop = RNA_def_property(srna, "clone_image", PROP_POINTER, PROP_NONE);
1129  RNA_def_property_pointer_sdna(prop, NULL, "clone");
1131  RNA_def_property_ui_text(prop, "Clone Image", "Image used as clone source");
1133  RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_ImaPaint_imagetype_poll");
1134 
1135  prop = RNA_def_property(srna, "stencil_color", PROP_FLOAT, PROP_COLOR_GAMMA);
1136  RNA_def_property_range(prop, 0.0, 1.0);
1137  RNA_def_property_float_sdna(prop, NULL, "stencil_col");
1138  RNA_def_property_ui_text(prop, "Stencil Color", "Stencil color in the viewport");
1139  RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_viewport_update");
1140 
1141  prop = RNA_def_property(srna, "dither", PROP_FLOAT, PROP_NONE);
1142  RNA_def_property_range(prop, 0.0, 2.0);
1143  RNA_def_property_ui_text(prop, "Dither", "Amount of dithering when painting on byte images");
1145 
1146  prop = RNA_def_property(srna, "use_clone_layer", PROP_BOOLEAN, PROP_NONE);
1149  prop,
1150  "Clone Map",
1151  "Use another UV map as clone source, otherwise use the 3D cursor as the source");
1152  RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_viewport_update");
1153 
1154  /* integers */
1155 
1156  prop = RNA_def_property(srna, "seam_bleed", PROP_INT, PROP_PIXEL);
1157  RNA_def_property_ui_range(prop, 0, 8, 1, -1);
1159  prop, "Bleed", "Extend paint beyond the faces UVs to reduce seams (in pixels, slower)");
1160 
1161  prop = RNA_def_property(srna, "normal_angle", PROP_INT, PROP_UNSIGNED);
1162  RNA_def_property_range(prop, 0, 90);
1164  prop, "Angle", "Paint most on faces pointing towards the view according to this angle");
1165 
1166  prop = RNA_def_int_array(srna,
1167  "screen_grab_size",
1168  2,
1169  NULL,
1170  0,
1171  0,
1172  "Screen Grab Size",
1173  "Size to capture the image for re-projecting",
1174  0,
1175  0);
1176  RNA_def_property_range(prop, 512, 16384);
1178 
1179  prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
1181  RNA_def_property_enum_items(prop, paint_type_items);
1182  RNA_def_property_ui_text(prop, "Mode", "Mode of operation for projection painting");
1183  RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_mode_update");
1184 
1185  prop = RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE);
1186  RNA_def_property_enum_sdna(prop, NULL, "interp");
1188  RNA_def_property_enum_items(prop, paint_interp_items);
1189  RNA_def_property_ui_text(prop, "Interpolation", "Texture filtering type");
1190  RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_mode_update");
1191 
1192  /* Missing data */
1193  prop = RNA_def_property(srna, "missing_uvs", PROP_BOOLEAN, PROP_NONE);
1195  RNA_def_property_ui_text(prop, "Missing UVs", "A UV layer is missing on the mesh");
1197 
1198  prop = RNA_def_property(srna, "missing_materials", PROP_BOOLEAN, PROP_NONE);
1200  RNA_def_property_ui_text(prop, "Missing Materials", "The mesh is missing materials");
1202 
1203  prop = RNA_def_property(srna, "missing_stencil", PROP_BOOLEAN, PROP_NONE);
1205  RNA_def_property_ui_text(prop, "Missing Stencil", "Image Painting does not have a stencil");
1207 
1208  prop = RNA_def_property(srna, "missing_texture", PROP_BOOLEAN, PROP_NONE);
1211  prop, "Missing Texture", "Image Painting does not have a texture to paint on");
1213 }
1214 
1216 {
1217  StructRNA *srna;
1218  PropertyRNA *prop;
1219 
1220  static const EnumPropertyItem select_mode_items[] = {
1221  {SCE_SELECT_PATH, "PATH", ICON_PARTICLE_PATH, "Path", "Path edit mode"},
1222  {SCE_SELECT_POINT, "POINT", ICON_PARTICLE_POINT, "Point", "Point select mode"},
1223  {SCE_SELECT_END, "TIP", ICON_PARTICLE_TIP, "Tip", "Tip select mode"},
1224  {0, NULL, 0, NULL, NULL},
1225  };
1226 
1227  static const EnumPropertyItem puff_mode[] = {
1228  {0, "ADD", 0, "Add", "Make hairs more puffy"},
1229  {1, "SUB", 0, "Sub", "Make hairs less puffy"},
1230  {0, NULL, 0, NULL, NULL},
1231  };
1232 
1233  static const EnumPropertyItem length_mode[] = {
1234  {0, "GROW", 0, "Grow", "Make hairs longer"},
1235  {1, "SHRINK", 0, "Shrink", "Make hairs shorter"},
1236  {0, NULL, 0, NULL, NULL},
1237  };
1238 
1239  static const EnumPropertyItem edit_type_items[] = {
1240  {PE_TYPE_PARTICLES, "PARTICLES", 0, "Particles", ""},
1241  {PE_TYPE_SOFTBODY, "SOFT_BODY", 0, "Soft Body", ""},
1242  {PE_TYPE_CLOTH, "CLOTH", 0, "Cloth", ""},
1243  {0, NULL, 0, NULL, NULL},
1244  };
1245 
1246  /* edit */
1247 
1248  srna = RNA_def_struct(brna, "ParticleEdit", NULL);
1249  RNA_def_struct_sdna(srna, "ParticleEditSettings");
1250  RNA_def_struct_path_func(srna, "rna_ParticleEdit_path");
1251  RNA_def_struct_ui_text(srna, "Particle Edit", "Properties of particle editing mode");
1252 
1253  prop = RNA_def_property(srna, "tool", PROP_ENUM, PROP_NONE);
1254  RNA_def_property_enum_sdna(prop, NULL, "brushtype");
1257  prop, NULL, "rna_ParticleEdit_tool_set", "rna_ParticleEdit_tool_itemf");
1258  RNA_def_property_ui_text(prop, "Tool", "");
1259 
1260  prop = RNA_def_property(srna, "select_mode", PROP_ENUM, PROP_NONE);
1261  RNA_def_property_enum_bitflag_sdna(prop, NULL, "selectmode");
1262  RNA_def_property_enum_items(prop, select_mode_items);
1263  RNA_def_property_ui_text(prop, "Selection Mode", "Particle select and display mode");
1265  RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ParticleEdit_update");
1266 
1267  prop = RNA_def_property(srna, "use_preserve_length", PROP_BOOLEAN, PROP_NONE);
1269  RNA_def_property_ui_text(prop, "Keep Lengths", "Keep path lengths constant");
1270 
1271  prop = RNA_def_property(srna, "use_preserve_root", PROP_BOOLEAN, PROP_NONE);
1273  RNA_def_property_ui_text(prop, "Keep Root", "Keep root keys unmodified");
1274 
1275  prop = RNA_def_property(srna, "use_emitter_deflect", PROP_BOOLEAN, PROP_NONE);
1277  RNA_def_property_ui_text(prop, "Deflect Emitter", "Keep paths from intersecting the emitter");
1278 
1279  prop = RNA_def_property(srna, "emitter_distance", PROP_FLOAT, PROP_DISTANCE);
1280  RNA_def_property_float_sdna(prop, NULL, "emitterdist");
1281  RNA_def_property_ui_range(prop, 0.0f, 10.0f, 10, 3);
1283  prop, "Emitter Distance", "Distance to keep particles away from the emitter");
1284 
1285  prop = RNA_def_property(srna, "use_fade_time", PROP_BOOLEAN, PROP_NONE);
1288  prop, "Fade Time", "Fade paths and keys further away from current frame");
1290  RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ParticleEdit_update");
1291 
1292  prop = RNA_def_property(srna, "use_auto_velocity", PROP_BOOLEAN, PROP_NONE);
1294  RNA_def_property_ui_text(prop, "Auto Velocity", "Calculate point velocities automatically");
1295 
1296  prop = RNA_def_property(srna, "show_particles", PROP_BOOLEAN, PROP_NONE);
1299  RNA_def_property_ui_text(prop, "Display Particles", "Display actual particles");
1300  RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ParticleEdit_redo");
1301 
1302  prop = RNA_def_property(srna, "use_default_interpolate", PROP_BOOLEAN, PROP_NONE);
1305  prop, "Interpolate", "Interpolate new particles from the existing ones");
1307 
1308  prop = RNA_def_property(srna, "default_key_count", PROP_INT, PROP_NONE);
1309  RNA_def_property_int_sdna(prop, NULL, "totaddkey");
1310  RNA_def_property_range(prop, 2, SHRT_MAX);
1311  RNA_def_property_ui_range(prop, 2, 20, 10, 3);
1312  RNA_def_property_ui_text(prop, "Keys", "How many keys to make new particles with");
1313 
1314  prop = RNA_def_property(srna, "brush", PROP_POINTER, PROP_NONE);
1315  RNA_def_property_struct_type(prop, "ParticleBrush");
1316  RNA_def_property_pointer_funcs(prop, "rna_ParticleEdit_brush_get", NULL, NULL, NULL);
1317  RNA_def_property_ui_text(prop, "Brush", "");
1318 
1319  prop = RNA_def_property(srna, "display_step", PROP_INT, PROP_NONE);
1320  RNA_def_property_int_sdna(prop, NULL, "draw_step");
1322  RNA_def_property_range(prop, 1, 10);
1323  RNA_def_property_ui_text(prop, "Steps", "How many steps to display the path with");
1324  RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ParticleEdit_redo");
1325 
1326  prop = RNA_def_property(srna, "fade_frames", PROP_INT, PROP_NONE);
1327  RNA_def_property_range(prop, 1, 100);
1328  RNA_def_property_ui_text(prop, "Frames", "How many frames to fade");
1330  RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ParticleEdit_update");
1331 
1332  prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
1334  RNA_def_property_enum_sdna(prop, NULL, "edittype");
1335  RNA_def_property_enum_items(prop, edit_type_items);
1336  RNA_def_property_ui_text(prop, "Type", "");
1337  RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ParticleEdit_redo");
1338 
1339  prop = RNA_def_property(srna, "is_editable", PROP_BOOLEAN, PROP_NONE);
1340  RNA_def_property_boolean_funcs(prop, "rna_ParticleEdit_editable_get", NULL);
1342  RNA_def_property_ui_text(prop, "Editable", "A valid edit mode exists");
1343 
1344  prop = RNA_def_property(srna, "is_hair", PROP_BOOLEAN, PROP_NONE);
1345  RNA_def_property_boolean_funcs(prop, "rna_ParticleEdit_hair_get", NULL);
1347  RNA_def_property_ui_text(prop, "Hair", "Editing hair");
1348 
1349  prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
1351  RNA_def_property_ui_text(prop, "Object", "The edited object");
1352 
1353  prop = RNA_def_property(srna, "shape_object", PROP_POINTER, PROP_NONE);
1355  RNA_def_property_ui_text(prop, "Shape Object", "Outer shape to use for tools");
1356  RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Mesh_object_poll");
1357  RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ParticleEdit_redo");
1358 
1359  /* brush */
1360 
1361  srna = RNA_def_struct(brna, "ParticleBrush", NULL);
1362  RNA_def_struct_sdna(srna, "ParticleBrushData");
1363  RNA_def_struct_path_func(srna, "rna_ParticleBrush_path");
1364  RNA_def_struct_ui_text(srna, "Particle Brush", "Particle editing brush");
1365 
1366  prop = RNA_def_property(srna, "size", PROP_INT, PROP_PIXEL);
1367  RNA_def_property_range(prop, 1, SHRT_MAX);
1369  RNA_def_property_ui_text(prop, "Radius", "Radius of the brush in pixels");
1370 
1371  prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_FACTOR);
1372  RNA_def_property_range(prop, 0.001, 1.0);
1373  RNA_def_property_ui_text(prop, "Strength", "Brush strength");
1374 
1375  prop = RNA_def_property(srna, "count", PROP_INT, PROP_NONE);
1376  RNA_def_property_range(prop, 1, 1000);
1377  RNA_def_property_ui_range(prop, 1, 100, 10, 3);
1378  RNA_def_property_ui_text(prop, "Count", "Particle count");
1379 
1380  prop = RNA_def_property(srna, "steps", PROP_INT, PROP_NONE);
1381  RNA_def_property_int_sdna(prop, NULL, "step");
1382  RNA_def_property_range(prop, 1, SHRT_MAX);
1383  RNA_def_property_ui_range(prop, 1, 50, 10, 3);
1384  RNA_def_property_ui_text(prop, "Steps", "Brush steps");
1385 
1386  prop = RNA_def_property(srna, "puff_mode", PROP_ENUM, PROP_NONE);
1387  RNA_def_property_enum_sdna(prop, NULL, "invert");
1388  RNA_def_property_enum_items(prop, puff_mode);
1389  RNA_def_property_ui_text(prop, "Puff Mode", "");
1390 
1391  prop = RNA_def_property(srna, "use_puff_volume", PROP_BOOLEAN, PROP_NONE);
1394  prop,
1395  "Puff Volume",
1396  "Apply puff to unselected end-points (helps maintain hair volume when puffing root)");
1397 
1398  prop = RNA_def_property(srna, "length_mode", PROP_ENUM, PROP_NONE);
1399  RNA_def_property_enum_sdna(prop, NULL, "invert");
1400  RNA_def_property_enum_items(prop, length_mode);
1401  RNA_def_property_ui_text(prop, "Length Mode", "");
1402 
1403  /* dummy */
1404  prop = RNA_def_property(srna, "curve", PROP_POINTER, PROP_NONE);
1405  RNA_def_property_struct_type(prop, "CurveMapping");
1406  RNA_def_property_pointer_funcs(prop, "rna_ParticleBrush_curve_get", NULL, NULL, NULL);
1407  RNA_def_property_ui_text(prop, "Curve", "");
1408 }
1409 
1410 /* srna -- gpencil speed guides */
1412 {
1413  StructRNA *srna;
1414  PropertyRNA *prop;
1415 
1416  srna = RNA_def_struct(brna, "GPencilSculptGuide", NULL);
1417  RNA_def_struct_sdna(srna, "GP_Sculpt_Guide");
1418  RNA_def_struct_path_func(srna, "rna_GPencilSculptGuide_path");
1419  RNA_def_struct_ui_text(srna, "GPencil Sculpt Guide", "Guides for drawing");
1420 
1421  static const EnumPropertyItem prop_gpencil_guidetypes[] = {
1422  {GP_GUIDE_CIRCULAR, "CIRCULAR", 0, "Circular", "Use single point to create rings"},
1423  {GP_GUIDE_RADIAL, "RADIAL", 0, "Radial", "Use single point as direction"},
1424  {GP_GUIDE_PARALLEL, "PARALLEL", 0, "Parallel", "Parallel lines"},
1425  {GP_GUIDE_GRID, "GRID", 0, "Grid", "Grid allows horizontal and vertical lines"},
1426  {GP_GUIDE_ISO, "ISO", 0, "Isometric", "Grid allows isometric and vertical lines"},
1427  {0, NULL, 0, NULL, NULL},
1428  };
1429 
1430  static const EnumPropertyItem prop_gpencil_guide_references[] = {
1431  {GP_GUIDE_REF_CURSOR, "CURSOR", 0, "Cursor", "Use cursor as reference point"},
1432  {GP_GUIDE_REF_CUSTOM, "CUSTOM", 0, "Custom", "Use custom reference point"},
1433  {GP_GUIDE_REF_OBJECT, "OBJECT", 0, "Object", "Use object as reference point"},
1434  {0, NULL, 0, NULL, NULL},
1435  };
1436 
1437  prop = RNA_def_property(srna, "use_guide", PROP_BOOLEAN, PROP_NONE);
1438  RNA_def_property_boolean_sdna(prop, NULL, "use_guide", false);
1439  RNA_def_property_boolean_default(prop, false);
1440  RNA_def_property_ui_text(prop, "Use Guides", "Enable speed guides");
1443 
1444  prop = RNA_def_property(srna, "use_snapping", PROP_BOOLEAN, PROP_NONE);
1445  RNA_def_property_boolean_sdna(prop, NULL, "use_snapping", false);
1446  RNA_def_property_boolean_default(prop, false);
1448  prop, "Use Snapping", "Enable snapping to guides angle or spacing options");
1451 
1452  prop = RNA_def_property(srna, "reference_object", PROP_POINTER, PROP_NONE);
1453  RNA_def_property_pointer_sdna(prop, NULL, "reference_object");
1454  RNA_def_property_ui_text(prop, "Object", "Object used for reference point");
1456  RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_viewport_update");
1457 
1458  prop = RNA_def_property(srna, "reference_point", PROP_ENUM, PROP_NONE);
1459  RNA_def_property_enum_sdna(prop, NULL, "reference_point");
1460  RNA_def_property_enum_items(prop, prop_gpencil_guide_references);
1461  RNA_def_property_ui_text(prop, "Type", "Type of speed guide");
1463  RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_viewport_update");
1464 
1465  prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
1466  RNA_def_property_enum_sdna(prop, NULL, "type");
1467  RNA_def_property_enum_items(prop, prop_gpencil_guidetypes);
1468  RNA_def_property_ui_text(prop, "Type", "Type of speed guide");
1471 
1472  prop = RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE);
1473  RNA_def_property_float_sdna(prop, NULL, "angle");
1474  RNA_def_property_range(prop, -(M_PI * 2.0f), (M_PI * 2.0f));
1475  RNA_def_property_ui_text(prop, "Angle", "Direction of lines");
1478 
1479  prop = RNA_def_property(srna, "angle_snap", PROP_FLOAT, PROP_ANGLE);
1480  RNA_def_property_float_sdna(prop, NULL, "angle_snap");
1481  RNA_def_property_range(prop, -(M_PI * 2.0f), (M_PI * 2.0f));
1482  RNA_def_property_ui_text(prop, "Angle Snap", "Angle snapping");
1485 
1486  prop = RNA_def_property(srna, "spacing", PROP_FLOAT, PROP_DISTANCE);
1487  RNA_def_property_float_sdna(prop, NULL, "spacing");
1488  RNA_def_property_range(prop, 0.0f, FLT_MAX);
1489  RNA_def_property_ui_range(prop, 0.0f, FLT_MAX, 1, 3);
1490  RNA_def_property_ui_text(prop, "Spacing", "Guide spacing");
1493 
1494  prop = RNA_def_property(srna, "location", PROP_FLOAT, PROP_DISTANCE);
1495  RNA_def_property_float_sdna(prop, NULL, "location");
1496  RNA_def_property_array(prop, 3);
1498  RNA_def_property_ui_text(prop, "Location", "Custom reference point for guides");
1499  RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
1500  RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, 3);
1501  RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_viewport_update");
1502 }
1503 
1505 {
1506  static const EnumPropertyItem prop_direction_items[] = {
1507  {0, "ADD", ICON_ADD, "Add", "Add effect of brush"},
1508  {GP_SCULPT_FLAG_INVERT, "SUBTRACT", ICON_REMOVE, "Subtract", "Subtract effect of brush"},
1509  {0, NULL, 0, NULL, NULL},
1510  };
1511 
1513 
1514  StructRNA *srna;
1515  PropertyRNA *prop;
1516 
1517  /* == Settings == */
1518  srna = RNA_def_struct(brna, "GPencilSculptSettings", NULL);
1519  RNA_def_struct_sdna(srna, "GP_Sculpt_Settings");
1520  RNA_def_struct_path_func(srna, "rna_GPencilSculptSettings_path");
1522  "GPencil Sculpt Settings",
1523  "General properties for Grease Pencil stroke sculpting tools");
1524 
1525  prop = RNA_def_property(srna, "guide", PROP_POINTER, PROP_NONE);
1526  RNA_def_property_struct_type(prop, "GPencilSculptGuide");
1528  RNA_def_property_ui_text(prop, "Guide", "");
1529 
1530  prop = RNA_def_property(srna, "use_multiframe_falloff", PROP_BOOLEAN, PROP_NONE);
1533  prop,
1534  "Use Falloff",
1535  "Use falloff effect when edit in multiframe mode to compute brush effect by frame");
1538 
1539  prop = RNA_def_property(srna, "use_thickness_curve", PROP_BOOLEAN, PROP_NONE);
1541  RNA_def_property_ui_text(prop, "Use Curve", "Use curve to define primitive stroke thickness");
1544 
1545  prop = RNA_def_property(srna, "use_scale_thickness", PROP_BOOLEAN, PROP_NONE);
1548  prop, "Scale Stroke Thickness", "Scale the stroke thickness when transforming strokes");
1551 
1552  /* custom falloff curve */
1553  prop = RNA_def_property(srna, "multiframe_falloff_curve", PROP_POINTER, PROP_NONE);
1554  RNA_def_property_pointer_sdna(prop, NULL, "cur_falloff");
1555  RNA_def_property_struct_type(prop, "CurveMapping");
1557  prop, "Curve", "Custom curve to control falloff of brush effect by Grease Pencil frames");
1560 
1561  /* custom primitive curve */
1562  prop = RNA_def_property(srna, "thickness_primitive_curve", PROP_POINTER, PROP_NONE);
1563  RNA_def_property_pointer_sdna(prop, NULL, "cur_primitive");
1564  RNA_def_property_struct_type(prop, "CurveMapping");
1565  RNA_def_property_ui_text(prop, "Curve", "Custom curve to control primitive thickness");
1568 
1569  /* lock axis */
1570  prop = RNA_def_property(srna, "lock_axis", PROP_ENUM, PROP_NONE);
1571  RNA_def_property_enum_sdna(prop, NULL, "lock_axis");
1573  RNA_def_property_ui_text(prop, "Lock Axis", "");
1575  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
1576 
1577  /* threshold for cutter */
1578  prop = RNA_def_property(srna, "intersection_threshold", PROP_FLOAT, PROP_NONE);
1579  RNA_def_property_float_sdna(prop, NULL, "isect_threshold");
1580  RNA_def_property_range(prop, 0.0f, 10.0f);
1581  RNA_def_property_float_default(prop, 0.1f);
1582  RNA_def_property_ui_text(prop, "Threshold", "Threshold for stroke intersections");
1584 }
1585 
1587 {
1588  StructRNA *srna;
1589 
1590  srna = RNA_def_struct(brna, "CurvesSculpt", "Paint");
1591  RNA_def_struct_path_func(srna, "rna_CurvesSculpt_path");
1592  RNA_def_struct_ui_text(srna, "Curves Sculpt Paint", "");
1593 }
1594 
1596 {
1597  /* *** Non-Animated *** */
1598  RNA_define_animate_sdna(false);
1599  rna_def_paint_curve(brna);
1601  rna_def_paint(brna);
1602  rna_def_sculpt(brna);
1603  rna_def_uv_sculpt(brna);
1604  rna_def_gp_paint(brna);
1605  rna_def_gp_vertexpaint(brna);
1606  rna_def_gp_sculptpaint(brna);
1607  rna_def_gp_weightpaint(brna);
1608  rna_def_vertex_paint(brna);
1609  rna_def_paint_mode(brna);
1610  rna_def_image_paint(brna);
1611  rna_def_particle_edit(brna);
1612  rna_def_gpencil_guides(brna);
1613  rna_def_gpencil_sculpt(brna);
1614  rna_def_curves_sculpt(brna);
1616 }
1617 
1618 #endif
#define BKE_brush_tool_get(brush, p)
Definition: BKE_brush.h:169
struct Scene * CTX_data_scene(const bContext *C)
Definition: context.c:1090
struct ViewLayer * CTX_data_view_layer(const bContext *C)
Definition: context.c:1100
struct Object * CTX_data_active_object(const bContext *C)
Definition: context.c:1353
struct Depsgraph * CTX_data_depsgraph_pointer(const bContext *C)
Definition: context.c:1505
struct Main * CTX_data_main(const bContext *C)
Definition: context.c:1074
General operations, lookup, etc. for materials.
void BKE_texpaint_slots_refresh_object(struct Scene *scene, struct Object *ob)
Definition: material.c:1564
General operations, lookup, etc. for blender objects.
void BKE_paint_toolslots_brush_update(struct Paint *paint)
void BKE_paint_invalidate_overlay_all(void)
Definition: paint.c:260
struct ParticleSystem * psys_get_current(struct Object *ob)
Definition: particle.c:634
void psys_free_path_cache(struct ParticleSystem *psys, struct PTCacheEdit *edit)
Definition: particle.c:997
@ BKE_PARTICLE_BATCH_DIRTY_ALL
Definition: BKE_particle.h:686
void BKE_particle_batch_cache_dirty_tag(struct ParticleSystem *psys, int mode)
Definition: particle.c:5274
A BVH for high poly meshes.
void pbvh_show_mask_set(PBVH *pbvh, bool show_mask)
Definition: pbvh.c:3185
#define BLI_assert(a)
Definition: BLI_assert.h:46
#define M_PI
Definition: BLI_math_base.h:20
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL() ATTR_MALLOC
Definition: string.c:42
unsigned int uint
Definition: BLI_sys_types.h:67
#define UNUSED_VARS(...)
#define UNUSED_VARS_NDEBUG(...)
#define UNUSED(x)
#define ELEM(...)
struct Depsgraph Depsgraph
Definition: DEG_depsgraph.h:35
void DEG_id_tag_update(struct ID *id, int flag)
ID and Library types, which are fundamental for sdna.
@ ID_RECALC_COPY_ON_WRITE
Definition: DNA_ID.h:834
@ ID_RECALC_GEOMETRY
Definition: DNA_ID.h:791
@ GP_SCULPT_FLAG_INVERT
@ BRUSH_AUTOMASKING_BOUNDARY_EDGES
@ BRUSH_AUTOMASKING_BOUNDARY_FACE_SETS
@ BRUSH_AUTOMASKING_FACE_SETS
@ BRUSH_AUTOMASKING_TOPOLOGY
#define MAX_BRUSH_PIXEL_RADIUS
@ IMA_TYPE_R_RESULT
@ IMA_TYPE_COMPOSITE
eObjectMode
@ OB_MODE_VERTEX_GPENCIL
@ OB_MODE_EDIT
@ OB_MODE_WEIGHT_PAINT
@ OB_MODE_WEIGHT_GPENCIL
@ OB_MODE_SCULPT
@ OB_MODE_SCULPT_CURVES
@ OB_MODE_SCULPT_GPENCIL
@ OB_MODE_TEXTURE_PAINT
@ OB_MODE_VERTEX_PAINT
@ OB_MODE_PAINT_GPENCIL
@ OB_MESH
#define PSYS_GLOBAL_HAIR
#define PE_TYPE_CLOTH
#define PE_BRUSH_PUFF
@ GP_GUIDE_CIRCULAR
@ GP_GUIDE_ISO
@ GP_GUIDE_PARALLEL
@ GP_GUIDE_RADIAL
@ GP_GUIDE_GRID
@ IMAGEPAINT_INTERP_LINEAR
@ IMAGEPAINT_INTERP_CLOSEST
#define IMAGEPAINT_PROJECT_FLAT
#define IMAGEPAINT_PROJECT_LAYER_STENCIL
#define PE_BRUSH_DATA_PUFF_VOLUME
#define PE_TYPE_SOFTBODY
@ GP_GUIDE_REF_OBJECT
@ GP_GUIDE_REF_CUSTOM
@ GP_GUIDE_REF_CURSOR
#define PE_DRAW_PART
#define PE_BRUSH_ADD
@ SCULPT_HIDE_MASK
@ SCULPT_ONLY_DEFORM
@ SCULPT_DYNTOPO_SUBDIVIDE
@ SCULPT_DYNTOPO_DETAIL_MANUAL
@ SCULPT_LOCK_X
@ SCULPT_LOCK_Z
@ SCULPT_HIDE_FACE_SETS
@ SCULPT_DYNTOPO_DETAIL_CONSTANT
@ SCULPT_DYNTOPO_COLLAPSE
@ SCULPT_DYNTOPO_SMOOTH_SHADING
@ SCULPT_DYNTOPO_DETAIL_BRUSH
@ SCULPT_LOCK_Y
#define SCE_SELECT_PATH
@ GP_SCULPT_SETT_FLAG_PRIMITIVE_CURVE
@ GP_SCULPT_SETT_FLAG_FRAME_FALLOFF
@ GP_SCULPT_SETT_FLAG_SCALE_THICKNESS
#define IMAGEPAINT_MODE_IMAGE
@ GP_LOCKAXIS_X
@ GP_LOCKAXIS_VIEW
@ GP_LOCKAXIS_Y
@ GP_LOCKAXIS_Z
@ GP_LOCKAXIS_CURSOR
#define IMAGEPAINT_PROJECT_XRAY
#define IMAGEPAINT_PROJECT_LAYER_CLONE
#define PE_KEEP_LENGTHS
#define PE_DEFLECT_EMITTER
#define IMAGEPAINT_MODE_MATERIAL
#define SCE_SELECT_END
@ PAINT_USE_CAVITY_MASK
@ PAINT_SCULPT_DELAY_UPDATES
@ PAINT_SHOW_BRUSH
@ PAINT_SHOW_BRUSH_ON_SURFACE
@ PAINT_FAST_NAVIGATE
#define PE_BRUSH_CUT
#define PE_INTERPOLATE_ADDED
#define OBACT(_view_layer)
#define IMAGEPAINT_PROJECT_LAYER_STENCIL_INV
#define SCE_SELECT_POINT
#define PAINT_MAX_INPUT_SAMPLES
@ VP_FLAG_VGROUP_RESTRICT
@ PAINT_CANVAS_SOURCE_COLOR_ATTRIBUTE
@ PAINT_CANVAS_SOURCE_IMAGE
@ PAINT_CANVAS_SOURCE_MATERIAL
@ PAINT_TILE_Z
@ PAINT_SYMM_Y
@ PAINT_TILE_Y
@ PAINT_SYMMETRY_FEATHER
@ PAINT_TILE_X
@ PAINT_SYMM_X
@ PAINT_SYMM_Z
#define PE_LOCK_FIRST
#define PE_FADE_TIME
#define IMAGEPAINT_MISSING_STENCIL
#define IMAGEPAINT_PROJECT_BACKFACE
#define PE_BRUSH_WEIGHT
#define PE_TYPE_PARTICLES
#define PE_BRUSH_LENGTH
#define IMAGEPAINT_MISSING_MATERIAL
#define PE_BRUSH_COMB
@ SCULPT_TRANSFORM_MODE_RADIUS_ELASTIC
@ SCULPT_TRANSFORM_MODE_ALL_VERTICES
@ GPPAINT_FLAG_USE_VERTEXCOLOR
@ GPPAINT_FLAG_USE_MATERIAL
#define IMAGEPAINT_MISSING_UVS
#define PE_BRUSH_SMOOTH
#define IMAGEPAINT_MISSING_TEX
#define PE_AUTO_VELOCITY
@ SPACE_IMAGE
void ED_space_image_set(struct Main *bmain, struct SpaceImage *sima, struct Image *ima, bool automatic)
Definition: image_edit.c:45
bool ED_paint_proj_mesh_data_check(struct Scene *scene, struct Object *ob, bool *uvs, bool *mat, bool *tex, bool *stencil)
struct PTCacheEdit * PE_get_current(struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob)
Read Guarded memory(de)allocation.
@ PROP_SCALE_CUBIC
Definition: RNA_types.h:108
@ PROP_FLOAT
Definition: RNA_types.h:61
@ PROP_BOOLEAN
Definition: RNA_types.h:59
@ PROP_ENUM
Definition: RNA_types.h:63
@ PROP_INT
Definition: RNA_types.h:60
@ PROP_POINTER
Definition: RNA_types.h:64
@ PROP_COLLECTION
Definition: RNA_types.h:65
@ PROP_CONTEXT_UPDATE
Definition: RNA_types.h:269
@ PROP_ANIMATABLE
Definition: RNA_types.h:202
@ PROP_EDITABLE
Definition: RNA_types.h:189
@ PROP_NEVER_NULL
Definition: RNA_types.h:239
@ PROP_ID_SELF_CHECK
Definition: RNA_types.h:232
@ PROP_XYZ
Definition: RNA_types.h:162
@ PROP_DISTANCE
Definition: RNA_types.h:149
@ PROP_PIXEL
Definition: RNA_types.h:141
@ PROP_ANGLE
Definition: RNA_types.h:145
@ PROP_NONE
Definition: RNA_types.h:126
@ PROP_PERCENTAGE
Definition: RNA_types.h:143
@ PROP_FACTOR
Definition: RNA_types.h:144
@ PROP_COLOR_GAMMA
Definition: RNA_types.h:165
@ PROP_XYZ_LENGTH
Definition: RNA_types.h:163
@ PROP_UNSIGNED
Definition: RNA_types.h:142
#define C
Definition: RandGen.cpp:25
#define NC_GEOM
Definition: WM_types.h:343
#define ND_DRAW
Definition: WM_types.h:410
#define NC_BRUSH
Definition: WM_types.h:335
#define ND_DATA
Definition: WM_types.h:456
#define NC_SCENE
Definition: WM_types.h:328
#define ND_TOOLSETTINGS
Definition: WM_types.h:397
#define ND_MODIFIER
Definition: WM_types.h:411
#define NA_EDITED
Definition: WM_types.h:523
#define ND_PARTICLE
Definition: WM_types.h:414
#define NC_GPENCIL
Definition: WM_types.h:349
#define NC_OBJECT
Definition: WM_types.h:329
#define NA_SELECTED
Definition: WM_types.h:528
@ BMO_SYMMETRIZE_NEGATIVE_X
@ BMO_SYMMETRIZE_NEGATIVE_Y
@ BMO_SYMMETRIZE_POSITIVE_Z
@ BMO_SYMMETRIZE_NEGATIVE_Z
@ BMO_SYMMETRIZE_POSITIVE_Y
@ BMO_SYMMETRIZE_POSITIVE_X
return(oflags[bm->toolflag_index].f &oflag) !=0
Scene scene
const Depsgraph * depsgraph
depth_tx normal_tx diffuse_light_tx specular_light_tx volume_light_tx environment_tx ambient_occlusion_tx aov_value_tx in_weight_img image(1, GPU_R32F, Qualifier::WRITE, ImageType::FLOAT_2D_ARRAY, "out_weight_img") .image(3
void ED_gpencil_tag_scene_gpencil(Scene *scene)
static void area(int d1, int d2, int e1, int e2, float weights[2])
PointerRNA rna_pointer_inherit_refine(PointerRNA *ptr, StructRNA *type, void *data)
Definition: rna_access.c:186
void RNA_def_property_pointer_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2740
void RNA_def_struct_path_func(StructRNA *srna, const char *path)
Definition: rna_define.c:1193
void RNA_define_animate_sdna(bool animate)
Definition: rna_define.c:748
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
Definition: rna_define.c:3493
void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t bit)
Definition: rna_define.c:2236
PropertyRNA * RNA_def_int_array(StructOrFunctionRNA *cont_, const char *identifier, int len, const int *default_value, int hardmin, int hardmax, const char *ui_name, const char *ui_description, int softmin, int softmax)
Definition: rna_define.c:3655
void RNA_def_property_float_default(PropertyRNA *prop, float value)
Definition: rna_define.c:2022
void RNA_def_function_return(FunctionRNA *func, PropertyRNA *ret)
Definition: rna_define.c:4312
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
Definition: rna_define.c:1645
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier, const char *call)
Definition: rna_define.c:4273
void RNA_def_property_collection_funcs(PropertyRNA *prop, const char *begin, const char *next, const char *end, const char *get, const char *length, const char *lookupint, const char *lookupstring, const char *assignint)
Definition: rna_define.c:3420
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
Definition: rna_define.c:1237
void RNA_def_property_boolean_default(PropertyRNA *prop, bool value)
Definition: rna_define.c:1937
void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const char *set)
Definition: rna_define.c:2944
void RNA_def_property_int_default(PropertyRNA *prop, int value)
Definition: rna_define.c:1978
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
Definition: rna_define.c:1872
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
Definition: rna_define.c:1048
void RNA_def_property_array(PropertyRNA *prop, int length)
Definition: rna_define.c:1539
void RNA_def_property_range(PropertyRNA *prop, double min, double max)
Definition: rna_define.c:1737
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
Definition: rna_define.c:1772
void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname, const char *propname, const char *lengthpropname)
Definition: rna_define.c:2769
void RNA_def_function_ui_description(FunctionRNA *func, const char *description)
Definition: rna_define.c:4347
void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *func)
Definition: rna_define.c:2900
void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char *set, const char *item)
Definition: rna_define.c:3224
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier, int type, int subtype)
Definition: rna_define.c:1257
void RNA_def_property_enum_bitflag_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2669
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
Definition: rna_define.c:1495
void RNA_def_property_pointer_funcs(PropertyRNA *prop, const char *get, const char *set, const char *type_fn, const char *poll)
Definition: rna_define.c:3385
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
Definition: rna_define.c:1028
void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2601
void RNA_def_struct_ui_icon(StructRNA *srna, int icon)
Definition: rna_define.c:1245
void RNA_def_property_ui_scale_type(PropertyRNA *prop, PropertyScaleType ui_scale_type)
Definition: rna_define.c:1715
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
Definition: rna_define.c:1490
void RNA_def_property_subtype(PropertyRNA *prop, PropertySubType subtype)
Definition: rna_define.c:1534
void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2493
void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double step, int precision)
Definition: rna_define.c:1664
void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2343
void RNA_def_property_boolean_negative_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
Definition: rna_define.c:2327
static void rna_def_uv_sculpt(BlenderRNA *brna)
static void rna_def_paint_tool_slot(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)
static const EnumPropertyItem prop_direction_items[]
Definition: screen_ops.c:2544
char vertexpaint_tool
short ob_mode
char gpencil_weight_tool
char uv_sculpt_tool
char gpencil_vertex_tool
char curves_sculpt_tool
char imagepaint_tool
char gpencil_sculpt_tool
char sculpt_tool
char gpencil_tool
char weightpaint_tool
void * next
Definition: DNA_ID.h:369
struct Image * canvas
void * first
Definition: DNA_listBase.h:31
Definition: BKE_main.h:121
ListBase screens
Definition: BKE_main.h:183
struct SculptSession * sculpt
struct ParticleSystem * psys
unsigned short ob_mode
unsigned int tool_offset
struct Paint_Runtime runtime
int tool_slots_len
struct PaintToolSlot * tool_slots
struct Brush * brush
ParticleBrushData brush[7]
struct Object * object
struct Scene * scene
void * data
Definition: RNA_types.h:38
struct ID * owner_id
Definition: RNA_types.h:36
struct ToolSettings * toolsettings
bool bm_smooth_shading
Definition: BKE_paint.h:542
bool show_mask
Definition: BKE_paint.h:551
struct PBVH * pbvh
Definition: BKE_paint.h:550
struct ImagePaintSettings imapaint
ListBase areabase
void WM_main_add_notifier(unsigned int type, void *reference)
PointerRNA * ptr
Definition: wm_files.c:3480