[Bf-blender-cvs] [c2ab069dfca] master: Fluid: Use OpenVDB as the default cache format for liquids too

Sebastián Barschkis noreply at git.blender.org
Wed Jun 24 18:39:10 CEST 2020


Commit: c2ab069dfca3c2c82313d7f5d2fa2c0a97dbe514
Author: Sebastián Barschkis
Date:   Wed Jun 24 18:38:56 2020 +0200
Branches: master
https://developer.blender.org/rBc2ab069dfca3c2c82313d7f5d2fa2c0a97dbe514

Fluid: Use OpenVDB as the default cache format for liquids too

With the updated OpenVDB setup, it is now perfectly fine to use OpenVDB for liquid domains.

===================================================================

M	release/scripts/startup/bl_operators/object_quick_effects.py
M	source/blender/blenkernel/intern/fluid.c

===================================================================

diff --git a/release/scripts/startup/bl_operators/object_quick_effects.py b/release/scripts/startup/bl_operators/object_quick_effects.py
index 59b66b427f1..311631ac65f 100644
--- a/release/scripts/startup/bl_operators/object_quick_effects.py
+++ b/release/scripts/startup/bl_operators/object_quick_effects.py
@@ -399,6 +399,9 @@ class QuickSmoke(ObjectModeOperator, Operator):
         if self.style == 'FIRE' or self.style == 'BOTH':
             obj.modifiers[-1].domain_settings.use_noise = True
 
+        # ensure correct cache file format for smoke
+        obj.modifiers[-1].domain_settings.cache_data_format = 'OPENVDB'
+
         # Setup material
 
         # Cycles and Eevee
@@ -511,7 +514,8 @@ class QuickLiquid(Operator):
         obj.modifiers[-1].domain_settings.use_collision_border_top = True
         obj.modifiers[-1].domain_settings.use_collision_border_bottom = True
 
-        # set correct cache file format for liquid
+        # ensure correct cache file formats for liquid
+        obj.modifiers[-1].domain_settings.cache_data_format = 'OPENVDB'
         obj.modifiers[-1].domain_settings.cache_mesh_format = 'BOBJECT'
 
         # change domain type, will also allocate and show particle system for FLIP
diff --git a/source/blender/blenkernel/intern/fluid.c b/source/blender/blenkernel/intern/fluid.c
index 103c3bb119d..98573ea98ec 100644
--- a/source/blender/blenkernel/intern/fluid.c
+++ b/source/blender/blenkernel/intern/fluid.c
@@ -4583,13 +4583,9 @@ void BKE_fluid_particles_set(FluidDomainSettings *settings, int value, bool clea
 
 void BKE_fluid_domain_type_set(Object *object, FluidDomainSettings *settings, int type)
 {
-  /* Set common values for liquid/smoke domain: cache type,
-   * border collision and viewport draw-type. */
+  /* Set values for border collision:
+   * Liquids should have a closed domain, smoke domains should be open. */
   if (type == FLUID_DOMAIN_TYPE_GAS) {
-    BKE_fluid_cachetype_mesh_set(settings, FLUID_DOMAIN_FILE_BIN_OBJECT);
-    BKE_fluid_cachetype_data_set(settings, FLUID_DOMAIN_FILE_UNI);
-    BKE_fluid_cachetype_particle_set(settings, FLUID_DOMAIN_FILE_UNI);
-    BKE_fluid_cachetype_noise_set(settings, FLUID_DOMAIN_FILE_UNI);
     BKE_fluid_collisionextents_set(settings, FLUID_DOMAIN_BORDER_FRONT, 1);
     BKE_fluid_collisionextents_set(settings, FLUID_DOMAIN_BORDER_BACK, 1);
     BKE_fluid_collisionextents_set(settings, FLUID_DOMAIN_BORDER_RIGHT, 1);
@@ -4599,10 +4595,6 @@ void BKE_fluid_domain_type_set(Object *object, FluidDomainSettings *settings, in
     object->dt = OB_WIRE;
   }
   else if (type == FLUID_DOMAIN_TYPE_LIQUID) {
-    BKE_fluid_cachetype_mesh_set(settings, FLUID_DOMAIN_FILE_BIN_OBJECT);
-    BKE_fluid_cachetype_data_set(settings, FLUID_DOMAIN_FILE_UNI);
-    BKE_fluid_cachetype_particle_set(settings, FLUID_DOMAIN_FILE_UNI);
-    BKE_fluid_cachetype_noise_set(settings, FLUID_DOMAIN_FILE_UNI);
     BKE_fluid_collisionextents_set(settings, FLUID_DOMAIN_BORDER_FRONT, 0);
     BKE_fluid_collisionextents_set(settings, FLUID_DOMAIN_BORDER_BACK, 0);
     BKE_fluid_collisionextents_set(settings, FLUID_DOMAIN_BORDER_RIGHT, 0);



More information about the Bf-blender-cvs mailing list