Blender  V2.93
rna_sculpt_paint.c
Go to the documentation of this file.
1 /*
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.
6  *
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.
11  *
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.
15  */
16 
21 #include <stdlib.h>
22 
23 #include "BLI_math.h"
24 #include "BLI_utildefines.h"
25 
26 #include "RNA_define.h"
27 #include "RNA_enum_types.h"
28 
29 #include "rna_internal.h"
30 
31 #include "DNA_ID.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"
37 
38 #include "BKE_brush.h"
39 #include "BKE_material.h"
40 #include "BKE_paint.h"
41 
42 #include "ED_image.h"
43 
44 #include "WM_api.h"
45 #include "WM_types.h"
46 
47 #include "bmesh.h"
48 
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},
58 };
59 
60 #ifndef RNA_RUNTIME
63  "VIEW",
64  ICON_RESTRICT_VIEW_ON,
65  "View",
66  "Align strokes to current view plane"},
68  "AXIS_Y",
69  ICON_AXIS_FRONT,
70  "Front (X-Z)",
71  "Project strokes to plane locked to Y"},
73  "AXIS_X",
74  ICON_AXIS_SIDE,
75  "Side (Y-Z)",
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"},
79  "CURSOR",
80  ICON_PIVOT_CURSOR,
81  "Cursor",
82  "Align strokes to current 3D cursor orientation"},
83  {0, NULL, 0, NULL, NULL},
84 };
85 
88  "MATERIAL",
89  0,
90  "Material",
91  "Paint using the active material base color"},
93  "VERTEXCOLOR",
94  0,
95  "Vertex Color",
96  "Paint the material with custom vertex color"},
97  {0, NULL, 0, NULL, NULL},
98 };
99 #endif
100 
102  {BMO_SYMMETRIZE_NEGATIVE_X, "NEGATIVE_X", 0, "-X to +X", ""},
103  {BMO_SYMMETRIZE_POSITIVE_X, "POSITIVE_X", 0, "+X to -X", ""},
104 
105  {BMO_SYMMETRIZE_NEGATIVE_Y, "NEGATIVE_Y", 0, "-Y to +Y", ""},
106  {BMO_SYMMETRIZE_POSITIVE_Y, "POSITIVE_Y", 0, "+Y to -Y", ""},
107 
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},
111 };
112 
113 #ifdef RNA_RUNTIME
114 # include "MEM_guardedalloc.h"
115 
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"
123 
124 # include "DEG_depsgraph.h"
125 
126 # include "ED_gpencil.h"
127 # include "ED_paint.h"
128 # include "ED_particle.h"
129 
130 static void rna_GPencil_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr))
131 {
132  /* mark all grease pencil datablocks of the scene */
134 }
135 
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},
143 };
144 
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},
150 };
151 
152 static PointerRNA rna_ParticleEdit_brush_get(PointerRNA *ptr)
153 {
155  ParticleBrushData *brush = NULL;
156 
157  brush = &pset->brush[pset->brushtype];
158 
160 }
161 
162 static PointerRNA rna_ParticleBrush_curve_get(PointerRNA *ptr)
163 {
165 }
166 
167 static void rna_ParticleEdit_redo(bContext *C, PointerRNA *UNUSED(ptr))
168 {
171  ViewLayer *view_layer = CTX_data_view_layer(C);
172  Object *ob = OBACT(view_layer);
174 
175  if (!edit) {
176  return;
177  }
178 
179  if (ob) {
181  }
182 
184  psys_free_path_cache(edit->psys, edit);
186 }
187 
188 static void rna_ParticleEdit_update(bContext *C, PointerRNA *UNUSED(ptr))
189 {
191  ViewLayer *view_layer = CTX_data_view_layer(C);
192  Object *ob = OBACT(view_layer);
193 
194  if (ob) {
196  }
197 
198  /* Sync tool setting changes from original to evaluated scenes. */
200 }
201 
202 static void rna_ParticleEdit_tool_set(PointerRNA *ptr, int value)
203 {
205 
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;
209  if (ob) {
212  }
213  }
214 
215  pset->brushtype = value;
216 }
217 static const EnumPropertyItem *rna_ParticleEdit_tool_itemf(bContext *C,
219  PropertyRNA *UNUSED(prop),
220  bool *UNUSED(r_free))
221 {
222  ViewLayer *view_layer = CTX_data_view_layer(C);
223  Object *ob = OBACT(view_layer);
224 # if 0
228  ParticleSystem *psys = edit ? edit->psys : NULL;
229 # else
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);
234 # endif
235 
236  if (psys) {
237  if (psys->flag & PSYS_GLOBAL_HAIR) {
239  }
240  else {
242  }
243  }
244 
245  return particle_edit_cache_brush_items;
246 }
247 
248 static bool rna_ParticleEdit_editable_get(PointerRNA *ptr)
249 {
251 
252  return (pset->object && pset->scene && PE_get_current(NULL, pset->scene, pset->object));
253 }
254 static bool rna_ParticleEdit_hair_get(PointerRNA *ptr)
255 {
257 
258  if (pset->scene) {
259  PTCacheEdit *edit = PE_get_current(NULL, pset->scene, pset->object);
260 
261  return (edit && edit->psys);
262  }
263 
264  return 0;
265 }
266 
267 static char *rna_ParticleEdit_path(PointerRNA *UNUSED(ptr))
268 {
269  return BLI_strdup("tool_settings.particle_edit");
270 }
271 
272 static bool rna_Brush_mode_poll(PointerRNA *ptr, PointerRNA value)
273 {
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);
280 
281  if (brush->ob_mode & ob_mode) {
282  if (paint->brush) {
283  if (BKE_brush_tool_get(paint->brush, paint) == BKE_brush_tool_get(brush, paint)) {
284  return true;
285  }
286  }
287  else {
288  return true;
289  }
290  }
291 
292  return false;
293 }
294 
295 static bool paint_contains_brush_slot(const Paint *paint, const PaintToolSlot *tslot, int *r_index)
296 {
297  if ((tslot >= paint->tool_slots) && (tslot < (paint->tool_slots + paint->tool_slots_len))) {
298  *r_index = (int)(tslot - paint->tool_slots);
299  return true;
300  }
301  return false;
302 }
303 
304 static bool rna_Brush_mode_with_tool_poll(PointerRNA *ptr, PointerRNA value)
305 {
306  Scene *scene = (Scene *)ptr->owner_id;
307  const PaintToolSlot *tslot = ptr->data;
309  Brush *brush = (Brush *)value.owner_id;
310  int mode = 0;
311  int slot_index = 0;
312 
313  if (paint_contains_brush_slot(&ts->imapaint.paint, tslot, &slot_index)) {
314  if (slot_index != brush->imagepaint_tool) {
315  return false;
316  }
317  mode = OB_MODE_TEXTURE_PAINT;
318  }
319  else if (paint_contains_brush_slot(&ts->sculpt->paint, tslot, &slot_index)) {
320  if (slot_index != brush->sculpt_tool) {
321  return false;
322  }
323  mode = OB_MODE_SCULPT;
324  }
325  else if (paint_contains_brush_slot(&ts->uvsculpt->paint, tslot, &slot_index)) {
326  if (slot_index != brush->uv_sculpt_tool) {
327  return false;
328  }
329  mode = OB_MODE_EDIT;
330  }
331  else if (paint_contains_brush_slot(&ts->vpaint->paint, tslot, &slot_index)) {
332  if (slot_index != brush->vertexpaint_tool) {
333  return false;
334  }
335  mode = OB_MODE_VERTEX_PAINT;
336  }
337  else if (paint_contains_brush_slot(&ts->wpaint->paint, tslot, &slot_index)) {
338  if (slot_index != brush->weightpaint_tool) {
339  return false;
340  }
341  mode = OB_MODE_WEIGHT_PAINT;
342  }
343  else if (paint_contains_brush_slot(&ts->gp_paint->paint, tslot, &slot_index)) {
344  if (slot_index != brush->gpencil_tool) {
345  return false;
346  }
347  mode = OB_MODE_PAINT_GPENCIL;
348  }
349  else if (paint_contains_brush_slot(&ts->gp_vertexpaint->paint, tslot, &slot_index)) {
350  if (slot_index != brush->gpencil_vertex_tool) {
351  return false;
352  }
353  mode = OB_MODE_VERTEX_GPENCIL;
354  }
355  else if (paint_contains_brush_slot(&ts->gp_sculptpaint->paint, tslot, &slot_index)) {
356  if (slot_index != brush->gpencil_sculpt_tool) {
357  return false;
358  }
359  mode = OB_MODE_SCULPT_GPENCIL;
360  }
361  else if (paint_contains_brush_slot(&ts->gp_weightpaint->paint, tslot, &slot_index)) {
362  if (slot_index != brush->gpencil_weight_tool) {
363  return false;
364  }
365  mode = OB_MODE_WEIGHT_GPENCIL;
366  }
367 
368  return brush->ob_mode & mode;
369 }
370 
371 static void rna_Sculpt_update(bContext *C, PointerRNA *UNUSED(ptr))
372 {
374  ViewLayer *view_layer = CTX_data_view_layer(C);
375  Object *ob = OBACT(view_layer);
376 
377  if (ob) {
380 
381  if (ob->sculpt) {
384  }
385  }
386 }
387 
388 static void rna_Sculpt_ShowMask_update(bContext *C, PointerRNA *UNUSED(ptr))
389 {
390  ViewLayer *view_layer = CTX_data_view_layer(C);
391  Object *object = OBACT(view_layer);
392  if (object == NULL || object->sculpt == NULL) {
393  return;
394  }
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);
400  }
403 }
404 
405 static char *rna_Sculpt_path(PointerRNA *UNUSED(ptr))
406 {
407  return BLI_strdup("tool_settings.sculpt");
408 }
409 
410 static char *rna_VertexPaint_path(PointerRNA *ptr)
411 {
412  Scene *scene = (Scene *)ptr->owner_id;
414  if (ptr->data == ts->vpaint) {
415  return BLI_strdup("tool_settings.vertex_paint");
416  }
417  else {
418  return BLI_strdup("tool_settings.weight_paint");
419  }
420 }
421 
422 static char *rna_ImagePaintSettings_path(PointerRNA *UNUSED(ptr))
423 {
424  return BLI_strdup("tool_settings.image_paint");
425 }
426 
427 static char *rna_UvSculpt_path(PointerRNA *UNUSED(ptr))
428 {
429  return BLI_strdup("tool_settings.uv_sculpt");
430 }
431 
432 static char *rna_GpPaint_path(PointerRNA *UNUSED(ptr))
433 {
434  return BLI_strdup("tool_settings.gpencil_paint");
435 }
436 
437 static char *rna_GpVertexPaint_path(PointerRNA *UNUSED(ptr))
438 {
439  return BLI_strdup("tool_settings.gpencil_vertex_paint");
440 }
441 
442 static char *rna_GpSculptPaint_path(PointerRNA *UNUSED(ptr))
443 {
444  return BLI_strdup("tool_settings.gpencil_sculpt_paint");
445 }
446 
447 static char *rna_GpWeightPaint_path(PointerRNA *UNUSED(ptr))
448 {
449  return BLI_strdup("tool_settings.gpencil_weight_paint");
450 }
451 
452 static char *rna_ParticleBrush_path(PointerRNA *UNUSED(ptr))
453 {
454  return BLI_strdup("tool_settings.particle_edit.brush");
455 }
456 
457 static void rna_Paint_brush_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
458 {
459  Paint *paint = ptr->data;
460  Brush *br = paint->brush;
462  /* Needed because we're not calling 'BKE_paint_brush_set' which handles this. */
465 }
466 
467 static void rna_ImaPaint_viewport_update(Main *UNUSED(bmain),
468  Scene *UNUSED(scene),
470 {
471  /* not the best solution maybe, but will refresh the 3D viewport */
473 }
474 
475 static void rna_ImaPaint_mode_update(bContext *C, PointerRNA *UNUSED(ptr))
476 {
478  ViewLayer *view_layer = CTX_data_view_layer(C);
479  Object *ob = OBACT(view_layer);
480 
481  if (ob && ob->type == OB_MESH) {
482  /* of course we need to invalidate here */
484 
485  /* We assume that changing the current mode will invalidate the uv layers
486  * so we need to refresh display. */
489  }
490 }
491 
492 static void rna_ImaPaint_stencil_update(bContext *C, PointerRNA *UNUSED(ptr))
493 {
495  ViewLayer *view_layer = CTX_data_view_layer(C);
496  Object *ob = OBACT(view_layer);
497 
498  if (ob && ob->type == OB_MESH) {
501  }
502 }
503 
504 static void rna_ImaPaint_canvas_update(bContext *C, PointerRNA *UNUSED(ptr))
505 {
506  Main *bmain = CTX_data_main(C);
508  ViewLayer *view_layer = CTX_data_view_layer(C);
509  Object *ob = OBACT(view_layer);
510  Object *obedit = OBEDIT_FROM_OBACT(ob);
511  bScreen *screen;
513 
514  for (screen = bmain->screens.first; screen; screen = screen->id.next) {
515  ScrArea *area;
516  for (area = screen->areabase.first; area; area = area->next) {
517  SpaceLink *slink;
518  for (slink = area->spacedata.first; slink; slink = slink->next) {
519  if (slink->spacetype == SPACE_IMAGE) {
520  SpaceImage *sima = (SpaceImage *)slink;
521 
522  if (!sima->pin) {
523  ED_space_image_set(bmain, sima, obedit, ima, true);
524  }
525  }
526  }
527  }
528  }
529 
530  if (ob && ob->type == OB_MESH) {
533  }
534 }
535 
536 static bool rna_ImaPaint_detect_data(ImagePaintSettings *imapaint)
537 {
538  return imapaint->missing_data == 0;
539 }
540 
541 static char *rna_GPencilSculptSettings_path(PointerRNA *UNUSED(ptr))
542 {
543  return BLI_strdup("tool_settings.gpencil_sculpt");
544 }
545 
546 static char *rna_GPencilSculptGuide_path(PointerRNA *UNUSED(ptr))
547 {
548  return BLI_strdup("tool_settings.gpencil_sculpt.guide");
549 }
550 
551 #else
552 
553 static void rna_def_paint_curve(BlenderRNA *brna)
554 {
555  StructRNA *srna;
556 
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);
560 }
561 
563 {
564  StructRNA *srna;
565  PropertyRNA *prop;
566 
567  srna = RNA_def_struct(brna, "PaintToolSlot", NULL);
568  RNA_def_struct_ui_text(srna, "Paint Tool Slot", "");
569 
570  prop = RNA_def_property(srna, "brush", PROP_POINTER, PROP_NONE);
572  RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Brush_mode_with_tool_poll");
573  RNA_def_property_ui_text(prop, "Brush", "");
574 }
575 
576 static void rna_def_paint(BlenderRNA *brna)
577 {
578  StructRNA *srna;
579  PropertyRNA *prop;
580 
581  srna = RNA_def_struct(brna, "Paint", NULL);
582  RNA_def_struct_ui_text(srna, "Paint", "");
583 
584  /* Global Settings */
585  prop = RNA_def_property(srna, "brush", PROP_POINTER, PROP_NONE);
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");
590 
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! */
597  prop, NULL, NULL, NULL, "rna_iterator_array_get", NULL, NULL, NULL, NULL);
598  RNA_def_property_ui_text(prop, "Paint Tool Slots", "");
599 
600  prop = RNA_def_property(srna, "palette", PROP_POINTER, PROP_NONE);
603  RNA_def_property_ui_text(prop, "Palette", "Active Palette");
604 
605  prop = RNA_def_property(srna, "show_brush", PROP_BOOLEAN, PROP_NONE);
607  RNA_def_property_ui_text(prop, "Show Brush", "");
609 
610  prop = RNA_def_property(srna, "show_brush_on_surface", PROP_BOOLEAN, PROP_NONE);
612  RNA_def_property_ui_text(prop, "Show Brush On Surface", "");
614 
615  prop = RNA_def_property(srna, "show_low_resolution", PROP_BOOLEAN, PROP_NONE);
618  prop, "Fast Navigate", "For multires, show low resolution while navigating the view");
620 
621  prop = RNA_def_property(srna, "use_sculpt_delay_updates", PROP_BOOLEAN, PROP_NONE);
624  prop,
625  "Delay Viewport Updates",
626  "Update the geometry when it enters the view, providing faster view navigation");
628 
629  prop = RNA_def_property(srna, "input_samples", PROP_INT, PROP_UNSIGNED);
630  RNA_def_property_int_sdna(prop, NULL, "num_input_samples");
633  prop, "Input Samples", "Average multiple input samples together to smooth the brush stroke");
635 
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");
640 
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");
645 
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");
650 
651  prop = RNA_def_property(srna, "use_symmetry_feather", PROP_BOOLEAN, PROP_NONE);
654  "Symmetry Feathering",
655  "Reduce the strength of the brush where it overlaps symmetrical daubs");
657 
658  prop = RNA_def_property(srna, "cavity_curve", PROP_POINTER, PROP_NONE);
660  RNA_def_property_ui_text(prop, "Curve", "Editable cavity curve");
662 
663  prop = RNA_def_property(srna, "use_cavity", PROP_BOOLEAN, PROP_NONE);
665  RNA_def_property_ui_text(prop, "Cavity Mask", "Mask painting according to mesh geometry cavity");
667 
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);
674  prop, "Tiling offset for the X Axis", "Stride at which tiled strokes are copied");
675 
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");
680 
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");
685 
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");
690 }
691 
692 static void rna_def_sculpt(BlenderRNA *brna)
693 {
694  static const EnumPropertyItem detail_refine_items[] = {
696  "SUBDIVIDE",
697  0,
698  "Subdivide Edges",
699  "Subdivide long edges to add mesh detail where needed"},
701  "COLLAPSE",
702  0,
703  "Collapse Edges",
704  "Collapse short edges to remove mesh detail where possible"},
706  "SUBDIVIDE_COLLAPSE",
707  0,
708  "Subdivide Collapse",
709  "Both subdivide long edges and collapse short edges to refine mesh detail"},
710  {0, NULL, 0, NULL, NULL},
711  };
712 
713  static const EnumPropertyItem detail_type_items[] = {
714  {0,
715  "RELATIVE",
716  0,
717  "Relative Detail",
718  "Mesh detail is relative to the brush size and detail size"},
720  "CONSTANT",
721  0,
722  "Constant Detail",
723  "Mesh detail is constant in world space according to detail size"},
725  "BRUSH",
726  0,
727  "Brush Detail",
728  "Mesh detail is relative to brush radius"},
730  "MANUAL",
731  0,
732  "Manual Detail",
733  "Mesh detail does not change on each stroke, only when using Flood Fill"},
734  {0, NULL, 0, NULL, NULL},
735  };
736 
737  StructRNA *srna;
738  PropertyRNA *prop;
739 
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", "");
743 
744  prop = RNA_def_property(srna, "radial_symmetry", PROP_INT, PROP_XYZ);
745  RNA_def_property_int_sdna(prop, NULL, "radial_symm");
747  RNA_def_property_range(prop, 1, 64);
748  RNA_def_property_ui_range(prop, 0, 32, 1, 1);
750  prop, "Radial Symmetry Count X Axis", "Number of times to copy strokes across the surface");
751 
752  prop = RNA_def_property(srna, "lock_x", PROP_BOOLEAN, PROP_NONE);
754  RNA_def_property_ui_text(prop, "Lock X", "Disallow changes to the X axis of vertices");
756 
757  prop = RNA_def_property(srna, "lock_y", PROP_BOOLEAN, PROP_NONE);
759  RNA_def_property_ui_text(prop, "Lock Y", "Disallow changes to the Y axis of vertices");
761 
762  prop = RNA_def_property(srna, "lock_z", PROP_BOOLEAN, PROP_NONE);
764  RNA_def_property_ui_text(prop, "Lock Z", "Disallow changes to the Z axis of vertices");
766 
767  prop = RNA_def_property(srna, "use_deform_only", PROP_BOOLEAN, PROP_NONE);
770  "Use Deform Only",
771  "Use only deformation modifiers (temporary disable all "
772  "constructive modifiers except multi-resolution)");
774  RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Sculpt_update");
775 
776  prop = RNA_def_property(srna, "show_mask", PROP_BOOLEAN, PROP_NONE);
778  RNA_def_property_ui_text(prop, "Show Mask", "Show mask as overlay on object");
780  RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Sculpt_ShowMask_update");
781 
782  prop = RNA_def_property(srna, "show_face_sets", PROP_BOOLEAN, PROP_NONE);
784  RNA_def_property_ui_text(prop, "Show Face Sets", "Show Face Sets as overlay on object");
786  RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Sculpt_ShowMask_update");
787 
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);
791  prop, "Detail Size", "Maximum edge length for dynamic topology sculpting (in pixels)");
793 
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);
797  prop,
798  "Detail Percentage",
799  "Maximum edge length for dynamic topology sculpting (in brush percenage)");
801 
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);
807  "Resolution",
808  "Maximum edge length for dynamic topology sculpting (as divisor "
809  "of blender unit - higher value means smaller edge length)");
811 
812  prop = RNA_def_property(srna, "use_smooth_shading", PROP_BOOLEAN, PROP_NONE);
815  "Smooth Shading",
816  "Show faces in dynamic-topology mode with smooth "
817  "shading rather than flat shaded");
819  RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Sculpt_update");
820 
821  prop = RNA_def_property(srna, "use_automasking_topology", PROP_BOOLEAN, PROP_NONE);
824  "Topology Auto-Masking",
825  "Affect only vertices connected to the active vertex under the brush");
827 
828  prop = RNA_def_property(srna, "use_automasking_face_sets", PROP_BOOLEAN, PROP_NONE);
831  "Face Sets Auto-Masking",
832  "Affect only vertices that share Face Sets with the active vertex");
834 
835  prop = RNA_def_property(srna, "use_automasking_boundary_edges", PROP_BOOLEAN, PROP_NONE);
838  prop, "Mesh Boundary Auto-Masking", "Do not affect non manifold boundary edges");
840 
841  prop = RNA_def_property(srna, "use_automasking_boundary_face_sets", PROP_BOOLEAN, PROP_NONE);
843  prop, NULL, "automasking_flags", BRUSH_AUTOMASKING_BOUNDARY_FACE_SETS);
845  "Face Sets Boundary Auto-Masking",
846  "Do not affect vertices that belong to a Face Set boundary");
848 
849  prop = RNA_def_property(srna, "symmetrize_direction", PROP_ENUM, PROP_NONE);
851  RNA_def_property_ui_text(prop, "Direction", "Source and destination for symmetrize operator");
852 
853  prop = RNA_def_property(srna, "detail_refine_method", PROP_ENUM, PROP_NONE);
855  RNA_def_property_enum_items(prop, detail_refine_items);
857  prop, "Detail Refine Method", "In dynamic-topology mode, how to add or remove mesh detail");
859 
860  prop = RNA_def_property(srna, "detail_type_method", PROP_ENUM, PROP_NONE);
862  RNA_def_property_enum_items(prop, detail_type_items);
864  prop, "Detail Type Method", "In dynamic-topology mode, how mesh detail size is calculated");
866 
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");
873 
874  prop = RNA_def_property(srna, "gravity_object", PROP_POINTER, PROP_NONE);
877  prop, "Orientation", "Object whose Z axis defines orientation of gravity");
879 }
880 
881 static void rna_def_uv_sculpt(BlenderRNA *brna)
882 {
883  StructRNA *srna;
884 
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", "");
888 }
889 
890 static void rna_def_gp_paint(BlenderRNA *brna)
891 {
892  StructRNA *srna;
893  PropertyRNA *prop;
894 
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", "");
898 
899  /* Use vertex color (main switch). */
900  prop = RNA_def_property(srna, "color_mode", PROP_ENUM, PROP_NONE);
901  RNA_def_property_enum_sdna(prop, NULL, "mode");
903  RNA_def_property_ui_text(prop, "Mode", "Paint Mode");
906 }
907 
909 {
910  StructRNA *srna;
911 
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", "");
915 }
916 
918 {
919  StructRNA *srna;
920 
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", "");
924 }
925 
927 {
928  StructRNA *srna;
929 
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", "");
933 }
934 
935 /* use for weight paint too */
937 {
938  StructRNA *srna;
939  PropertyRNA *prop;
940 
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");
945 
946  /* weight paint only */
947  prop = RNA_def_property(srna, "use_group_restrict", PROP_BOOLEAN, PROP_NONE);
949  RNA_def_property_ui_text(prop, "Restrict", "Restrict painting to vertices in the group");
951 
952  /* Mirroring */
953  prop = RNA_def_property(srna, "radial_symmetry", PROP_INT, PROP_XYZ);
954  RNA_def_property_int_sdna(prop, NULL, "radial_symm");
956  RNA_def_property_range(prop, 1, 64);
957  RNA_def_property_ui_range(prop, 1, 32, 1, 1);
959  prop, "Radial Symmetry Count X Axis", "Number of times to copy strokes across the surface");
960 }
961 
962 static void rna_def_image_paint(BlenderRNA *brna)
963 {
964  StructRNA *srna;
965  PropertyRNA *prop;
966  FunctionRNA *func;
967 
968  static const EnumPropertyItem paint_type_items[] = {
970  "MATERIAL",
971  0,
972  "Material",
973  "Detect image slots from the material"},
975  "IMAGE",
976  0,
977  "Single Image",
978  "Set image for texture painting directly"},
979  {0, NULL, 0, NULL, NULL},
980  };
981 
982  static const EnumPropertyItem paint_interp_items[] = {
983  {IMAGEPAINT_INTERP_LINEAR, "LINEAR", 0, "Linear", "Linear interpolation"},
985  "CLOSEST",
986  0,
987  "Closest",
988  "No interpolation (sample closest texel)"},
989  {0, NULL, 0, NULL, NULL},
990  };
991 
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");
996 
997  /* functions */
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");
1000 
1001  /* return type */
1002  RNA_def_function_return(func, RNA_def_boolean(func, "ok", 1, "", ""));
1003 
1004  /* booleans */
1005  prop = RNA_def_property(srna, "use_occlude", PROP_BOOLEAN, PROP_NONE);
1008  prop, "Occlude", "Only paint onto the faces directly under the brush (slower)");
1010 
1011  prop = RNA_def_property(srna, "use_backface_culling", PROP_BOOLEAN, PROP_NONE);
1013  RNA_def_property_ui_text(prop, "Cull", "Ignore faces pointing away from the view (faster)");
1015 
1016  prop = RNA_def_property(srna, "use_normal_falloff", PROP_BOOLEAN, PROP_NONE);
1018  RNA_def_property_ui_text(prop, "Normal", "Paint most on faces pointing towards the view");
1020 
1021  prop = RNA_def_property(srna, "use_stencil_layer", PROP_BOOLEAN, PROP_NONE);
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");
1025 
1026  prop = RNA_def_property(srna, "invert_stencil", PROP_BOOLEAN, PROP_NONE);
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");
1030 
1031  prop = RNA_def_property(srna, "stencil_image", PROP_POINTER, PROP_NONE);
1032  RNA_def_property_pointer_sdna(prop, NULL, "stencil");
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");
1036 
1037  prop = RNA_def_property(srna, "canvas", PROP_POINTER, PROP_NONE);
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");
1041 
1042  prop = RNA_def_property(srna, "clone_image", PROP_POINTER, PROP_NONE);
1043  RNA_def_property_pointer_sdna(prop, NULL, "clone");
1045  RNA_def_property_ui_text(prop, "Clone Image", "Image used as clone source");
1047 
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");
1053 
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");
1058 
1059  prop = RNA_def_property(srna, "use_clone_layer", PROP_BOOLEAN, PROP_NONE);
1062  prop,
1063  "Clone Map",
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");
1066 
1067  /* integers */
1068 
1069  prop = RNA_def_property(srna, "seam_bleed", PROP_INT, PROP_PIXEL);
1070  RNA_def_property_ui_range(prop, 0, 8, 1, -1);
1072  prop, "Bleed", "Extend paint beyond the faces UVs to reduce seams (in pixels, slower)");
1073 
1074  prop = RNA_def_property(srna, "normal_angle", PROP_INT, PROP_UNSIGNED);
1075  RNA_def_property_range(prop, 0, 90);
1077  prop, "Angle", "Paint most on faces pointing towards the view according to this angle");
1078 
1079  prop = RNA_def_int_array(srna,
1080  "screen_grab_size",
1081  2,
1082  NULL,
1083  0,
1084  0,
1085  "Screen Grab Size",
1086  "Size to capture the image for re-projecting",
1087  0,
1088  0);
1089  RNA_def_property_range(prop, 512, 16384);
1091 
1092  prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
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");
1097 
1098  prop = RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE);
1099  RNA_def_property_enum_sdna(prop, NULL, "interp");
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");
1104 
1105  /* Missing data */
1106  prop = RNA_def_property(srna, "missing_uvs", PROP_BOOLEAN, PROP_NONE);
1108  RNA_def_property_ui_text(prop, "Missing UVs", "A UV layer is missing on the mesh");
1110 
1111  prop = RNA_def_property(srna, "missing_materials", PROP_BOOLEAN, PROP_NONE);
1113  RNA_def_property_ui_text(prop, "Missing Materials", "The mesh is missing materials");
1115 
1116  prop = RNA_def_property(srna, "missing_stencil", PROP_BOOLEAN, PROP_NONE);
1118  RNA_def_property_ui_text(prop, "Missing Stencil", "Image Painting does not have a stencil");
1120 
1121  prop = RNA_def_property(srna, "missing_texture", PROP_BOOLEAN, PROP_NONE);
1124  prop, "Missing Texture", "Image Painting does not have a texture to paint on");
1126 }
1127 
1129 {
1130  StructRNA *srna;
1131  PropertyRNA *prop;
1132 
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},
1138  };
1139 
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},
1144  };
1145 
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},
1150  };
1151 
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},
1157  };
1158 
1159  /* edit */
1160 
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");
1165 
1166  prop = RNA_def_property(srna, "tool", PROP_ENUM, PROP_NONE);
1167  RNA_def_property_enum_sdna(prop, NULL, "brushtype");
1170  prop, NULL, "rna_ParticleEdit_tool_set", "rna_ParticleEdit_tool_itemf");
1171  RNA_def_property_ui_text(prop, "Tool", "");
1172 
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");
1178  RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ParticleEdit_update");
1179 
1180  prop = RNA_def_property(srna, "use_preserve_length", PROP_BOOLEAN, PROP_NONE);
1182  RNA_def_property_ui_text(prop, "Keep Lengths", "Keep path lengths constant");
1183 
1184  prop = RNA_def_property(srna, "use_preserve_root", PROP_BOOLEAN, PROP_NONE);
1186  RNA_def_property_ui_text(prop, "Keep Root", "Keep root keys unmodified");
1187 
1188  prop = RNA_def_property(srna, "use_emitter_deflect", PROP_BOOLEAN, PROP_NONE);
1190  RNA_def_property_ui_text(prop, "Deflect Emitter", "Keep paths from intersecting the emitter");
1191 
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);
1196  prop, "Emitter Distance", "Distance to keep particles away from the emitter");
1197 
1198  prop = RNA_def_property(srna, "use_fade_time", PROP_BOOLEAN, PROP_NONE);
1201  prop, "Fade Time", "Fade paths and keys further away from current frame");
1203  RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ParticleEdit_update");
1204 
1205  prop = RNA_def_property(srna, "use_auto_velocity", PROP_BOOLEAN, PROP_NONE);
1207  RNA_def_property_ui_text(prop, "Auto Velocity", "Calculate point velocities automatically");
1208 
1209  prop = RNA_def_property(srna, "show_particles", PROP_BOOLEAN, PROP_NONE);
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");
1214 
1215  prop = RNA_def_property(srna, "use_default_interpolate", PROP_BOOLEAN, PROP_NONE);
1218  prop, "Interpolate", "Interpolate new particles from the existing ones");
1219 
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");
1225 
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", "");
1230 
1231  prop = RNA_def_property(srna, "display_step", PROP_INT, PROP_NONE);
1232  RNA_def_property_int_sdna(prop, NULL, "draw_step");
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");
1237 
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");
1242  RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ParticleEdit_update");
1243 
1244  prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
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");
1250 
1251  prop = RNA_def_property(srna, "is_editable", PROP_BOOLEAN, PROP_NONE);
1252  RNA_def_property_boolean_funcs(prop, "rna_ParticleEdit_editable_get", NULL);
1254  RNA_def_property_ui_text(prop, "Editable", "A valid edit mode exists");
1255 
1256  prop = RNA_def_property(srna, "is_hair", PROP_BOOLEAN, PROP_NONE);
1257  RNA_def_property_boolean_funcs(prop, "rna_ParticleEdit_hair_get", NULL);
1259  RNA_def_property_ui_text(prop, "Hair", "Editing hair");
1260 
1261  prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
1263  RNA_def_property_ui_text(prop, "Object", "The edited object");
1264 
1265  prop = RNA_def_property(srna, "shape_object", PROP_POINTER, PROP_NONE);
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");
1270 
1271  /* brush */
1272 
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");
1277 
1278  prop = RNA_def_property(srna, "size", PROP_INT, PROP_PIXEL);
1279  RNA_def_property_range(prop, 1, SHRT_MAX);
1281  RNA_def_property_ui_text(prop, "Radius", "Radius of the brush in pixels");
1282 
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");
1286 
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");
1291 
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");
1297 
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", "");
1302 
1303  prop = RNA_def_property(srna, "use_puff_volume", PROP_BOOLEAN, PROP_NONE);
1306  prop,
1307  "Puff Volume",
1308  "Apply puff to unselected end-points (helps maintain hair volume when puffing root)");
1309 
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", "");
1314 
1315  /* dummy */
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", "");
1320 }
1321 
1322 /* srna -- gpencil speed guides */
1324 {
1325  StructRNA *srna;
1326  PropertyRNA *prop;
1327 
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");
1332 
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},
1340  };
1341 
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},
1347  };
1348 
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");
1355 
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);
1360  prop, "Use Snapping", "Enable snapping to guides angle or spacing options");
1363 
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");
1368  RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_viewport_update");
1369 
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");
1375  RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_viewport_update");
1376 
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");
1383 
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");
1390 
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");
1397 
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");
1405 
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);
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");
1414 }
1415 
1417 {
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},
1422  };
1423 
1425 
1426  StructRNA *srna;
1427  PropertyRNA *prop;
1428 
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");
1434  "GPencil Sculpt Settings",
1435  "General properties for Grease Pencil stroke sculpting tools");
1436 
1437  prop = RNA_def_property(srna, "guide", PROP_POINTER, PROP_NONE);
1438  RNA_def_property_struct_type(prop, "GPencilSculptGuide");
1440  RNA_def_property_ui_text(prop, "Guide", "");
1441 
1442  prop = RNA_def_property(srna, "use_multiframe_falloff", PROP_BOOLEAN, PROP_NONE);
1445  prop,
1446  "Use Falloff",
1447  "Use falloff effect when edit in multiframe mode to compute brush effect by frame");
1450 
1451  prop = RNA_def_property(srna, "use_thickness_curve", PROP_BOOLEAN, PROP_NONE);
1453  RNA_def_property_ui_text(prop, "Use Curve", "Use curve to define primitive stroke thickness");
1456 
1457  prop = RNA_def_property(srna, "use_scale_thickness", PROP_BOOLEAN, PROP_NONE);
1460  prop, "Scale Stroke Thickness", "Scale the stroke thickness when transforming strokes");
1463 
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");
1469  prop, "Curve", "Custom curve to control falloff of brush effect by Grease Pencil frames");
1472 
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");
1480 
1481  /* lock axis */
1482  prop = RNA_def_property(srna, "lock_axis", PROP_ENUM, PROP_NONE);
1483  RNA_def_property_enum_sdna(prop, NULL, "lock_axis");
1485  RNA_def_property_ui_text(prop, "Lock Axis", "");
1487  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
1488 
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");
1496 }
1497 
1499 {
1500  /* *** Non-Animated *** */
1501  RNA_define_animate_sdna(false);
1502  rna_def_paint_curve(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);
1517 }
1518 
1519 #endif
#define BKE_brush_tool_get(brush, p)
Definition: BKE_brush.h:141
struct Scene * CTX_data_scene(const bContext *C)
Definition: context.c:1034
struct ViewLayer * CTX_data_view_layer(const bContext *C)
Definition: context.c:1044
struct Depsgraph * CTX_data_depsgraph_pointer(const bContext *C)
Definition: context.c:1401
struct Main * CTX_data_main(const bContext *C)
Definition: context.c:1018
General operations, lookup, etc. for materials.
void BKE_texpaint_slots_refresh_object(struct Scene *scene, struct Object *ob)
Definition: material.c:1361
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:272
struct ParticleSystem * psys_get_current(struct Object *ob)
Definition: particle.c:645
void psys_free_path_cache(struct ParticleSystem *psys, struct PTCacheEdit *edit)
Definition: particle.c:986
void BKE_particle_batch_cache_dirty_tag(struct ParticleSystem *psys, int mode)
Definition: particle.c:5243
@ BKE_PARTICLE_BATCH_DIRTY_ALL
Definition: BKE_particle.h:620
A BVH for high poly meshes.
void pbvh_show_mask_set(PBVH *pbvh, bool show_mask)
Definition: pbvh.c:3016
#define BLI_assert(a)
Definition: BLI_assert.h:58
#define M_PI
Definition: BLI_math_base.h:38
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL() ATTR_MALLOC
Definition: string.c:70
unsigned int uint
Definition: BLI_sys_types.h:83
#define UNUSED_VARS(...)
#define UNUSED_VARS_NDEBUG(...)
#define UNUSED(x)
struct Depsgraph Depsgraph
Definition: DEG_depsgraph.h:51
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:654
@ ID_RECALC_GEOMETRY
Definition: DNA_ID.h:611
@ 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
eObjectMode
@ OB_MODE_VERTEX_GPENCIL
@ OB_MODE_EDIT
@ OB_MODE_WEIGHT_PAINT
@ OB_MODE_WEIGHT_GPENCIL
@ OB_MODE_SCULPT
@ 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
#define IMAGEPAINT_PROJECT_FLAT
#define IMAGEPAINT_PROJECT_LAYER_STENCIL
#define PE_BRUSH_DATA_PUFF_VOLUME
#define OBEDIT_FROM_OBACT(ob)
#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
@ 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
@ VP_FLAG_VGROUP_RESTRICT
#define SCE_SELECT_END
@ PAINT_USE_CAVITY_MASK
@ PAINT_SCULPT_DELAY_UPDATES
@ PAINT_SHOW_BRUSH
@ PAINT_SHOW_BRUSH_ON_SURFACE
@ PAINT_FAST_NAVIGATE
@ IMAGEPAINT_MODE_IMAGE
@ IMAGEPAINT_MODE_MATERIAL
#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
@ 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
@ GPPAINT_FLAG_USE_VERTEXCOLOR
@ GPPAINT_FLAG_USE_MATERIAL
#define IMAGEPAINT_PROJECT_BACKFACE
#define PE_BRUSH_WEIGHT
#define PE_TYPE_PARTICLES
#define PE_BRUSH_LENGTH
#define IMAGEPAINT_MISSING_MATERIAL
#define PE_BRUSH_COMB
#define IMAGEPAINT_MISSING_UVS
#define PE_BRUSH_SMOOTH
@ IMAGEPAINT_INTERP_LINEAR
@ IMAGEPAINT_INTERP_CLOSEST
#define IMAGEPAINT_MISSING_TEX
#define PE_AUTO_VELOCITY
@ SPACE_IMAGE
void ED_space_image_set(struct Main *bmain, struct SpaceImage *sima, struct Object *obedit, struct Image *ima, bool automatic)
Definition: image_edit.c:60
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.
StructRNA RNA_ParticleBrush
StructRNA RNA_CurveMapping
const EnumPropertyItem rna_enum_particle_edit_disconnected_hair_brush_items[]
@ PROP_FLOAT
Definition: RNA_types.h:75
@ PROP_BOOLEAN
Definition: RNA_types.h:73
@ PROP_ENUM
Definition: RNA_types.h:77
@ PROP_INT
Definition: RNA_types.h:74
@ PROP_POINTER
Definition: RNA_types.h:78
@ PROP_COLLECTION
Definition: RNA_types.h:79
@ PROP_CONTEXT_UPDATE
Definition: RNA_types.h:254
@ PROP_ANIMATABLE
Definition: RNA_types.h:188
@ PROP_EDITABLE
Definition: RNA_types.h:175
@ PROP_NEVER_NULL
Definition: RNA_types.h:225
@ PROP_ID_SELF_CHECK
Definition: RNA_types.h:218
@ PROP_XYZ
Definition: RNA_types.h:148
@ PROP_DISTANCE
Definition: RNA_types.h:135
@ PROP_PIXEL
Definition: RNA_types.h:128
@ PROP_ANGLE
Definition: RNA_types.h:132
@ PROP_NONE
Definition: RNA_types.h:113
@ PROP_PERCENTAGE
Definition: RNA_types.h:130
@ PROP_FACTOR
Definition: RNA_types.h:131
@ PROP_COLOR_GAMMA
Definition: RNA_types.h:151
@ PROP_UNSIGNED
Definition: RNA_types.h:129
#define C
Definition: RandGen.cpp:39
#define ND_DRAW
Definition: WM_types.h:362
#define NC_BRUSH
Definition: WM_types.h:286
#define ND_DATA
Definition: WM_types.h:408
#define NC_SCENE
Definition: WM_types.h:279
#define ND_TOOLSETTINGS
Definition: WM_types.h:349
#define ND_MODIFIER
Definition: WM_types.h:363
#define NA_EDITED
Definition: WM_types.h:462
#define ND_PARTICLE
Definition: WM_types.h:366
#define NC_GPENCIL
Definition: WM_types.h:300
#define NC_OBJECT
Definition: WM_types.h:280
#define NA_SELECTED
Definition: WM_types.h:467
@ 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
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:196
void RNA_def_property_pointer_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2762
void RNA_def_struct_path_func(StructRNA *srna, const char *path)
Definition: rna_define.c:1212
void RNA_define_animate_sdna(bool animate)
Definition: rna_define.c:766
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
Definition: rna_define.c:3481
void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t bit)
Definition: rna_define.c:2257
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:3643
void RNA_def_property_float_default(PropertyRNA *prop, float value)
Definition: rna_define.c:2042
void RNA_def_function_return(FunctionRNA *func, PropertyRNA *ret)
Definition: rna_define.c:4302
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
Definition: rna_define.c:1676
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier, const char *call)
Definition: rna_define.c:4262
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:3408
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
Definition: rna_define.c:1259
void RNA_def_property_boolean_default(PropertyRNA *prop, bool value)
Definition: rna_define.c:1957
void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const char *set)
Definition: rna_define.c:2971
void RNA_def_property_int_default(PropertyRNA *prop, int value)
Definition: rna_define.c:1998
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
Definition: rna_define.c:1892
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
Definition: rna_define.c:1067
void RNA_def_property_array(PropertyRNA *prop, int length)
Definition: rna_define.c:1568
void RNA_def_property_range(PropertyRNA *prop, double min, double max)
Definition: rna_define.c:1757
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
Definition: rna_define.c:1792
void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname, const char *propname, const char *lengthpropname)
Definition: rna_define.c:2791
void RNA_def_function_ui_description(FunctionRNA *func, const char *description)
Definition: rna_define.c:4337
void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *func)
Definition: rna_define.c:2927
void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char *set, const char *item)
Definition: rna_define.c:3251
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier, int type, int subtype)
Definition: rna_define.c:1279
void RNA_def_property_enum_bitflag_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2691
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
Definition: rna_define.c:1517
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:3373
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
Definition: rna_define.c:1047
void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2623
void RNA_def_struct_ui_icon(StructRNA *srna, int icon)
Definition: rna_define.c:1267
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
Definition: rna_define.c:1512
void RNA_def_property_subtype(PropertyRNA *prop, PropertySubType subtype)
Definition: rna_define.c:1563
void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2515
void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double step, int precision)
Definition: rna_define.c:1706
void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2364
void RNA_def_property_boolean_negative_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
Definition: rna_define.c:2348
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_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:2403
char vertexpaint_tool
short ob_mode
char gpencil_weight_tool
char uv_sculpt_tool
char gpencil_vertex_tool
char imagepaint_tool
char gpencil_sculpt_tool
char sculpt_tool
char gpencil_tool
char weightpaint_tool
void * next
Definition: DNA_ID.h:274
struct Image * canvas
void * first
Definition: DNA_listBase.h:47
Definition: BKE_main.h:116
ListBase screens
Definition: BKE_main.h:161
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:52
struct ID * owner_id
Definition: RNA_types.h:50
struct ToolSettings * toolsettings
bool bm_smooth_shading
Definition: BKE_paint.h:496
bool show_mask
Definition: BKE_paint.h:505
struct PBVH * pbvh
Definition: BKE_paint.h:504
struct ImagePaintSettings imapaint
ListBase areabase
void WM_main_add_notifier(unsigned int type, void *reference)
PointerRNA * ptr
Definition: wm_files.c:3157