[Bf-blender-cvs] [9b308f27ad8] blender-v2.82-release: Fluid: Fixed deletion issue with secondary fluid particle systems

Sebastián Barschkis noreply at git.blender.org
Fri Jan 31 13:51:18 CET 2020


Commit: 9b308f27ad8d2eae6d37df65f22ae74bbdb2792b
Author: Sebastián Barschkis
Date:   Fri Jan 31 11:35:47 2020 +0100
Branches: blender-v2.82-release
https://developer.blender.org/rB9b308f27ad8d2eae6d37df65f22ae74bbdb2792b

Fluid: Fixed deletion issue with secondary fluid particle systems

Manually deleting fluid particle systems had no effect in the fluid domain UI.

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

M	source/blender/blenkernel/intern/particle.c

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

diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c
index 6b87cf2df81..97fcef4fd27 100644
--- a/source/blender/blenkernel/intern/particle.c
+++ b/source/blender/blenkernel/intern/particle.c
@@ -3586,14 +3586,47 @@ void object_remove_particle_system(Main *bmain, Scene *UNUSED(scene), Object *ob
     return;
   }
 
-  /* clear all other appearances of this pointer (like on manta flow modifier) */
+  /* Clear particle system in fluid modifier. */
   if ((md = modifiers_findByType(ob, eModifierType_Fluid))) {
     FluidModifierData *mmd = (FluidModifierData *)md;
+
+    /* Clear particle system pointer in flow settings. */
     if ((mmd->type == MOD_FLUID_TYPE_FLOW) && mmd->flow && mmd->flow->psys) {
       if (mmd->flow->psys == psys) {
         mmd->flow->psys = NULL;
       }
     }
+    /* Clear particle flag in domain settings when removing particle system manually. */
+    if (mmd->type == MOD_FLUID_TYPE_DOMAIN) {
+      if (psys->part->type == PART_FLUID_FLIP) {
+        mmd->domain->particle_type &= ~FLUID_DOMAIN_PARTICLE_FLIP;
+      }
+      if (psys->part->type == PART_FLUID_SPRAY || psys->part->type == PART_FLUID_SPRAYFOAM ||
+          psys->part->type == PART_FLUID_SPRAYBUBBLE ||
+          psys->part->type == PART_FLUID_SPRAYFOAMBUBBLE) {
+        mmd->domain->particle_type &= ~FLUID_DOMAIN_PARTICLE_SPRAY;
+      }
+      if (psys->part->type == PART_FLUID_FOAM || psys->part->type == PART_FLUID_SPRAYFOAM ||
+          psys->part->type == PART_FLUID_FOAMBUBBLE ||
+          psys->part->type == PART_FLUID_SPRAYFOAMBUBBLE) {
+        mmd->domain->particle_type &= ~FLUID_DOMAIN_PARTICLE_FOAM;
+      }
+      if (psys->part->type == PART_FLUID_BUBBLE || psys->part->type == PART_FLUID_FOAMBUBBLE ||
+          psys->part->type == PART_FLUID_SPRAYBUBBLE ||
+          psys->part->type == PART_FLUID_SPRAYFOAMBUBBLE) {
+        mmd->domain->particle_type &= ~FLUID_DOMAIN_PARTICLE_BUBBLE;
+      }
+      if (psys->part->type == PART_FLUID_TRACER) {
+        mmd->domain->particle_type &= ~FLUID_DOMAIN_PARTICLE_TRACER;
+      }
+
+      /* Disable combined export if combined particle system was deleted. */
+      if (psys->part->type == PART_FLUID_SPRAYFOAM || psys->part->type == PART_FLUID_SPRAYBUBBLE ||
+          psys->part->type == PART_FLUID_FOAMBUBBLE ||
+          psys->part->type == PART_FLUID_SPRAYFOAMBUBBLE) {
+        mmd->domain->sndparticle_combined_export = SNDPARTICLE_COMBINED_EXPORT_OFF;
+      }
+    }
   }
 
   if ((md = modifiers_findByType(ob, eModifierType_DynamicPaint))) {



More information about the Bf-blender-cvs mailing list