Blender  V3.3
rna_dynamicpaint.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
7 #include <limits.h>
8 #include <stdlib.h>
9 
10 #include "BKE_dynamicpaint.h"
11 #include "BKE_modifier.h"
12 
13 #include "DNA_dynamicpaint_types.h"
14 #include "DNA_modifier_types.h"
15 #include "DNA_object_force_types.h"
16 #include "DNA_object_types.h"
17 #include "DNA_scene_types.h"
18 
19 #include "RNA_define.h"
20 #include "RNA_enum_types.h"
21 
22 #include "rna_internal.h"
23 
24 #include "WM_types.h"
25 
27  {MOD_DYNAMICPAINT_TYPE_CANVAS, "CANVAS", 0, "Canvas", ""},
28  {MOD_DYNAMICPAINT_TYPE_BRUSH, "BRUSH", 0, "Brush", ""},
29  {0, NULL, 0, NULL, NULL},
30 };
31 
32 #ifdef RNA_RUNTIME
33 
34 # include "BKE_context.h"
35 # include "BKE_particle.h"
36 
37 # include "DEG_depsgraph.h"
38 # include "DEG_depsgraph_build.h"
39 
40 static char *rna_DynamicPaintCanvasSettings_path(const PointerRNA *ptr)
41 {
43  const ModifierData *md = (ModifierData *)settings->pmd;
44  char name_esc[sizeof(md->name) * 2];
45 
46  BLI_str_escape(name_esc, md->name, sizeof(name_esc));
47  return BLI_sprintfN("modifiers[\"%s\"].canvas_settings", name_esc);
48 }
49 
50 static char *rna_DynamicPaintBrushSettings_path(const PointerRNA *ptr)
51 {
53  const ModifierData *md = (ModifierData *)settings->pmd;
54  char name_esc[sizeof(md->name) * 2];
55 
56  BLI_str_escape(name_esc, md->name, sizeof(name_esc));
57  return BLI_sprintfN("modifiers[\"%s\"].brush_settings", name_esc);
58 }
59 
60 static char *rna_DynamicPaintSurface_path(const PointerRNA *ptr)
61 {
63  const ModifierData *md = (ModifierData *)surface->canvas->pmd;
64  char name_esc[sizeof(md->name) * 2];
65  char name_esc_surface[sizeof(surface->name) * 2];
66 
67  BLI_str_escape(name_esc, md->name, sizeof(name_esc));
68  BLI_str_escape(name_esc_surface, surface->name, sizeof(name_esc_surface));
69  return BLI_sprintfN(
70  "modifiers[\"%s\"].canvas_settings.canvas_surfaces[\"%s\"]", name_esc, name_esc_surface);
71 }
72 
73 /*
74  * Surfaces
75  */
76 
77 static void rna_DynamicPaint_redoModifier(Main *UNUSED(bmain),
78  Scene *UNUSED(scene),
79  PointerRNA *ptr)
80 {
82 }
83 
84 static void rna_DynamicPaintSurfaces_updateFrames(Main *UNUSED(bmain),
85  Scene *UNUSED(scene),
86  PointerRNA *ptr)
87 {
89 }
90 
91 static void rna_DynamicPaintSurface_reset(Main *bmain, Scene *scene, PointerRNA *ptr)
92 {
94  rna_DynamicPaint_redoModifier(bmain, scene, ptr);
95 }
96 
97 static void rna_DynamicPaintSurface_initialcolortype(Main *bmain, Scene *scene, PointerRNA *ptr)
98 {
100 
101  surface->init_layername[0] = '\0';
103  rna_DynamicPaint_redoModifier(bmain, scene, ptr);
104 }
105 
106 static void rna_DynamicPaintSurface_uniqueName(Main *UNUSED(bmain),
107  Scene *UNUSED(scene),
108  PointerRNA *ptr)
109 {
111  ((DynamicPaintSurface *)ptr->data)->name);
112 }
113 
114 static void rna_DynamicPaintSurface_changeType(Main *bmain, Scene *scene, PointerRNA *ptr)
115 {
118  rna_DynamicPaintSurface_reset(bmain, scene, ptr);
119 }
120 
121 static void rna_DynamicPaintSurfaces_changeFormat(Main *bmain, Scene *scene, PointerRNA *ptr)
122 {
124 
127  rna_DynamicPaintSurface_reset(bmain, scene, ptr);
128 }
129 
130 static void rna_DynamicPaint_reset_dependency(Main *bmain,
131  Scene *UNUSED(scene),
133 {
135 }
136 
137 static void rna_DynamicPaintSurface_reset_dependency(Main *bmain, Scene *scene, PointerRNA *ptr)
138 {
139  rna_DynamicPaintSurface_reset(bmain, scene, ptr);
140  rna_DynamicPaint_reset_dependency(bmain, scene, ptr);
141 }
142 
143 static PointerRNA rna_PaintSurface_active_get(PointerRNA *ptr)
144 {
147  int id = 0;
148 
149  for (; surface; surface = surface->next) {
150  if (id == canvas->active_sur) {
151  return rna_pointer_inherit_refine(ptr, &RNA_DynamicPaintSurface, surface);
152  }
153  id++;
154  }
155  return rna_pointer_inherit_refine(ptr, &RNA_DynamicPaintSurface, NULL);
156 }
157 
158 static void rna_DynamicPaint_surfaces_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
159 {
161 # if 0
163  iter, (void *)canvas->surfaces, sizeof(PaintSurface), canvas->totsur, 0, 0);
164 # endif
165  rna_iterator_listbase_begin(iter, &canvas->surfaces, NULL);
166 }
167 
168 static int rna_Surface_active_point_index_get(PointerRNA *ptr)
169 {
171  return canvas->active_sur;
172 }
173 
174 static void rna_Surface_active_point_index_set(struct PointerRNA *ptr, int value)
175 {
177  canvas->active_sur = value;
178  return;
179 }
180 
181 static void rna_Surface_active_point_range(
182  PointerRNA *ptr, int *min, int *max, int *UNUSED(softmin), int *UNUSED(softmax))
183 {
185 
186  *min = 0;
187  *max = BLI_listbase_count(&canvas->surfaces) - 1;
188 }
189 
190 /* uvlayer */
191 static void rna_DynamicPaint_uvlayer_set(PointerRNA *ptr, const char *value)
192 {
193  DynamicPaintCanvasSettings *canvas = ((DynamicPaintSurface *)ptr->data)->canvas;
195  int id = 0;
196 
197  for (; surface; surface = surface->next) {
198  if (id == canvas->active_sur) {
200  ptr, value, surface->uvlayer_name, sizeof(surface->uvlayer_name));
201  return;
202  }
203  id++;
204  }
205 }
206 
207 /* is point cache used */
208 static bool rna_DynamicPaint_is_cache_user_get(PointerRNA *ptr)
209 {
211 
212  return (surface->format != MOD_DPAINT_SURFACE_F_IMAGESEQ) ? 1 : 0;
213 }
214 
215 /* Does output layer exist. */
216 static bool rna_DynamicPaint_is_output_exists(DynamicPaintSurface *surface, Object *ob, int index)
217 {
218  return dynamicPaint_outputLayerExists(surface, ob, index);
219 }
220 
221 static const EnumPropertyItem *rna_DynamicPaint_surface_type_itemf(bContext *UNUSED(C),
222  PointerRNA *ptr,
223  PropertyRNA *UNUSED(prop),
224  bool *r_free)
225 {
227 
228  EnumPropertyItem *item = NULL;
229  EnumPropertyItem tmp = {0, "", 0, "", ""};
230  int totitem = 0;
231 
232  /* Paint type - available for all formats */
234  tmp.identifier = "PAINT";
235  tmp.name = "Paint";
236  tmp.icon = ICON_TPAINT_HLT;
237  RNA_enum_item_add(&item, &totitem, &tmp);
238 
239  /* Displace */
241  tmp.value = MOD_DPAINT_SURFACE_T_DISPLACE;
242  tmp.identifier = "DISPLACE";
243  tmp.name = "Displace";
244  tmp.icon = ICON_MOD_DISPLACE;
245  RNA_enum_item_add(&item, &totitem, &tmp);
246  }
247 
248  /* Weight */
249  if (surface->format == MOD_DPAINT_SURFACE_F_VERTEX) {
250  tmp.value = MOD_DPAINT_SURFACE_T_WEIGHT;
251  tmp.identifier = "WEIGHT";
252  tmp.name = "Weight";
253  tmp.icon = ICON_MOD_VERTEX_WEIGHT;
254  RNA_enum_item_add(&item, &totitem, &tmp);
255  }
256 
257  /* Height waves */
258  {
259  tmp.value = MOD_DPAINT_SURFACE_T_WAVE;
260  tmp.identifier = "WAVE";
261  tmp.name = "Waves";
262  tmp.icon = ICON_MOD_WAVE;
263  RNA_enum_item_add(&item, &totitem, &tmp);
264  }
265 
266  RNA_enum_item_end(&item, &totitem);
267  *r_free = true;
268 
269  return item;
270 }
271 
272 #else
273 
274 /* canvas.canvas_surfaces */
276 {
277  StructRNA *srna;
278  PropertyRNA *prop;
279 
280  RNA_def_property_srna(cprop, "DynamicPaintSurfaces");
281  srna = RNA_def_struct(brna, "DynamicPaintSurfaces", NULL);
282  RNA_def_struct_sdna(srna, "DynamicPaintCanvasSettings");
283  RNA_def_struct_ui_text(srna, "Canvas Surfaces", "Collection of Dynamic Paint Canvas surfaces");
284 
285  prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED);
288  "rna_Surface_active_point_index_get",
289  "rna_Surface_active_point_index_set",
290  "rna_Surface_active_point_range");
291  RNA_def_property_ui_text(prop, "Active Point Cache Index", "");
292 
293  prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
294  RNA_def_property_struct_type(prop, "DynamicPaintSurface");
295  RNA_def_property_pointer_funcs(prop, "rna_PaintSurface_active_get", NULL, NULL, NULL);
296  RNA_def_property_ui_text(prop, "Active Surface", "Active Dynamic Paint surface being displayed");
298 }
299 
301 {
302  StructRNA *srna;
303  PropertyRNA *prop;
304  PropertyRNA *parm;
305  FunctionRNA *func;
306 
307  /* Surface format */
308  static const EnumPropertyItem prop_dynamicpaint_surface_format[] = {
309  /*{MOD_DPAINT_SURFACE_F_PTEX, "PTEX", ICON_TEXTURE_SHADED, "Ptex", ""}, */
310  {MOD_DPAINT_SURFACE_F_VERTEX, "VERTEX", ICON_OUTLINER_DATA_MESH, "Vertex", ""},
311  {MOD_DPAINT_SURFACE_F_IMAGESEQ, "IMAGE", ICON_FILE_IMAGE, "Image Sequence", ""},
312  {0, NULL, 0, NULL, NULL},
313  };
314 
315  /* Surface type - generated dynamically based on surface format */
316  static const EnumPropertyItem prop_dynamicpaint_surface_type[] = {
317  {MOD_DPAINT_SURFACE_T_PAINT, "PAINT", 0, "Paint", ""},
318  {0, NULL, 0, NULL, NULL},
319  };
320 
321  /* Initial color setting */
322  static const EnumPropertyItem prop_dynamicpaint_init_color_type[] = {
323  {MOD_DPAINT_INITIAL_NONE, "NONE", 0, "None", ""},
324  {MOD_DPAINT_INITIAL_COLOR, "COLOR", ICON_COLOR, "Color", ""},
325  {MOD_DPAINT_INITIAL_TEXTURE, "TEXTURE", ICON_TEXTURE, "UV Texture", ""},
326  {MOD_DPAINT_INITIAL_VERTEXCOLOR, "VERTEX_COLOR", ICON_GROUP_VCOL, "Vertex Color", ""},
327  {0, NULL, 0, NULL, NULL},
328  };
329 
330  /* Effect type
331  * Only used by UI to view per effect settings. */
332  static const EnumPropertyItem prop_dynamicpaint_effecttype[] = {
333  {1, "SPREAD", 0, "Spread", ""},
334  {2, "DRIP", 0, "Drip", ""},
335  {3, "SHRINK", 0, "Shrink", ""},
336  {0, NULL, 0, NULL, NULL},
337  };
338 
339  /* Displace-map file format. */
340  static const EnumPropertyItem prop_dynamicpaint_image_fileformat[] = {
341  {MOD_DPAINT_IMGFORMAT_PNG, "PNG", 0, "PNG", ""},
342 # ifdef WITH_OPENEXR
343  {MOD_DPAINT_IMGFORMAT_OPENEXR, "OPENEXR", 0, "OpenEXR", ""},
344 # endif
345  {0, NULL, 0, NULL, NULL},
346  };
347 
348  /* Displace-map type. */
349  static const EnumPropertyItem prop_dynamicpaint_displace_type[] = {
350  {MOD_DPAINT_DISP_DISPLACE, "DISPLACE", 0, "Displacement", ""},
351  {MOD_DPAINT_DISP_DEPTH, "DEPTH", 0, "Depth", ""},
352  {0, NULL, 0, NULL, NULL},
353  };
354 
355  /* Surface */
356  srna = RNA_def_struct(brna, "DynamicPaintSurface", NULL);
357  RNA_def_struct_sdna(srna, "DynamicPaintSurface");
358  RNA_def_struct_ui_text(srna, "Paint Surface", "A canvas surface layer");
359  RNA_def_struct_path_func(srna, "rna_DynamicPaintSurface_path");
360 
361  prop = RNA_def_property(srna, "surface_format", PROP_ENUM, PROP_NONE);
363  RNA_def_property_enum_sdna(prop, NULL, "format");
364  RNA_def_property_enum_items(prop, prop_dynamicpaint_surface_format);
365  RNA_def_property_ui_text(prop, "Format", "Surface Format");
366  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaintSurfaces_changeFormat");
367 
368  prop = RNA_def_property(srna, "surface_type", PROP_ENUM, PROP_NONE);
370  RNA_def_property_enum_sdna(prop, NULL, "type");
371  RNA_def_property_enum_items(prop, prop_dynamicpaint_surface_type);
372  RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_DynamicPaint_surface_type_itemf");
373  RNA_def_property_ui_text(prop, "Surface Type", "Surface Type");
374  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaintSurface_changeType");
375 
376  prop = RNA_def_property(srna, "is_active", PROP_BOOLEAN, PROP_NONE);
378  RNA_def_property_ui_text(prop, "Is Active", "Toggle whether surface is processed or ignored");
379  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
380 
381  prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
382  RNA_def_property_ui_text(prop, "Name", "Surface name");
383  RNA_def_property_update(prop, NC_OBJECT, "rna_DynamicPaintSurface_uniqueName");
384  RNA_def_struct_name_property(srna, prop);
385 
386  prop = RNA_def_property(srna, "brush_collection", PROP_POINTER, PROP_NONE);
387  RNA_def_property_struct_type(prop, "Collection");
388  RNA_def_property_pointer_sdna(prop, NULL, "brush_group");
391  prop, "Brush Collection", "Only use brush objects from this collection");
393  prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaintSurface_reset_dependency");
394 
395  /*
396  * Paint, wet and displace
397  */
398 
399  prop = RNA_def_property(srna, "use_dissolve", PROP_BOOLEAN, PROP_NONE);
401  RNA_def_property_ui_text(prop, "Dissolve", "Enable to make surface changes disappear over time");
402 
403  prop = RNA_def_property(srna, "dissolve_speed", PROP_INT, PROP_TIME);
404  RNA_def_property_int_sdna(prop, NULL, "diss_speed");
405  RNA_def_property_range(prop, 1.0, 10000.0);
406  RNA_def_property_ui_range(prop, 1.0, 10000.0, 5, -1);
408  prop, "Dissolve Time", "Approximately in how many frames should dissolve happen");
409 
410  prop = RNA_def_property(srna, "use_drying", PROP_BOOLEAN, PROP_NONE);
412  RNA_def_property_ui_text(prop, "Dry", "Enable to make surface wetness dry over time");
413 
414  prop = RNA_def_property(srna, "dry_speed", PROP_INT, PROP_TIME);
415  RNA_def_property_range(prop, 1.0, 10000.0);
416  RNA_def_property_ui_range(prop, 1.0, 10000.0, 5, -1);
418  prop, "Dry Time", "Approximately in how many frames should drying happen");
419 
420  /*
421  * Simulation settings
422  */
423  prop = RNA_def_property(srna, "image_resolution", PROP_INT, PROP_NONE);
425  RNA_def_property_range(prop, 16.0, 4096.0);
426  RNA_def_property_ui_range(prop, 16.0, 4096.0, 1, -1);
427  RNA_def_property_ui_text(prop, "Resolution", "Output image resolution");
428 
429  prop = RNA_def_property(srna, "uv_layer", PROP_STRING, PROP_NONE);
430  RNA_def_property_string_sdna(prop, NULL, "uvlayer_name");
431  RNA_def_property_ui_text(prop, "UV Map", "UV map name");
432  RNA_def_property_string_funcs(prop, NULL, NULL, "rna_DynamicPaint_uvlayer_set");
433 
434  prop = RNA_def_property(srna, "frame_start", PROP_INT, PROP_NONE);
435  RNA_def_property_int_sdna(prop, NULL, "start_frame");
437  RNA_def_property_range(prop, 1.0, MAXFRAMEF);
438  RNA_def_property_ui_range(prop, 1.0, 9999, 1, -1);
439  RNA_def_property_ui_text(prop, "Start Frame", "Simulation start frame");
440  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaintSurfaces_updateFrames");
441 
442  prop = RNA_def_property(srna, "frame_end", PROP_INT, PROP_NONE);
443  RNA_def_property_int_sdna(prop, NULL, "end_frame");
445  RNA_def_property_range(prop, 1.0, MAXFRAMEF);
446  RNA_def_property_ui_range(prop, 1.0, 9999.0, 1, -1);
447  RNA_def_property_ui_text(prop, "End Frame", "Simulation end frame");
448  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaintSurfaces_updateFrames");
449 
450  prop = RNA_def_property(srna, "frame_substeps", PROP_INT, PROP_NONE);
451  RNA_def_property_int_sdna(prop, NULL, "substeps");
452  RNA_def_property_range(prop, 0.0, 20.0);
453  RNA_def_property_ui_range(prop, 0.0, 10, 1, -1);
455  prop, "Sub-Steps", "Do extra frames between scene frames to ensure smooth motion");
456 
457  prop = RNA_def_property(srna, "use_antialiasing", PROP_BOOLEAN, PROP_NONE);
460  RNA_def_property_ui_text(prop, "Anti-Aliasing", "Use 5x multisampling to smooth paint edges");
461  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaintSurface_reset");
462 
463  prop = RNA_def_property(srna, "brush_influence_scale", PROP_FLOAT, PROP_FACTOR);
464  RNA_def_property_float_sdna(prop, NULL, "influence_scale");
465  RNA_def_property_range(prop, 0.0, 1.0);
466  RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 2);
468  prop, "Influence Scale", "Adjust influence brush objects have on this surface");
469  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
470 
471  prop = RNA_def_property(srna, "brush_radius_scale", PROP_FLOAT, PROP_FACTOR);
472  RNA_def_property_float_sdna(prop, NULL, "radius_scale");
473  RNA_def_property_range(prop, 0.0, 10.0);
474  RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 2);
476  prop, "Radius Scale", "Adjust radius of proximity brushes or particles for this surface");
477  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
478 
479  /*
480  * Initial Color
481  */
482 
483  prop = RNA_def_property(srna, "init_color_type", PROP_ENUM, PROP_NONE);
485  RNA_def_property_enum_items(prop, prop_dynamicpaint_init_color_type);
486  RNA_def_property_ui_text(prop, "Initial Color", "");
489  "rna_DynamicPaintSurface_initialcolortype");
490 
491  prop = RNA_def_property(srna, "init_color", PROP_FLOAT, PROP_COLOR_GAMMA);
493  RNA_def_property_array(prop, 4);
494  RNA_def_property_ui_text(prop, "Color", "Initial color of the surface");
496  prop, NC_MATERIAL | ND_SHADING_DRAW | ND_MODIFIER, "rna_DynamicPaintSurface_reset");
497 
498  prop = RNA_def_property(srna, "init_texture", PROP_POINTER, PROP_NONE);
500  RNA_def_property_ui_text(prop, "Texture", "");
502  prop, NC_MATERIAL | ND_SHADING_DRAW | ND_MODIFIER, "rna_DynamicPaintSurface_reset");
503 
504  prop = RNA_def_property(srna, "init_layername", PROP_STRING, PROP_NONE);
505  RNA_def_property_ui_text(prop, "Data Layer", "");
507  prop, NC_MATERIAL | ND_SHADING_DRAW | ND_MODIFIER, "rna_DynamicPaintSurface_reset");
508 
509  /*
510  * Effect Settings
511  */
512  prop = RNA_def_property(srna, "effect_ui", PROP_ENUM, PROP_NONE);
514  RNA_def_property_enum_items(prop, prop_dynamicpaint_effecttype);
515  RNA_def_property_ui_text(prop, "Effect Type", "");
516 
517  prop = RNA_def_property(srna, "use_dry_log", PROP_BOOLEAN, PROP_NONE);
520  prop, "Slow", "Use logarithmic drying (makes high values to dry faster than low values)");
521 
522  prop = RNA_def_property(srna, "use_dissolve_log", PROP_BOOLEAN, PROP_NONE);
525  prop, "Slow", "Use logarithmic dissolve (makes high values to fade faster than low values)");
526 
527  prop = RNA_def_property(srna, "use_spread", PROP_BOOLEAN, PROP_NONE);
531  prop, "Use Spread", "Process spread effect (spread wet paint around surface)");
532  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaintSurface_reset");
533 
534  prop = RNA_def_property(srna, "spread_speed", PROP_FLOAT, PROP_NONE);
535  RNA_def_property_float_sdna(prop, NULL, "spread_speed");
536  RNA_def_property_range(prop, 0.001, 10.0);
537  RNA_def_property_ui_range(prop, 0.01, 5.0, 1, 2);
539  prop, "Spread Speed", "How fast spread effect moves on the canvas surface");
540 
541  prop = RNA_def_property(srna, "color_dry_threshold", PROP_FLOAT, PROP_FACTOR);
542  RNA_def_property_float_sdna(prop, NULL, "color_dry_threshold");
543  RNA_def_property_range(prop, 0.0, 1.0);
544  RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 2);
546  prop, "Color Dry", "The wetness level when colors start to shift to the background");
547 
548  prop = RNA_def_property(srna, "color_spread_speed", PROP_FLOAT, PROP_NONE);
549  RNA_def_property_float_sdna(prop, NULL, "color_spread_speed");
550  RNA_def_property_range(prop, 0.0, 2.0);
551  RNA_def_property_ui_range(prop, 0.0, 2.0, 1, 2);
552  RNA_def_property_ui_text(prop, "Color Spread", "How fast colors get mixed within wet paint");
553 
554  prop = RNA_def_property(srna, "use_drip", PROP_BOOLEAN, PROP_NONE);
558  prop, "Use Drip", "Process drip effect (drip wet paint to gravity direction)");
559  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaintSurface_reset");
560 
561  prop = RNA_def_property(srna, "use_shrink", PROP_BOOLEAN, PROP_NONE);
564  RNA_def_property_ui_text(prop, "Use Shrink", "Process shrink effect (shrink paint areas)");
565  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaintSurface_reset");
566 
567  prop = RNA_def_property(srna, "shrink_speed", PROP_FLOAT, PROP_NONE);
568  RNA_def_property_float_sdna(prop, NULL, "shrink_speed");
569  RNA_def_property_range(prop, 0.001, 10.0);
570  RNA_def_property_ui_range(prop, 0.01, 5.0, 1, 2);
572  prop, "Shrink Speed", "How fast shrink effect moves on the canvas surface");
573 
574  prop = RNA_def_property(srna, "effector_weights", PROP_POINTER, PROP_NONE);
575  RNA_def_property_struct_type(prop, "EffectorWeights");
578  RNA_def_property_ui_text(prop, "Effector Weights", "");
579 
580  prop = RNA_def_property(srna, "drip_velocity", PROP_FLOAT, PROP_NONE);
581  RNA_def_property_float_sdna(prop, NULL, "drip_vel");
582  RNA_def_property_range(prop, -200.0f, 200.0f);
583  RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
584  RNA_def_property_ui_text(prop, "Velocity", "How much surface velocity affects dripping");
585 
586  prop = RNA_def_property(srna, "drip_acceleration", PROP_FLOAT, PROP_NONE);
587  RNA_def_property_float_sdna(prop, NULL, "drip_acc");
588  RNA_def_property_range(prop, -200.0f, 200.0f);
589  RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
590  RNA_def_property_ui_text(prop, "Acceleration", "How much surface acceleration affects dripping");
591 
592  /*
593  * Output settings
594  */
595  prop = RNA_def_property(srna, "use_premultiply", PROP_BOOLEAN, PROP_NONE);
599  prop, "Premultiply Alpha", "Multiply color by alpha (recommended for Blender input)");
600 
601  prop = RNA_def_property(srna, "image_output_path", PROP_STRING, PROP_DIRPATH);
602  RNA_def_property_string_sdna(prop, NULL, "image_output_path");
603  RNA_def_property_ui_text(prop, "Output Path", "Directory to save the textures");
604 
605  /* output for primary surface data */
606  prop = RNA_def_property(srna, "output_name_a", PROP_STRING, PROP_NONE);
607  RNA_def_property_string_sdna(prop, NULL, "output_name");
608  RNA_def_property_ui_text(prop, "Output Name", "Name used to save output from this surface");
609 
610  prop = RNA_def_property(srna, "use_output_a", PROP_BOOLEAN, PROP_NONE);
612  RNA_def_property_ui_text(prop, "Use Output", "Save this output layer");
613 
614  /* Output for secondary surface data. */
615  prop = RNA_def_property(srna, "output_name_b", PROP_STRING, PROP_NONE);
616  RNA_def_property_string_sdna(prop, NULL, "output_name2");
617  RNA_def_property_ui_text(prop, "Output Name", "Name used to save output from this surface");
618 
619  prop = RNA_def_property(srna, "use_output_b", PROP_BOOLEAN, PROP_NONE);
621  RNA_def_property_ui_text(prop, "Use Output", "Save this output layer");
622 
623  /* to check if output name exists */
624  func = RNA_def_function(srna, "output_exists", "rna_DynamicPaint_is_output_exists");
625  RNA_def_function_ui_description(func, "Checks if surface output layer of given name exists");
626  parm = RNA_def_pointer(func, "object", "Object", "", "");
628  parm = RNA_def_int(func, "index", 0, 0, 1, "Index", "", 0, 1);
630  /* return type */
631  parm = RNA_def_boolean(func, "exists", 0, "", "");
632  RNA_def_function_return(func, parm);
633 
634  prop = RNA_def_property(srna, "depth_clamp", PROP_FLOAT, PROP_NONE);
636  RNA_def_property_range(prop, 0.00, 50.0);
637  RNA_def_property_ui_range(prop, 0.00, 5.0, 1, 2);
639  prop,
640  "Max Displace",
641  "Maximum level of depth intersection in object space (use 0.0 to disable)");
642  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
643 
644  prop = RNA_def_property(srna, "displace_factor", PROP_FLOAT, PROP_NONE);
645  RNA_def_property_float_sdna(prop, NULL, "disp_factor");
647  RNA_def_property_range(prop, -50.0, 50.0);
648  RNA_def_property_ui_range(prop, -5.0, 5.0, 1, 2);
650  prop, "Displace Factor", "Strength of displace when applied to the mesh");
651  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
652 
653  prop = RNA_def_property(srna, "image_fileformat", PROP_ENUM, PROP_NONE);
655  RNA_def_property_enum_items(prop, prop_dynamicpaint_image_fileformat);
656  RNA_def_property_ui_text(prop, "File Format", "");
657 
658  prop = RNA_def_property(srna, "displace_type", PROP_ENUM, PROP_NONE);
659  RNA_def_property_enum_sdna(prop, NULL, "disp_type");
661  RNA_def_property_enum_items(prop, prop_dynamicpaint_displace_type);
662  RNA_def_property_ui_text(prop, "Data Type", "");
663 
664  prop = RNA_def_property(srna, "use_incremental_displace", PROP_BOOLEAN, PROP_NONE);
668  prop, "Incremental", "New displace is added cumulatively on top of existing");
669  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaintSurface_reset");
670 
671  /* wave simulator settings */
672  prop = RNA_def_property(srna, "wave_damping", PROP_FLOAT, PROP_NONE);
673  RNA_def_property_range(prop, 0.0, 1.0);
674  RNA_def_property_ui_range(prop, 0.01, 1.0, 1, 2);
675  RNA_def_property_ui_text(prop, "Damping", "Wave damping factor");
676 
677  prop = RNA_def_property(srna, "wave_speed", PROP_FLOAT, PROP_NONE);
678  RNA_def_property_range(prop, 0.01, 5.0);
679  RNA_def_property_ui_range(prop, 0.20, 4.0, 1, 2);
680  RNA_def_property_ui_text(prop, "Speed", "Wave propagation speed");
681 
682  prop = RNA_def_property(srna, "wave_timescale", PROP_FLOAT, PROP_NONE);
683  RNA_def_property_range(prop, 0.01, 3.0);
684  RNA_def_property_ui_range(prop, 0.01, 1.5, 1, 2);
685  RNA_def_property_ui_text(prop, "Timescale", "Wave time scaling factor");
686 
687  prop = RNA_def_property(srna, "wave_spring", PROP_FLOAT, PROP_NONE);
688  RNA_def_property_range(prop, 0.0, 1.0);
689  RNA_def_property_ui_range(prop, 0.01, 1.0, 1, 2);
690  RNA_def_property_ui_text(prop, "Spring", "Spring force that pulls water level back to zero");
691 
692  prop = RNA_def_property(srna, "wave_smoothness", PROP_FLOAT, PROP_NONE);
693  RNA_def_property_range(prop, 0.0, 10.0);
694  RNA_def_property_ui_range(prop, 0.1, 5.0, 1, 2);
696  "Smoothness",
697  "Limit maximum steepness of wave slope between simulation points "
698  "(use higher values for smoother waves at expense of reduced detail)");
699 
700  prop = RNA_def_property(srna, "use_wave_open_border", PROP_BOOLEAN, PROP_NONE);
702  RNA_def_property_ui_text(prop, "Open Borders", "Pass waves through mesh edges");
703 
704  /* cache */
705  prop = RNA_def_property(srna, "point_cache", PROP_POINTER, PROP_NONE);
707  RNA_def_property_pointer_sdna(prop, NULL, "pointcache");
708  RNA_def_property_struct_type(prop, "PointCache");
709  RNA_def_property_ui_text(prop, "Point Cache", "");
710 
711  /* is cache used */
712  prop = RNA_def_property(srna, "is_cache_user", PROP_BOOLEAN, PROP_NONE);
713  RNA_def_property_boolean_funcs(prop, "rna_DynamicPaint_is_cache_user_get", NULL);
714  RNA_def_property_ui_text(prop, "Use Cache", "");
716 }
717 
719 {
720  StructRNA *srna;
721  PropertyRNA *prop;
722 
723  srna = RNA_def_struct(brna, "DynamicPaintCanvasSettings", NULL);
724  RNA_def_struct_ui_text(srna, "Canvas Settings", "Dynamic Paint canvas settings");
725  RNA_def_struct_sdna(srna, "DynamicPaintCanvasSettings");
726  RNA_def_struct_path_func(srna, "rna_DynamicPaintCanvasSettings_path");
727 
728  /*
729  * Surface Slots
730  */
731  prop = RNA_def_property(srna, "canvas_surfaces", PROP_COLLECTION, PROP_NONE);
733  "rna_DynamicPaint_surfaces_begin",
734  "rna_iterator_listbase_next",
735  "rna_iterator_listbase_end",
736  "rna_iterator_listbase_get",
737  NULL,
738  NULL,
739  NULL,
740  NULL);
741  RNA_def_property_struct_type(prop, "DynamicPaintSurface");
742  RNA_def_property_ui_text(prop, "Paint Surface List", "Paint surface list");
743  rna_def_canvas_surfaces(brna, prop);
744 }
745 
747 {
748  StructRNA *srna;
749  PropertyRNA *prop;
750 
751  /* paint collision type */
752  static const EnumPropertyItem prop_dynamicpaint_collisiontype[] = {
753  {MOD_DPAINT_COL_PSYS, "PARTICLE_SYSTEM", ICON_PARTICLES, "Particle System", ""},
754  {MOD_DPAINT_COL_POINT, "POINT", ICON_EMPTY_AXIS, "Object Center", ""},
755  {MOD_DPAINT_COL_DIST, "DISTANCE", ICON_DRIVER_DISTANCE, "Proximity", ""},
756  {MOD_DPAINT_COL_VOLDIST, "VOLUME_DISTANCE", ICON_META_CUBE, "Mesh Volume + Proximity", ""},
757  {MOD_DPAINT_COL_VOLUME, "VOLUME", ICON_MESH_CUBE, "Mesh Volume", ""},
758  {0, NULL, 0, NULL, NULL},
759  };
760 
761  static const EnumPropertyItem prop_dynamicpaint_prox_falloff[] = {
762  {MOD_DPAINT_PRFALL_SMOOTH, "SMOOTH", ICON_SPHERECURVE, "Smooth", ""},
763  {MOD_DPAINT_PRFALL_CONSTANT, "CONSTANT", ICON_NOCURVE, "Constant", ""},
764  {MOD_DPAINT_PRFALL_RAMP, "RAMP", ICON_COLOR, "Color Ramp", ""},
765  {0, NULL, 0, NULL, NULL},
766  };
767 
768  static const EnumPropertyItem prop_dynamicpaint_brush_wave_type[] = {
769  {MOD_DPAINT_WAVEB_CHANGE, "CHANGE", 0, "Depth Change", ""},
770  {MOD_DPAINT_WAVEB_DEPTH, "DEPTH", 0, "Obstacle", ""},
771  {MOD_DPAINT_WAVEB_FORCE, "FORCE", 0, "Force", ""},
772  {MOD_DPAINT_WAVEB_REFLECT, "REFLECT", 0, "Reflect Only", ""},
773  {0, NULL, 0, NULL, NULL},
774  };
775 
776  static const EnumPropertyItem prop_dynamicpaint_brush_ray_dir[] = {
777  {MOD_DPAINT_RAY_CANVAS, "CANVAS", 0, "Canvas Normal", ""},
778  {MOD_DPAINT_RAY_BRUSH_AVG, "BRUSH", 0, "Brush Normal", ""},
779  {MOD_DPAINT_RAY_ZPLUS, "Z_AXIS", 0, "Z-Axis", ""},
780  {0, NULL, 0, NULL, NULL},
781  };
782 
783  srna = RNA_def_struct(brna, "DynamicPaintBrushSettings", NULL);
784  RNA_def_struct_ui_text(srna, "Brush Settings", "Brush settings");
785  RNA_def_struct_sdna(srna, "DynamicPaintBrushSettings");
786  RNA_def_struct_path_func(srna, "rna_DynamicPaintBrushSettings_path");
787 
788  /*
789  * Paint
790  */
791  prop = RNA_def_property(srna, "paint_color", PROP_FLOAT, PROP_COLOR_GAMMA);
792  RNA_def_property_float_sdna(prop, NULL, "r");
793  RNA_def_property_array(prop, 3);
794  RNA_def_property_ui_text(prop, "Paint Color", "Color of the paint");
795  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
796 
797  prop = RNA_def_property(srna, "paint_alpha", PROP_FLOAT, PROP_NONE);
798  RNA_def_property_float_sdna(prop, NULL, "alpha");
799  RNA_def_property_range(prop, 0.0, 1.0);
800  RNA_def_property_ui_range(prop, 0.0, 1.0, 5, 2);
801  RNA_def_property_ui_text(prop, "Paint Alpha", "Paint alpha");
802  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
803 
804  prop = RNA_def_property(srna, "use_absolute_alpha", PROP_BOOLEAN, PROP_NONE);
807  prop, "Absolute Alpha", "Only increase alpha value if paint alpha is higher than existing");
808 
809  prop = RNA_def_property(srna, "paint_wetness", PROP_FLOAT, PROP_NONE);
810  RNA_def_property_float_sdna(prop, NULL, "wetness");
811  RNA_def_property_range(prop, 0.0, 1.0);
812  RNA_def_property_ui_range(prop, 0.0, 1.0, 5, 2);
814  prop,
815  "Paint Wetness",
816  "Paint wetness, visible in wetmap (some effects only affect wet paint)");
817  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
818 
819  prop = RNA_def_property(srna, "use_paint_erase", PROP_BOOLEAN, PROP_NONE);
821  RNA_def_property_ui_text(prop, "Erase Paint", "Erase / remove paint instead of adding it");
822  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
823 
824  prop = RNA_def_property(srna, "wave_type", PROP_ENUM, PROP_NONE);
826  RNA_def_property_enum_items(prop, prop_dynamicpaint_brush_wave_type);
827  RNA_def_property_ui_text(prop, "Wave Type", "");
828 
829  prop = RNA_def_property(srna, "wave_factor", PROP_FLOAT, PROP_NONE);
830  RNA_def_property_range(prop, -2.0, 2.0);
831  RNA_def_property_ui_range(prop, -1.0, 1.0, 5, 2);
832  RNA_def_property_ui_text(prop, "Factor", "Multiplier for wave influence of this brush");
833 
834  prop = RNA_def_property(srna, "wave_clamp", PROP_FLOAT, PROP_NONE);
835  RNA_def_property_range(prop, 0.00, 50.0);
836  RNA_def_property_ui_range(prop, 0.00, 5.0, 1, 2);
838  prop,
839  "Clamp Waves",
840  "Maximum level of surface intersection used to influence waves (use 0.0 to disable)");
841 
842  prop = RNA_def_property(srna, "use_smudge", PROP_BOOLEAN, PROP_NONE);
845  prop, "Do Smudge", "Make this brush to smudge existing paint as it moves");
846 
847  prop = RNA_def_property(srna, "smudge_strength", PROP_FLOAT, PROP_NONE);
848  RNA_def_property_range(prop, 0.0, 1.0);
849  RNA_def_property_ui_range(prop, 0.0, 1.0, 5, 2);
850  RNA_def_property_ui_text(prop, "Smudge Strength", "Smudge effect strength");
851 
852  prop = RNA_def_property(srna, "velocity_max", PROP_FLOAT, PROP_NONE);
853  RNA_def_property_float_sdna(prop, NULL, "max_velocity");
854  RNA_def_property_range(prop, 0.0001, 10.0);
855  RNA_def_property_ui_range(prop, 0.1, 2.0, 5, 2);
857  prop, "Max Velocity", "Velocity considered as maximum influence (Blender units per frame)");
858 
859  prop = RNA_def_property(srna, "use_velocity_alpha", PROP_BOOLEAN, PROP_NONE);
862  prop, "Multiply Alpha", "Multiply brush influence by velocity color ramp alpha");
863  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
864 
865  prop = RNA_def_property(srna, "use_velocity_depth", PROP_BOOLEAN, PROP_NONE);
868  prop,
869  "Multiply Depth",
870  "Multiply brush intersection depth (displace, waves) by velocity ramp alpha");
871  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
872 
873  prop = RNA_def_property(srna, "use_velocity_color", PROP_BOOLEAN, PROP_NONE);
875  RNA_def_property_ui_text(prop, "Replace Color", "Replace brush color by velocity color ramp");
876  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
877 
878  /*
879  * Paint Area / Collision
880  */
881  prop = RNA_def_property(srna, "paint_source", PROP_ENUM, PROP_NONE);
883  RNA_def_property_enum_sdna(prop, NULL, "collision");
884  RNA_def_property_enum_items(prop, prop_dynamicpaint_collisiontype);
885  RNA_def_property_ui_text(prop, "Paint Source", "");
886  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
887 
888  prop = RNA_def_property(srna, "paint_distance", PROP_FLOAT, PROP_NONE);
889  RNA_def_property_float_sdna(prop, NULL, "paint_distance");
890  RNA_def_property_range(prop, 0.0, 500.0);
891  RNA_def_property_ui_range(prop, 0.0, 500.0, 10, 3);
893  prop, "Proximity Distance", "Maximum distance from brush to mesh surface to affect paint");
894  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
895 
896  prop = RNA_def_property(srna, "use_proximity_ramp_alpha", PROP_BOOLEAN, PROP_NONE);
898  RNA_def_property_ui_text(prop, "Only Use Alpha", "Only read color ramp alpha");
899  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
900 
901  prop = RNA_def_property(srna, "proximity_falloff", PROP_ENUM, PROP_NONE);
903  RNA_def_property_enum_sdna(prop, NULL, "proximity_falloff");
904  RNA_def_property_enum_items(prop, prop_dynamicpaint_prox_falloff);
905  RNA_def_property_ui_text(prop, "Falloff", "Proximity falloff type");
906  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
907 
908  prop = RNA_def_property(srna, "use_proximity_project", PROP_BOOLEAN, PROP_NONE);
911  prop,
912  "Project",
913  "Brush is projected to canvas from defined direction within brush proximity");
914  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
915 
916  prop = RNA_def_property(srna, "ray_direction", PROP_ENUM, PROP_NONE);
917  RNA_def_property_enum_sdna(prop, NULL, "ray_dir");
918  RNA_def_property_enum_items(prop, prop_dynamicpaint_brush_ray_dir);
920  prop,
921  "Ray Direction",
922  "Ray direction to use for projection (if brush object is located in that direction "
923  "it's painted)");
924  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
925 
926  prop = RNA_def_property(srna, "invert_proximity", PROP_BOOLEAN, PROP_NONE);
929  prop, "Inner Proximity", "Proximity falloff is applied inside the volume");
930  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
931 
932  prop = RNA_def_property(srna, "use_negative_volume", PROP_BOOLEAN, PROP_NONE);
934  RNA_def_property_ui_text(prop, "Negate Volume", "Negate influence inside the volume");
935  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
936 
937  /*
938  * Particle
939  */
940  prop = RNA_def_property(srna, "particle_system", PROP_POINTER, PROP_NONE);
941  RNA_def_property_pointer_sdna(prop, NULL, "psys");
942  RNA_def_property_struct_type(prop, "ParticleSystem");
944  RNA_def_property_ui_text(prop, "Particle Systems", "The particle system to paint with");
945  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_reset_dependency");
946 
947  prop = RNA_def_property(srna, "use_particle_radius", PROP_BOOLEAN, PROP_NONE);
949  RNA_def_property_ui_text(prop, "Use Particle Radius", "Use radius from particle settings");
950  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
951 
952  prop = RNA_def_property(srna, "solid_radius", PROP_FLOAT, PROP_NONE);
953  RNA_def_property_float_sdna(prop, NULL, "particle_radius");
954  RNA_def_property_range(prop, 0.01, 10.0);
955  RNA_def_property_ui_range(prop, 0.01, 2.0, 5, 3);
956  RNA_def_property_ui_text(prop, "Solid Radius", "Radius that will be painted solid");
957  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
958 
959  prop = RNA_def_property(srna, "smooth_radius", PROP_FLOAT, PROP_NONE);
960  RNA_def_property_float_sdna(prop, NULL, "particle_smooth");
961  RNA_def_property_range(prop, 0.0, 10.0);
962  RNA_def_property_ui_range(prop, 0.0, 1.0, 5, -1);
963  RNA_def_property_ui_text(prop, "Smooth Radius", "Smooth falloff added after solid radius");
964  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
965 
966  /*
967  * Color ramps
968  */
969  prop = RNA_def_property(srna, "paint_ramp", PROP_POINTER, PROP_NONE);
970  RNA_def_property_pointer_sdna(prop, NULL, "paint_ramp");
971  RNA_def_property_struct_type(prop, "ColorRamp");
973  prop, "Paint Color Ramp", "Color ramp used to define proximity falloff");
974  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
975 
976  prop = RNA_def_property(srna, "velocity_ramp", PROP_POINTER, PROP_NONE);
977  RNA_def_property_pointer_sdna(prop, NULL, "vel_ramp");
978  RNA_def_property_struct_type(prop, "ColorRamp");
980  prop, "Velocity Color Ramp", "Color ramp used to define brush velocity effect");
981  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
982 }
983 
985 {
989 }
990 
991 #endif
bool dynamicPaint_outputLayerExists(struct DynamicPaintSurface *surface, struct Object *ob, int output)
Definition: dynamicpaint.c:322
void dynamicPaintSurface_updateType(struct DynamicPaintSurface *surface)
Definition: dynamicpaint.c:409
void dynamicPaintSurface_setUniqueName(struct DynamicPaintSurface *surface, const char *basename)
Definition: dynamicpaint.c:401
bool dynamicPaint_resetSurface(const struct Scene *scene, struct DynamicPaintSurface *surface)
void dynamicPaint_clearSurface(const struct Scene *scene, struct DynamicPaintSurface *surface)
void dynamicPaint_cacheUpdateFrames(struct DynamicPaintSurface *surface)
int BLI_listbase_count(const struct ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
size_t size_t char * BLI_sprintfN(const char *__restrict format,...) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC ATTR_PRINTF_FORMAT(1
size_t size_t char size_t BLI_str_escape(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL()
Definition: string.c:250
#define UNUSED(x)
#define ELEM(...)
void DEG_id_tag_update(struct ID *id, int flag)
void DEG_relations_tag_update(struct Main *bmain)
@ ID_RECALC_GEOMETRY
Definition: DNA_ID.h:791
@ MOD_DPAINT_INITIAL_NONE
@ MOD_DPAINT_INITIAL_VERTEXCOLOR
@ MOD_DPAINT_INITIAL_COLOR
@ MOD_DPAINT_INITIAL_TEXTURE
@ MOD_DPAINT_SURFACE_T_WEIGHT
@ MOD_DPAINT_SURFACE_T_PAINT
@ MOD_DPAINT_SURFACE_T_DISPLACE
@ MOD_DPAINT_SURFACE_T_WAVE
@ MOD_DPAINT_RAY_BRUSH_AVG
@ MOD_DPAINT_RAY_CANVAS
@ MOD_DPAINT_RAY_ZPLUS
@ MOD_DPAINT_COL_DIST
@ MOD_DPAINT_COL_VOLDIST
@ MOD_DPAINT_COL_POINT
@ MOD_DPAINT_COL_VOLUME
@ MOD_DPAINT_COL_PSYS
@ MOD_DPAINT_ACTIVE
@ MOD_DPAINT_OUT2
@ MOD_DPAINT_USE_DRYING
@ MOD_DPAINT_ANTIALIAS
@ MOD_DPAINT_WAVE_OPEN_BORDERS
@ MOD_DPAINT_DISP_INCREMENTAL
@ MOD_DPAINT_OUT1
@ MOD_DPAINT_DISSOLVE
@ MOD_DPAINT_MULALPHA
@ MOD_DPAINT_DISSOLVE_LOG
@ MOD_DPAINT_DRY_LOG
@ MOD_DPAINT_PRFALL_CONSTANT
@ MOD_DPAINT_PRFALL_SMOOTH
@ MOD_DPAINT_PRFALL_RAMP
@ MOD_DPAINT_DISP_DEPTH
@ MOD_DPAINT_DISP_DISPLACE
@ MOD_DPAINT_PROX_PROJECT
@ MOD_DPAINT_ABS_ALPHA
@ MOD_DPAINT_RAMP_ALPHA
@ MOD_DPAINT_INVERSE_PROX
@ MOD_DPAINT_VELOCITY_ALPHA
@ MOD_DPAINT_VELOCITY_DEPTH
@ MOD_DPAINT_ERASE
@ MOD_DPAINT_VELOCITY_COLOR
@ MOD_DPAINT_DO_SMUDGE
@ MOD_DPAINT_PART_RAD
@ MOD_DPAINT_NEGATE_VOLUME
@ MOD_DPAINT_EFFECT_DO_DRIP
@ MOD_DPAINT_EFFECT_DO_SPREAD
@ MOD_DPAINT_EFFECT_DO_SHRINK
@ MOD_DPAINT_WAVEB_REFLECT
@ MOD_DPAINT_WAVEB_DEPTH
@ MOD_DPAINT_WAVEB_CHANGE
@ MOD_DPAINT_WAVEB_FORCE
@ MOD_DPAINT_SURFACE_F_VERTEX
@ MOD_DPAINT_SURFACE_F_IMAGESEQ
@ MOD_DPAINT_IMGFORMAT_OPENEXR
@ MOD_DPAINT_IMGFORMAT_PNG
@ MOD_DYNAMICPAINT_TYPE_BRUSH
@ MOD_DYNAMICPAINT_TYPE_CANVAS
Object is a sort of wrapper for general info.
#define MAXFRAMEF
@ PARM_REQUIRED
Definition: RNA_types.h:352
@ 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_STRING
Definition: RNA_types.h:62
@ PROP_POINTER
Definition: RNA_types.h:64
@ PROP_COLLECTION
Definition: RNA_types.h:65
@ PROPOVERRIDE_OVERRIDABLE_LIBRARY
Definition: RNA_types.h:312
@ PROP_ANIMATABLE
Definition: RNA_types.h:202
@ PROP_EDITABLE
Definition: RNA_types.h:189
@ PROP_NEVER_NULL
Definition: RNA_types.h:239
@ PROP_TIME
Definition: RNA_types.h:146
@ PROP_NONE
Definition: RNA_types.h:126
@ PROP_DIRPATH
Definition: RNA_types.h:130
@ PROP_FACTOR
Definition: RNA_types.h:144
@ PROP_COLOR_GAMMA
Definition: RNA_types.h:165
@ PROP_UNSIGNED
Definition: RNA_types.h:142
#define C
Definition: RandGen.cpp:25
#define ND_DRAW
Definition: WM_types.h:410
#define ND_MODIFIER
Definition: WM_types.h:411
#define NC_MATERIAL
Definition: WM_types.h:330
#define NC_OBJECT
Definition: WM_types.h:329
#define ND_SHADING_DRAW
Definition: WM_types.h:426
return(oflags[bm->toolflag_index].f &oflag) !=0
Scene scene
struct @211::@212 surface
void rna_iterator_listbase_begin(CollectionPropertyIterator *iter, ListBase *lb, IteratorSkipFunc skip)
Definition: rna_access.c:4729
void rna_iterator_array_begin(CollectionPropertyIterator *iter, void *ptr, int itemsize, int length, bool free_ptr, IteratorSkipFunc skip)
Definition: rna_access.c:4781
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
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
PropertyRNA * RNA_def_pointer(StructOrFunctionRNA *cont_, const char *identifier, const char *type, const char *ui_name, const char *ui_description)
Definition: rna_define.c:4170
void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t bit)
Definition: rna_define.c:2236
void RNA_def_property_string_funcs(PropertyRNA *prop, const char *get, const char *length, const char *set)
Definition: rna_define.c:3285
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
void RNA_def_property_string_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2695
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier, const char *call)
Definition: rna_define.c:4273
void RNA_def_property_srna(PropertyRNA *prop, const char *type)
Definition: rna_define.c:3474
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_funcs(PropertyRNA *prop, const char *get, const char *set)
Definition: rna_define.c:2944
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_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_enum_item_end(EnumPropertyItem **items, int *totitem)
Definition: rna_define.c:4487
void RNA_def_struct_name_property(struct StructRNA *srna, struct PropertyRNA *prop)
Definition: rna_define.c:1103
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_enum_item_add(EnumPropertyItem **items, int *totitem, const EnumPropertyItem *item)
Definition: rna_define.c:4436
void RNA_def_property_int_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
Definition: rna_define.c:3028
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
Definition: rna_define.c:1490
PropertyRNA * RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, int default_value, int hardmin, int hardmax, const char *ui_name, const char *ui_description, int softmin, int softmax)
Definition: rna_define.c:3597
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_override_flag(PropertyRNA *prop, PropertyOverrideFlag flag)
Definition: rna_define.c:1503
void RNA_def_parameter_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
Definition: rna_define.c:1518
static void rna_def_canvas_surfaces(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_dynamic_paint(BlenderRNA *brna)
static void rna_def_canvas_surface(BlenderRNA *brna)
static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna)
static void rna_def_dynamic_paint_canvas_settings(BlenderRNA *brna)
const EnumPropertyItem rna_enum_prop_dynamicpaint_type_items[]
void rna_object_uvlayer_name_set(struct PointerRNA *ptr, const char *value, char *result, int maxlen)
#define min(a, b)
Definition: sort.c:35
struct DynamicPaintModifierData * pmd
struct DynamicPaintModifierData * pmd
void * first
Definition: DNA_listBase.h:31
Definition: BKE_main.h:121
void * data
Definition: RNA_types.h:38
struct ID * owner_id
Definition: RNA_types.h:36
float max
PointerRNA * ptr
Definition: wm_files.c:3480