[Bf-blender-cvs] [f9892bd6cf1] master: Fix T77264: Mantaflow: Liquid checkbox doesn't turn on while switching between fluid types

Philipp Oeser noreply at git.blender.org
Thu Jun 4 09:53:26 CEST 2020


Commit: f9892bd6cf13a19343691bfa2a13e554b1d34c17
Author: Philipp Oeser
Date:   Tue Jun 2 15:51:27 2020 +0200
Branches: master
https://developer.blender.org/rBf9892bd6cf13a19343691bfa2a13e554b1d34c17

Fix T77264: Mantaflow: Liquid checkbox doesn't turn on while switching
between fluid types

When switching to gas, the fluids were not actually destroyed, leading to
the situation that they were then destroyed when actually switching to
liquid.

Maniphest Tasks: T77264

Differential Revision: https://developer.blender.org/D7907

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

M	source/blender/makesrna/intern/rna_fluid.c

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

diff --git a/source/blender/makesrna/intern/rna_fluid.c b/source/blender/makesrna/intern/rna_fluid.c
index 93c7c1f3480..43d2234ddf2 100644
--- a/source/blender/makesrna/intern/rna_fluid.c
+++ b/source/blender/makesrna/intern/rna_fluid.c
@@ -227,8 +227,11 @@ static void rna_Fluid_flip_parts_update(Main *bmain, Scene *scene, PointerRNA *p
   mmd = (FluidModifierData *)BKE_modifiers_findby_type(ob, eModifierType_Fluid);
   bool exists = rna_Fluid_parts_exists(ptr, PART_FLUID_FLIP);
 
-  /* Only create a particle system in liquid domain mode. */
+  /* Only create a particle system in liquid domain mode.
+   * Remove any remainings of a liquid sim when switching to gas. */
   if (mmd->domain->type != FLUID_DOMAIN_TYPE_LIQUID) {
+    rna_Fluid_parts_delete(ptr, PART_FLUID_FLIP);
+    mmd->domain->particle_type &= ~FLUID_DOMAIN_PARTICLE_FLIP;
     rna_Fluid_domain_reset(bmain, scene, ptr);
     return;
   }



More information about the Bf-blender-cvs mailing list