[Bf-blender-cvs] [07ed64aae6f] blender-v2.83-release: Fluid: Use maximum for initial velocity grid application

Sebastián Barschkis noreply at git.blender.org
Wed Apr 22 16:21:11 CEST 2020


Commit: 07ed64aae6fde5429ffe0ab7e30d240009a98e37
Author: Sebastián Barschkis
Date:   Wed Apr 22 15:00:52 2020 +0200
Branches: blender-v2.83-release
https://developer.blender.org/rB07ed64aae6fde5429ffe0ab7e30d240009a98e37

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 bde0abe1499..9709b74516b 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