Commit: 31d3f034ab8b7531eded7b0200d6ec77ba29b6a2
Author: Sebastián Barschkis
Date:   Thu Apr 30 18:08:52 2020 +0200
Branches: master
https://developer.blender.org/rB31d3f034ab8b7531eded7b0200d6ec77ba29b6a2

Fix T76097: Simulations don't take animated gravity into account

Together with 21485e94aac1 this commit should fix the issue with animated 
gravity values.

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

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

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

diff --git a/source/blender/blenkernel/intern/fluid.c 
b/source/blender/blenkernel/intern/fluid.c
index 2b99133fe97..5340fa63f38 100644
--- a/source/blender/blenkernel/intern/fluid.c
+++ b/source/blender/blenkernel/intern/fluid.c
@@ -3772,6 +3772,12 @@ static void 
BKE_fluid_modifier_processDomain(FluidModifierData *mmd,
   /* Get distance between cache start and current frame for total time. */
   mds->time_total = abs(scene_framenr - mds->cache_frame_start) * 
mds->frame_length;
 
+  /* Ensure that gravity is copied over every frame (could be keyframed). */
+  if (scene->physics_settings.flag & PHYS_GLOBAL_GRAVITY) {
+    copy_v3_v3(mds->gravity, scene->physics_settings.gravity);
+    mul_v3_fl(mds->gravity, mds->effector_weights->global_gravity);
+  }
+
   int next_frame = scene_framenr + 1;
   int prev_frame = scene_framenr - 1;
   /* Ensure positivity of previous frame. */

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to