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