[Bf-blender-cvs] [a0fe22095e6] master: Fluid: Use maximum for initial velocity grid application

Sebastián Barschkis noreply at git.blender.org
Wed Apr 22 15:30:34 CEST 2020


Commit: a0fe22095e6d9b8b194c2cf6f9a7c7b419d7e61c
Author: Sebastián Barschkis
Date:   Wed Apr 22 15:00:52 2020 +0200
Branches: master
https://developer.blender.org/rBa0fe22095e6d9b8b194c2cf6f9a7c7b419d7e61c

Fluid: Use maximum for initial velocity grid application

Using MAX2 when writing intial velocities into the grid prevents overriding initial velocities when using multiple flow objects that are close to each other.

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

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

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

diff --git a/source/blender/blenkernel/intern/fluid.c b/source/blender/blenkernel/intern/fluid.c
index 4934ec570d3..a26feb2d06b 100644
--- a/source/blender/blenkernel/intern/fluid.c
+++ b/source/blender/blenkernel/intern/fluid.c
@@ -3110,9 +3110,9 @@ static void update_flowsfluids(struct Depsgraph *depsgraph,
                                   levelset,
                                   emission_in);
               if (mfs->flags & FLUID_FLOW_INITVELOCITY) {
-                velx_initial[d_index] = velocity_map[e_index * 3];
-                vely_initial[d_index] = velocity_map[e_index * 3 + 1];
-                velz_initial[d_index] = velocity_map[e_index * 3 + 2];
+                velx_initial[d_index] = MAX2(velx_initial[d_index], velocity_map[e_index * 3]);
+                vely_initial[d_index] = MAX2(vely_initial[d_index], velocity_map[e_index * 3 + 1]);
+                velz_initial[d_index] = MAX2(velz_initial[d_index], velocity_map[e_index * 3 + 2]);
               }
             }
           }



More information about the Bf-blender-cvs mailing list