Blender  V3.3
rna_fluid.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
7 #include <limits.h>
8 #include <stdlib.h>
9 
10 #include "BLI_path_util.h"
11 #include "BLI_sys_types.h"
12 #include "BLI_utildefines.h"
13 
14 #include "RNA_define.h"
15 #include "RNA_enum_types.h"
16 
17 #include "rna_internal.h"
18 
19 #include "BKE_fluid.h"
20 #include "BKE_modifier.h"
21 #include "BKE_pointcache.h"
22 
23 #include "DNA_fluid_types.h"
24 #include "DNA_modifier_types.h"
25 #include "DNA_object_force_types.h"
26 #include "DNA_object_types.h"
27 #include "DNA_particle_types.h"
28 #include "DNA_scene_types.h"
29 
30 #include "WM_api.h"
31 #include "WM_types.h"
32 
33 #ifdef RNA_RUNTIME
34 
35 # include "BLI_math.h"
36 # include "BLI_threads.h"
37 
38 # include "BKE_colorband.h"
39 # include "BKE_context.h"
40 # include "BKE_particle.h"
41 
42 # include "DEG_depsgraph.h"
43 # include "DEG_depsgraph_build.h"
44 
45 # include "manta_fluid_API.h"
46 
47 static void rna_Fluid_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
48 {
50 
51  /* Needed for liquid domain objects */
52  Object *ob = (Object *)ptr->owner_id;
54 }
55 
56 static void rna_Fluid_dependency_update(Main *bmain, Scene *scene, PointerRNA *ptr)
57 {
58  rna_Fluid_update(bmain, scene, ptr);
60 }
61 
62 static void rna_Fluid_datacache_reset(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
63 {
64 # ifdef WITH_FLUID
66  if (settings->fmd && settings->fmd->domain) {
67  Object *ob = (Object *)ptr->owner_id;
70 
71  /* In replay mode, always invalidate guiding cache too. */
72  if (settings->cache_type == FLUID_DOMAIN_CACHE_REPLAY) {
73  cache_map |= FLUID_DOMAIN_OUTDATED_GUIDE;
74  }
75  BKE_fluid_cache_free(settings, ob, cache_map);
76  }
77 # endif
79 }
80 static void rna_Fluid_noisecache_reset(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
81 {
82 # ifdef WITH_FLUID
84  if (settings->fmd && settings->fmd->domain) {
85  Object *ob = (Object *)ptr->owner_id;
86  int cache_map = FLUID_DOMAIN_OUTDATED_NOISE;
87  BKE_fluid_cache_free(settings, ob, cache_map);
88  }
89 # endif
91 }
92 static void rna_Fluid_meshcache_reset(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
93 {
94 # ifdef WITH_FLUID
96  if (settings->fmd && settings->fmd->domain) {
97  Object *ob = (Object *)ptr->owner_id;
98  int cache_map = FLUID_DOMAIN_OUTDATED_MESH;
99  BKE_fluid_cache_free(settings, ob, cache_map);
100  }
101 # endif
103 }
104 static void rna_Fluid_particlescache_reset(Main *UNUSED(bmain),
105  Scene *UNUSED(scene),
106  PointerRNA *ptr)
107 {
108 # ifdef WITH_FLUID
110  if (settings->fmd && settings->fmd->domain) {
111  Object *ob = (Object *)ptr->owner_id;
112  int cache_map = FLUID_DOMAIN_OUTDATED_PARTICLES;
113  BKE_fluid_cache_free(settings, ob, cache_map);
114  }
115 # endif
117 }
118 static void rna_Fluid_guidingcache_reset(Main *UNUSED(bmain),
119  Scene *UNUSED(scene),
120  PointerRNA *ptr)
121 {
122 # ifdef WITH_FLUID
124  if (settings->fmd && settings->fmd->domain) {
125  Object *ob = (Object *)ptr->owner_id;
129  BKE_fluid_cache_free(settings, ob, cache_map);
130  }
131 # endif
133 }
134 
135 static void rna_Fluid_effector_reset(Main *bmain, Scene *scene, PointerRNA *ptr)
136 {
137 # ifdef WITH_FLUID
139  settings->flags |= FLUID_EFFECTOR_NEEDS_UPDATE;
140 # endif
141 
142  rna_Fluid_update(bmain, scene, ptr);
143 }
144 
145 static void rna_Fluid_flow_reset(Main *bmain, Scene *scene, PointerRNA *ptr)
146 {
147 # ifdef WITH_FLUID
149  settings->flags |= FLUID_FLOW_NEEDS_UPDATE;
150 # endif
151 
152  rna_Fluid_update(bmain, scene, ptr);
153 }
154 
155 static void rna_Fluid_domain_data_reset(Main *bmain, Scene *scene, PointerRNA *ptr)
156 {
157 # ifdef WITH_FLUID
159  BKE_fluid_modifier_reset(settings->fmd);
160 # endif
161 
162  rna_Fluid_datacache_reset(bmain, scene, ptr);
163  rna_Fluid_update(bmain, scene, ptr);
164 }
165 
166 static void rna_Fluid_domain_noise_reset(Main *bmain, Scene *scene, PointerRNA *ptr)
167 {
168 # ifdef WITH_FLUID
170  BKE_fluid_modifier_reset(settings->fmd);
171 # endif
172 
173  rna_Fluid_noisecache_reset(bmain, scene, ptr);
174  rna_Fluid_update(bmain, scene, ptr);
175 }
176 
177 static void rna_Fluid_domain_mesh_reset(Main *bmain, Scene *scene, PointerRNA *ptr)
178 {
179 # ifdef WITH_FLUID
181  BKE_fluid_modifier_reset(settings->fmd);
182 # endif
183 
184  rna_Fluid_meshcache_reset(bmain, scene, ptr);
185  rna_Fluid_update(bmain, scene, ptr);
186 }
187 
188 static void rna_Fluid_domain_particles_reset(Main *bmain, Scene *scene, PointerRNA *ptr)
189 {
190 # ifdef WITH_FLUID
192  BKE_fluid_modifier_reset(settings->fmd);
193 # endif
194 
195  rna_Fluid_particlescache_reset(bmain, scene, ptr);
196  rna_Fluid_update(bmain, scene, ptr);
197 }
198 
199 static void rna_Fluid_reset_dependency(Main *bmain, Scene *scene, PointerRNA *ptr)
200 {
201 # ifdef WITH_FLUID
203  BKE_fluid_modifier_reset(settings->fmd);
204 # endif
205 
206  rna_Fluid_dependency_update(bmain, scene, ptr);
207 }
208 
209 static void rna_Fluid_parts_create(Main *bmain,
210  PointerRNA *ptr,
211  const char *pset_name,
212  const char *parts_name,
213  const char *psys_name,
214  int psys_type)
215 {
216 # ifndef WITH_FLUID
217  UNUSED_VARS(bmain, ptr, pset_name, parts_name, psys_name, psys_type);
218 # else
219  Object *ob = (Object *)ptr->owner_id;
220  BKE_fluid_particle_system_create(bmain, ob, pset_name, parts_name, psys_name, psys_type);
221 # endif
222 }
223 
224 static void rna_Fluid_parts_delete(PointerRNA *ptr, int ptype)
225 {
226 # ifndef WITH_FLUID
227  UNUSED_VARS(ptr, ptype);
228 # else
229  Object *ob = (Object *)ptr->owner_id;
231 # endif
232 }
233 
234 static bool rna_Fluid_parts_exists(PointerRNA *ptr, int ptype)
235 {
236  Object *ob = (Object *)ptr->owner_id;
237  ParticleSystem *psys;
238 
239  for (psys = ob->particlesystem.first; psys; psys = psys->next) {
240  if (psys->part->type == ptype) {
241  return true;
242  }
243  }
244  return false;
245 }
246 
247 static void rna_Fluid_flip_parts_update(Main *bmain, Scene *scene, PointerRNA *ptr)
248 {
249  Object *ob = (Object *)ptr->owner_id;
250  FluidModifierData *fmd;
252  bool exists = rna_Fluid_parts_exists(ptr, PART_FLUID_FLIP);
253 
254  /* Only create a particle system in liquid domain mode.
255  * Remove any remaining data from a liquid sim when switching to gas. */
256  if (fmd->domain->type != FLUID_DOMAIN_TYPE_LIQUID) {
257  rna_Fluid_parts_delete(ptr, PART_FLUID_FLIP);
258  fmd->domain->particle_type &= ~FLUID_DOMAIN_PARTICLE_FLIP;
259  rna_Fluid_domain_data_reset(bmain, scene, ptr);
260  return;
261  }
262 
263  if (ob->type == OB_MESH && !exists) {
264  rna_Fluid_parts_create(
265  bmain, ptr, "LiquidParticleSettings", "Liquid", "Liquid Particle System", PART_FLUID_FLIP);
266  fmd->domain->particle_type |= FLUID_DOMAIN_PARTICLE_FLIP;
267  }
268  else {
269  rna_Fluid_parts_delete(ptr, PART_FLUID_FLIP);
270  fmd->domain->particle_type &= ~FLUID_DOMAIN_PARTICLE_FLIP;
271  }
272  rna_Fluid_update(bmain, scene, ptr);
273 }
274 
275 static void rna_Fluid_spray_parts_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
276 {
277  Object *ob = (Object *)ptr->owner_id;
278  FluidModifierData *fmd;
280  bool exists = rna_Fluid_parts_exists(ptr, PART_FLUID_SPRAY);
281 
282  if (ob->type == OB_MESH && !exists) {
283  rna_Fluid_parts_create(
284  bmain, ptr, "SprayParticleSettings", "Spray", "Spray Particle System", PART_FLUID_SPRAY);
285  fmd->domain->particle_type |= FLUID_DOMAIN_PARTICLE_SPRAY;
286  }
287  else {
288  rna_Fluid_parts_delete(ptr, PART_FLUID_SPRAY);
289  fmd->domain->particle_type &= ~FLUID_DOMAIN_PARTICLE_SPRAY;
290  }
291 }
292 
293 static void rna_Fluid_bubble_parts_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
294 {
295  Object *ob = (Object *)ptr->owner_id;
296  FluidModifierData *fmd;
298  bool exists = rna_Fluid_parts_exists(ptr, PART_FLUID_BUBBLE);
299 
300  if (ob->type == OB_MESH && !exists) {
301  rna_Fluid_parts_create(bmain,
302  ptr,
303  "BubbleParticleSettings",
304  "Bubbles",
305  "Bubble Particle System",
307  fmd->domain->particle_type |= FLUID_DOMAIN_PARTICLE_BUBBLE;
308  }
309  else {
310  rna_Fluid_parts_delete(ptr, PART_FLUID_BUBBLE);
311  fmd->domain->particle_type &= ~FLUID_DOMAIN_PARTICLE_BUBBLE;
312  }
313 }
314 
315 static void rna_Fluid_foam_parts_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
316 {
317  Object *ob = (Object *)ptr->owner_id;
318  FluidModifierData *fmd;
320  bool exists = rna_Fluid_parts_exists(ptr, PART_FLUID_FOAM);
321 
322  if (ob->type == OB_MESH && !exists) {
323  rna_Fluid_parts_create(
324  bmain, ptr, "FoamParticleSettings", "Foam", "Foam Particle System", PART_FLUID_FOAM);
325  fmd->domain->particle_type |= FLUID_DOMAIN_PARTICLE_FOAM;
326  }
327  else {
328  rna_Fluid_parts_delete(ptr, PART_FLUID_FOAM);
329  fmd->domain->particle_type &= ~FLUID_DOMAIN_PARTICLE_FOAM;
330  }
331 }
332 
333 static void rna_Fluid_tracer_parts_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
334 {
335  Object *ob = (Object *)ptr->owner_id;
336  FluidModifierData *fmd;
338  bool exists = rna_Fluid_parts_exists(ptr, PART_FLUID_TRACER);
339 
340  if (ob->type == OB_MESH && !exists) {
341  rna_Fluid_parts_create(bmain,
342  ptr,
343  "TracerParticleSettings",
344  "Tracers",
345  "Tracer Particle System",
347  fmd->domain->particle_type |= FLUID_DOMAIN_PARTICLE_TRACER;
348  }
349  else {
350  rna_Fluid_parts_delete(ptr, PART_FLUID_TRACER);
351  fmd->domain->particle_type &= ~FLUID_DOMAIN_PARTICLE_TRACER;
352  }
353 }
354 
355 static void rna_Fluid_combined_export_update(Main *bmain, Scene *scene, PointerRNA *ptr)
356 {
357  Object *ob = (Object *)ptr->owner_id;
358  FluidModifierData *fmd;
360 
361  if (fmd->domain->sndparticle_combined_export == SNDPARTICLE_COMBINED_EXPORT_OFF) {
362  rna_Fluid_parts_delete(ptr, PART_FLUID_SPRAYFOAM);
363  rna_Fluid_parts_delete(ptr, PART_FLUID_SPRAYBUBBLE);
364  rna_Fluid_parts_delete(ptr, PART_FLUID_FOAMBUBBLE);
365  rna_Fluid_parts_delete(ptr, PART_FLUID_SPRAYFOAMBUBBLE);
366 
367  bool exists_spray = rna_Fluid_parts_exists(ptr, PART_FLUID_SPRAY);
368  bool exists_foam = rna_Fluid_parts_exists(ptr, PART_FLUID_FOAM);
369  bool exists_bubble = rna_Fluid_parts_exists(ptr, PART_FLUID_BUBBLE);
370 
371  /* Re-add each particle type if enabled and no particle system exists for them anymore. */
372  if ((fmd->domain->particle_type & FLUID_DOMAIN_PARTICLE_SPRAY) && !exists_spray) {
373  rna_Fluid_spray_parts_update(bmain, scene, ptr);
374  }
375  if ((fmd->domain->particle_type & FLUID_DOMAIN_PARTICLE_FOAM) && !exists_foam) {
376  rna_Fluid_foam_parts_update(bmain, scene, ptr);
377  }
378  if ((fmd->domain->particle_type & FLUID_DOMAIN_PARTICLE_BUBBLE) && !exists_bubble) {
379  rna_Fluid_bubble_parts_update(bmain, scene, ptr);
380  }
381  }
382  else if (fmd->domain->sndparticle_combined_export == SNDPARTICLE_COMBINED_EXPORT_SPRAY_FOAM) {
383  if (ob->type == OB_MESH && !rna_Fluid_parts_exists(ptr, PART_FLUID_SPRAYFOAM)) {
384 
385  rna_Fluid_parts_create(bmain,
386  ptr,
387  "SprayFoamParticleSettings",
388  "Spray + Foam",
389  "Spray + Foam Particle System",
391 
392  fmd->domain->particle_type |= FLUID_DOMAIN_PARTICLE_SPRAY;
393  fmd->domain->particle_type |= FLUID_DOMAIN_PARTICLE_FOAM;
394 
395  rna_Fluid_parts_delete(ptr, PART_FLUID_SPRAY);
396  rna_Fluid_parts_delete(ptr, PART_FLUID_FOAM);
397  rna_Fluid_parts_delete(ptr, PART_FLUID_SPRAYBUBBLE);
398  rna_Fluid_parts_delete(ptr, PART_FLUID_FOAMBUBBLE);
399  rna_Fluid_parts_delete(ptr, PART_FLUID_SPRAYFOAMBUBBLE);
400 
401  /* Re-add spray if enabled and no particle system exists for it anymore. */
402  bool exists_bubble = rna_Fluid_parts_exists(ptr, PART_FLUID_BUBBLE);
403  if ((fmd->domain->particle_type & FLUID_DOMAIN_PARTICLE_BUBBLE) && !exists_bubble) {
404  rna_Fluid_bubble_parts_update(bmain, scene, ptr);
405  }
406  }
407  }
408  else if (fmd->domain->sndparticle_combined_export == SNDPARTICLE_COMBINED_EXPORT_SPRAY_BUBBLE) {
409  if (ob->type == OB_MESH && !rna_Fluid_parts_exists(ptr, PART_FLUID_SPRAYBUBBLE)) {
410 
411  rna_Fluid_parts_create(bmain,
412  ptr,
413  "SprayBubbleParticleSettings",
414  "Spray + Bubbles",
415  "Spray + Bubble Particle System",
417 
418  fmd->domain->particle_type |= FLUID_DOMAIN_PARTICLE_SPRAY;
419  fmd->domain->particle_type |= FLUID_DOMAIN_PARTICLE_BUBBLE;
420 
421  rna_Fluid_parts_delete(ptr, PART_FLUID_SPRAY);
422  rna_Fluid_parts_delete(ptr, PART_FLUID_BUBBLE);
423  rna_Fluid_parts_delete(ptr, PART_FLUID_SPRAYFOAM);
424  rna_Fluid_parts_delete(ptr, PART_FLUID_FOAMBUBBLE);
425  rna_Fluid_parts_delete(ptr, PART_FLUID_SPRAYFOAMBUBBLE);
426 
427  /* Re-add foam if enabled and no particle system exists for it anymore. */
428  bool exists_foam = rna_Fluid_parts_exists(ptr, PART_FLUID_FOAM);
429  if ((fmd->domain->particle_type & FLUID_DOMAIN_PARTICLE_FOAM) && !exists_foam) {
430  rna_Fluid_foam_parts_update(bmain, scene, ptr);
431  }
432  }
433  }
434  else if (fmd->domain->sndparticle_combined_export == SNDPARTICLE_COMBINED_EXPORT_FOAM_BUBBLE) {
435  if (ob->type == OB_MESH && !rna_Fluid_parts_exists(ptr, PART_FLUID_FOAMBUBBLE)) {
436 
437  rna_Fluid_parts_create(bmain,
438  ptr,
439  "FoamBubbleParticleSettings",
440  "Foam + Bubble Particles",
441  "Foam + Bubble Particle System",
443 
444  fmd->domain->particle_type |= FLUID_DOMAIN_PARTICLE_FOAM;
445  fmd->domain->particle_type |= FLUID_DOMAIN_PARTICLE_BUBBLE;
446 
447  rna_Fluid_parts_delete(ptr, PART_FLUID_FOAM);
448  rna_Fluid_parts_delete(ptr, PART_FLUID_BUBBLE);
449  rna_Fluid_parts_delete(ptr, PART_FLUID_SPRAYFOAM);
450  rna_Fluid_parts_delete(ptr, PART_FLUID_SPRAYBUBBLE);
451  rna_Fluid_parts_delete(ptr, PART_FLUID_SPRAYFOAMBUBBLE);
452 
453  /* Re-add foam if enabled and no particle system exists for it anymore. */
454  bool exists_spray = rna_Fluid_parts_exists(ptr, PART_FLUID_SPRAY);
455  if ((fmd->domain->particle_type & FLUID_DOMAIN_PARTICLE_SPRAY) && !exists_spray) {
456  rna_Fluid_spray_parts_update(bmain, scene, ptr);
457  }
458  }
459  }
460  else if (fmd->domain->sndparticle_combined_export ==
462  if (ob->type == OB_MESH && !rna_Fluid_parts_exists(ptr, PART_FLUID_SPRAYFOAMBUBBLE)) {
463 
464  rna_Fluid_parts_create(bmain,
465  ptr,
466  "SprayFoamBubbleParticleSettings",
467  "Spray + Foam + Bubbles",
468  "Spray + Foam + Bubble Particle System",
470 
471  fmd->domain->particle_type |= FLUID_DOMAIN_PARTICLE_SPRAY;
472  fmd->domain->particle_type |= FLUID_DOMAIN_PARTICLE_FOAM;
473  fmd->domain->particle_type |= FLUID_DOMAIN_PARTICLE_BUBBLE;
474 
475  rna_Fluid_parts_delete(ptr, PART_FLUID_SPRAY);
476  rna_Fluid_parts_delete(ptr, PART_FLUID_FOAM);
477  rna_Fluid_parts_delete(ptr, PART_FLUID_BUBBLE);
478  rna_Fluid_parts_delete(ptr, PART_FLUID_SPRAYFOAM);
479  rna_Fluid_parts_delete(ptr, PART_FLUID_SPRAYBUBBLE);
480  rna_Fluid_parts_delete(ptr, PART_FLUID_FOAMBUBBLE);
481  }
482  }
483  else {
484  /* sanity check, should not occur */
485  printf("ERROR: Unexpected combined export setting encountered!");
486  }
487 }
488 
489 static void rna_Fluid_cache_startframe_set(struct PointerRNA *ptr, int value)
490 {
492  BKE_fluid_cache_startframe_set(settings, value);
493 }
494 
495 static void rna_Fluid_cache_endframe_set(struct PointerRNA *ptr, int value)
496 {
498  BKE_fluid_cache_endframe_set(settings, value);
499 }
500 
501 static void rna_Fluid_cachetype_mesh_set(struct PointerRNA *ptr, int value)
502 {
504  BKE_fluid_cachetype_mesh_set(settings, value);
505 }
506 
507 static void rna_Fluid_cachetype_data_set(struct PointerRNA *ptr, int value)
508 {
510  BKE_fluid_cachetype_data_set(settings, value);
511 }
512 
513 static void rna_Fluid_cachetype_particle_set(struct PointerRNA *ptr, int value)
514 {
516  BKE_fluid_cachetype_particle_set(settings, value);
517 }
518 
519 static void rna_Fluid_cachetype_noise_set(struct PointerRNA *ptr, int value)
520 {
522  BKE_fluid_cachetype_noise_set(settings, value);
523 }
524 
525 static void rna_Fluid_cachetype_set(struct PointerRNA *ptr, int value)
526 {
528 
529  if (value != settings->cache_type) {
530  settings->cache_type = value;
531  settings->cache_flag = 0;
532  }
533 }
534 
535 static void rna_Fluid_guide_parent_set(struct PointerRNA *ptr,
536  struct PointerRNA value,
537  struct ReportList *UNUSED(reports))
538 {
540  Object *par = (Object *)value.data;
541 
542  FluidModifierData *fmd_par = NULL;
543 
544  if (par != NULL) {
546  if (fmd_par && fmd_par->domain) {
547  fds->guide_parent = value.data;
548  copy_v3_v3_int(fds->guide_res, fmd_par->domain->res);
549  }
550  }
551  else {
552  fds->guide_parent = NULL;
553  }
554 }
555 
556 static const EnumPropertyItem *rna_Fluid_cachetype_mesh_itemf(bContext *UNUSED(C),
558  PropertyRNA *UNUSED(prop),
559  bool *r_free)
560 {
561  EnumPropertyItem *item = NULL;
562  EnumPropertyItem tmp = {0, "", 0, "", ""};
563  int totitem = 0;
564 
566  tmp.identifier = "BOBJECT";
567  tmp.name = "Binary Object";
568  tmp.description = "Binary object file format (.bobj.gz)";
569  RNA_enum_item_add(&item, &totitem, &tmp);
570 
572  tmp.identifier = "OBJECT";
573  tmp.name = "Object";
574  tmp.description = "Object file format (.obj)";
575  RNA_enum_item_add(&item, &totitem, &tmp);
576 
577  RNA_enum_item_end(&item, &totitem);
578  *r_free = true;
579 
580  return item;
581 }
582 
583 static const EnumPropertyItem *rna_Fluid_cachetype_volume_itemf(bContext *UNUSED(C),
584  PointerRNA *ptr,
585  PropertyRNA *UNUSED(prop),
586  bool *r_free)
587 {
588  EnumPropertyItem *item = NULL;
589  EnumPropertyItem tmp = {0, "", 0, "", ""};
590  int totitem = 0;
591 
593  tmp.identifier = "UNI";
594  tmp.name = "Uni Cache";
595  tmp.description = "Uni file format (.uni)";
596  RNA_enum_item_add(&item, &totitem, &tmp);
597 
598 # ifdef WITH_OPENVDB
600  tmp.identifier = "OPENVDB";
601  tmp.name = "OpenVDB";
602  tmp.description = "OpenVDB file format (.vdb)";
603  RNA_enum_item_add(&item, &totitem, &tmp);
604 # endif
605 
606  /* Support for deprecated .raw format. */
611  tmp.identifier = "RAW";
612  tmp.name = "Raw Cache";
613  tmp.description = "Raw file format (.raw)";
614  RNA_enum_item_add(&item, &totitem, &tmp);
615  }
616 
617  RNA_enum_item_end(&item, &totitem);
618  *r_free = true;
619 
620  return item;
621 }
622 
623 static const EnumPropertyItem *rna_Fluid_cachetype_particle_itemf(bContext *UNUSED(C),
625  PropertyRNA *UNUSED(prop),
626  bool *r_free)
627 {
628  EnumPropertyItem *item = NULL;
629  EnumPropertyItem tmp = {0, "", 0, "", ""};
630  int totitem = 0;
631 
633  tmp.identifier = "UNI";
634  tmp.name = "Uni Cache";
635  tmp.description = "Uni file format";
636  RNA_enum_item_add(&item, &totitem, &tmp);
637 
638  RNA_enum_item_end(&item, &totitem);
639  *r_free = true;
640 
641  return item;
642 }
643 
644 static void rna_Fluid_cache_directory_set(struct PointerRNA *ptr, const char *value)
645 {
647 
648  if (STREQ(settings->cache_directory, value)) {
649  return;
650  }
651 
652  BLI_strncpy(settings->cache_directory, value, sizeof(settings->cache_directory));
653 
654  /* TODO(sebbas): Read cache state in order to set cache bake flags and cache pause frames
655  * correctly. */
656  // settings->cache_flag = 0;
657 }
658 
659 static const EnumPropertyItem *rna_Fluid_cobafield_itemf(bContext *UNUSED(C),
660  PointerRNA *ptr,
661  PropertyRNA *UNUSED(prop),
662  bool *r_free)
663 {
665 
666  EnumPropertyItem *item = NULL;
667  EnumPropertyItem tmp = {0, "", 0, "", ""};
668  int totitem = 0;
669 
671  tmp.identifier = "FLAGS";
672  tmp.icon = 0;
673  tmp.name = "Flags";
674  tmp.description = "Flag grid of the fluid domain";
675  RNA_enum_item_add(&item, &totitem, &tmp);
676 
678  tmp.identifier = "PRESSURE";
679  tmp.icon = 0;
680  tmp.name = "Pressure";
681  tmp.description = "Pressure field of the fluid domain";
682  RNA_enum_item_add(&item, &totitem, &tmp);
683 
685  tmp.identifier = "VELOCITY_X";
686  tmp.icon = 0;
687  tmp.name = "X Velocity";
688  tmp.description = "X component of the velocity field";
689  RNA_enum_item_add(&item, &totitem, &tmp);
690 
692  tmp.identifier = "VELOCITY_Y";
693  tmp.icon = 0;
694  tmp.name = "Y Velocity";
695  tmp.description = "Y component of the velocity field";
696  RNA_enum_item_add(&item, &totitem, &tmp);
697 
699  tmp.identifier = "VELOCITY_Z";
700  tmp.icon = 0;
701  tmp.name = "Z Velocity";
702  tmp.description = "Z component of the velocity field";
703  RNA_enum_item_add(&item, &totitem, &tmp);
704 
706  tmp.identifier = "FORCE_X";
707  tmp.icon = 0;
708  tmp.name = "X Force";
709  tmp.description = "X component of the force field";
710  RNA_enum_item_add(&item, &totitem, &tmp);
711 
713  tmp.identifier = "FORCE_Y";
714  tmp.icon = 0;
715  tmp.name = "Y Force";
716  tmp.description = "Y component of the force field";
717  RNA_enum_item_add(&item, &totitem, &tmp);
718 
720  tmp.identifier = "FORCE_Z";
721  tmp.icon = 0;
722  tmp.name = "Z Force";
723  tmp.description = "Z component of the force field";
724  RNA_enum_item_add(&item, &totitem, &tmp);
725 
726  if (settings->type == FLUID_DOMAIN_TYPE_GAS) {
728  tmp.identifier = "COLOR_R";
729  tmp.icon = 0;
730  tmp.name = "Red";
731  tmp.description = "Red component of the color field";
732  RNA_enum_item_add(&item, &totitem, &tmp);
733 
735  tmp.identifier = "COLOR_G";
736  tmp.icon = 0;
737  tmp.name = "Green";
738  tmp.description = "Green component of the color field";
739  RNA_enum_item_add(&item, &totitem, &tmp);
740 
742  tmp.identifier = "COLOR_B";
743  tmp.icon = 0;
744  tmp.name = "Blue";
745  tmp.description = "Blue component of the color field";
746  RNA_enum_item_add(&item, &totitem, &tmp);
747 
749  tmp.identifier = "DENSITY";
750  tmp.icon = 0;
751  tmp.name = "Density";
752  tmp.description = "Quantity of soot in the fluid";
753  RNA_enum_item_add(&item, &totitem, &tmp);
754 
756  tmp.identifier = "FLAME";
757  tmp.icon = 0;
758  tmp.name = "Flame";
759  tmp.description = "Flame field";
760  RNA_enum_item_add(&item, &totitem, &tmp);
761 
763  tmp.identifier = "FUEL";
764  tmp.icon = 0;
765  tmp.name = "Fuel";
766  tmp.description = "Fuel field";
767  RNA_enum_item_add(&item, &totitem, &tmp);
768 
770  tmp.identifier = "HEAT";
771  tmp.icon = 0;
772  tmp.name = "Heat";
773  tmp.description = "Temperature of the fluid";
774  RNA_enum_item_add(&item, &totitem, &tmp);
775  }
776  else if (settings->type == FLUID_DOMAIN_TYPE_LIQUID) {
778  tmp.identifier = "PHI";
779  tmp.icon = 0;
780  tmp.name = "Fluid Levelset";
781  tmp.description = "Levelset representation of the fluid";
782  RNA_enum_item_add(&item, &totitem, &tmp);
783 
785  tmp.identifier = "PHI_IN";
786  tmp.icon = 0;
787  tmp.name = "Inflow Levelset";
788  tmp.description = "Levelset representation of the inflow";
789  RNA_enum_item_add(&item, &totitem, &tmp);
790 
792  tmp.identifier = "PHI_OUT";
793  tmp.icon = 0;
794  tmp.name = "Outflow Levelset";
795  tmp.description = "Levelset representation of the outflow";
796  RNA_enum_item_add(&item, &totitem, &tmp);
797 
799  tmp.identifier = "PHI_OBSTACLE";
800  tmp.icon = 0;
801  tmp.name = "Obstacle Levelset";
802  tmp.description = "Levelset representation of the obstacles";
803  RNA_enum_item_add(&item, &totitem, &tmp);
804  }
805 
806  RNA_enum_item_end(&item, &totitem);
807  *r_free = true;
808 
809  return item;
810 }
811 
812 static const EnumPropertyItem *rna_Fluid_data_depth_itemf(bContext *UNUSED(C),
813  PointerRNA *ptr,
814  PropertyRNA *UNUSED(prop),
815  bool *r_free)
816 {
818 
819  EnumPropertyItem *item = NULL;
820  EnumPropertyItem tmp = {0, "", 0, "", ""};
821  int totitem = 0;
822 
824  tmp.identifier = "32";
825  tmp.icon = 0;
826  tmp.name = "Full";
827  tmp.description = "Full float (Use 32 bit for all data)";
828  RNA_enum_item_add(&item, &totitem, &tmp);
829 
831  tmp.identifier = "16";
832  tmp.icon = 0;
833  tmp.name = "Half";
834  tmp.description = "Half float (Use 16 bit for all data)";
835  RNA_enum_item_add(&item, &totitem, &tmp);
836 
837  if (settings->type == FLUID_DOMAIN_TYPE_LIQUID) {
839  tmp.identifier = "8";
840  tmp.icon = 0;
841  tmp.name = "Mini";
842  tmp.description = "Mini float (Use 8 bit where possible, otherwise use 16 bit)";
843  RNA_enum_item_add(&item, &totitem, &tmp);
844  }
845 
846  RNA_enum_item_end(&item, &totitem);
847  *r_free = true;
848 
849  return item;
850 }
851 
852 static void rna_Fluid_domaintype_set(struct PointerRNA *ptr, int value)
853 {
855  Object *ob = (Object *)ptr->owner_id;
856  BKE_fluid_domain_type_set(ob, settings, value);
857  BKE_fluid_fields_sanitize(settings);
858 }
859 
860 static char *rna_FluidDomainSettings_path(const PointerRNA *ptr)
861 {
862  const FluidDomainSettings *settings = (FluidDomainSettings *)ptr->data;
863  const ModifierData *md = (ModifierData *)settings->fmd;
864  char name_esc[sizeof(md->name) * 2];
865 
866  BLI_str_escape(name_esc, md->name, sizeof(name_esc));
867  return BLI_sprintfN("modifiers[\"%s\"].domain_settings", name_esc);
868 }
869 
870 static char *rna_FluidFlowSettings_path(const PointerRNA *ptr)
871 {
872  const FluidFlowSettings *settings = (FluidFlowSettings *)ptr->data;
873  const ModifierData *md = (ModifierData *)settings->fmd;
874  char name_esc[sizeof(md->name) * 2];
875 
876  BLI_str_escape(name_esc, md->name, sizeof(name_esc));
877  return BLI_sprintfN("modifiers[\"%s\"].flow_settings", name_esc);
878 }
879 
880 static char *rna_FluidEffectorSettings_path(const PointerRNA *ptr)
881 {
882  const FluidEffectorSettings *settings = (FluidEffectorSettings *)ptr->data;
883  const ModifierData *md = (ModifierData *)settings->fmd;
884  char name_esc[sizeof(md->name) * 2];
885 
886  BLI_str_escape(name_esc, md->name, sizeof(name_esc));
887  return BLI_sprintfN("modifiers[\"%s\"].effector_settings", name_esc);
888 }
889 
890 /* -------------------------------------------------------------------- */
894 # ifdef WITH_FLUID
895 
896 static int rna_FluidModifier_grid_get_length(const PointerRNA *ptr,
898 {
900  float *density = NULL;
901  int size = 0;
902 
903  if (fds->flags & FLUID_DOMAIN_USE_NOISE && fds->fluid) {
904  /* high resolution smoke */
905  int res[3];
906 
907  manta_noise_get_res(fds->fluid, res);
908  size = res[0] * res[1] * res[2];
909 
911  }
912  else if (fds->fluid) {
913  /* regular resolution */
914  size = fds->res[0] * fds->res[1] * fds->res[2];
916  }
917 
918  length[0] = (density) ? size : 0;
919  return length[0];
920 }
921 
922 static int rna_FluidModifier_color_grid_get_length(const PointerRNA *ptr,
924 {
925  rna_FluidModifier_grid_get_length(ptr, length);
926 
927  length[0] *= 4;
928  return length[0];
929 }
930 
931 static int rna_FluidModifier_velocity_grid_get_length(const PointerRNA *ptr,
933 {
935  float *vx = NULL;
936  float *vy = NULL;
937  float *vz = NULL;
938  int size = 0;
939 
940  /* Velocity data is always low-resolution. */
941  if (fds->fluid) {
942  size = 3 * fds->res[0] * fds->res[1] * fds->res[2];
943  vx = manta_get_velocity_x(fds->fluid);
944  vy = manta_get_velocity_y(fds->fluid);
945  vz = manta_get_velocity_z(fds->fluid);
946  }
947 
948  length[0] = (vx && vy && vz) ? size : 0;
949  return length[0];
950 }
951 
952 static int rna_FluidModifier_heat_grid_get_length(const PointerRNA *ptr,
954 {
956  float *heat = NULL;
957  int size = 0;
958 
959  /* Heat data is always low-resolution. */
960  if (fds->fluid) {
961  size = fds->res[0] * fds->res[1] * fds->res[2];
962  heat = manta_smoke_get_heat(fds->fluid);
963  }
964 
965  length[0] = (heat) ? size : 0;
966  return length[0];
967 }
968 
969 static void rna_FluidModifier_density_grid_get(PointerRNA *ptr, float *values)
970 {
973  int size = rna_FluidModifier_grid_get_length(ptr, length);
974  float *density;
975 
977 
978  if (fds->flags & FLUID_DOMAIN_USE_NOISE && fds->fluid) {
980  }
981  else {
983  }
984 
985  memcpy(values, density, size * sizeof(float));
986 
988 }
989 
990 static void rna_FluidModifier_velocity_grid_get(PointerRNA *ptr, float *values)
991 {
994  int size = rna_FluidModifier_velocity_grid_get_length(ptr, length);
995  float *vx, *vy, *vz;
996  int i;
997 
999 
1000  vx = manta_get_velocity_x(fds->fluid);
1001  vy = manta_get_velocity_y(fds->fluid);
1002  vz = manta_get_velocity_z(fds->fluid);
1003 
1004  for (i = 0; i < size; i += 3) {
1005  *(values++) = *(vx++);
1006  *(values++) = *(vy++);
1007  *(values++) = *(vz++);
1008  }
1009 
1011 }
1012 
1013 static void rna_FluidModifier_color_grid_get(PointerRNA *ptr, float *values)
1014 {
1017  int size = rna_FluidModifier_grid_get_length(ptr, length);
1018 
1020 
1021  if (!fds->fluid) {
1022  memset(values, 0, size * sizeof(float));
1023  }
1024  else {
1025  if (fds->flags & FLUID_DOMAIN_USE_NOISE) {
1026  if (manta_noise_has_colors(fds->fluid)) {
1027  manta_noise_get_rgba(fds->fluid, values, 0);
1028  }
1029  else {
1030  manta_noise_get_rgba_fixed_color(fds->fluid, fds->active_color, values, 0);
1031  }
1032  }
1033  else {
1034  if (manta_smoke_has_colors(fds->fluid)) {
1035  manta_smoke_get_rgba(fds->fluid, values, 0);
1036  }
1037  else {
1038  manta_smoke_get_rgba_fixed_color(fds->fluid, fds->active_color, values, 0);
1039  }
1040  }
1041  }
1042 
1044 }
1045 
1046 static void rna_FluidModifier_flame_grid_get(PointerRNA *ptr, float *values)
1047 {
1050  int size = rna_FluidModifier_grid_get_length(ptr, length);
1051  float *flame;
1052 
1054 
1055  if (fds->flags & FLUID_DOMAIN_USE_NOISE && fds->fluid) {
1056  flame = manta_noise_get_flame(fds->fluid);
1057  }
1058  else {
1059  flame = manta_smoke_get_flame(fds->fluid);
1060  }
1061 
1062  if (flame) {
1063  memcpy(values, flame, size * sizeof(float));
1064  }
1065  else {
1066  memset(values, 0, size * sizeof(float));
1067  }
1068 
1070 }
1071 
1072 static void rna_FluidModifier_heat_grid_get(PointerRNA *ptr, float *values)
1073 {
1076  int size = rna_FluidModifier_heat_grid_get_length(ptr, length);
1077  float *heat;
1078 
1080 
1081  heat = manta_smoke_get_heat(fds->fluid);
1082 
1083  if (heat != NULL) {
1084  /* scale heat values from -2.0-2.0 to -1.0-1.0. */
1085  for (int i = 0; i < size; i++) {
1086  values[i] = heat[i] * 0.5f;
1087  }
1088  }
1089  else {
1090  memset(values, 0, size * sizeof(float));
1091  }
1092 
1094 }
1095 
1096 static void rna_FluidModifier_temperature_grid_get(PointerRNA *ptr, float *values)
1097 {
1100  int size = rna_FluidModifier_grid_get_length(ptr, length);
1101  float *flame;
1102 
1104 
1105  if (fds->flags & FLUID_DOMAIN_USE_NOISE && fds->fluid) {
1106  flame = manta_noise_get_flame(fds->fluid);
1107  }
1108  else {
1109  flame = manta_smoke_get_flame(fds->fluid);
1110  }
1111 
1112  if (flame) {
1113  /* Output is such that 0..1 maps to 0..1000K */
1114  float offset = fds->flame_ignition;
1115  float scale = fds->flame_max_temp - fds->flame_ignition;
1116 
1117  for (int i = 0; i < size; i++) {
1118  values[i] = (flame[i] > 0.01f) ? offset + flame[i] * scale : 0.0f;
1119  }
1120  }
1121  else {
1122  memset(values, 0, size * sizeof(float));
1123  }
1124 
1126 }
1127 # endif /* WITH_FLUID */
1128 
1131 static void rna_FluidFlow_density_vgroup_get(PointerRNA *ptr, char *value)
1132 {
1135 }
1136 
1137 static int rna_FluidFlow_density_vgroup_length(PointerRNA *ptr)
1138 {
1141 }
1142 
1143 static void rna_FluidFlow_density_vgroup_set(struct PointerRNA *ptr, const char *value)
1144 {
1147 }
1148 
1149 static void rna_FluidFlow_uvlayer_set(struct PointerRNA *ptr, const char *value)
1150 {
1152  rna_object_uvlayer_name_set(ptr, value, flow->uvlayer_name, sizeof(flow->uvlayer_name));
1153 }
1154 
1155 static void rna_Fluid_use_color_ramp_set(struct PointerRNA *ptr, bool value)
1156 {
1158 
1159  fds->use_coba = value;
1160 
1161  if (value && fds->coba == NULL) {
1162  fds->coba = BKE_colorband_add(false);
1163  }
1164 }
1165 
1166 static void rna_Fluid_flowsource_set(struct PointerRNA *ptr, int value)
1167 {
1168  FluidFlowSettings *settings = (FluidFlowSettings *)ptr->data;
1169 
1170  if (value != settings->source) {
1171  settings->source = value;
1172  }
1173 }
1174 
1175 static const EnumPropertyItem *rna_Fluid_flowsource_itemf(bContext *UNUSED(C),
1176  PointerRNA *ptr,
1177  PropertyRNA *UNUSED(prop),
1178  bool *r_free)
1179 {
1180  FluidFlowSettings *settings = (FluidFlowSettings *)ptr->data;
1181 
1182  EnumPropertyItem *item = NULL;
1183  EnumPropertyItem tmp = {0, "", 0, "", ""};
1184  int totitem = 0;
1185 
1187  tmp.identifier = "MESH";
1188  tmp.icon = ICON_META_CUBE;
1189  tmp.name = "Mesh";
1190  tmp.description = "Emit fluid from mesh surface or volume";
1191  RNA_enum_item_add(&item, &totitem, &tmp);
1192 
1193  if (settings->type != FLUID_FLOW_TYPE_LIQUID) {
1195  tmp.identifier = "PARTICLES";
1196  tmp.icon = ICON_PARTICLES;
1197  tmp.name = "Particle System";
1198  tmp.description = "Emit smoke from particles";
1199  RNA_enum_item_add(&item, &totitem, &tmp);
1200  }
1201 
1202  RNA_enum_item_end(&item, &totitem);
1203  *r_free = true;
1204 
1205  return item;
1206 }
1207 
1208 static void rna_Fluid_flowtype_set(struct PointerRNA *ptr, int value)
1209 {
1210  FluidFlowSettings *settings = (FluidFlowSettings *)ptr->data;
1211 
1212  if (value != settings->type) {
1213  short prev_value = settings->type;
1214  settings->type = value;
1215 
1216  /* Force flow source to mesh for liquids.
1217  * Also use different surface emission. Liquids should by default not emit around surface. */
1218  if (value == FLUID_FLOW_TYPE_LIQUID) {
1219  rna_Fluid_flowsource_set(ptr, FLUID_FLOW_SOURCE_MESH);
1220  settings->surface_distance = 0.0f;
1221  }
1222  /* Use some surface emission when switching to a gas emitter. Gases should by default emit a
1223  * bit around surface. */
1224  if (prev_value == FLUID_FLOW_TYPE_LIQUID) {
1225  settings->surface_distance = 1.5f;
1226  }
1227  }
1228 }
1229 
1230 #else
1231 
1233 {
1234  StructRNA *srna;
1235  PropertyRNA *prop;
1236 
1237  static EnumPropertyItem domain_types[] = {
1238  {FLUID_DOMAIN_TYPE_GAS, "GAS", 0, "Gas", "Create domain for gases"},
1239  {FLUID_DOMAIN_TYPE_LIQUID, "LIQUID", 0, "Liquid", "Create domain for liquids"},
1240  {0, NULL, 0, NULL, NULL}};
1241 
1242  static const EnumPropertyItem prop_compression_items[] = {
1243  {VDB_COMPRESSION_ZIP, "ZIP", 0, "Zip", "Effective but slow compression"},
1244 # ifdef WITH_OPENVDB_BLOSC
1246  "BLOSC",
1247  0,
1248  "Blosc",
1249  "Multithreaded compression, similar in size and quality as 'Zip'"},
1250 # endif
1251  {VDB_COMPRESSION_NONE, "NONE", 0, "None", "Do not use any compression"},
1252  {0, NULL, 0, NULL, NULL}};
1253 
1254  static const EnumPropertyItem smoke_highres_sampling_items[] = {
1255  {SM_HRES_FULLSAMPLE, "FULLSAMPLE", 0, "Full Sample", ""},
1256  {SM_HRES_LINEAR, "LINEAR", 0, "Linear", ""},
1257  {SM_HRES_NEAREST, "NEAREST", 0, "Nearest", ""},
1258  {0, NULL, 0, NULL, NULL},
1259  };
1260 
1261  static EnumPropertyItem cache_types[] = {
1262  {FLUID_DOMAIN_CACHE_REPLAY, "REPLAY", 0, "Replay", "Use the timeline to bake the scene"},
1264  "MODULAR",
1265  0,
1266  "Modular",
1267  "Bake every stage of the simulation separately"},
1268  {FLUID_DOMAIN_CACHE_ALL, "ALL", 0, "All", "Bake all simulation settings at once"},
1269  {0, NULL, 0, NULL, NULL}};
1270 
1271  /* OpenVDB data depth - generated dynamically based on domain type */
1272  static EnumPropertyItem fluid_data_depth_items[] = {
1273  {0, "NONE", 0, "", ""},
1274  {0, NULL, 0, NULL, NULL},
1275  };
1276 
1277  static EnumPropertyItem fluid_mesh_quality_items[] = {
1279  "IMPROVED",
1280  0,
1281  "Final",
1282  "Use improved particle level set (slower but more precise and with mesh smoothening "
1283  "options)"},
1285  "UNION",
1286  0,
1287  "Preview",
1288  "Use union particle level set (faster but lower quality)"},
1289  {0, NULL, 0, NULL, NULL},
1290  };
1291 
1292  static EnumPropertyItem fluid_guide_source_items[] = {
1294  "DOMAIN",
1295  0,
1296  "Domain",
1297  "Use a fluid domain for guiding (domain needs to be baked already so that velocities can "
1298  "be extracted). Guiding domain can be of any type (i.e. gas or liquid)"},
1300  "EFFECTOR",
1301  0,
1302  "Effector",
1303  "Use guiding (effector) objects to create fluid guiding (guiding objects should be "
1304  "animated and baked once set up completely)"},
1305  {0, NULL, 0, NULL, NULL},
1306  };
1307 
1308  /* Cache type - generated dynamically based on domain type */
1309  static EnumPropertyItem cache_file_type_items[] = {
1310  {0, "NONE", 0, "", ""},
1311  {0, NULL, 0, NULL, NULL},
1312  };
1313 
1314  static const EnumPropertyItem interp_method_item[] = {
1315  {FLUID_DISPLAY_INTERP_LINEAR, "LINEAR", 0, "Linear", "Good smoothness and speed"},
1317  "CUBIC",
1318  0,
1319  "Cubic",
1320  "Smoothed high quality interpolation, but slower"},
1321  {FLUID_DISPLAY_INTERP_CLOSEST, "CLOSEST", 0, "Closest", "No interpolation"},
1322  {0, NULL, 0, NULL, NULL},
1323  };
1324 
1325  static const EnumPropertyItem axis_slice_position_items[] = {
1326  {SLICE_AXIS_AUTO,
1327  "AUTO",
1328  0,
1329  "Auto",
1330  "Adjust slice direction according to the view direction"},
1331  {SLICE_AXIS_X, "X", 0, "X", "Slice along the X axis"},
1332  {SLICE_AXIS_Y, "Y", 0, "Y", "Slice along the Y axis"},
1333  {SLICE_AXIS_Z, "Z", 0, "Z", "Slice along the Z axis"},
1334  {0, NULL, 0, NULL, NULL},
1335  };
1336 
1337  static const EnumPropertyItem vector_draw_items[] = {
1338  {VECTOR_DRAW_NEEDLE, "NEEDLE", 0, "Needle", "Display vectors as needles"},
1339  {VECTOR_DRAW_STREAMLINE, "STREAMLINE", 0, "Streamlines", "Display vectors as streamlines"},
1340  {VECTOR_DRAW_MAC, "MAC", 0, "MAC Grid", "Display vector field as MAC grid"},
1341  {0, NULL, 0, NULL, NULL},
1342  };
1343 
1344  static const EnumPropertyItem vector_field_items[] = {
1346  "FLUID_VELOCITY",
1347  0,
1348  "Fluid Velocity",
1349  "Velocity field of the fluid domain"},
1351  "GUIDE_VELOCITY",
1352  0,
1353  "Guide Velocity",
1354  "Guide velocity field of the fluid domain"},
1355  {FLUID_DOMAIN_VECTOR_FIELD_FORCE, "FORCE", 0, "Force", "Force field of the fluid domain"},
1356  {0, NULL, 0, NULL, NULL},
1357  };
1358 
1359  static const EnumPropertyItem gridlines_color_field_items[] = {
1360  {0, "NONE", 0, "None", "None"},
1361  {FLUID_GRIDLINE_COLOR_TYPE_FLAGS, "FLAGS", 0, "Flags", "Flag grid of the fluid domain"},
1363  "RANGE",
1364  0,
1365  "Highlight Range",
1366  "Highlight the voxels with values of the color mapped field within the range"},
1367  {0, NULL, 0, NULL, NULL},
1368  };
1369 
1370  static const EnumPropertyItem gridlines_cell_filter_items[] = {
1371  {FLUID_CELL_TYPE_NONE, "NONE", 0, "None", "Highlight the cells regardless of their type"},
1372  {FLUID_CELL_TYPE_FLUID, "FLUID", 0, "Fluid", "Highlight only the cells of type Fluid"},
1374  "OBSTACLE",
1375  0,
1376  "Obstacle",
1377  "Highlight only the cells of type Obstacle"},
1378  {FLUID_CELL_TYPE_EMPTY, "EMPTY", 0, "Empty", "Highlight only the cells of type Empty"},
1379  {FLUID_CELL_TYPE_INFLOW, "INFLOW", 0, "Inflow", "Highlight only the cells of type Inflow"},
1381  "OUTFLOW",
1382  0,
1383  "Outflow",
1384  "Highlight only the cells of type Outflow"},
1385  {0, NULL, 0, NULL, NULL},
1386  };
1387 
1388  static const EnumPropertyItem sndparticle_boundary_items[] = {
1390  "DELETE",
1391  0,
1392  "Delete",
1393  "Delete secondary particles that are inside obstacles or left the domain"},
1395  "PUSHOUT",
1396  0,
1397  "Push Out",
1398  "Push secondary particles that left the domain back into the domain"},
1399  {0, NULL, 0, NULL, NULL}};
1400 
1401  static const EnumPropertyItem sndparticle_combined_export_items[] = {
1403  "OFF",
1404  0,
1405  "Off",
1406  "Create a separate particle system for every secondary particle type"},
1408  "SPRAY_FOAM",
1409  0,
1410  "Spray + Foam",
1411  "Spray and foam particles are saved in the same particle system"},
1413  "SPRAY_BUBBLES",
1414  0,
1415  "Spray + Bubbles",
1416  "Spray and bubble particles are saved in the same particle system"},
1418  "FOAM_BUBBLES",
1419  0,
1420  "Foam + Bubbles",
1421  "Foam and bubbles particles are saved in the same particle system"},
1423  "SPRAY_FOAM_BUBBLES",
1424  0,
1425  "Spray + Foam + Bubbles",
1426  "Create one particle system that contains all three secondary particle types"},
1427  {0, NULL, 0, NULL, NULL}};
1428 
1429  static EnumPropertyItem simulation_methods[] = {
1431  "FLIP",
1432  0,
1433  "FLIP",
1434  "Use FLIP as the simulation method (more splashy behavior)"},
1436  "APIC",
1437  0,
1438  "APIC",
1439  "Use APIC as the simulation method (more energetic and stable behavior)"},
1440  {0, NULL, 0, NULL, NULL},
1441  };
1442 
1443  srna = RNA_def_struct(brna, "FluidDomainSettings", NULL);
1444  RNA_def_struct_ui_text(srna, "Domain Settings", "Fluid domain settings");
1445  RNA_def_struct_sdna(srna, "FluidDomainSettings");
1446  RNA_def_struct_path_func(srna, "rna_FluidDomainSettings_path");
1447 
1448  prop = RNA_def_property(srna, "effector_weights", PROP_POINTER, PROP_NONE);
1449  RNA_def_property_struct_type(prop, "EffectorWeights");
1452  RNA_def_property_ui_text(prop, "Effector Weights", "");
1453 
1454  /* object collections */
1455 
1456  prop = RNA_def_property(srna, "effector_group", PROP_POINTER, PROP_NONE);
1457  RNA_def_property_pointer_sdna(prop, NULL, "effector_group");
1458  RNA_def_property_struct_type(prop, "Collection");
1460  RNA_def_property_ui_text(prop, "Effector Collection", "Limit effectors to this collection");
1461  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_reset_dependency");
1462 
1463  prop = RNA_def_property(srna, "fluid_group", PROP_POINTER, PROP_NONE);
1464  RNA_def_property_pointer_sdna(prop, NULL, "fluid_group");
1465  RNA_def_property_struct_type(prop, "Collection");
1467  RNA_def_property_ui_text(prop, "Fluid Collection", "Limit fluid objects to this collection");
1468  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_reset_dependency");
1469 
1470  prop = RNA_def_property(srna, "force_collection", PROP_POINTER, PROP_NONE);
1471  RNA_def_property_pointer_sdna(prop, NULL, "force_group");
1472  RNA_def_property_struct_type(prop, "Collection");
1474  RNA_def_property_ui_text(prop, "Force Collection", "Limit forces to this collection");
1475  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_reset_dependency");
1476 
1477  /* grid access */
1478 
1479 # ifdef WITH_FLUID
1480  prop = RNA_def_property(srna, "density_grid", PROP_FLOAT, PROP_NONE);
1481  RNA_def_property_array(prop, 32);
1484  RNA_def_property_dynamic_array_funcs(prop, "rna_FluidModifier_grid_get_length");
1485  RNA_def_property_float_funcs(prop, "rna_FluidModifier_density_grid_get", NULL, NULL);
1486  RNA_def_property_ui_text(prop, "Density Grid", "Smoke density grid");
1487 
1488  prop = RNA_def_property(srna, "velocity_grid", PROP_FLOAT, PROP_NONE);
1489  RNA_def_property_array(prop, 32);
1492  RNA_def_property_dynamic_array_funcs(prop, "rna_FluidModifier_velocity_grid_get_length");
1493  RNA_def_property_float_funcs(prop, "rna_FluidModifier_velocity_grid_get", NULL, NULL);
1494  RNA_def_property_ui_text(prop, "Velocity Grid", "Smoke velocity grid");
1495 
1496  prop = RNA_def_property(srna, "flame_grid", PROP_FLOAT, PROP_NONE);
1497  RNA_def_property_array(prop, 32);
1500  RNA_def_property_dynamic_array_funcs(prop, "rna_FluidModifier_grid_get_length");
1501  RNA_def_property_float_funcs(prop, "rna_FluidModifier_flame_grid_get", NULL, NULL);
1502  RNA_def_property_ui_text(prop, "Flame Grid", "Smoke flame grid");
1503 
1504  prop = RNA_def_property(srna, "color_grid", PROP_FLOAT, PROP_NONE);
1505  RNA_def_property_array(prop, 32);
1508  RNA_def_property_dynamic_array_funcs(prop, "rna_FluidModifier_color_grid_get_length");
1509  RNA_def_property_float_funcs(prop, "rna_FluidModifier_color_grid_get", NULL, NULL);
1510  RNA_def_property_ui_text(prop, "Color Grid", "Smoke color grid");
1511 
1512  prop = RNA_def_property(srna, "heat_grid", PROP_FLOAT, PROP_NONE);
1513  RNA_def_property_array(prop, 32);
1516  RNA_def_property_dynamic_array_funcs(prop, "rna_FluidModifier_heat_grid_get_length");
1517  RNA_def_property_float_funcs(prop, "rna_FluidModifier_heat_grid_get", NULL, NULL);
1518  RNA_def_property_ui_text(prop, "Heat Grid", "Smoke heat grid");
1519 
1520  prop = RNA_def_property(srna, "temperature_grid", PROP_FLOAT, PROP_NONE);
1521  RNA_def_property_array(prop, 32);
1524  RNA_def_property_dynamic_array_funcs(prop, "rna_FluidModifier_grid_get_length");
1525  RNA_def_property_float_funcs(prop, "rna_FluidModifier_temperature_grid_get", NULL, NULL);
1527  prop, "Temperature Grid", "Smoke temperature grid, range 0 to 1 represents 0 to 1000K");
1528 # endif /* WITH_FLUID */
1529 
1530  /* domain object data */
1531 
1532  prop = RNA_def_property(srna,
1533  "start_point",
1534  PROP_FLOAT,
1535  PROP_XYZ); /* can change each frame when using adaptive domain */
1536  RNA_def_property_float_sdna(prop, NULL, "p0");
1538  RNA_def_property_ui_text(prop, "p0", "Start point");
1539 
1540  prop = RNA_def_property(srna,
1541  "cell_size",
1542  PROP_FLOAT,
1543  PROP_XYZ); /* can change each frame when using adaptive domain */
1545  RNA_def_property_ui_text(prop, "cell_size", "Cell Size");
1546 
1547  prop = RNA_def_property(srna,
1548  "domain_resolution",
1549  PROP_INT,
1550  PROP_XYZ); /* can change each frame when using adaptive domain */
1551  RNA_def_property_int_sdna(prop, NULL, "res");
1553  RNA_def_property_ui_text(prop, "res", "Smoke Grid Resolution");
1554 
1555  /* adaptive domain options */
1556 
1557  prop = RNA_def_property(srna, "additional_res", PROP_INT, PROP_NONE);
1558  RNA_def_property_int_sdna(prop, NULL, "adapt_res");
1559  RNA_def_property_range(prop, 0, 512);
1560  RNA_def_property_ui_text(prop, "Additional", "Maximum number of additional cells");
1561  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_datacache_reset");
1562 
1563  prop = RNA_def_property(srna, "adapt_margin", PROP_INT, PROP_NONE);
1564  RNA_def_property_int_sdna(prop, NULL, "adapt_margin");
1565  RNA_def_property_range(prop, 2, 24);
1567  prop, "Margin", "Margin added around fluid to minimize boundary interference");
1568  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_datacache_reset");
1569 
1570  prop = RNA_def_property(srna, "adapt_threshold", PROP_FLOAT, PROP_NONE);
1571  RNA_def_property_range(prop, 0.0, 1.0);
1572  RNA_def_property_ui_range(prop, 0.0, 1.0, 0.02, 6);
1574  prop,
1575  "Threshold",
1576  "Minimum amount of fluid a cell can contain before it is considered empty");
1577  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_datacache_reset");
1578 
1579  prop = RNA_def_property(srna, "use_adaptive_domain", PROP_BOOLEAN, PROP_NONE);
1582  prop, "Adaptive Domain", "Adapt simulation resolution and size to fluid");
1584  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_domain_data_reset");
1585 
1586  /* fluid domain options */
1587 
1588  prop = RNA_def_property(srna, "resolution_max", PROP_INT, PROP_NONE);
1589  RNA_def_property_int_sdna(prop, NULL, "maxres");
1590  RNA_def_property_range(prop, 6, 10000);
1591  RNA_def_property_ui_range(prop, 24, 10000, 2, -1);
1593  prop,
1594  "Maximum Resolution",
1595  "Resolution used for the fluid domain. Value corresponds to the longest domain side "
1596  "(resolution for other domain sides is calculated automatically)");
1598  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_domain_data_reset");
1599 
1600  prop = RNA_def_property(srna, "use_collision_border_front", PROP_BOOLEAN, PROP_NONE);
1601  RNA_def_property_boolean_sdna(prop, NULL, "border_collisions", FLUID_DOMAIN_BORDER_FRONT);
1602  RNA_def_property_ui_text(prop, "Front", "Enable collisions with front domain border");
1603  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_datacache_reset");
1604 
1605  prop = RNA_def_property(srna, "use_collision_border_back", PROP_BOOLEAN, PROP_NONE);
1606  RNA_def_property_boolean_sdna(prop, NULL, "border_collisions", FLUID_DOMAIN_BORDER_BACK);
1607  RNA_def_property_ui_text(prop, "Back", "Enable collisions with back domain border");
1608  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_datacache_reset");
1609 
1610  prop = RNA_def_property(srna, "use_collision_border_right", PROP_BOOLEAN, PROP_NONE);
1611  RNA_def_property_boolean_sdna(prop, NULL, "border_collisions", FLUID_DOMAIN_BORDER_RIGHT);
1612  RNA_def_property_ui_text(prop, "Right", "Enable collisions with right domain border");
1613  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_datacache_reset");
1614 
1615  prop = RNA_def_property(srna, "use_collision_border_left", PROP_BOOLEAN, PROP_NONE);
1616  RNA_def_property_boolean_sdna(prop, NULL, "border_collisions", FLUID_DOMAIN_BORDER_LEFT);
1617  RNA_def_property_ui_text(prop, "Left", "Enable collisions with left domain border");
1618  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_datacache_reset");
1619 
1620  prop = RNA_def_property(srna, "use_collision_border_top", PROP_BOOLEAN, PROP_NONE);
1621  RNA_def_property_boolean_sdna(prop, NULL, "border_collisions", FLUID_DOMAIN_BORDER_TOP);
1622  RNA_def_property_ui_text(prop, "Top", "Enable collisions with top domain border");
1623  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_datacache_reset");
1624 
1625  prop = RNA_def_property(srna, "use_collision_border_bottom", PROP_BOOLEAN, PROP_NONE);
1626  RNA_def_property_boolean_sdna(prop, NULL, "border_collisions", FLUID_DOMAIN_BORDER_BOTTOM);
1627  RNA_def_property_ui_text(prop, "Bottom", "Enable collisions with bottom domain border");
1628  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_datacache_reset");
1629 
1630  prop = RNA_def_property(srna, "gravity", PROP_FLOAT, PROP_ACCELERATION);
1631  RNA_def_property_float_sdna(prop, NULL, "gravity");
1632  RNA_def_property_array(prop, 3);
1633  RNA_def_property_range(prop, -1000.1, 1000.1);
1634  RNA_def_property_ui_text(prop, "Gravity", "Gravity in X, Y and Z direction");
1635  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_datacache_reset");
1636 
1637  prop = RNA_def_property(srna, "domain_type", PROP_ENUM, PROP_NONE);
1638  RNA_def_property_enum_sdna(prop, NULL, "type");
1639  RNA_def_property_enum_items(prop, domain_types);
1640  RNA_def_property_enum_funcs(prop, NULL, "rna_Fluid_domaintype_set", NULL);
1641  RNA_def_property_ui_text(prop, "Domain Type", "Change domain type of the simulation");
1643  RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Fluid_flip_parts_update");
1644 
1645  prop = RNA_def_property(srna, "delete_in_obstacle", PROP_BOOLEAN, PROP_NONE);
1647  RNA_def_property_ui_text(prop, "Clear In Obstacle", "Delete fluid inside obstacles");
1648  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_datacache_reset");
1649 
1650  /* smoke domain options */
1651 
1652  prop = RNA_def_property(srna, "alpha", PROP_FLOAT, PROP_NONE);
1653  RNA_def_property_float_sdna(prop, NULL, "alpha");
1654  RNA_def_property_range(prop, -5.0, 5.0);
1655  RNA_def_property_ui_range(prop, -5.0, 5.0, 0.02, 5);
1657  prop,
1658  "Buoyancy Density",
1659  "Buoyant force based on smoke density (higher value results in faster rising smoke)");
1660  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_datacache_reset");
1661 
1662  prop = RNA_def_property(srna, "beta", PROP_FLOAT, PROP_NONE);
1663  RNA_def_property_float_sdna(prop, NULL, "beta");
1664  RNA_def_property_range(prop, -5.0, 5.0);
1665  RNA_def_property_ui_range(prop, -5.0, 5.0, 0.02, 5);
1667  prop,
1668  "Buoyancy Heat",
1669  "Buoyant force based on smoke heat (higher value results in faster rising smoke)");
1670  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_datacache_reset");
1671 
1672  prop = RNA_def_property(srna, "dissolve_speed", PROP_INT, PROP_NONE);
1673  RNA_def_property_int_sdna(prop, NULL, "diss_speed");
1674  RNA_def_property_range(prop, 1.0, 10000.0);
1675  RNA_def_property_ui_range(prop, 1.0, 10000.0, 1, -1);
1677  prop,
1678  "Dissolve Speed",
1679  "Determine how quickly the smoke dissolves (lower value makes smoke disappear faster)");
1680  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_datacache_reset");
1681 
1682  prop = RNA_def_property(srna, "vorticity", PROP_FLOAT, PROP_NONE);
1683  RNA_def_property_float_sdna(prop, NULL, "vorticity");
1684  RNA_def_property_range(prop, 0.0, 4.0);
1685  RNA_def_property_ui_text(prop, "Vorticity", "Amount of turbulence and rotation in smoke");
1686  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_datacache_reset");
1687 
1688  prop = RNA_def_property(srna, "highres_sampling", PROP_ENUM, PROP_NONE);
1689  RNA_def_property_enum_items(prop, smoke_highres_sampling_items);
1690  RNA_def_property_ui_text(prop, "Emitter", "Method for sampling the high resolution flow");
1691  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_datacache_reset");
1692 
1693  prop = RNA_def_property(srna, "use_dissolve_smoke", PROP_BOOLEAN, PROP_NONE);
1695  RNA_def_property_ui_text(prop, "Dissolve Smoke", "Let smoke disappear over time");
1696  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_datacache_reset");
1697 
1698  prop = RNA_def_property(srna, "use_dissolve_smoke_log", PROP_BOOLEAN, PROP_NONE);
1701  prop,
1702  "Logarithmic Dissolve",
1703  "Dissolve smoke in a logarithmic fashion. Dissolves quickly at first, but lingers longer");
1704  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_datacache_reset");
1705 
1706  /* flame options */
1707 
1708  prop = RNA_def_property(srna, "burning_rate", PROP_FLOAT, PROP_NONE);
1709  RNA_def_property_range(prop, 0.01, 4.0);
1710  RNA_def_property_ui_range(prop, 0.01, 2.0, 1.0, 5);
1712  prop, "Speed", "Speed of the burning reaction (higher value results in smaller flames)");
1713  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_datacache_reset");
1714 
1715  prop = RNA_def_property(srna, "flame_smoke", PROP_FLOAT, PROP_NONE);
1716  RNA_def_property_range(prop, 0.0, 8.0);
1717  RNA_def_property_ui_range(prop, 0.0, 4.0, 1.0, 5);
1718  RNA_def_property_ui_text(prop, "Smoke", "Amount of smoke created by burning fuel");
1719  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_datacache_reset");
1720 
1721  prop = RNA_def_property(srna, "flame_vorticity", PROP_FLOAT, PROP_NONE);
1722  RNA_def_property_range(prop, 0.0, 2.0);
1723  RNA_def_property_ui_range(prop, 0.0, 1.0, 1.0, 5);
1724  RNA_def_property_ui_text(prop, "Vorticity", "Additional vorticity for the flames");
1725  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_datacache_reset");
1726 
1727  prop = RNA_def_property(srna, "flame_ignition", PROP_FLOAT, PROP_NONE);
1728  RNA_def_property_range(prop, 0.5, 5.0);
1729  RNA_def_property_ui_range(prop, 0.5, 2.5, 1.0, 5);
1731  prop,
1732  "Minimum",
1733  "Minimum temperature of the flames (higher value results in faster rising flames)");
1734  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_datacache_reset");
1735 
1736  prop = RNA_def_property(srna, "flame_max_temp", PROP_FLOAT, PROP_NONE);
1737  RNA_def_property_range(prop, 1.0, 10.0);
1738  RNA_def_property_ui_range(prop, 1.0, 5.0, 1.0, 5);
1740  prop,
1741  "Maximum",
1742  "Maximum temperature of the flames (higher value results in faster rising flames)");
1743  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_datacache_reset");
1744 
1745  prop = RNA_def_property(srna, "flame_smoke_color", PROP_FLOAT, PROP_COLOR_GAMMA);
1746  RNA_def_property_array(prop, 3);
1747  RNA_def_property_ui_text(prop, "Smoke Color", "Color of smoke emitted from burning fuel");
1748  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_datacache_reset");
1749 
1750  /* noise options */
1751 
1752  prop = RNA_def_property(srna, "noise_strength", PROP_FLOAT, PROP_NONE);
1753  RNA_def_property_float_sdna(prop, NULL, "noise_strength");
1754  RNA_def_property_range(prop, 0.0, 10.0);
1755  RNA_def_property_ui_range(prop, 0.0, 10.0, 1, 2);
1756  RNA_def_property_ui_text(prop, "Strength", "Strength of noise");
1757  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_noisecache_reset");
1758 
1759  prop = RNA_def_property(srna, "noise_pos_scale", PROP_FLOAT, PROP_NONE);
1760  RNA_def_property_float_sdna(prop, NULL, "noise_pos_scale");
1761  RNA_def_property_range(prop, 0.0001, 10.0);
1763  prop, "Scale", "Scale of noise (higher value results in larger vortices)");
1764  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_noisecache_reset");
1765 
1766  prop = RNA_def_property(srna, "noise_time_anim", PROP_FLOAT, PROP_NONE);
1767  RNA_def_property_float_sdna(prop, NULL, "noise_time_anim");
1768  RNA_def_property_range(prop, 0.0001, 10.0);
1769  RNA_def_property_ui_text(prop, "Time", "Animation time of noise");
1770  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_noisecache_reset");
1771 
1772  prop = RNA_def_property(srna, "noise_scale", PROP_INT, PROP_NONE);
1773  RNA_def_property_int_sdna(prop, NULL, "noise_scale");
1774  RNA_def_property_range(prop, 1, 100);
1775  RNA_def_property_ui_range(prop, 1, 10, 1, -1);
1777  "Noise Scale",
1778  "The noise simulation is scaled up by this factor (compared to the "
1779  "base resolution of the domain)");
1781  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_domain_noise_reset");
1782 
1783  prop = RNA_def_property(srna, "use_noise", PROP_BOOLEAN, PROP_NONE);
1785  RNA_def_property_ui_text(prop, "Use Noise", "Enable fluid noise (using amplification)");
1787  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_update");
1788 
1789  /* liquid domain options */
1790 
1791  prop = RNA_def_property(srna, "simulation_method", PROP_ENUM, PROP_NONE);
1792  RNA_def_property_enum_sdna(prop, NULL, "simulation_method");
1793  RNA_def_property_enum_items(prop, simulation_methods);
1794  RNA_def_property_ui_text(prop, "Simulation Method", "Change the underlying simulation method");
1796  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_domain_data_reset");
1797 
1798  prop = RNA_def_property(srna, "flip_ratio", PROP_FLOAT, PROP_NONE);
1799  RNA_def_property_range(prop, 0.0, 1.0);
1801  prop,
1802  "FLIP Ratio",
1803  "PIC/FLIP Ratio. A value of 1.0 will result in a completely FLIP based simulation. Use a "
1804  "lower value for simulations which should produce smaller splashes");
1805  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_datacache_reset");
1806 
1807  prop = RNA_def_property(srna, "particle_randomness", PROP_FLOAT, PROP_NONE);
1808  RNA_def_property_range(prop, 0.0, 10.0);
1809  RNA_def_property_ui_text(prop, "Randomness", "Randomness factor for particle sampling");
1810  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_datacache_reset");
1811 
1812  prop = RNA_def_property(srna, "particle_number", PROP_INT, PROP_NONE);
1813  RNA_def_property_range(prop, 1, 5);
1815  prop, "Number", "Particle number factor (higher value results in more particles)");
1816  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_datacache_reset");
1817 
1818  prop = RNA_def_property(srna, "particle_min", PROP_INT, PROP_NONE);
1819  RNA_def_property_int_sdna(prop, NULL, "particle_minimum");
1820  RNA_def_property_range(prop, 0, 1000);
1822  "Minimum",
1823  "Minimum number of particles per cell (ensures that each cell has at "
1824  "least this amount of particles)");
1825  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_datacache_reset");
1826 
1827  prop = RNA_def_property(srna, "particle_max", PROP_INT, PROP_NONE);
1828  RNA_def_property_int_sdna(prop, NULL, "particle_maximum");
1829  RNA_def_property_range(prop, 0, 1000);
1831  "Maximum",
1832  "Maximum number of particles per cell (ensures that each cell has at "
1833  "most this amount of particles)");
1834  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_datacache_reset");
1835 
1836  prop = RNA_def_property(srna, "particle_radius", PROP_FLOAT, PROP_NONE);
1837  RNA_def_property_range(prop, 0.0, 10.0);
1839  "Radius",
1840  "Particle radius factor. Increase this value if the simulation appears "
1841  "to leak volume, decrease it if the simulation seems to gain volume");
1842  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_datacache_reset");
1843 
1844  prop = RNA_def_property(srna, "particle_band_width", PROP_FLOAT, PROP_NONE);
1845  RNA_def_property_range(prop, 0.0, 1000.0);
1847  prop,
1848  "Width",
1849  "Particle (narrow) band width (higher value results in thicker band and more particles)");
1850  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_datacache_reset");
1851 
1852  prop = RNA_def_property(srna, "use_flip_particles", PROP_BOOLEAN, PROP_NONE);
1854  RNA_def_property_ui_text(prop, "FLIP", "Create liquid particle system");
1856  RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Fluid_flip_parts_update");
1857 
1858  prop = RNA_def_property(srna, "use_fractions", PROP_BOOLEAN, PROP_NONE);
1861  prop,
1862  "Fractional Obstacles",
1863  "Fractional obstacles improve and smoothen the fluid-obstacle boundary");
1865  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_datacache_reset");
1866 
1867  prop = RNA_def_property(srna, "fractions_threshold", PROP_FLOAT, PROP_NONE);
1868  RNA_def_property_range(prop, 0.001, 1.0);
1869  RNA_def_property_ui_range(prop, 0.01, 1.0, 0.05, -1);
1871  "Obstacle Threshold",
1872  "Determines how much fluid is allowed in an obstacle cell "
1873  "(higher values will tag a boundary cell as an obstacle easier "
1874  "and reduce the boundary smoothening effect)");
1875  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_datacache_reset");
1876 
1877  prop = RNA_def_property(srna, "fractions_distance", PROP_FLOAT, PROP_NONE);
1878  RNA_def_property_range(prop, -5.0, 5.0);
1879  RNA_def_property_ui_range(prop, 0.01, 5.0, 0.1, -1);
1881  "Obstacle Distance",
1882  "Determines how far apart fluid and obstacle are (higher values will "
1883  "result in fluid being further away from obstacles, smaller values "
1884  "will let fluid move towards the inside of obstacles)");
1885  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_datacache_reset");
1886 
1887  prop = RNA_def_property(srna, "sys_particle_maximum", PROP_INT, PROP_NONE);
1888  RNA_def_property_int_sdna(prop, NULL, "sys_particle_maximum");
1889  RNA_def_property_range(prop, 0, INT_MAX);
1891  prop,
1892  "System Maximum",
1893  "Maximum number of fluid particles that are allowed in this simulation");
1894  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_datacache_reset");
1895 
1896  /* viscosity options */
1897 
1898  prop = RNA_def_property(srna, "use_viscosity", PROP_BOOLEAN, PROP_NONE);
1900  RNA_def_property_ui_text(prop, "Use Viscosity", "Enable fluid viscosity settings");
1901  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_datacache_reset");
1902 
1903  prop = RNA_def_property(srna, "viscosity_value", PROP_FLOAT, PROP_NONE);
1904  RNA_def_property_range(prop, 0.0, 10.0);
1905  RNA_def_property_ui_range(prop, 0.0, 5.0, 1.0, 3);
1907  "Strength",
1908  "Viscosity of liquid (higher values result in more viscous fluids, a "
1909  "value of 0 will still apply some viscosity)");
1910  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_datacache_reset");
1911 
1912  /* diffusion options */
1913 
1914  prop = RNA_def_property(srna, "use_diffusion", PROP_BOOLEAN, PROP_NONE);
1917  prop, "Use Diffusion", "Enable fluid diffusion settings (e.g. viscosity, surface tension)");
1919  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_datacache_reset");
1920 
1921  prop = RNA_def_property(srna, "surface_tension", PROP_FLOAT, PROP_NONE);
1922  RNA_def_property_range(prop, 0.0, 100.0);
1924  prop,
1925  "Tension",
1926  "Surface tension of liquid (higher value results in greater hydrophobic behavior)");
1927  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_datacache_reset");
1928 
1929  prop = RNA_def_property(srna, "viscosity_base", PROP_FLOAT, PROP_NONE);
1930  RNA_def_property_float_sdna(prop, NULL, "viscosity_base");
1931  RNA_def_property_range(prop, 0, 10);
1933  prop,
1934  "Viscosity Base",
1935  "Viscosity setting: value that is multiplied by 10 to the power of (exponent*-1)");
1936  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_datacache_reset");
1937 
1938  prop = RNA_def_property(srna, "viscosity_exponent", PROP_INT, PROP_NONE);
1939  RNA_def_property_int_sdna(prop, NULL, "viscosity_exponent");
1940  RNA_def_property_range(prop, 0, 10);
1942  prop,
1943  "Viscosity Exponent",
1944  "Negative exponent for the viscosity value (to simplify entering small values "
1945  "e.g. 5*10^-6)");
1946  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_datacache_reset");
1947 
1948  /* Mesh options. */
1949 
1950  prop = RNA_def_property(srna, "mesh_concave_upper", PROP_FLOAT, PROP_NONE);
1951  RNA_def_property_range(prop, 0.0, 10.0);
1953  prop,
1954  "Upper Concavity",
1955  "Upper mesh concavity bound (high values tend to smoothen and fill out concave regions)");
1956  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_meshcache_reset");
1957 
1958  prop = RNA_def_property(srna, "mesh_concave_lower", PROP_FLOAT, PROP_NONE);
1959  RNA_def_property_range(prop, 0.0, 10.0);
1961  prop,
1962  "Lower Concavity",
1963  "Lower mesh concavity bound (high values tend to smoothen and fill out concave regions)");
1964  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_meshcache_reset");
1965 
1966  prop = RNA_def_property(srna, "mesh_smoothen_pos", PROP_INT, PROP_NONE);
1967  RNA_def_property_range(prop, 0, 100);
1968  RNA_def_property_ui_text(prop, "Smoothen Pos", "Positive mesh smoothening");
1969  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_meshcache_reset");
1970 
1971  prop = RNA_def_property(srna, "mesh_smoothen_neg", PROP_INT, PROP_NONE);
1972  RNA_def_property_range(prop, 0, 100);
1973  RNA_def_property_ui_text(prop, "Smoothen Neg", "Negative mesh smoothening");
1974  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_meshcache_reset");
1975 
1976  prop = RNA_def_property(srna, "mesh_scale", PROP_INT, PROP_NONE);
1977  RNA_def_property_int_sdna(prop, NULL, "mesh_scale");
1978  RNA_def_property_range(prop, 1, 100);
1979  RNA_def_property_ui_range(prop, 1, 10, 1, -1);
1981  "Mesh scale",
1982  "The mesh simulation is scaled up by this factor (compared to the base "
1983  "resolution of the domain). For best meshing, it is recommended to "
1984  "adjust the mesh particle radius alongside this value");
1986  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_domain_mesh_reset");
1987 
1988  prop = RNA_def_property(srna, "mesh_generator", PROP_ENUM, PROP_NONE);
1989  RNA_def_property_enum_sdna(prop, NULL, "mesh_generator");
1990  RNA_def_property_enum_items(prop, fluid_mesh_quality_items);
1991  RNA_def_property_ui_text(prop, "Mesh generator", "Which particle level set generator to use");
1992  RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Fluid_update");
1993 
1994  prop = RNA_def_property(srna, "use_mesh", PROP_BOOLEAN, PROP_NONE);
1996  RNA_def_property_ui_text(prop, "Use Mesh", "Enable fluid mesh (using amplification)");
1998  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_update");
1999 
2000  prop = RNA_def_property(srna, "use_speed_vectors", PROP_BOOLEAN, PROP_NONE);
2003  "Speed Vectors",
2004  "Caches velocities of mesh vertices. These will be used "
2005  "(automatically) when rendering with motion blur enabled");
2007  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_meshcache_reset");
2008 
2009  prop = RNA_def_property(srna, "mesh_particle_radius", PROP_FLOAT, PROP_NONE);
2010  RNA_def_property_range(prop, 0.0, 10.0);
2012  "Radius",
2013  "Particle radius factor (higher value results in larger (meshed) "
2014  "particles). Needs to be adjusted after changing the mesh scale");
2015  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_meshcache_reset");
2016 
2017  /* secondary particles options */
2018 
2019  prop = RNA_def_property(srna, "sndparticle_potential_min_wavecrest", PROP_FLOAT, PROP_NONE);
2020  RNA_def_property_float_sdna(prop, NULL, "sndparticle_tau_min_wc");
2021  RNA_def_property_range(prop, 0.0, 1000.0);
2022  RNA_def_property_ui_range(prop, 0.0, 1000.0, 100.0, 3);
2024  "Minimum Wave Crest Potential",
2025  "Lower clamping threshold for marking fluid cells as wave crests "
2026  "(lower value results in more marked cells)");
2027  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_particlescache_reset");
2028 
2029  prop = RNA_def_property(srna, "sndparticle_potential_max_wavecrest", PROP_FLOAT, PROP_NONE);
2030  RNA_def_property_float_sdna(prop, NULL, "sndparticle_tau_max_wc");
2031  RNA_def_property_range(prop, 0.0, 1000.0);
2032  RNA_def_property_ui_range(prop, 0.0, 1000.0, 100.0, 3);
2034  "Maximum Wave Crest Potential",
2035  "Upper clamping threshold for marking fluid cells as wave crests "
2036  "(higher value results in less marked cells)");
2037  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_particlescache_reset");
2038 
2039  prop = RNA_def_property(srna, "sndparticle_potential_min_trappedair", PROP_FLOAT, PROP_NONE);
2040  RNA_def_property_float_sdna(prop, NULL, "sndparticle_tau_min_ta");
2041  RNA_def_property_range(prop, 0.0, 1000.0);
2042  RNA_def_property_ui_range(prop, 0.0, 10000.0, 100.0, 3);
2044  "Minimum Trapped Air Potential",
2045  "Lower clamping threshold for marking fluid cells where air is trapped "
2046  "(lower value results in more marked cells)");
2047  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_particlescache_reset");
2048 
2049  prop = RNA_def_property(srna, "sndparticle_potential_max_trappedair", PROP_FLOAT, PROP_NONE);
2050  RNA_def_property_float_sdna(prop, NULL, "sndparticle_tau_max_ta");
2051  RNA_def_property_range(prop, 0.0, 1000.0);
2052  RNA_def_property_ui_range(prop, 0.0, 1000.0, 100.0, 3);
2054  "Maximum Trapped Air Potential",
2055  "Upper clamping threshold for marking fluid cells where air is trapped "
2056  "(higher value results in less marked cells)");
2057  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_particlescache_reset");
2058 
2059  prop = RNA_def_property(srna, "sndparticle_potential_min_energy", PROP_FLOAT, PROP_NONE);
2060  RNA_def_property_float_sdna(prop, NULL, "sndparticle_tau_min_k");
2061  RNA_def_property_range(prop, 0.0, 1000.0);
2062  RNA_def_property_ui_range(prop, 0.0, 1000.0, 100.0, 3);
2064  prop,
2065  "Minimum Kinetic Energy Potential",
2066  "Lower clamping threshold that indicates the fluid speed where cells start to emit "
2067  "particles (lower values result in generally more particles)");
2068  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_particlescache_reset");
2069 
2070  prop = RNA_def_property(srna, "sndparticle_potential_max_energy", PROP_FLOAT, PROP_NONE);
2071  RNA_def_property_float_sdna(prop, NULL, "sndparticle_tau_max_k");
2072  RNA_def_property_range(prop, 0.0, 1000.0);
2073  RNA_def_property_ui_range(prop, 0.0, 1000.0, 100.0, 3);
2075  prop,
2076  "Maximum Kinetic Energy Potential",
2077  "Upper clamping threshold that indicates the fluid speed where cells no longer emit more "
2078  "particles (higher value results in generally less particles)");
2079  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_particlescache_reset");
2080 
2081  prop = RNA_def_property(srna, "sndparticle_sampling_wavecrest", PROP_INT, PROP_NONE);
2082  RNA_def_property_int_sdna(prop, NULL, "sndparticle_k_wc");
2083  RNA_def_property_range(prop, 0, 10000);
2084  RNA_def_property_ui_range(prop, 0, 10000, 1.0, -1);
2086  "Wave Crest Sampling",
2087  "Maximum number of particles generated per wave crest cell per frame");
2088  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_particlescache_reset");
2089 
2090  prop = RNA_def_property(srna, "sndparticle_sampling_trappedair", PROP_INT, PROP_NONE);
2091  RNA_def_property_int_sdna(prop, NULL, "sndparticle_k_ta");
2092  RNA_def_property_range(prop, 0, 10000);
2093  RNA_def_property_ui_range(prop, 0, 10000, 1.0, -1);
2095  "Trapped Air Sampling",
2096  "Maximum number of particles generated per trapped air cell per frame");
2097  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_particlescache_reset");
2098 
2099  prop = RNA_def_property(srna, "sndparticle_bubble_buoyancy", PROP_FLOAT, PROP_NONE);
2100  RNA_def_property_float_sdna(prop, NULL, "sndparticle_k_b");
2101  RNA_def_property_range(prop, 0.0, 100.0);
2102  RNA_def_property_ui_range(prop, 0.0, 100.0, 10.0, 2);
2104  "Bubble Buoyancy",
2105  "Amount of buoyancy force that rises bubbles (high value results in "
2106  "bubble movement mainly upwards)");
2107  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_particlescache_reset");
2108 
2109  prop = RNA_def_property(srna, "sndparticle_bubble_drag", PROP_FLOAT, PROP_NONE);
2110  RNA_def_property_float_sdna(prop, NULL, "sndparticle_k_d");
2111  RNA_def_property_range(prop, 0.0, 100.0);
2112  RNA_def_property_ui_range(prop, 0.0, 100.0, 10.0, 2);
2114  "Bubble Drag",
2115  "Amount of drag force that moves bubbles along with the fluid (high "
2116  "value results in bubble movement mainly along with the fluid)");
2117  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_particlescache_reset");
2118 
2119  prop = RNA_def_property(srna, "sndparticle_life_min", PROP_FLOAT, PROP_NONE);
2120  RNA_def_property_float_sdna(prop, NULL, "sndparticle_l_min");
2121  RNA_def_property_range(prop, 0.0, 10000.0);
2122  RNA_def_property_ui_range(prop, 0.0, 10000.0, 100.0, 1);
2123  RNA_def_property_ui_text(prop, "Minimum Lifetime", "Lowest possible particle lifetime");
2124  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_particlescache_reset");
2125 
2126  prop = RNA_def_property(srna, "sndparticle_life_max", PROP_FLOAT, PROP_NONE);
2127  RNA_def_property_float_sdna(prop, NULL, "sndparticle_l_max");
2128  RNA_def_property_range(prop, 0.0, 10000.0);
2129  RNA_def_property_ui_range(prop, 0.0, 10000.0, 100.0, 1);
2130  RNA_def_property_ui_text(prop, "Maximum Lifetime", "Highest possible particle lifetime");
2131  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_particlescache_reset");
2132 
2133  prop = RNA_def_property(srna, "sndparticle_boundary", PROP_ENUM, PROP_NONE);
2134  RNA_def_property_enum_sdna(prop, NULL, "sndparticle_boundary");
2135  RNA_def_property_enum_items(prop, sndparticle_boundary_items);
2137  prop, "Particles in Boundary", "How particles that left the domain are treated");
2138  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_particlescache_reset");
2139 
2140  prop = RNA_def_property(srna, "sndparticle_combined_export", PROP_ENUM, PROP_NONE);
2141  RNA_def_property_enum_sdna(prop, NULL, "sndparticle_combined_export");
2142  RNA_def_property_enum_items(prop, sndparticle_combined_export_items);
2144  prop,
2145  "Combined Export",
2146  "Determines which particle systems are created from secondary particles");
2147  RNA_def_property_update(prop, 0, "rna_Fluid_combined_export_update");
2148 
2149  prop = RNA_def_property(srna, "sndparticle_potential_radius", PROP_INT, PROP_NONE);
2150  RNA_def_property_int_sdna(prop, NULL, "sndparticle_potential_radius");
2151  RNA_def_property_range(prop, 1, 4);
2152  RNA_def_property_ui_range(prop, 1, 4, 1, -1);
2154  "Potential Radius",
2155  "Radius to compute potential for each cell (higher values are slower "
2156  "but create smoother potential grids)");
2157  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_particlescache_reset");
2158 
2159  prop = RNA_def_property(srna, "sndparticle_update_radius", PROP_INT, PROP_NONE);
2160  RNA_def_property_int_sdna(prop, NULL, "sndparticle_update_radius");
2161  RNA_def_property_range(prop, 1, 4);
2162  RNA_def_property_ui_range(prop, 1, 4, 1, -1);
2164  "Update Radius",
2165  "Radius to compute position update for each particle (higher values "
2166  "are slower but particles move less chaotic)");
2167  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_particlescache_reset");
2168 
2169  prop = RNA_def_property(srna, "particle_scale", PROP_INT, PROP_NONE);
2170  RNA_def_property_int_sdna(prop, NULL, "particle_scale");
2171  RNA_def_property_range(prop, 1, 100);
2172  RNA_def_property_ui_range(prop, 1, 10, 1, -1);
2174  "Particle scale",
2175  "The particle simulation is scaled up by this factor (compared to the "
2176  "base resolution of the domain)");
2178  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_domain_particles_reset");
2179 
2180  prop = RNA_def_property(srna, "use_spray_particles", PROP_BOOLEAN, PROP_NONE);
2182  RNA_def_property_ui_text(prop, "Spray", "Create spray particle system");
2184  RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Fluid_spray_parts_update");
2185 
2186  prop = RNA_def_property(srna, "use_bubble_particles", PROP_BOOLEAN, PROP_NONE);
2188  RNA_def_property_ui_text(prop, "Bubble", "Create bubble particle system");
2190  RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Fluid_bubble_parts_update");
2191 
2192  prop = RNA_def_property(srna, "use_foam_particles", PROP_BOOLEAN, PROP_NONE);
2194  RNA_def_property_ui_text(prop, "Foam", "Create foam particle system");
2196  RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Fluid_foam_parts_update");
2197 
2198  prop = RNA_def_property(srna, "use_tracer_particles", PROP_BOOLEAN, PROP_NONE);
2200  RNA_def_property_ui_text(prop, "Tracer", "Create tracer particle system");
2202  RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Fluid_tracer_parts_update");
2203 
2204  /* fluid guiding options */
2205 
2206  prop = RNA_def_property(srna, "guide_alpha", PROP_FLOAT, PROP_NONE);
2207  RNA_def_property_float_sdna(prop, NULL, "guide_alpha");
2208  RNA_def_property_range(prop, 1.0, 100.0);
2209  RNA_def_property_ui_text(prop, "Weight", "Guiding weight (higher value results in greater lag)");
2210  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_datacache_reset");
2211 
2212  prop = RNA_def_property(srna, "guide_beta", PROP_INT, PROP_NONE);
2213  RNA_def_property_int_sdna(prop, NULL, "guide_beta");
2214  RNA_def_property_range(prop, 1, 50);
2215  RNA_def_property_ui_text(prop, "Size", "Guiding size (higher value results in larger vortices)");
2216  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_datacache_reset");
2217 
2218  prop = RNA_def_property(srna, "guide_vel_factor", PROP_FLOAT, PROP_NONE);
2219  RNA_def_property_float_sdna(prop, NULL, "guide_vel_factor");
2220  RNA_def_property_range(prop, 0.0, 100.0);
2222  prop,
2223  "Velocity Factor",
2224  "Guiding velocity factor (higher value results in greater guiding velocities)");
2225  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_datacache_reset");
2226 
2227  prop = RNA_def_property(srna, "guide_source", PROP_ENUM, PROP_NONE);
2228  RNA_def_property_enum_sdna(prop, NULL, "guide_source");
2229  RNA_def_property_enum_items(prop, fluid_guide_source_items);
2230  RNA_def_property_ui_text(prop, "Guiding source", "Choose where to get guiding velocities from");
2231  RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Fluid_update");
2232 
2233  prop = RNA_def_property(srna, "guide_parent", PROP_POINTER, PROP_NONE);
2234  RNA_def_property_pointer_sdna(prop, NULL, "guide_parent");
2235  RNA_def_property_struct_type(prop, "Object");
2236  RNA_def_property_pointer_funcs(prop, NULL, "rna_Fluid_guide_parent_set", NULL, NULL);
2239  "",
2240  "Use velocities from this object for the guiding effect (object needs "
2241  "to have fluid modifier and be of type domain))");
2242  RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Fluid_guidingcache_reset");
2243 
2244  prop = RNA_def_property(srna, "use_guide", PROP_BOOLEAN, PROP_NONE);
2246  RNA_def_property_ui_text(prop, "Use Guiding", "Enable fluid guiding");
2248  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_update");
2249 
2250  /* cache options */
2251 
2252  prop = RNA_def_property(srna, "cache_frame_start", PROP_INT, PROP_TIME);
2253  RNA_def_property_int_sdna(prop, NULL, "cache_frame_start");
2255  RNA_def_property_int_funcs(prop, NULL, "rna_Fluid_cache_startframe_set", NULL);
2257  prop,
2258  "Start",
2259  "Frame on which the simulation starts. This is the first frame that will be baked");
2261 
2262  prop = RNA_def_property(srna, "cache_frame_end", PROP_INT, PROP_TIME);
2263  RNA_def_property_int_sdna(prop, NULL, "cache_frame_end");
2265  RNA_def_property_int_funcs(prop, NULL, "rna_Fluid_cache_endframe_set", NULL);
2267  prop,
2268  "End",
2269  "Frame on which the simulation stops. This is the last frame that will be baked");
2271 
2272  prop = RNA_def_property(srna, "cache_frame_offset", PROP_INT, PROP_TIME);
2273  RNA_def_property_int_sdna(prop, NULL, "cache_frame_offset");
2276  prop,
2277  "Offset",
2278  "Frame offset that is used when loading the simulation from the cache. It is not considered "
2279  "when baking the simulation, only when loading it");
2281 
2282  prop = RNA_def_property(srna, "cache_frame_pause_data", PROP_INT, PROP_TIME);
2283  RNA_def_property_int_sdna(prop, NULL, "cache_frame_pause_data");
2284 
2285  prop = RNA_def_property(srna, "cache_frame_pause_noise", PROP_INT, PROP_TIME);
2286  RNA_def_property_int_sdna(prop, NULL, "cache_frame_pause_noise");
2287 
2288  prop = RNA_def_property(srna, "cache_frame_pause_mesh", PROP_INT, PROP_TIME);
2289  RNA_def_property_int_sdna(prop, NULL, "cache_frame_pause_mesh");
2290 
2291  prop = RNA_def_property(srna, "cache_frame_pause_particles", PROP_INT, PROP_TIME);
2292  RNA_def_property_int_sdna(prop, NULL, "cache_frame_pause_particles");
2293 
2294  prop = RNA_def_property(srna, "cache_frame_pause_guide", PROP_INT, PROP_TIME);
2295  RNA_def_property_int_sdna(prop, NULL, "cache_frame_pause_guide");
2296 
2297  prop = RNA_def_property(srna, "cache_mesh_format", PROP_ENUM, PROP_NONE);
2298  RNA_def_property_enum_sdna(prop, NULL, "cache_mesh_format");
2299  RNA_def_property_enum_items(prop, cache_file_type_items);
2301  prop, NULL, "rna_Fluid_cachetype_mesh_set", "rna_Fluid_cachetype_mesh_itemf");
2303  prop, "File Format", "Select the file format to be used for caching surface data");
2305  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_meshcache_reset");
2306 
2307  prop = RNA_def_property(srna, "cache_data_format", PROP_ENUM, PROP_NONE);
2308  RNA_def_property_enum_sdna(prop, NULL, "cache_data_format");
2309  RNA_def_property_enum_items(prop, cache_file_type_items);
2311  prop, NULL, "rna_Fluid_cachetype_data_set", "rna_Fluid_cachetype_volume_itemf");
2313  prop, "File Format", "Select the file format to be used for caching volumetric data");
2315  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_datacache_reset");
2316 
2317  prop = RNA_def_property(srna, "cache_particle_format", PROP_ENUM, PROP_NONE);
2318  RNA_def_property_enum_sdna(prop, NULL, "cache_particle_format");
2319  RNA_def_property_enum_items(prop, cache_file_type_items);
2321  prop, NULL, "rna_Fluid_cachetype_particle_set", "rna_Fluid_cachetype_particle_itemf");
2323  prop, "File Format", "Select the file format to be used for caching particle data");
2325  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_particlescache_reset");
2326 
2327  prop = RNA_def_property(srna, "cache_noise_format", PROP_ENUM, PROP_NONE);
2328  RNA_def_property_enum_sdna(prop, NULL, "cache_noise_format");
2329  RNA_def_property_enum_items(prop, cache_file_type_items);
2331  prop, NULL, "rna_Fluid_cachetype_noise_set", "rna_Fluid_cachetype_volume_itemf");
2333  prop, "File Format", "Select the file format to be used for caching noise data");
2335  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_noisecache_reset");
2336 
2337  prop = RNA_def_property(srna, "cache_type", PROP_ENUM, PROP_NONE);
2338  RNA_def_property_enum_sdna(prop, NULL, "cache_type");
2339  RNA_def_property_enum_items(prop, cache_types);
2340  RNA_def_property_enum_funcs(prop, NULL, "rna_Fluid_cachetype_set", NULL);
2341  RNA_def_property_ui_text(prop, "Type", "Change the cache type of the simulation");
2343  RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Fluid_domain_data_reset");
2344 
2345  prop = RNA_def_property(srna, "cache_resumable", PROP_BOOLEAN, PROP_NONE);
2348  prop,
2349  "Resumable",
2350  "Additional data will be saved so that the bake jobs can be resumed after pausing. Because "
2351  "more data will be written to disk it is recommended to avoid enabling this option when "
2352  "baking at high resolutions");
2354  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_datacache_reset");
2355 
2356  prop = RNA_def_property(srna, "cache_directory", PROP_STRING, PROP_DIRPATH);
2358  RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Fluid_cache_directory_set");
2359  RNA_def_property_string_sdna(prop, NULL, "cache_directory");
2360  RNA_def_property_ui_text(prop, "Cache directory", "Directory that contains fluid cache files");
2361  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_update");
2362 
2363  prop = RNA_def_property(srna, "is_cache_baking_data", PROP_BOOLEAN, PROP_NONE);
2366 
2367  prop = RNA_def_property(srna, "has_cache_baked_data", PROP_BOOLEAN, PROP_NONE);
2370 
2371  prop = RNA_def_property(srna, "is_cache_baking_noise", PROP_BOOLEAN, PROP_NONE);
2374 
2375  prop = RNA_def_property(srna, "has_cache_baked_noise", PROP_BOOLEAN, PROP_NONE);
2378 
2379  prop = RNA_def_property(srna, "is_cache_baking_mesh", PROP_BOOLEAN, PROP_NONE);
2382 
2383  prop = RNA_def_property(srna, "has_cache_baked_mesh", PROP_BOOLEAN, PROP_NONE);
2386 
2387  prop = RNA_def_property(srna, "is_cache_baking_particles", PROP_BOOLEAN, PROP_NONE);
2390 
2391  prop = RNA_def_property(srna, "has_cache_baked_particles", PROP_BOOLEAN, PROP_NONE);
2394 
2395  prop = RNA_def_property(srna, "is_cache_baking_guide", PROP_BOOLEAN, PROP_NONE);
2398 
2399  prop = RNA_def_property(srna, "has_cache_baked_guide", PROP_BOOLEAN, PROP_NONE);
2402 
2403  /* Read only checks, avoids individually accessing flags above. */
2404  prop = RNA_def_property(srna, "is_cache_baking_any", PROP_BOOLEAN, PROP_NONE);
2407 
2408  prop = RNA_def_property(srna, "has_cache_baked_any", PROP_BOOLEAN, PROP_NONE);
2411 
2412  prop = RNA_def_property(srna, "export_manta_script", PROP_BOOLEAN, PROP_NONE);
2415  prop,
2416  "Export Mantaflow Script",
2417  "Generate and export Mantaflow script from current domain settings during bake. This is "
2418  "only needed if you plan to analyze the cache (e.g. view grids, velocity vectors, "
2419  "particles) in Mantaflow directly (outside of Blender) after baking the simulation");
2421  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_domain_data_reset");
2422 
2423  prop = RNA_def_property(srna, "openvdb_cache_compress_type", PROP_ENUM, PROP_NONE);
2424  RNA_def_property_enum_sdna(prop, NULL, "openvdb_compression");
2425  RNA_def_property_enum_items(prop, prop_compression_items);
2426  RNA_def_property_ui_text(prop, "Compression", "Compression method to be used");
2427  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_domain_data_reset");
2428 
2429  prop = RNA_def_property(srna, "openvdb_data_depth", PROP_ENUM, PROP_NONE);
2430  RNA_def_property_enum_sdna(prop, NULL, "openvdb_data_depth");
2431  RNA_def_property_enum_items(prop, fluid_data_depth_items);
2432  RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Fluid_data_depth_itemf");
2434  prop,
2435  "Data Depth",
2436  "Bit depth for fluid particles and grids (lower bit values reduce file size)");
2437  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_domain_data_reset");
2438 
2439  /* time options */
2440 
2441  prop = RNA_def_property(srna, "time_scale", PROP_FLOAT, PROP_NONE);
2442  RNA_def_property_float_sdna(prop, NULL, "time_scale");
2443  RNA_def_property_range(prop, 0.0001, 10.0);
2444  RNA_def_property_ui_text(prop, "Time Scale", "Adjust simulation speed");
2445  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_datacache_reset");
2446 
2447  prop = RNA_def_property(srna, "cfl_condition", PROP_FLOAT, PROP_NONE);
2448  RNA_def_property_float_sdna(prop, NULL, "cfl_condition");
2449  RNA_def_property_range(prop, 0.0, 10.0);
2451  "CFL",
2452  "Maximal velocity per cell (greater CFL numbers will minimize the "
2453  "number of simulation steps and the computation time.)");
2454  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_datacache_reset");
2455 
2456  prop = RNA_def_property(srna, "use_adaptive_timesteps", PROP_BOOLEAN, PROP_NONE);
2458  RNA_def_property_ui_text(prop, "Use Adaptive Time Steps", "");
2459  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_datacache_reset");
2460 
2461  prop = RNA_def_property(srna, "timesteps_min", PROP_INT, PROP_NONE);
2462  RNA_def_property_int_sdna(prop, NULL, "timesteps_minimum");
2463  RNA_def_property_range(prop, 1, 100);
2464  RNA_def_property_ui_range(prop, 0, 100, 1, -1);
2466  prop, "Minimum", "Minimum number of simulation steps to perform for one frame");
2467  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_datacache_reset");
2468 
2469  prop = RNA_def_property(srna, "timesteps_max", PROP_INT, PROP_NONE);
2470  RNA_def_property_int_sdna(prop, NULL, "timesteps_maximum");
2471  RNA_def_property_range(prop, 1, 100);
2472  RNA_def_property_ui_range(prop, 0, 100, 1, -1);
2474  prop, "Maximum", "Maximum number of simulation steps to perform for one frame");
2475  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_datacache_reset");
2476 
2477  /* display settings */
2478 
2479  prop = RNA_def_property(srna, "use_slice", PROP_BOOLEAN, PROP_NONE);
2480  RNA_def_property_boolean_sdna(prop, NULL, "axis_slice_method", AXIS_SLICE_SINGLE);
2481  RNA_def_property_ui_text(prop, "Slice", "Perform a single slice of the domain object");
2483 
2484  prop = RNA_def_property(srna, "slice_axis", PROP_ENUM, PROP_NONE);
2485  RNA_def_property_enum_sdna(prop, NULL, "slice_axis");
2486  RNA_def_property_enum_items(prop, axis_slice_position_items);
2487  RNA_def_property_ui_text(prop, "Axis", "");
2489 
2490  prop = RNA_def_property(srna, "slice_per_voxel", PROP_FLOAT, PROP_NONE);
2491  RNA_def_property_float_sdna(prop, NULL, "slice_per_voxel");
2492  RNA_def_property_range(prop, 0.0, 100.0);
2493  RNA_def_property_ui_range(prop, 0.0, 5.0, 0.1, 1);
2495  prop, "Slice Per Voxel", "How many slices per voxel should be generated");
2497 
2498  prop = RNA_def_property(srna, "slice_depth", PROP_FLOAT, PROP_FACTOR);
2499  RNA_def_property_float_sdna(prop, NULL, "slice_depth");
2500  RNA_def_property_range(prop, 0.0, 1.0);
2501  RNA_def_property_ui_range(prop, 0.0, 1.0, 0.1, 3);
2502  RNA_def_property_ui_text(prop, "Position", "Position of the slice");
2504 
2505  prop = RNA_def_property(srna, "display_thickness", PROP_FLOAT, PROP_NONE);
2506  RNA_def_property_float_sdna(prop, NULL, "display_thickness");
2507  RNA_def_property_range(prop, 0.001, 1000.0);
2508  RNA_def_property_ui_range(prop, 0.1, 100.0, 0.1, 3);
2509  RNA_def_property_ui_text(prop, "Thickness", "Thickness of smoke display in the viewport");
2511 
2512  prop = RNA_def_property(srna, "display_interpolation", PROP_ENUM, PROP_NONE);
2513  RNA_def_property_enum_sdna(prop, NULL, "interp_method");
2514  RNA_def_property_enum_items(prop, interp_method_item);
2516  prop, "Interpolation", "Interpolation method to use for smoke/fire volumes in solid mode");
2518 
2519  prop = RNA_def_property(srna, "show_gridlines", PROP_BOOLEAN, PROP_NONE);
2520  RNA_def_property_boolean_sdna(prop, NULL, "show_gridlines", 0);
2521  RNA_def_property_ui_text(prop, "Gridlines", "Show gridlines");
2523 
2524  prop = RNA_def_property(srna, "show_velocity", PROP_BOOLEAN, PROP_NONE);
2525  RNA_def_property_boolean_sdna(prop, NULL, "draw_velocity", 0);
2526  RNA_def_property_ui_text(prop, "Vector Display", "Visualize vector fields");
2528 
2529  prop = RNA_def_property(srna, "vector_display_type", PROP_ENUM, PROP_NONE);
2530  RNA_def_property_enum_sdna(prop, NULL, "vector_draw_type");
2531  RNA_def_property_enum_items(prop, vector_draw_items);
2532  RNA_def_property_ui_text(prop, "Display Type", "");
2534 
2535  prop = RNA_def_property(srna, "vector_field", PROP_ENUM, PROP_NONE);
2536  RNA_def_property_enum_sdna(prop, NULL, "vector_field");
2537  RNA_def_property_enum_items(prop, vector_field_items);
2538  RNA_def_property_ui_text(prop, "Field", "Vector field to be represented by the display vectors");
2540 
2541  prop = RNA_def_property(srna, "vector_scale_with_magnitude", PROP_BOOLEAN, PROP_NONE);
2542  RNA_def_property_boolean_sdna(prop, NULL, "vector_scale_with_magnitude", 0);
2543  RNA_def_property_ui_text(prop, "Magnitude", "Scale vectors with their magnitudes");
2545 
2546  prop = RNA_def_property(srna, "vector_show_mac_x", PROP_BOOLEAN, PROP_NONE);
2547  RNA_def_property_boolean_sdna(prop, NULL, "vector_draw_mac_components", VECTOR_DRAW_MAC_X);
2548  RNA_def_property_ui_text(prop, "X", "Show X-component of MAC Grid");
2550 
2551  prop = RNA_def_property(srna, "vector_show_mac_y", PROP_BOOLEAN, PROP_NONE);
2552  RNA_def_property_boolean_sdna(prop, NULL, "vector_draw_mac_components", VECTOR_DRAW_MAC_Y);
2553  RNA_def_property_ui_text(prop, "Y", "Show Y-component of MAC Grid");
2555 
2556  prop = RNA_def_property(srna, "vector_show_mac_z", PROP_BOOLEAN, PROP_NONE);
2557  RNA_def_property_boolean_sdna(prop, NULL, "vector_draw_mac_components", VECTOR_DRAW_MAC_Z);
2558  RNA_def_property_ui_text(prop, "Z", "Show Z-component of MAC Grid");
2560 
2561  prop = RNA_def_property(srna, "vector_scale", PROP_FLOAT, PROP_NONE);
2562  RNA_def_property_float_sdna(prop, NULL, "vector_scale");
2563  RNA_def_property_range(prop, 0.0, 1000.0);
2564  RNA_def_property_ui_range(prop, 0.0, 100.0, 0.1, 3);
2565  RNA_def_property_ui_text(prop, "Scale", "Multiplier for scaling the vectors");
2567 
2568  /* --------- Color mapping. --------- */
2569 
2570  prop = RNA_def_property(srna, "use_color_ramp", PROP_BOOLEAN, PROP_NONE);
2571  RNA_def_property_boolean_sdna(prop, NULL, "use_coba", 0);
2572  RNA_def_property_boolean_funcs(prop, NULL, "rna_Fluid_use_color_ramp_set");
2574  "Grid Display",
2575  "Render a simulation field while mapping its voxels values to the "
2576  "colors of a ramp or using a predefined color code");
2578 
2579  /* Color ramp field items are generated dynamically based on domain type. */
2580  static const EnumPropertyItem coba_field_items[] = {
2581  {0, "NONE", 0, "", ""},
2582  {0, NULL, 0, NULL, NULL},
2583  };
2584 
2585  prop = RNA_def_property(srna, "color_ramp_field", PROP_ENUM, PROP_NONE);
2586  RNA_def_property_enum_sdna(prop, NULL, "coba_field");
2587  RNA_def_property_enum_items(prop, coba_field_items);
2588  RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Fluid_cobafield_itemf");
2589  RNA_def_property_ui_text(prop, "Field", "Simulation field to color map");
2591 
2592  prop = RNA_def_property(srna, "color_ramp_field_scale", PROP_FLOAT, PROP_NONE);
2593  RNA_def_property_float_sdna(prop, NULL, "grid_scale");
2594  RNA_def_property_range(prop, 0.001, 100000.0);
2595  RNA_def_property_ui_range(prop, 0.001, 1000.0, 0.1, 3);
2597  prop, "Scale", "Multiplier for scaling the selected field to color map");
2599 
2600  prop = RNA_def_property(srna, "color_ramp", PROP_POINTER, PROP_NEVER_NULL);
2601  RNA_def_property_pointer_sdna(prop, NULL, "coba");
2602  RNA_def_property_struct_type(prop, "ColorRamp");
2603  RNA_def_property_ui_text(prop, "Color Ramp", "");
2605 
2606  prop = RNA_def_property(srna, "clipping", PROP_FLOAT, PROP_NONE);
2607  RNA_def_property_float_sdna(prop, NULL, "clipping");
2608  RNA_def_property_range(prop, 0.0, 1.0);
2609  RNA_def_property_ui_range(prop, 0.0, 1.0, 0.1, 6);
2611  prop,
2612  "Clipping",
2613  "Value under which voxels are considered empty space to optimize rendering");
2615 
2616  prop = RNA_def_property(srna, "gridlines_color_field", PROP_ENUM, PROP_NONE);
2617  RNA_def_property_enum_sdna(prop, NULL, "gridlines_color_field");
2618  RNA_def_property_enum_items(prop, gridlines_color_field_items);
2620  prop, "Color Gridlines", "Simulation field to color map onto gridlines");
2622 
2623  prop = RNA_def_property(srna, "gridlines_lower_bound", PROP_FLOAT, PROP_NONE);
2624  RNA_def_property_float_sdna(prop, NULL, "gridlines_lower_bound");
2625  RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
2626  RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 0.1, 6);
2627  RNA_def_property_ui_text(prop, "Lower Bound", "Lower bound of the highlighting range");
2629 
2630  prop = RNA_def_property(srna, "gridlines_upper_bound", PROP_FLOAT, PROP_NONE);
2631  RNA_def_property_float_sdna(prop, NULL, "gridlines_upper_bound");
2632  RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
2633  RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 0.1, 6);
2634  RNA_def_property_ui_text(prop, "Upper Bound", "Upper bound of the highlighting range");
2636 
2637  prop = RNA_def_property(srna, "gridlines_range_color", PROP_FLOAT, PROP_COLOR);
2638  RNA_def_property_float_sdna(prop, NULL, "gridlines_range_color");
2639  RNA_def_property_array(prop, 4);
2640  RNA_def_property_ui_text(prop, "Color", "Color used to highlight the range");
2642 
2643  prop = RNA_def_property(srna, "gridlines_cell_filter", PROP_ENUM, PROP_NONE);
2644  RNA_def_property_enum_sdna(prop, NULL, "gridlines_cell_filter");
2645  RNA_def_property_enum_items(prop, gridlines_cell_filter_items);
2646  RNA_def_property_ui_text(prop, "Cell Type", "Cell type to be highlighted");
2648 
2649  prop = RNA_def_property(srna, "velocity_scale", PROP_FLOAT, PROP_NONE);
2650  RNA_def_property_float_sdna(prop, NULL, "velocity_scale");
2651  RNA_def_property_range(prop, 0.0f, FLT_MAX);
2652  RNA_def_property_ui_text(prop, "Velocity Scale", "Factor to control the amount of motion blur");
2653  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_update");
2654 }
2655 
2657 {
2658  StructRNA *srna;
2659  PropertyRNA *prop;
2660 
2661  static const EnumPropertyItem flow_type_items[] = {
2662  {FLUID_FLOW_TYPE_SMOKE, "SMOKE", 0, "Smoke", "Add smoke"},
2663  {FLUID_FLOW_TYPE_SMOKEFIRE, "BOTH", 0, "Fire + Smoke", "Add fire and smoke"},
2664  {FLUID_FLOW_TYPE_FIRE, "FIRE", 0, "Fire", "Add fire"},
2665  {FLUID_FLOW_TYPE_LIQUID, "LIQUID", 0, "Liquid", "Add liquid"},
2666  {0, NULL, 0, NULL, NULL},
2667  };
2668 
2669  static EnumPropertyItem flow_behavior_items[] = {
2670  {FLUID_FLOW_BEHAVIOR_INFLOW, "INFLOW", 0, "Inflow", "Add fluid to simulation"},
2671  {FLUID_FLOW_BEHAVIOR_OUTFLOW, "OUTFLOW", 0, "Outflow", "Delete fluid from simulation"},
2673  "GEOMETRY",
2674  0,
2675  "Geometry",
2676  "Only use given geometry for fluid"},
2677  {0, NULL, 0, NULL, NULL},
2678  };
2679 
2680  /* Flow source - generated dynamically based on flow type */
2681  static EnumPropertyItem flow_sources[] = {
2682  {0, "NONE", 0, "", ""},
2683  {0, NULL, 0, NULL, NULL},
2684  };
2685 
2686  static const EnumPropertyItem flow_texture_types[] = {
2688  "AUTO",
2689  0,
2690  "Generated",
2691  "Generated coordinates centered to flow object"},
2692  {FLUID_FLOW_TEXTURE_MAP_UV, "UV", 0, "UV", "Use UV layer for texture coordinates"},
2693  {0, NULL, 0, NULL, NULL},
2694  };
2695 
2696  srna = RNA_def_struct(brna, "FluidFlowSettings", NULL);
2697  RNA_def_struct_ui_text(srna, "Flow Settings", "Fluid flow settings");
2698  RNA_def_struct_sdna(srna, "FluidFlowSettings");
2699  RNA_def_struct_path_func(srna, "rna_FluidFlowSettings_path");
2700 
2701  prop = RNA_def_property(srna, "density", PROP_FLOAT, PROP_FACTOR);
2702  RNA_def_property_float_sdna(prop, NULL, "density");
2703  RNA_def_property_range(prop, 0.0, 10);
2704  RNA_def_property_ui_range(prop, 0.0, 1.0, 1.0, 4);
2705  RNA_def_property_ui_text(prop, "Density", "");
2706  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_flow_reset");
2707 
2708  prop = RNA_def_property(srna, "smoke_color", PROP_FLOAT, PROP_COLOR_GAMMA);
2709  RNA_def_property_float_sdna(prop, NULL, "color");
2710  RNA_def_property_array(prop, 3);
2711  RNA_def_property_ui_text(prop, "Smoke Color", "Color of smoke");
2712  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_flow_reset");
2713 
2714  prop = RNA_def_property(srna, "fuel_amount", PROP_FLOAT, PROP_NONE);
2715  RNA_def_property_range(prop, 0.0, 10);
2716  RNA_def_property_ui_range(prop, 0.0, 5.0, 1.0, 4);
2717  RNA_def_property_ui_text(prop, "Flame Rate", "");
2718  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_flow_reset");
2719 
2720  prop = RNA_def_property(srna, "temperature", PROP_FLOAT, PROP_NONE);
2721  RNA_def_property_float_sdna(prop, NULL, "temperature");
2722  RNA_def_property_range(prop, -10, 10);
2723  RNA_def_property_ui_range(prop, -10, 10, 1, 1);
2724  RNA_def_property_ui_text(prop, "Temp. Diff.", "Temperature difference to ambient temperature");
2725  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_flow_reset");
2726 
2727  prop = RNA_def_property(srna, "particle_system", PROP_POINTER, PROP_NONE);
2728  RNA_def_property_pointer_sdna(prop, NULL, "psys");
2729  RNA_def_property_struct_type(prop, "ParticleSystem");
2731  RNA_def_property_ui_text(prop, "Particle Systems", "Particle systems emitted from the object");
2732  RNA_def_property_update(prop, 0, "rna_Fluid_reset_dependency");
2733 
2734  prop = RNA_def_property(srna, "flow_type", PROP_ENUM, PROP_NONE);
2735  RNA_def_property_enum_sdna(prop, NULL, "type");
2736  RNA_def_property_enum_items(prop, flow_type_items);
2737  RNA_def_property_enum_funcs(prop, NULL, "rna_Fluid_flowtype_set", NULL);
2738  RNA_def_property_ui_text(prop, "Flow Type", "Change type of fluid in the simulation");
2739  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_flow_reset");
2740 
2741  prop = RNA_def_property(srna, "flow_behavior", PROP_ENUM, PROP_NONE);
2742  RNA_def_property_enum_sdna(prop, NULL, "behavior");
2743  RNA_def_property_enum_items(prop, flow_behavior_items);
2744  RNA_def_property_ui_text(prop, "Flow Behavior", "Change flow behavior in the simulation");
2745  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_flow_reset");
2746 
2747  prop = RNA_def_property(srna, "flow_source", PROP_ENUM, PROP_NONE);
2748  RNA_def_property_enum_sdna(prop, NULL, "source");
2749  RNA_def_property_enum_items(prop, flow_sources);
2751  prop, NULL, "rna_Fluid_flowsource_set", "rna_Fluid_flowsource_itemf");
2752  RNA_def_property_ui_text(prop, "Source", "Change how fluid is emitted");
2753  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_flow_reset");
2754 
2755  prop = RNA_def_property(srna, "use_absolute", PROP_BOOLEAN, PROP_NONE);
2758  "Absolute Density",
2759  "Only allow given density value in emitter area and will not add up");
2760  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_flow_reset");
2761 
2762  prop = RNA_def_property(srna, "use_initial_velocity", PROP_BOOLEAN, PROP_NONE);
2765  prop, "Initial Velocity", "Fluid has some initial velocity when it is emitted");
2766  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_flow_reset");
2767 
2768  prop = RNA_def_property(srna, "velocity_factor", PROP_FLOAT, PROP_NONE);
2769  RNA_def_property_float_sdna(prop, NULL, "vel_multi");
2770  RNA_def_property_range(prop, -100.0, 100.0);
2771  RNA_def_property_ui_range(prop, -2.0, 2.0, 0.05, 5);
2773  "Source",
2774  "Multiplier of source velocity passed to fluid (source velocity is "
2775  "non-zero only if object is moving)");
2776  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_flow_reset");
2777 
2778  prop = RNA_def_property(srna, "velocity_normal", PROP_FLOAT, PROP_NONE);
2779  RNA_def_property_float_sdna(prop, NULL, "vel_normal");
2780  RNA_def_property_range(prop, -100.0, 100.0);
2781  RNA_def_property_ui_range(prop, -2.0, 2.0, 0.05, 5);
2782  RNA_def_property_ui_text(prop, "Normal", "Amount of normal directional velocity");
2783  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_flow_reset");
2784 
2785  prop = RNA_def_property(srna, "velocity_random", PROP_FLOAT, PROP_NONE);
2786  RNA_def_property_float_sdna(prop, NULL, "vel_random");
2787  RNA_def_property_range(prop, 0.0, 10.0);
2788  RNA_def_property_ui_range(prop, 0.0, 2.0, 0.05, 5);
2789  RNA_def_property_ui_text(prop, "Random", "Amount of random velocity");
2790  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_flow_reset");
2791 
2792  prop = RNA_def_property(srna, "velocity_coord", PROP_FLOAT, PROP_VELOCITY);
2793  RNA_def_property_float_sdna(prop, NULL, "vel_coord");
2794  RNA_def_property_array(prop, 3);
2795  RNA_def_property_range(prop, -1000.1, 1000.1);
2797  prop,
2798  "Initial",
2799  "Additional initial velocity in X, Y and Z direction (added to source velocity)");
2800  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_flow_reset");
2801 
2802  prop = RNA_def_property(srna, "volume_density", PROP_FLOAT, PROP_NONE);
2803  RNA_def_property_range(prop, 0.0, 1.0);
2804  RNA_def_property_ui_range(prop, 0.0, 1.0, 0.05, 5);
2806  "Volume Emission",
2807  "Controls fluid emission from within the mesh (higher value results in "
2808  "greater emissions from inside the mesh)");
2809  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_flow_reset");
2810 
2811  prop = RNA_def_property(srna, "surface_distance", PROP_FLOAT, PROP_NONE);
2812  RNA_def_property_range(prop, 0.0, 10.0);
2813  RNA_def_property_ui_range(prop, 0.0, 10.0, 0.05, 5);
2815  "Surface Emission",
2816  "Controls fluid emission from the mesh surface (higher value results "
2817  "in emission further away from the mesh surface");
2818  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_flow_reset");
2819 
2820  prop = RNA_def_property(srna, "use_plane_init", PROP_BOOLEAN, PROP_NONE);
2823  prop,
2824  "Is Planar",
2825  "Treat this object as a planar and unclosed mesh. Fluid will only be emitted from the mesh "
2826  "surface and based on the surface emission value");
2827  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_flow_reset");
2828 
2829  prop = RNA_def_property(srna, "particle_size", PROP_FLOAT, PROP_NONE);
2830  RNA_def_property_range(prop, 0.1, FLT_MAX);
2831  RNA_def_property_ui_range(prop, 0.5, 5.0, 0.05, 5);
2832  RNA_def_property_ui_text(prop, "Size", "Particle size in simulation cells");
2833  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_flow_reset");
2834 
2835  prop = RNA_def_property(srna, "use_particle_size", PROP_BOOLEAN, PROP_NONE);
2838  prop, "Set Size", "Set particle size in simulation cells or use nearest cell");
2839  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_flow_reset");
2840 
2841  prop = RNA_def_property(srna, "use_inflow", PROP_BOOLEAN, PROP_NONE);
2843  RNA_def_property_ui_text(prop, "Use Flow", "Control when to apply fluid flow");
2844  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_flow_reset");
2845 
2846  prop = RNA_def_property(srna, "subframes", PROP_INT, PROP_NONE);
2847  RNA_def_property_range(prop, 0, 200);
2848  RNA_def_property_ui_range(prop, 0, 10, 1, -1);
2850  "Subframes",
2851  "Number of additional samples to take between frames to improve "
2852  "quality of fast moving flows");
2853  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_flow_reset");
2854 
2855  prop = RNA_def_property(srna, "density_vertex_group", PROP_STRING, PROP_NONE);
2857  "rna_FluidFlow_density_vgroup_get",
2858  "rna_FluidFlow_density_vgroup_length",
2859  "rna_FluidFlow_density_vgroup_set");
2861  prop, "Vertex Group", "Name of vertex group which determines surface emission rate");
2862  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_flow_reset");
2863 
2864  prop = RNA_def_property(srna, "use_texture", PROP_BOOLEAN, PROP_NONE);
2866  RNA_def_property_ui_text(prop, "Use Texture", "Use a texture to control emission strength");
2867  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_flow_reset");
2868 
2869  prop = RNA_def_property(srna, "texture_map_type", PROP_ENUM, PROP_NONE);
2870  RNA_def_property_enum_sdna(prop, NULL, "texture_type");
2871  RNA_def_property_enum_items(prop, flow_texture_types);
2872  RNA_def_property_ui_text(prop, "Mapping", "Texture mapping type");
2873  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_flow_reset");
2874 
2875  prop = RNA_def_property(srna, "uv_layer", PROP_STRING, PROP_NONE);
2876  RNA_def_property_string_sdna(prop, NULL, "uvlayer_name");
2877  RNA_def_property_ui_text(prop, "UV Map", "UV map name");
2878  RNA_def_property_string_funcs(prop, NULL, NULL, "rna_FluidFlow_uvlayer_set");
2879  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_flow_reset");
2880 
2881  prop = RNA_def_property(srna, "noise_texture", PROP_POINTER, PROP_NONE);
2883  RNA_def_property_ui_text(prop, "Texture", "Texture that controls emission strength");
2884  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_flow_reset");
2885 
2886  prop = RNA_def_property(srna, "texture_size", PROP_FLOAT, PROP_NONE);
2887  RNA_def_property_range(prop, 0.01, 10.0);
2888  RNA_def_property_ui_range(prop, 0.1, 5.0, 0.05, 5);
2889  RNA_def_property_ui_text(prop, "Size", "Size of texture mapping");
2890  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_flow_reset");
2891 
2892  prop = RNA_def_property(srna, "texture_offset", PROP_FLOAT, PROP_NONE);
2893  RNA_def_property_range(prop, 0.0, 200.0);
2894  RNA_def_property_ui_range(prop, 0.0, 100.0, 0.05, 5);
2895  RNA_def_property_ui_text(prop, "Offset", "Z-offset of texture mapping");
2896  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_flow_reset");
2897 }
2898 
2900 {
2901  static EnumPropertyItem effector_type_items[] = {
2902  {FLUID_EFFECTOR_TYPE_COLLISION, "COLLISION", 0, "Collision", "Create collision object"},
2903  {FLUID_EFFECTOR_TYPE_GUIDE, "GUIDE", 0, "Guide", "Create guide object"},
2904  {0, NULL, 0, NULL, NULL},
2905  };
2906 
2907  static EnumPropertyItem fluid_guide_mode_items[] = {
2909  "MAXIMUM",
2910  0,
2911  "Maximize",
2912  "Compare velocities from previous frame with new velocities from current frame and keep "
2913  "the maximum"},
2915  "MINIMUM",
2916  0,
2917  "Minimize",
2918  "Compare velocities from previous frame with new velocities from current frame and keep "
2919  "the minimum"},
2921  "OVERRIDE",
2922  0,
2923  "Override",
2924  "Always write new guide velocities for every frame (each frame only contains current "
2925  "velocities from guiding objects)"},
2927  "AVERAGED",
2928  0,
2929  "Averaged",
2930  "Take average of velocities from previous frame and new velocities from current frame"},
2931  {0, NULL, 0, NULL, NULL},
2932  };
2933 
2934  StructRNA *srna;
2935  PropertyRNA *prop;
2936 
2937  srna = RNA_def_struct(brna, "FluidEffectorSettings", NULL);
2938  RNA_def_struct_ui_text(srna, "Effector Settings", "Smoke collision settings");
2939  RNA_def_struct_sdna(srna, "FluidEffectorSettings");
2940  RNA_def_struct_path_func(srna, "rna_FluidEffectorSettings_path");
2941 
2942  prop = RNA_def_property(srna, "effector_type", PROP_ENUM, PROP_NONE);
2943  RNA_def_property_enum_sdna(prop, NULL, "type");
2944  RNA_def_property_enum_items(prop, effector_type_items);
2945  RNA_def_property_ui_text(prop, "Effector Type", "Change type of effector in the simulation");
2946  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_effector_reset");
2947 
2948  prop = RNA_def_property(srna, "surface_distance", PROP_FLOAT, PROP_NONE);
2949  RNA_def_property_range(prop, 0.0, 10.0);
2950  RNA_def_property_ui_range(prop, 0.0, 10.0, 0.05, 5);
2952  prop, "Surface", "Additional distance around mesh surface to consider as effector");
2953  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_effector_reset");
2954 
2955  prop = RNA_def_property(srna, "use_plane_init", PROP_BOOLEAN, PROP_NONE);
2957  RNA_def_property_ui_text(prop, "Is Planar", "Treat this object as a planar, unclosed mesh");
2958  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_domain_data_reset");
2959 
2960  prop = RNA_def_property(srna, "velocity_factor", PROP_FLOAT, PROP_NONE);
2961  RNA_def_property_float_sdna(prop, NULL, "vel_multi");
2962  RNA_def_property_range(prop, -100.0, 100.0);
2963  RNA_def_property_ui_text(prop, "Source", "Multiplier of obstacle velocity");
2964  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_effector_reset");
2965 
2966  prop = RNA_def_property(srna, "guide_mode", PROP_ENUM, PROP_NONE);
2967  RNA_def_property_enum_sdna(prop, NULL, "guide_mode");
2968  RNA_def_property_enum_items(prop, fluid_guide_mode_items);
2969  RNA_def_property_ui_text(prop, "Guiding mode", "How to create guiding velocities");
2970  RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Fluid_effector_reset");
2971 
2972  prop = RNA_def_property(srna, "use_effector", PROP_BOOLEAN, PROP_NONE);
2974  RNA_def_property_ui_text(prop, "Enabled", "Control when to apply the effector");
2975  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_effector_reset");
2976 
2977  prop = RNA_def_property(srna, "subframes", PROP_INT, PROP_NONE);
2978  RNA_def_property_range(prop, 0, 200);
2979  RNA_def_property_ui_range(prop, 0, 10, 1, -1);
2981  "Subframes",
2982  "Number of additional samples to take between frames to improve "
2983  "quality of fast moving effector objects");
2984  RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_effector_reset");
2985 }
2986 
2988 {
2992 }
2993 
2994 #endif
struct ColorBand * BKE_colorband_add(bool rangetype)
Definition: colorband.c:296
void BKE_fluid_modifier_reset(struct FluidModifierData *fmd)
Definition: fluid.c:4793
void BKE_fluid_particle_system_destroy(struct Object *ob, int particle_type)
void BKE_fluid_cache_endframe_set(struct FluidDomainSettings *settings, int value)
Definition: fluid.c:4533
void BKE_fluid_domain_type_set(struct Object *object, struct FluidDomainSettings *settings, int type)
Definition: fluid.c:4595
void BKE_fluid_cache_startframe_set(struct FluidDomainSettings *settings, int value)
Definition: fluid.c:4527
void BKE_fluid_cachetype_noise_set(struct FluidDomainSettings *settings, int cache_noise_format)
Definition: fluid.c:4566
void BKE_fluid_particle_system_create(struct Main *bmain, struct Object *ob, const char *pset_name, const char *parts_name, const char *psys_name, int psys_type)
void BKE_fluid_cachetype_particle_set(struct FluidDomainSettings *settings, int cache_particle_format)
Definition: fluid.c:4557
void BKE_fluid_fields_sanitize(struct FluidDomainSettings *settings)
Definition: fluid.c:4647
void BKE_fluid_cachetype_mesh_set(struct FluidDomainSettings *settings, int cache_mesh_format)
Definition: fluid.c:4539
void BKE_fluid_cachetype_data_set(struct FluidDomainSettings *settings, int cache_data_format)
Definition: fluid.c:4548
void BKE_fluid_cache_free(struct FluidDomainSettings *fds, struct Object *ob, int cache_map)
struct ModifierData * BKE_modifiers_findby_type(const struct Object *ob, ModifierType type)
MINLINE void copy_v3_v3_int(int r[3], const int a[3])
#define FILE_MAX
size_t size_t char * BLI_sprintfN(const char *__restrict format,...) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC ATTR_PRINTF_FORMAT(1
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_NONNULL()
Definition: string.c:64
size_t size_t char size_t BLI_str_escape(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL()
Definition: string.c:250
#define THREAD_LOCK_READ
Definition: BLI_threads.h:120
void BLI_rw_mutex_lock(ThreadRWMutex *mutex, int mode)
Definition: threads.cc:488
void BLI_rw_mutex_unlock(ThreadRWMutex *mutex)
Definition: threads.cc:498
#define UNUSED_VARS(...)
#define UNUSED(x)
#define STREQ(a, b)
void DEG_id_tag_update(struct ID *id, int flag)
void DEG_relations_tag_update(struct Main *bmain)
@ ID_RECALC_GEOMETRY
Definition: DNA_ID.h:791
@ FLUID_FLOW_ABSOLUTE
@ FLUID_FLOW_TEXTUREEMIT
@ FLUID_FLOW_USE_PART_SIZE
@ FLUID_FLOW_NEEDS_UPDATE
@ FLUID_FLOW_USE_PLANE_INIT
@ FLUID_FLOW_INITVELOCITY
@ FLUID_FLOW_USE_INFLOW
@ FLUID_EFFECTOR_GUIDE_MAX
@ FLUID_EFFECTOR_GUIDE_OVERRIDE
@ FLUID_EFFECTOR_GUIDE_AVERAGED
@ FLUID_EFFECTOR_GUIDE_MIN
@ FLUID_DOMAIN_TYPE_GAS
@ FLUID_DOMAIN_TYPE_LIQUID
@ FLUID_DOMAIN_MESH_UNION
@ FLUID_DOMAIN_MESH_IMPROVED
@ FLUID_FLOW_SOURCE_PARTICLES
@ FLUID_FLOW_SOURCE_MESH
@ FLUID_GRIDLINE_COLOR_TYPE_FLAGS
@ FLUID_GRIDLINE_COLOR_TYPE_RANGE
@ FLUID_DOMAIN_PARTICLE_SPRAY
@ FLUID_DOMAIN_PARTICLE_FOAM
@ FLUID_DOMAIN_PARTICLE_TRACER
@ FLUID_DOMAIN_PARTICLE_FLIP
@ FLUID_DOMAIN_PARTICLE_BUBBLE
@ FLUID_DOMAIN_CACHE_ALL
@ FLUID_DOMAIN_CACHE_REPLAY
@ FLUID_DOMAIN_CACHE_MODULAR
@ FLUID_DISPLAY_INTERP_CLOSEST
@ FLUID_DISPLAY_INTERP_CUBIC
@ FLUID_DISPLAY_INTERP_LINEAR
@ FLUID_DOMAIN_METHOD_FLIP
@ FLUID_DOMAIN_METHOD_APIC
@ FLUID_DOMAIN_USE_ADAPTIVE_DOMAIN
@ FLUID_DOMAIN_USE_MESH
@ FLUID_DOMAIN_DELETE_IN_OBSTACLE
@ FLUID_DOMAIN_USE_RESUMABLE_CACHE
@ FLUID_DOMAIN_USE_DISSOLVE_LOG
@ FLUID_DOMAIN_USE_DIFFUSION
@ FLUID_DOMAIN_USE_ADAPTIVE_TIME
@ FLUID_DOMAIN_USE_GUIDE
@ FLUID_DOMAIN_EXPORT_MANTA_SCRIPT
@ FLUID_DOMAIN_USE_VISCOSITY
@ FLUID_DOMAIN_USE_SPEED_VECTORS
@ FLUID_DOMAIN_USE_NOISE
@ FLUID_DOMAIN_USE_FRACTIONS
@ FLUID_DOMAIN_USE_DISSOLVE
@ VDB_PRECISION_MINI_FLOAT
@ VDB_PRECISION_FULL_FLOAT
@ VDB_PRECISION_HALF_FLOAT
@ FLUID_DOMAIN_FIELD_COLOR_B
@ FLUID_DOMAIN_FIELD_FLAME
@ FLUID_DOMAIN_FIELD_PHI_OUT
@ FLUID_DOMAIN_FIELD_FORCE_Z
@ FLUID_DOMAIN_FIELD_PHI_OBSTACLE
@ FLUID_DOMAIN_FIELD_FLAGS
@ FLUID_DOMAIN_FIELD_VELOCITY_Z
@ FLUID_DOMAIN_FIELD_FORCE_Y
@ FLUID_DOMAIN_FIELD_PHI
@ FLUID_DOMAIN_FIELD_PRESSURE
@ FLUID_DOMAIN_FIELD_VELOCITY_X
@ FLUID_DOMAIN_FIELD_DENSITY
@ FLUID_DOMAIN_FIELD_VELOCITY_Y
@ FLUID_DOMAIN_FIELD_PHI_IN
@ FLUID_DOMAIN_FIELD_HEAT
@ FLUID_DOMAIN_FIELD_COLOR_G
@ FLUID_DOMAIN_FIELD_FORCE_X
@ FLUID_DOMAIN_FIELD_FUEL
@ FLUID_DOMAIN_FIELD_COLOR_R
@ SNDPARTICLE_BOUNDARY_DELETE
@ SNDPARTICLE_BOUNDARY_PUSHOUT
@ SM_HRES_NEAREST
@ SM_HRES_LINEAR
@ SM_HRES_FULLSAMPLE
@ FLUID_DOMAIN_BAKED_DATA
@ FLUID_DOMAIN_OUTDATED_GUIDE
@ FLUID_DOMAIN_OUTDATED_PARTICLES
@ FLUID_DOMAIN_BAKING_MESH
@ FLUID_DOMAIN_BAKING_NOISE
@ FLUID_DOMAIN_BAKING_GUIDE
@ FLUID_DOMAIN_OUTDATED_NOISE
@ FLUID_DOMAIN_BAKED_NOISE
@ FLUID_DOMAIN_BAKED_MESH
@ FLUID_DOMAIN_OUTDATED_MESH
@ FLUID_DOMAIN_BAKING_DATA
@ FLUID_DOMAIN_BAKED_GUIDE
@ FLUID_DOMAIN_BAKED_PARTICLES
@ FLUID_DOMAIN_OUTDATED_DATA
@ FLUID_DOMAIN_BAKING_PARTICLES
@ FLUID_FLOW_TYPE_FIRE
@ FLUID_FLOW_TYPE_SMOKEFIRE
@ FLUID_FLOW_TYPE_LIQUID
@ FLUID_FLOW_TYPE_SMOKE
@ FLUID_DOMAIN_BORDER_BOTTOM
@ FLUID_DOMAIN_BORDER_LEFT
@ FLUID_DOMAIN_BORDER_RIGHT
@ FLUID_DOMAIN_BORDER_FRONT
@ FLUID_DOMAIN_BORDER_TOP
@ FLUID_DOMAIN_BORDER_BACK
@ VECTOR_DRAW_NEEDLE
@ VECTOR_DRAW_STREAMLINE
@ VECTOR_DRAW_MAC
@ VECTOR_DRAW_MAC_X
@ VECTOR_DRAW_MAC_Y
@ VECTOR_DRAW_MAC_Z
@ VDB_COMPRESSION_NONE
@ VDB_COMPRESSION_ZIP
@ VDB_COMPRESSION_BLOSC
@ FLUID_DOMAIN_FILE_BIN_OBJECT
@ FLUID_DOMAIN_FILE_RAW
@ FLUID_DOMAIN_FILE_OBJECT
@ FLUID_DOMAIN_FILE_UNI
@ FLUID_DOMAIN_FILE_OPENVDB
@ FLUID_DOMAIN_GUIDE_SRC_EFFECTOR
@ FLUID_DOMAIN_GUIDE_SRC_DOMAIN
@ FLUID_FLOW_TEXTURE_MAP_UV
@ FLUID_FLOW_TEXTURE_MAP_AUTO
@ FLUID_EFFECTOR_NEEDS_UPDATE
@ FLUID_EFFECTOR_USE_EFFEC
@ FLUID_EFFECTOR_USE_PLANE_INIT
@ AXIS_SLICE_SINGLE
@ SNDPARTICLE_COMBINED_EXPORT_OFF
@ SNDPARTICLE_COMBINED_EXPORT_SPRAY_FOAM
@ SNDPARTICLE_COMBINED_EXPORT_SPRAY_BUBBLE
@ SNDPARTICLE_COMBINED_EXPORT_SPRAY_FOAM_BUBBLE
@ SNDPARTICLE_COMBINED_EXPORT_FOAM_BUBBLE
@ FLUID_DOMAIN_VECTOR_FIELD_FORCE
@ FLUID_DOMAIN_VECTOR_FIELD_VELOCITY
@ FLUID_DOMAIN_VECTOR_FIELD_GUIDE_VELOCITY
#define FLUID_DOMAIN_BAKED_ALL
@ SLICE_AXIS_X
@ SLICE_AXIS_AUTO
@ SLICE_AXIS_Z
@ SLICE_AXIS_Y
@ FLUID_FLOW_BEHAVIOR_GEOMETRY
@ FLUID_FLOW_BEHAVIOR_OUTFLOW
@ FLUID_FLOW_BEHAVIOR_INFLOW
@ FLUID_EFFECTOR_TYPE_GUIDE
@ FLUID_EFFECTOR_TYPE_COLLISION
#define FLUID_DOMAIN_BAKING_ALL
@ FLUID_CELL_TYPE_OUTFLOW
@ FLUID_CELL_TYPE_FLUID
@ FLUID_CELL_TYPE_EMPTY
@ FLUID_CELL_TYPE_NONE
@ FLUID_CELL_TYPE_OBSTACLE
@ FLUID_CELL_TYPE_INFLOW
@ eModifierType_Fluid
Object is a sort of wrapper for general info.
@ OB_MESH
@ PART_FLUID_FLIP
@ PART_FLUID_BUBBLE
@ PART_FLUID_SPRAYBUBBLE
@ PART_FLUID_TRACER
@ PART_FLUID_FOAM
@ PART_FLUID_SPRAYFOAMBUBBLE
@ PART_FLUID_SPRAYFOAM
@ PART_FLUID_SPRAY
@ PART_FLUID_FOAMBUBBLE
#define MAXFRAME
#define RNA_MAX_ARRAY_DIMENSION
Definition: RNA_define.h:28
@ PROP_FLOAT
Definition: RNA_types.h:61
@ PROP_BOOLEAN
Definition: RNA_types.h:59
@ PROP_ENUM
Definition: RNA_types.h:63
@ PROP_INT
Definition: RNA_types.h:60
@ PROP_STRING
Definition: RNA_types.h:62
@ PROP_POINTER
Definition: RNA_types.h:64
@ PROPOVERRIDE_OVERRIDABLE_LIBRARY
Definition: RNA_types.h:312
@ PROP_DYNAMIC
Definition: RNA_types.h:290
@ PROP_ANIMATABLE
Definition: RNA_types.h:202
@ PROP_EDITABLE
Definition: RNA_types.h:189
@ PROP_NEVER_NULL
Definition: RNA_types.h:239
@ PROP_TIME
Definition: RNA_types.h:146
@ PROP_XYZ
Definition: RNA_types.h:162
@ PROP_ACCELERATION
Definition: RNA_types.h:157
@ PROP_COLOR
Definition: RNA_types.h:153
@ PROP_NONE
Definition: RNA_types.h:126
@ PROP_DIRPATH
Definition: RNA_types.h:130
@ PROP_FACTOR
Definition: RNA_types.h:144
@ PROP_COLOR_GAMMA
Definition: RNA_types.h:165
@ PROP_VELOCITY
Definition: RNA_types.h:156
#define C
Definition: RandGen.cpp:25
#define ND_DRAW
Definition: WM_types.h:410
#define ND_MODIFIER
Definition: WM_types.h:411
#define NC_OBJECT
Definition: WM_types.h:329
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition: btDbvt.cpp:52
Scene scene
ccl_gpu_kernel_postfix ccl_global float int int int int float bool int offset
float * manta_smoke_get_heat(struct MANTA *smoke)
bool manta_noise_has_colors(struct MANTA *smoke)
float * manta_smoke_get_density(struct MANTA *smoke)
float * manta_get_velocity_x(struct MANTA *fluid)
float * manta_smoke_get_flame(struct MANTA *smoke)
float * manta_get_velocity_y(struct MANTA *fluid)
void manta_noise_get_rgba(struct MANTA *smoke, float *data, int sequential)
void manta_noise_get_res(struct MANTA *smoke, int *res)
float * manta_noise_get_density(struct MANTA *smoke)
float * manta_noise_get_flame(struct MANTA *smoke)
bool manta_smoke_has_colors(struct MANTA *smoke)
float * manta_get_velocity_z(struct MANTA *fluid)
void manta_noise_get_rgba_fixed_color(struct MANTA *smoke, float color[3], float *data, int sequential)
void manta_smoke_get_rgba(struct MANTA *smoke, float *data, int sequential)
void manta_smoke_get_rgba_fixed_color(struct MANTA *smoke, float color[3], float *data, int sequential)
T length(const vec_base< T, Size > &a)
static const pxr::TfToken density("density", pxr::TfToken::Immortal)
void RNA_def_property_pointer_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2740
void RNA_def_struct_path_func(StructRNA *srna, const char *path)
Definition: rna_define.c:1193
void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t bit)
Definition: rna_define.c:2236
void RNA_def_property_string_funcs(PropertyRNA *prop, const char *get, const char *length, const char *set)
Definition: rna_define.c:3285
void RNA_def_property_float_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
Definition: rna_define.c:3126
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
Definition: rna_define.c:1645
void RNA_def_property_string_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2695
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
Definition: rna_define.c:1237
void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const char *set)
Definition: rna_define.c:2944
void RNA_def_property_dynamic_array_funcs(PropertyRNA *prop, const char *getlength)
Definition: rna_define.c:2926
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
Definition: rna_define.c:1872
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
Definition: rna_define.c:1048
void RNA_def_property_array(PropertyRNA *prop, int length)
Definition: rna_define.c:1539
void RNA_def_property_range(PropertyRNA *prop, double min, double max)
Definition: rna_define.c:1737
void RNA_def_property_string_maxlength(PropertyRNA *prop, int maxlength)
Definition: rna_define.c:1920
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
Definition: rna_define.c:1772
void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *func)
Definition: rna_define.c:2900
void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char *set, const char *item)
Definition: rna_define.c:3224
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier, int type, int subtype)
Definition: rna_define.c:1257
void RNA_enum_item_end(EnumPropertyItem **items, int *totitem)
Definition: rna_define.c:4487
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
Definition: rna_define.c:1495
void RNA_def_property_pointer_funcs(PropertyRNA *prop, const char *get, const char *set, const char *type_fn, const char *poll)
Definition: rna_define.c:3385
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
Definition: rna_define.c:1028
void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2601
void RNA_enum_item_add(EnumPropertyItem **items, int *totitem, const EnumPropertyItem *item)
Definition: rna_define.c:4436
void RNA_def_property_int_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
Definition: rna_define.c:3028
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
Definition: rna_define.c:1490
void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2493
void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double step, int precision)
Definition: rna_define.c:1664
void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2343
void RNA_def_property_override_flag(PropertyRNA *prop, PropertyOverrideFlag flag)
Definition: rna_define.c:1503
static void rna_def_fluid_domain_settings(BlenderRNA *brna)
Definition: rna_fluid.c:1232
void RNA_def_fluid(BlenderRNA *brna)
Definition: rna_fluid.c:2987
static void rna_def_fluid_flow_settings(BlenderRNA *brna)
Definition: rna_fluid.c:2656
static void rna_def_fluid_effector_settings(BlenderRNA *brna)
Definition: rna_fluid.c:2899
void rna_object_vgroup_name_index_set(struct PointerRNA *ptr, const char *value, short *index)
void rna_object_vgroup_name_index_get(struct PointerRNA *ptr, char *value, int index)
void rna_object_uvlayer_name_set(struct PointerRNA *ptr, const char *value, char *result, int maxlen)
int rna_object_vgroup_name_index_length(struct PointerRNA *ptr, int index)
const char * identifier
Definition: RNA_types.h:461
const char * name
Definition: RNA_types.h:465
const char * description
Definition: RNA_types.h:467
struct FluidModifierData * fmd
struct MANTA * fluid
char cache_directory[1024]
struct ColorBand * coba
struct Object * guide_parent
struct FluidModifierData * fmd
struct FluidModifierData * fmd
struct FluidDomainSettings * domain
void * first
Definition: DNA_listBase.h:31
Definition: BKE_main.h:121
ListBase particlesystem
void * data
Definition: RNA_types.h:38
struct ID * owner_id
Definition: RNA_types.h:36
void WM_main_add_notifier(unsigned int type, void *reference)
PointerRNA * ptr
Definition: wm_files.c:3480