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