Blender V5.0
rna_dynamicpaint.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#include <cstdlib>
10
11#include "BKE_modifier.hh"
12
14
15#include "BLT_translation.hh"
16
18#include "DNA_modifier_types.h"
19#include "DNA_scene_types.h"
20
21#include "RNA_define.hh"
22#include "RNA_enum_types.hh"
23
24#include "rna_internal.hh"
25
26#include "WM_types.hh"
27
29 {MOD_DYNAMICPAINT_TYPE_CANVAS, "CANVAS", 0, "Canvas", ""},
30 {MOD_DYNAMICPAINT_TYPE_BRUSH, "BRUSH", 0, "Brush", ""},
31 {0, nullptr, 0, nullptr, nullptr},
32};
33
34#ifdef RNA_RUNTIME
35
36# include <fmt/format.h>
37
38# include "BLI_string.h"
39
40# include "BKE_context.hh"
41# include "BKE_dynamicpaint.h"
42# include "BKE_particle.h"
43
44# include "DEG_depsgraph.hh"
45# include "DEG_depsgraph_build.hh"
46
47static std::optional<std::string> rna_DynamicPaintCanvasSettings_path(const PointerRNA *ptr)
48{
50 const ModifierData *md = (ModifierData *)settings->pmd;
51 char name_esc[sizeof(md->name) * 2];
52
53 BLI_str_escape(name_esc, md->name, sizeof(name_esc));
54 return fmt::format("modifiers[\"{}\"].canvas_settings", name_esc);
55}
56
57static std::optional<std::string> rna_DynamicPaintBrushSettings_path(const PointerRNA *ptr)
58{
60 const ModifierData *md = (ModifierData *)settings->pmd;
61 char name_esc[sizeof(md->name) * 2];
62
63 BLI_str_escape(name_esc, md->name, sizeof(name_esc));
64 return fmt::format("modifiers[\"{}\"].brush_settings", name_esc);
65}
66
67static std::optional<std::string> rna_DynamicPaintSurface_path(const PointerRNA *ptr)
68{
69 const DynamicPaintSurface *surface = (DynamicPaintSurface *)ptr->data;
70 const ModifierData *md = (ModifierData *)surface->canvas->pmd;
71 char name_esc[sizeof(md->name) * 2];
72 char name_esc_surface[sizeof(surface->name) * 2];
73
74 BLI_str_escape(name_esc, md->name, sizeof(name_esc));
75 BLI_str_escape(name_esc_surface, surface->name, sizeof(name_esc_surface));
76 return fmt::format(
77 "modifiers[\"{}\"].canvas_settings.canvas_surfaces[\"{}\"]", name_esc, name_esc_surface);
78}
79
80/*
81 * Surfaces
82 */
83
84static void rna_DynamicPaint_redoModifier(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
85{
87}
88
89static void rna_DynamicPaintSurfaces_updateFrames(Main * /*bmain*/,
90 Scene * /*scene*/,
92{
94}
95
96static void rna_DynamicPaintSurface_reset(Main *bmain, Scene *scene, PointerRNA *ptr)
97{
99 rna_DynamicPaint_redoModifier(bmain, scene, ptr);
100}
101
102static void rna_DynamicPaintSurface_initialcolortype(Main *bmain, Scene *scene, PointerRNA *ptr)
103{
104 DynamicPaintSurface *surface = (DynamicPaintSurface *)ptr->data;
105
106 surface->init_layername[0] = '\0';
107 dynamicPaint_clearSurface(scene, surface);
108 rna_DynamicPaint_redoModifier(bmain, scene, ptr);
109}
110
111static void rna_DynamicPaintSurface_uniqueName(Main * /*bmain*/,
112 Scene * /*scene*/,
114{
116 ((DynamicPaintSurface *)ptr->data)->name);
117}
118
119static void rna_DynamicPaintSurface_changeType(Main *bmain, Scene *scene, PointerRNA *ptr)
120{
123 rna_DynamicPaintSurface_reset(bmain, scene, ptr);
124}
125
126static void rna_DynamicPaintSurfaces_changeFormat(Main *bmain, Scene *scene, PointerRNA *ptr)
127{
128 DynamicPaintSurface *surface = (DynamicPaintSurface *)ptr->data;
129
130 /* Only #MOD_DPAINT_SURFACE_F_VERTEX supports #MOD_DPAINT_SURFACE_T_WEIGHT. */
131 if (surface->format == MOD_DPAINT_SURFACE_F_IMAGESEQ &&
132 surface->type == MOD_DPAINT_SURFACE_T_WEIGHT)
133 {
134 surface->type = MOD_DPAINT_SURFACE_T_PAINT;
135 }
136
138 rna_DynamicPaintSurface_reset(bmain, scene, ptr);
139}
140
141static void rna_DynamicPaint_reset_dependency(Main *bmain, Scene * /*scene*/, PointerRNA * /*ptr*/)
142{
144}
145
146static void rna_DynamicPaintSurface_reset_dependency(Main *bmain, Scene *scene, PointerRNA *ptr)
147{
148 rna_DynamicPaintSurface_reset(bmain, scene, ptr);
149 rna_DynamicPaint_reset_dependency(bmain, scene, ptr);
150}
151
152static PointerRNA rna_PaintSurface_active_get(PointerRNA *ptr)
153{
155 DynamicPaintSurface *surface = static_cast<DynamicPaintSurface *>(canvas->surfaces.first);
156 int id = 0;
157
158 for (; surface; surface = surface->next) {
159 if (id == canvas->active_sur) {
160 return RNA_pointer_create_with_parent(*ptr, &RNA_DynamicPaintSurface, surface);
161 }
162 id++;
163 }
164 return PointerRNA_NULL;
165}
166
167static void rna_DynamicPaint_surfaces_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
168{
170# if 0
172 iter, ptr,(void *)canvas->surfaces, sizeof(PaintSurface), canvas->totsur, 0, 0);
173# endif
174 rna_iterator_listbase_begin(iter, ptr, &canvas->surfaces, nullptr);
175}
176
177static int rna_Surface_active_point_index_get(PointerRNA *ptr)
178{
180 return canvas->active_sur;
181}
182
183static void rna_Surface_active_point_index_set(PointerRNA *ptr, int value)
184{
186 canvas->active_sur = value;
187}
188
189static void rna_Surface_active_point_range(
190 PointerRNA *ptr, int *min, int *max, int * /*softmin*/, int * /*softmax*/)
191{
193
194 *min = 0;
195 *max = BLI_listbase_count(&canvas->surfaces) - 1;
196}
197
198/* uvlayer */
199static void rna_DynamicPaint_uvlayer_set(PointerRNA *ptr, const char *value)
200{
201 DynamicPaintCanvasSettings *canvas = ((DynamicPaintSurface *)ptr->data)->canvas;
202 DynamicPaintSurface *surface = static_cast<DynamicPaintSurface *>(canvas->surfaces.first);
203 int id = 0;
204
205 for (; surface; surface = surface->next) {
206 if (id == canvas->active_sur) {
208 ptr, value, surface->uvlayer_name, sizeof(surface->uvlayer_name));
209 return;
210 }
211 id++;
212 }
213}
214
215/* is point cache used */
216static bool rna_DynamicPaint_is_cache_user_get(PointerRNA *ptr)
217{
218 DynamicPaintSurface *surface = (DynamicPaintSurface *)ptr->data;
219
220 return (surface->format != MOD_DPAINT_SURFACE_F_IMAGESEQ) ? true : false;
221}
222
223/* Does output layer exist. */
224static bool rna_DynamicPaint_is_output_exists(DynamicPaintSurface *surface, Object *ob, int index)
225{
226 return dynamicPaint_outputLayerExists(surface, ob, index);
227}
228
229static const EnumPropertyItem *rna_DynamicPaint_surface_type_itemf(bContext * /*C*/,
231 PropertyRNA * /*prop*/,
232 bool *r_free)
233{
234 DynamicPaintSurface *surface = (DynamicPaintSurface *)ptr->data;
235
236 EnumPropertyItem *item = nullptr;
237 EnumPropertyItem tmp = {0, "", 0, "", ""};
238 int totitem = 0;
239
240 /* Paint type - available for all formats */
242 tmp.identifier = "PAINT";
243 tmp.name = "Paint";
244 tmp.icon = ICON_TPAINT_HLT;
245 RNA_enum_item_add(&item, &totitem, &tmp);
246
247 /* Displace */
250 tmp.identifier = "DISPLACE";
251 tmp.name = "Displace";
252 tmp.icon = ICON_MOD_DISPLACE;
253 RNA_enum_item_add(&item, &totitem, &tmp);
254 }
255
256 /* Weight */
257 if (surface->format == MOD_DPAINT_SURFACE_F_VERTEX) {
259 tmp.identifier = "WEIGHT";
260 tmp.name = "Weight";
261 tmp.icon = ICON_MOD_VERTEX_WEIGHT;
262 RNA_enum_item_add(&item, &totitem, &tmp);
263 }
264
265 /* Height waves */
266 {
268 tmp.identifier = "WAVE";
269 tmp.name = "Waves";
270 tmp.icon = ICON_MOD_WAVE;
271 RNA_enum_item_add(&item, &totitem, &tmp);
272 }
273
274 RNA_enum_item_end(&item, &totitem);
275 *r_free = true;
276
277 return item;
278}
279
280#else
281
282/* canvas.canvas_surfaces */
284{
285 StructRNA *srna;
286 PropertyRNA *prop;
287
288 RNA_def_property_srna(cprop, "DynamicPaintSurfaces");
289 srna = RNA_def_struct(brna, "DynamicPaintSurfaces", nullptr);
290 RNA_def_struct_sdna(srna, "DynamicPaintCanvasSettings");
291 RNA_def_struct_ui_text(srna, "Canvas Surfaces", "Collection of Dynamic Paint Canvas surfaces");
292
293 prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED);
296 "rna_Surface_active_point_index_get",
297 "rna_Surface_active_point_index_set",
298 "rna_Surface_active_point_range");
299 RNA_def_property_ui_text(prop, "Active Point Cache Index", "");
300
301 prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
302 RNA_def_property_struct_type(prop, "DynamicPaintSurface");
303 RNA_def_property_pointer_funcs(prop, "rna_PaintSurface_active_get", nullptr, nullptr, nullptr);
304 RNA_def_property_ui_text(prop, "Active Surface", "Active Dynamic Paint surface being displayed");
305 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, nullptr);
306}
307
309{
310 StructRNA *srna;
311 PropertyRNA *prop;
312 PropertyRNA *parm;
313 FunctionRNA *func;
314
315 /* Surface format */
316 static const EnumPropertyItem prop_dynamicpaint_surface_format[] = {
317 // {MOD_DPAINT_SURFACE_F_PTEX, "PTEX", ICON_TEXTURE_SHADED, "Ptex", ""},
318 {MOD_DPAINT_SURFACE_F_VERTEX, "VERTEX", ICON_OUTLINER_DATA_MESH, "Vertex", ""},
319 {MOD_DPAINT_SURFACE_F_IMAGESEQ, "IMAGE", ICON_FILE_IMAGE, "Image Sequence", ""},
320 {0, nullptr, 0, nullptr, nullptr},
321 };
322
323 /* Surface type - generated dynamically based on surface format */
324 static const EnumPropertyItem prop_dynamicpaint_surface_type[] = {
325 {MOD_DPAINT_SURFACE_T_PAINT, "PAINT", 0, "Paint", ""},
326 {0, nullptr, 0, nullptr, nullptr},
327 };
328
329 /* Initial color setting */
330 static const EnumPropertyItem prop_dynamicpaint_init_color_type[] = {
331 {MOD_DPAINT_INITIAL_NONE, "NONE", 0, "None", ""},
332 {MOD_DPAINT_INITIAL_COLOR, "COLOR", ICON_COLOR, "Color", ""},
333 {MOD_DPAINT_INITIAL_TEXTURE, "TEXTURE", ICON_TEXTURE, "UV Texture", ""},
334 {MOD_DPAINT_INITIAL_VERTEXCOLOR, "VERTEX_COLOR", ICON_GROUP_VCOL, "Vertex Color", ""},
335 {0, nullptr, 0, nullptr, nullptr},
336 };
337
338 /* Effect type
339 * Only used by UI to view per effect settings. */
340 static const EnumPropertyItem prop_dynamicpaint_effecttype[] = {
341 {1, "SPREAD", 0, "Spread", ""},
342 {2, "DRIP", 0, "Drip", ""},
343 {3, "SHRINK", 0, "Shrink", ""},
344 {0, nullptr, 0, nullptr, nullptr},
345 };
346
347 /* Displace-map file format. */
348 static const EnumPropertyItem prop_dynamicpaint_image_fileformat[] = {
349 {MOD_DPAINT_IMGFORMAT_PNG, "PNG", 0, "PNG", ""},
350# ifdef WITH_IMAGE_OPENEXR
351 {MOD_DPAINT_IMGFORMAT_OPENEXR, "OPENEXR", 0, "OpenEXR", ""},
352# endif
353 {0, nullptr, 0, nullptr, nullptr},
354 };
355
356 /* Displace-map type. */
357 static const EnumPropertyItem prop_dynamicpaint_displace_type[] = {
358 {MOD_DPAINT_DISP_DISPLACE, "DISPLACE", 0, "Displacement", ""},
359 {MOD_DPAINT_DISP_DEPTH, "DEPTH", 0, "Depth", ""},
360 {0, nullptr, 0, nullptr, nullptr},
361 };
362
363 /* Surface */
364 srna = RNA_def_struct(brna, "DynamicPaintSurface", nullptr);
365 RNA_def_struct_sdna(srna, "DynamicPaintSurface");
366 RNA_def_struct_ui_text(srna, "Paint Surface", "A canvas surface layer");
367 RNA_def_struct_path_func(srna, "rna_DynamicPaintSurface_path");
368
369 prop = RNA_def_property(srna, "surface_format", PROP_ENUM, PROP_NONE);
371 RNA_def_property_enum_sdna(prop, nullptr, "format");
372 RNA_def_property_enum_items(prop, prop_dynamicpaint_surface_format);
373 RNA_def_property_ui_text(prop, "Format", "Surface Format");
374 RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaintSurfaces_changeFormat");
375
376 prop = RNA_def_property(srna, "surface_type", PROP_ENUM, PROP_NONE);
378 RNA_def_property_enum_sdna(prop, nullptr, "type");
379 RNA_def_property_enum_items(prop, prop_dynamicpaint_surface_type);
380 RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_DynamicPaint_surface_type_itemf");
381 RNA_def_property_ui_text(prop, "Surface Type", "Surface Type");
382 RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaintSurface_changeType");
383
384 prop = RNA_def_property(srna, "is_active", PROP_BOOLEAN, PROP_NONE);
385 RNA_def_property_boolean_sdna(prop, nullptr, "flags", MOD_DPAINT_ACTIVE);
386 RNA_def_property_ui_text(prop, "Is Active", "Toggle whether surface is processed or ignored");
387 RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
388
389 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
390 RNA_def_property_ui_text(prop, "Name", "Surface name");
391 RNA_def_property_update(prop, NC_OBJECT, "rna_DynamicPaintSurface_uniqueName");
393
394 prop = RNA_def_property(srna, "brush_collection", PROP_POINTER, PROP_NONE);
395 RNA_def_property_struct_type(prop, "Collection");
396 RNA_def_property_pointer_sdna(prop, nullptr, "brush_group");
399 prop, "Brush Collection", "Only use brush objects from this collection");
401 prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaintSurface_reset_dependency");
402
403 /*
404 * Paint, wet and displace
405 */
406
407 prop = RNA_def_property(srna, "use_dissolve", PROP_BOOLEAN, PROP_NONE);
408 RNA_def_property_boolean_sdna(prop, nullptr, "flags", MOD_DPAINT_DISSOLVE);
409 RNA_def_property_ui_text(prop, "Dissolve", "Enable to make surface changes disappear over time");
411
412 prop = RNA_def_property(srna, "dissolve_speed", PROP_INT, PROP_TIME);
413 RNA_def_property_int_sdna(prop, nullptr, "diss_speed");
414 RNA_def_property_range(prop, 1.0, 10000.0);
415 RNA_def_property_ui_range(prop, 1.0, 10000.0, 5, -1);
417 prop, "Dissolve Time", "Approximately in how many frames should dissolve happen");
418
419 prop = RNA_def_property(srna, "use_drying", PROP_BOOLEAN, PROP_NONE);
421 RNA_def_property_ui_text(prop, "Dry", "Enable to make surface wetness dry over time");
422
423 prop = RNA_def_property(srna, "dry_speed", PROP_INT, PROP_TIME);
424 RNA_def_property_range(prop, 1.0, 10000.0);
425 RNA_def_property_ui_range(prop, 1.0, 10000.0, 5, -1);
427 prop, "Dry Time", "Approximately in how many frames should drying happen");
428
429 /*
430 * Simulation settings
431 */
432 prop = RNA_def_property(srna, "image_resolution", PROP_INT, PROP_NONE);
434 RNA_def_property_range(prop, 16.0, 4096.0);
435 RNA_def_property_ui_range(prop, 16.0, 4096.0, 1, -1);
436 RNA_def_property_ui_text(prop, "Resolution", "Output image resolution");
437
438 prop = RNA_def_property(srna, "uv_layer", PROP_STRING, PROP_NONE);
439 RNA_def_property_string_sdna(prop, nullptr, "uvlayer_name");
440 RNA_def_property_ui_text(prop, "UV Map", "UV map name");
441 RNA_def_property_string_funcs(prop, nullptr, nullptr, "rna_DynamicPaint_uvlayer_set");
442
443 prop = RNA_def_property(srna, "frame_start", PROP_INT, PROP_NONE);
444 RNA_def_property_int_sdna(prop, nullptr, "start_frame");
447 RNA_def_property_ui_range(prop, 1.0, 9999, 1, -1);
448 RNA_def_property_ui_text(prop, "Start Frame", "Simulation start frame");
449 RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaintSurfaces_updateFrames");
450
451 prop = RNA_def_property(srna, "frame_end", PROP_INT, PROP_NONE);
452 RNA_def_property_int_sdna(prop, nullptr, "end_frame");
455 RNA_def_property_ui_range(prop, 1.0, 9999.0, 1, -1);
456 RNA_def_property_ui_text(prop, "End Frame", "Simulation end frame");
457 RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaintSurfaces_updateFrames");
458
459 prop = RNA_def_property(srna, "frame_substeps", PROP_INT, PROP_NONE);
460 RNA_def_property_int_sdna(prop, nullptr, "substeps");
461 RNA_def_property_range(prop, 0.0, 20.0);
462 RNA_def_property_ui_range(prop, 0.0, 10, 1, -1);
464 prop, "Sub-Steps", "Do extra frames between scene frames to ensure smooth motion");
465
466 prop = RNA_def_property(srna, "use_antialiasing", PROP_BOOLEAN, PROP_NONE);
470 "Anti-Aliasing",
472 " multisampling to smooth paint edges");
473 RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaintSurface_reset");
474
475 prop = RNA_def_property(srna, "brush_influence_scale", PROP_FLOAT, PROP_FACTOR);
476 RNA_def_property_float_sdna(prop, nullptr, "influence_scale");
477 RNA_def_property_range(prop, 0.0, 1.0);
478 RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 2);
480 prop, "Influence Scale", "Adjust influence brush objects have on this surface");
481 RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
482
483 prop = RNA_def_property(srna, "brush_radius_scale", PROP_FLOAT, PROP_FACTOR);
484 RNA_def_property_float_sdna(prop, nullptr, "radius_scale");
485 RNA_def_property_range(prop, 0.0, 10.0);
486 RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 2);
488 prop, "Radius Scale", "Adjust radius of proximity brushes or particles for this surface");
489 RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
490
491 /*
492 * Initial Color
493 */
494
495 prop = RNA_def_property(srna, "init_color_type", PROP_ENUM, PROP_NONE);
497 RNA_def_property_enum_items(prop, prop_dynamicpaint_init_color_type);
498 RNA_def_property_ui_text(prop, "Initial Color", "");
501 "rna_DynamicPaintSurface_initialcolortype");
502
503 prop = RNA_def_property(srna, "init_color", PROP_FLOAT, PROP_COLOR_GAMMA);
505 RNA_def_property_array(prop, 4);
506 RNA_def_property_ui_text(prop, "Color", "Initial color of the surface");
508 prop, NC_MATERIAL | ND_SHADING_DRAW | ND_MODIFIER, "rna_DynamicPaintSurface_reset");
509
510 prop = RNA_def_property(srna, "init_texture", PROP_POINTER, PROP_NONE);
512 RNA_def_property_ui_text(prop, "Texture", "");
514 prop, NC_MATERIAL | ND_SHADING_DRAW | ND_MODIFIER, "rna_DynamicPaintSurface_reset");
515
516 prop = RNA_def_property(srna, "init_layername", PROP_STRING, PROP_NONE);
517 RNA_def_property_ui_text(prop, "Data Layer", "");
519 prop, NC_MATERIAL | ND_SHADING_DRAW | ND_MODIFIER, "rna_DynamicPaintSurface_reset");
520
521 /*
522 * Effect Settings
523 */
524 prop = RNA_def_property(srna, "effect_ui", PROP_ENUM, PROP_NONE);
526 RNA_def_property_enum_items(prop, prop_dynamicpaint_effecttype);
527 RNA_def_property_ui_text(prop, "Effect Type", "");
528
529 prop = RNA_def_property(srna, "use_dry_log", PROP_BOOLEAN, PROP_NONE);
530 RNA_def_property_boolean_sdna(prop, nullptr, "flags", MOD_DPAINT_DRY_LOG);
532 prop, "Slow", "Use logarithmic drying (makes high values to dry faster than low values)");
533
534 prop = RNA_def_property(srna, "use_dissolve_log", PROP_BOOLEAN, PROP_NONE);
537 prop, "Slow", "Use logarithmic dissolve (makes high values to fade faster than low values)");
538
539 prop = RNA_def_property(srna, "use_spread", PROP_BOOLEAN, PROP_NONE);
543 prop, "Use Spread", "Process spread effect (spread wet paint around surface)");
544 RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaintSurface_reset");
545
546 prop = RNA_def_property(srna, "spread_speed", PROP_FLOAT, PROP_NONE);
547 RNA_def_property_float_sdna(prop, nullptr, "spread_speed");
548 RNA_def_property_range(prop, 0.001, 10.0);
549 RNA_def_property_ui_range(prop, 0.01, 5.0, 1, 2);
551 prop, "Spread Speed", "How fast spread effect moves on the canvas surface");
552
553 prop = RNA_def_property(srna, "color_dry_threshold", PROP_FLOAT, PROP_FACTOR);
554 RNA_def_property_float_sdna(prop, nullptr, "color_dry_threshold");
555 RNA_def_property_range(prop, 0.0, 1.0);
556 RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 2);
558 prop, "Color Dry", "The wetness level when colors start to shift to the background");
559
560 prop = RNA_def_property(srna, "color_spread_speed", PROP_FLOAT, PROP_NONE);
561 RNA_def_property_float_sdna(prop, nullptr, "color_spread_speed");
562 RNA_def_property_range(prop, 0.0, 2.0);
563 RNA_def_property_ui_range(prop, 0.0, 2.0, 1, 2);
564 RNA_def_property_ui_text(prop, "Color Spread", "How fast colors get mixed within wet paint");
565
566 prop = RNA_def_property(srna, "use_drip", PROP_BOOLEAN, PROP_NONE);
570 prop, "Use Drip", "Process drip effect (drip wet paint to gravity direction)");
571 RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaintSurface_reset");
572
573 prop = RNA_def_property(srna, "use_shrink", PROP_BOOLEAN, PROP_NONE);
576 RNA_def_property_ui_text(prop, "Use Shrink", "Process shrink effect (shrink paint areas)");
577 RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaintSurface_reset");
578
579 prop = RNA_def_property(srna, "shrink_speed", PROP_FLOAT, PROP_NONE);
580 RNA_def_property_float_sdna(prop, nullptr, "shrink_speed");
581 RNA_def_property_range(prop, 0.001, 10.0);
582 RNA_def_property_ui_range(prop, 0.01, 5.0, 1, 2);
584 prop, "Shrink Speed", "How fast shrink effect moves on the canvas surface");
585
586 prop = RNA_def_property(srna, "effector_weights", PROP_POINTER, PROP_NONE);
587 RNA_def_property_struct_type(prop, "EffectorWeights");
590 RNA_def_property_ui_text(prop, "Effector Weights", "");
591
592 prop = RNA_def_property(srna, "drip_velocity", PROP_FLOAT, PROP_NONE);
593 RNA_def_property_float_sdna(prop, nullptr, "drip_vel");
594 RNA_def_property_range(prop, -200.0f, 200.0f);
595 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
596 RNA_def_property_ui_text(prop, "Velocity", "How much surface velocity affects dripping");
597
598 prop = RNA_def_property(srna, "drip_acceleration", PROP_FLOAT, PROP_NONE);
599 RNA_def_property_float_sdna(prop, nullptr, "drip_acc");
600 RNA_def_property_range(prop, -200.0f, 200.0f);
601 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
602 RNA_def_property_ui_text(prop, "Acceleration", "How much surface acceleration affects dripping");
603
604 /*
605 * Output settings
606 */
607 prop = RNA_def_property(srna, "use_premultiply", PROP_BOOLEAN, PROP_NONE);
609 RNA_def_property_boolean_sdna(prop, nullptr, "flags", MOD_DPAINT_MULALPHA);
611 prop, "Premultiply Alpha", "Multiply color by alpha (recommended for Blender input)");
612
613 prop = RNA_def_property(srna, "image_output_path", PROP_STRING, PROP_DIRPATH);
614 RNA_def_property_string_sdna(prop, nullptr, "image_output_path");
616 RNA_def_property_ui_text(prop, "Output Path", "Directory to save the textures");
617
618 /* output for primary surface data */
619 prop = RNA_def_property(srna, "output_name_a", PROP_STRING, PROP_NONE);
620 RNA_def_property_string_sdna(prop, nullptr, "output_name");
621 RNA_def_property_ui_text(prop, "Output Name", "Name used to save output from this surface");
622
623 prop = RNA_def_property(srna, "use_output_a", PROP_BOOLEAN, PROP_NONE);
624 RNA_def_property_boolean_sdna(prop, nullptr, "flags", MOD_DPAINT_OUT1);
625 RNA_def_property_ui_text(prop, "Use Output", "Save this output layer");
626
627 /* Output for secondary surface data. */
628 prop = RNA_def_property(srna, "output_name_b", PROP_STRING, PROP_NONE);
629 RNA_def_property_string_sdna(prop, nullptr, "output_name2");
630 RNA_def_property_ui_text(prop, "Output Name", "Name used to save output from this surface");
631
632 prop = RNA_def_property(srna, "use_output_b", PROP_BOOLEAN, PROP_NONE);
633 RNA_def_property_boolean_sdna(prop, nullptr, "flags", MOD_DPAINT_OUT2);
634 RNA_def_property_ui_text(prop, "Use Output", "Save this output layer");
635
636 /* to check if output name exists */
637 func = RNA_def_function(srna, "output_exists", "rna_DynamicPaint_is_output_exists");
638 RNA_def_function_ui_description(func, "Checks if surface output layer of given name exists");
639 parm = RNA_def_pointer(func, "object", "Object", "", "");
641 parm = RNA_def_int(func, "index", 0, 0, 1, "Index", "", 0, 1);
643 /* return type */
644 parm = RNA_def_boolean(func, "exists", false, "", "");
645 RNA_def_function_return(func, parm);
646
647 prop = RNA_def_property(srna, "depth_clamp", PROP_FLOAT, PROP_NONE);
649 RNA_def_property_range(prop, 0.00, 50.0);
650 RNA_def_property_ui_range(prop, 0.00, 5.0, 1, 2);
652 prop,
653 "Max Displace",
654 "Maximum level of depth intersection in object space (use 0.0 to disable)");
655 RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
656
657 prop = RNA_def_property(srna, "displace_factor", PROP_FLOAT, PROP_NONE);
658 RNA_def_property_float_sdna(prop, nullptr, "disp_factor");
660 RNA_def_property_range(prop, -50.0, 50.0);
661 RNA_def_property_ui_range(prop, -5.0, 5.0, 1, 2);
663 prop, "Displace Factor", "Strength of displace when applied to the mesh");
664 RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
665
666 prop = RNA_def_property(srna, "image_fileformat", PROP_ENUM, PROP_NONE);
668 RNA_def_property_enum_items(prop, prop_dynamicpaint_image_fileformat);
669 RNA_def_property_ui_text(prop, "File Format", "");
670
671 prop = RNA_def_property(srna, "displace_type", PROP_ENUM, PROP_NONE);
672 RNA_def_property_enum_sdna(prop, nullptr, "disp_type");
674 RNA_def_property_enum_items(prop, prop_dynamicpaint_displace_type);
675 RNA_def_property_ui_text(prop, "Data Type", "");
676
677 prop = RNA_def_property(srna, "use_incremental_displace", PROP_BOOLEAN, PROP_NONE);
681 prop, "Incremental", "New displace is added cumulatively on top of existing");
682 RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaintSurface_reset");
683
684 /* wave simulator settings */
685 prop = RNA_def_property(srna, "wave_damping", PROP_FLOAT, PROP_NONE);
686 RNA_def_property_range(prop, 0.0, 1.0);
687 RNA_def_property_ui_range(prop, 0.01, 1.0, 1, 2);
688 RNA_def_property_ui_text(prop, "Damping", "Wave damping factor");
689
690 prop = RNA_def_property(srna, "wave_speed", PROP_FLOAT, PROP_NONE);
691 RNA_def_property_range(prop, 0.01, 5.0);
692 RNA_def_property_ui_range(prop, 0.20, 4.0, 1, 2);
693 RNA_def_property_ui_text(prop, "Speed", "Wave propagation speed");
694
695 prop = RNA_def_property(srna, "wave_timescale", PROP_FLOAT, PROP_NONE);
696 RNA_def_property_range(prop, 0.01, 3.0);
697 RNA_def_property_ui_range(prop, 0.01, 1.5, 1, 2);
698 RNA_def_property_ui_text(prop, "Timescale", "Wave time scaling factor");
699
700 prop = RNA_def_property(srna, "wave_spring", PROP_FLOAT, PROP_NONE);
701 RNA_def_property_range(prop, 0.0, 1.0);
702 RNA_def_property_ui_range(prop, 0.01, 1.0, 1, 2);
703 RNA_def_property_ui_text(prop, "Spring", "Spring force that pulls water level back to zero");
704
705 prop = RNA_def_property(srna, "wave_smoothness", PROP_FLOAT, PROP_NONE);
706 RNA_def_property_range(prop, 0.0, 10.0);
707 RNA_def_property_ui_range(prop, 0.1, 5.0, 1, 2);
709 "Smoothness",
710 "Limit maximum steepness of wave slope between simulation points "
711 "(use higher values for smoother waves at expense of reduced detail)");
712
713 prop = RNA_def_property(srna, "use_wave_open_border", PROP_BOOLEAN, PROP_NONE);
715 RNA_def_property_ui_text(prop, "Open Borders", "Pass waves through mesh edges");
716
717 /* cache */
718 prop = RNA_def_property(srna, "point_cache", PROP_POINTER, PROP_NONE);
720 RNA_def_property_pointer_sdna(prop, nullptr, "pointcache");
721 RNA_def_property_struct_type(prop, "PointCache");
722 RNA_def_property_ui_text(prop, "Point Cache", "");
723
724 /* is cache used */
725 prop = RNA_def_property(srna, "is_cache_user", PROP_BOOLEAN, PROP_NONE);
726 RNA_def_property_boolean_funcs(prop, "rna_DynamicPaint_is_cache_user_get", nullptr);
727 RNA_def_property_ui_text(prop, "Use Cache", "");
729}
730
732{
733 StructRNA *srna;
734 PropertyRNA *prop;
735
736 srna = RNA_def_struct(brna, "DynamicPaintCanvasSettings", nullptr);
737 RNA_def_struct_ui_text(srna, "Canvas Settings", "Dynamic Paint canvas settings");
738 RNA_def_struct_sdna(srna, "DynamicPaintCanvasSettings");
739 RNA_def_struct_path_func(srna, "rna_DynamicPaintCanvasSettings_path");
740
741 /*
742 * Surface Slots
743 */
744 prop = RNA_def_property(srna, "canvas_surfaces", PROP_COLLECTION, PROP_NONE);
746 "rna_DynamicPaint_surfaces_begin",
747 "rna_iterator_listbase_next",
748 "rna_iterator_listbase_end",
749 "rna_iterator_listbase_get",
750 nullptr,
751 nullptr,
752 nullptr,
753 nullptr);
754 RNA_def_property_struct_type(prop, "DynamicPaintSurface");
755 RNA_def_property_ui_text(prop, "Paint Surface List", "Paint surface list");
756 rna_def_canvas_surfaces(brna, prop);
757}
758
760{
761 StructRNA *srna;
762 PropertyRNA *prop;
763
764 /* paint collision type */
765 static const EnumPropertyItem prop_dynamicpaint_collisiontype[] = {
766 {MOD_DPAINT_COL_PSYS, "PARTICLE_SYSTEM", ICON_PARTICLES, "Particle System", ""},
767 {MOD_DPAINT_COL_POINT, "POINT", ICON_EMPTY_AXIS, "Object Center", ""},
768 {MOD_DPAINT_COL_DIST, "DISTANCE", ICON_DRIVER_DISTANCE, "Proximity", ""},
769 {MOD_DPAINT_COL_VOLDIST, "VOLUME_DISTANCE", ICON_META_CUBE, "Mesh Volume + Proximity", ""},
770 {MOD_DPAINT_COL_VOLUME, "VOLUME", ICON_MESH_CUBE, "Mesh Volume", ""},
771 {0, nullptr, 0, nullptr, nullptr},
772 };
773
774 static const EnumPropertyItem prop_dynamicpaint_prox_falloff[] = {
775 {MOD_DPAINT_PRFALL_SMOOTH, "SMOOTH", ICON_SPHERECURVE, "Smooth", ""},
776 {MOD_DPAINT_PRFALL_CONSTANT, "CONSTANT", ICON_NOCURVE, "Constant", ""},
777 {MOD_DPAINT_PRFALL_RAMP, "RAMP", ICON_COLOR, "Color Ramp", ""},
778 {0, nullptr, 0, nullptr, nullptr},
779 };
780
781 static const EnumPropertyItem prop_dynamicpaint_brush_wave_type[] = {
782 {MOD_DPAINT_WAVEB_CHANGE, "CHANGE", 0, "Depth Change", ""},
783 {MOD_DPAINT_WAVEB_DEPTH, "DEPTH", 0, "Obstacle", ""},
784 {MOD_DPAINT_WAVEB_FORCE, "FORCE", 0, "Force", ""},
785 {MOD_DPAINT_WAVEB_REFLECT, "REFLECT", 0, "Reflect Only", ""},
786 {0, nullptr, 0, nullptr, nullptr},
787 };
788
789 static const EnumPropertyItem prop_dynamicpaint_brush_ray_dir[] = {
790 {MOD_DPAINT_RAY_CANVAS, "CANVAS", 0, "Canvas Normal", ""},
791 {MOD_DPAINT_RAY_BRUSH_AVG, "BRUSH", 0, "Brush Normal", ""},
792 {MOD_DPAINT_RAY_ZPLUS, "Z_AXIS", 0, "Z-Axis", ""},
793 {0, nullptr, 0, nullptr, nullptr},
794 };
795
796 srna = RNA_def_struct(brna, "DynamicPaintBrushSettings", nullptr);
797 RNA_def_struct_ui_text(srna, "Brush Settings", "Brush settings");
798 RNA_def_struct_sdna(srna, "DynamicPaintBrushSettings");
799 RNA_def_struct_path_func(srna, "rna_DynamicPaintBrushSettings_path");
800
801 /*
802 * Paint
803 */
804 prop = RNA_def_property(srna, "paint_color", PROP_FLOAT, PROP_COLOR_GAMMA);
805 RNA_def_property_float_sdna(prop, nullptr, "r");
806 RNA_def_property_array(prop, 3);
807 RNA_def_property_ui_text(prop, "Paint Color", "Color of the paint");
808 RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
809
810 prop = RNA_def_property(srna, "paint_alpha", PROP_FLOAT, PROP_NONE);
811 RNA_def_property_float_sdna(prop, nullptr, "alpha");
812 RNA_def_property_range(prop, 0.0, 1.0);
813 RNA_def_property_ui_range(prop, 0.0, 1.0, 5, 2);
814 RNA_def_property_ui_text(prop, "Paint Alpha", "Paint alpha");
815 RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
816
817 prop = RNA_def_property(srna, "use_absolute_alpha", PROP_BOOLEAN, PROP_NONE);
820 prop, "Absolute Alpha", "Only increase alpha value if paint alpha is higher than existing");
821
822 prop = RNA_def_property(srna, "paint_wetness", PROP_FLOAT, PROP_NONE);
823 RNA_def_property_float_sdna(prop, nullptr, "wetness");
824 RNA_def_property_range(prop, 0.0, 1.0);
825 RNA_def_property_ui_range(prop, 0.0, 1.0, 5, 2);
827 prop,
828 "Paint Wetness",
829 "Paint wetness, visible in wetmap (some effects only affect wet paint)");
830 RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
831
832 prop = RNA_def_property(srna, "use_paint_erase", PROP_BOOLEAN, PROP_NONE);
833 RNA_def_property_boolean_sdna(prop, nullptr, "flags", MOD_DPAINT_ERASE);
834 RNA_def_property_ui_text(prop, "Erase Paint", "Erase / remove paint instead of adding it");
835 RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
836
837 prop = RNA_def_property(srna, "wave_type", PROP_ENUM, PROP_NONE);
839 RNA_def_property_enum_items(prop, prop_dynamicpaint_brush_wave_type);
840 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, nullptr, "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, nullptr, "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, nullptr, "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, nullptr, "proximity_falloff");
918 RNA_def_property_enum_items(prop, prop_dynamicpaint_prox_falloff);
919 RNA_def_property_ui_text(prop, "Falloff", "Proximity falloff type");
921 RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
922
923 prop = RNA_def_property(srna, "use_proximity_project", PROP_BOOLEAN, PROP_NONE);
926 prop,
927 "Project",
928 "Brush is projected to canvas from defined direction within brush proximity");
929 RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
930
931 prop = RNA_def_property(srna, "ray_direction", PROP_ENUM, PROP_NONE);
932 RNA_def_property_enum_sdna(prop, nullptr, "ray_dir");
933 RNA_def_property_enum_items(prop, prop_dynamicpaint_brush_ray_dir);
935 prop,
936 "Ray Direction",
937 "Ray direction to use for projection (if brush object is located in that direction "
938 "it's painted)");
939 RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
940
941 prop = RNA_def_property(srna, "invert_proximity", PROP_BOOLEAN, PROP_NONE);
944 prop, "Inner Proximity", "Proximity falloff is applied inside the volume");
945 RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
946
947 prop = RNA_def_property(srna, "use_negative_volume", PROP_BOOLEAN, PROP_NONE);
949 RNA_def_property_ui_text(prop, "Negate Volume", "Negate influence inside the volume");
950 RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
951
952 /*
953 * Particle
954 */
955 prop = RNA_def_property(srna, "particle_system", PROP_POINTER, PROP_NONE);
956 RNA_def_property_pointer_sdna(prop, nullptr, "psys");
957 RNA_def_property_struct_type(prop, "ParticleSystem");
959 RNA_def_property_ui_text(prop, "Particle Systems", "The particle system to paint with");
960 RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_reset_dependency");
961
962 prop = RNA_def_property(srna, "use_particle_radius", PROP_BOOLEAN, PROP_NONE);
963 RNA_def_property_boolean_sdna(prop, nullptr, "flags", MOD_DPAINT_PART_RAD);
964 RNA_def_property_ui_text(prop, "Use Particle Radius", "Use radius from particle settings");
965 RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
966
967 prop = RNA_def_property(srna, "solid_radius", PROP_FLOAT, PROP_NONE);
968 RNA_def_property_float_sdna(prop, nullptr, "particle_radius");
969 RNA_def_property_range(prop, 0.01, 10.0);
970 RNA_def_property_ui_range(prop, 0.01, 2.0, 5, 3);
971 RNA_def_property_ui_text(prop, "Solid Radius", "Radius that will be painted solid");
972 RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
973
974 prop = RNA_def_property(srna, "smooth_radius", PROP_FLOAT, PROP_NONE);
975 RNA_def_property_float_sdna(prop, nullptr, "particle_smooth");
976 RNA_def_property_range(prop, 0.0, 10.0);
977 RNA_def_property_ui_range(prop, 0.0, 1.0, 5, -1);
978 RNA_def_property_ui_text(prop, "Smooth Radius", "Smooth falloff added after solid radius");
979 RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
980
981 /*
982 * Color ramps
983 */
984 prop = RNA_def_property(srna, "paint_ramp", PROP_POINTER, PROP_NONE);
985 RNA_def_property_pointer_sdna(prop, nullptr, "paint_ramp");
986 RNA_def_property_struct_type(prop, "ColorRamp");
988 prop, "Paint Color Ramp", "Color ramp used to define proximity falloff");
989 RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
990
991 prop = RNA_def_property(srna, "velocity_ramp", PROP_POINTER, PROP_NONE);
992 RNA_def_property_pointer_sdna(prop, nullptr, "vel_ramp");
993 RNA_def_property_struct_type(prop, "ColorRamp");
995 prop, "Velocity Color Ramp", "Color ramp used to define brush velocity effect");
996 RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
997}
998
1005
1006#endif
bool dynamicPaint_outputLayerExists(struct DynamicPaintSurface *surface, struct Object *ob, int output)
void dynamicPaintSurface_updateType(struct DynamicPaintSurface *surface)
void dynamicPaintSurface_setUniqueName(struct DynamicPaintSurface *surface, const char *basename)
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 ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
Definition listbase.cc:524
size_t BLI_str_escape(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
#define BLI_STR_UTF8_MULTIPLICATION_SIGN
#define ELEM(...)
#define BLT_I18NCONTEXT_ID_BRUSH
#define BLT_I18NCONTEXT_ID_SIMULATION
void DEG_id_tag_update(ID *id, unsigned int flags)
void DEG_relations_tag_update(Main *bmain)
@ ID_RECALC_GEOMETRY
Definition DNA_ID.h:1074
@ MOD_DPAINT_INITIAL_NONE
@ MOD_DPAINT_INITIAL_VERTEXCOLOR
@ MOD_DPAINT_INITIAL_COLOR
@ MOD_DPAINT_INITIAL_TEXTURE
@ 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_VELOCITY_COLOR
@ MOD_DPAINT_DO_SMUDGE
@ MOD_DPAINT_PART_RAD
@ MOD_DPAINT_NEGATE_VOLUME
@ 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_DISP_DEPTH
@ MOD_DPAINT_DISP_DISPLACE
@ 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_PRFALL_CONSTANT
@ MOD_DPAINT_PRFALL_SMOOTH
@ MOD_DPAINT_PRFALL_RAMP
@ MOD_DPAINT_EFFECT_DO_DRIP
@ MOD_DPAINT_EFFECT_DO_SPREAD
@ MOD_DPAINT_EFFECT_DO_SHRINK
@ 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_SURFACE_F_VERTEX
@ MOD_DPAINT_SURFACE_F_IMAGESEQ
@ MOD_DYNAMICPAINT_TYPE_BRUSH
@ MOD_DYNAMICPAINT_TYPE_CANVAS
#define MAXFRAMEF
@ PARM_REQUIRED
Definition RNA_types.hh:545
@ PROP_FLOAT
Definition RNA_types.hh:164
@ PROP_BOOLEAN
Definition RNA_types.hh:162
@ PROP_ENUM
Definition RNA_types.hh:166
@ PROP_INT
Definition RNA_types.hh:163
@ PROP_STRING
Definition RNA_types.hh:165
@ PROP_POINTER
Definition RNA_types.hh:167
@ PROP_COLLECTION
Definition RNA_types.hh:168
@ PROPOVERRIDE_OVERRIDABLE_LIBRARY
Definition RNA_types.hh:503
PropertyFlag
Definition RNA_types.hh:300
@ PROP_ANIMATABLE
Definition RNA_types.hh:319
@ PROP_PATH_SUPPORTS_BLEND_RELATIVE
Definition RNA_types.hh:456
@ PROP_EDITABLE
Definition RNA_types.hh:306
@ PROP_NEVER_NULL
Definition RNA_types.hh:377
@ PROP_TIME
Definition RNA_types.hh:253
@ PROP_NONE
Definition RNA_types.hh:233
@ PROP_DIRPATH
Definition RNA_types.hh:237
@ PROP_FACTOR
Definition RNA_types.hh:251
@ PROP_COLOR_GAMMA
Definition RNA_types.hh:272
@ PROP_UNSIGNED
Definition RNA_types.hh:249
#define ND_DRAW
Definition WM_types.hh:461
#define ND_MODIFIER
Definition WM_types.hh:462
#define NC_MATERIAL
Definition WM_types.hh:380
#define NC_OBJECT
Definition WM_types.hh:379
#define ND_SHADING_DRAW
Definition WM_types.hh:478
return true
const PointerRNA PointerRNA_NULL
void rna_iterator_listbase_begin(CollectionPropertyIterator *iter, PointerRNA *ptr, ListBase *lb, IteratorSkipFunc skip)
void rna_iterator_array_begin(CollectionPropertyIterator *iter, PointerRNA *ptr, void *data, size_t itemsize, int64_t length, bool free_ptr, IteratorSkipFunc skip)
PointerRNA RNA_pointer_create_with_parent(const PointerRNA &parent, StructRNA *type, void *data)
void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
void RNA_def_struct_name_property(StructRNA *srna, PropertyRNA *prop)
void RNA_def_property_pointer_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_struct_path_func(StructRNA *srna, const char *path)
void RNA_def_property_string_funcs(PropertyRNA *prop, const char *get, const char *length, const char *set)
void RNA_def_function_return(FunctionRNA *func, PropertyRNA *ret)
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
void RNA_def_property_string_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_srna(PropertyRNA *prop, const char *type)
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)
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const char *set)
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier, const char *call)
void RNA_def_property_array(PropertyRNA *prop, int length)
void RNA_def_property_range(PropertyRNA *prop, double min, double max)
PropertyRNA * RNA_def_pointer(StructOrFunctionRNA *cont_, const char *identifier, const char *type, const char *ui_name, const char *ui_description)
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
void RNA_def_function_ui_description(FunctionRNA *func, const char *description)
void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *func)
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier, int type, int subtype)
void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char *set, const char *item)
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
void RNA_enum_item_end(EnumPropertyItem **items, int *totitem)
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_property_pointer_funcs(PropertyRNA *prop, const char *get, const char *set, const char *type_fn, const char *poll)
void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_enum_item_add(EnumPropertyItem **items, int *totitem, const EnumPropertyItem *item)
void RNA_def_property_int_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
void RNA_def_property_translation_context(PropertyRNA *prop, const char *context)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double step, int precision)
void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const char *propname)
PropertyRNA * RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, const int default_value, const int hardmin, const int hardmax, const char *ui_name, const char *ui_description, const int softmin, const int softmax)
void RNA_def_property_override_flag(PropertyRNA *prop, PropertyOverrideFlag flag)
void RNA_def_parameter_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
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(PointerRNA *ptr, const char *value, char *result, int result_maxncpy)
#define min(a, b)
Definition sort.cc:36
struct DynamicPaintSurface * next
const char * identifier
Definition RNA_types.hh:657
const char * name
Definition RNA_types.hh:661
void * first
max
Definition text_draw.cc:251
PointerRNA * ptr
Definition wm_files.cc:4238