Page MenuHome

Fluid simulation stopping collide after pause/resume
Confirmed, NormalPublicBUG

Description

System Information
Operating system: Win10x64, i7-8700k, 32gb
Graphics card: GTX1660Ti

Blender Version
Broken: blender-2.83-a210b8297f5a-windows64
Worked: 2.83 c26f470cfeea is last that I can test

Exact steps for others to reproduce the error


Start to bake, press ESC to stop, press resume to make collisions disappear.


The video shows:

  1. How it looks like when the entire simulation is baked at once.
  2. How it looks like when I pause and resume the simulation during baking.

Event Timeline

Could you provide a simple blend file?
(This would save developers' time).

Richard Antalik (ISS) changed the task status from Needs Triage to Confirmed.Tue, Mar 17, 5:08 PM
Richard Antalik (ISS) updated the task description. (Show Details)

Note, that when bake is resumed, flow seems to fall to 0, or completely cut off in my build (365287048319)

if i drop just .blend file, it would have baked liquid? or i need something like cache folder too ?

ok i baked simple scene and put cache folder there.
~88 Mb

As you can see, i clicked pause on 50th frame (of 100)

Jacques Lucke (JacquesLucke) changed the subtype of this task from "Report" to "Bug".

@Sebastián Barschkis (sebbas), the root cause here is this is_first_frame check. Not sure how you'd like to fix that as there are multi possibilities. Also, you might have made similar assumptions in other places in the code, would be good if you could check if those suffer from the same issue.

diff --git a/source/blender/blenkernel/intern/fluid.c b/source/blender/blenkernel/intern/fluid.c
index dc872b933eb..5fb705392c5 100644
--- a/source/blender/blenkernel/intern/fluid.c
+++ b/source/blender/blenkernel/intern/fluid.c
@@ -1212,7 +1212,7 @@ static void update_obstacles(Depsgraph *depsgraph,
       }
 

       /* Optimization: Static objects don't need emission computation after first frame. */
-      if (is_static && !is_first_frame) {
+      if (is_static) {
         continue;
       }
       /* Optimization: Skip effector objects with disabled effec flag. */

Something like this should fix it, but leads to memory leaks for now:

diff --git a/source/blender/blenkernel/intern/fluid.c b/source/blender/blenkernel/intern/fluid.c
index dc872b933eb..5200cdb11f4 100644
--- a/source/blender/blenkernel/intern/fluid.c
+++ b/source/blender/blenkernel/intern/fluid.c
@@ -1176,6 +1176,7 @@ static void update_obstacles(Depsgraph *depsgraph,
   Object **effecobjs = NULL;
   uint numeffecobjs = 0, effec_index = 0;
   bool is_first_frame = (frame == mds->cache_frame_start);
+  bool is_first_frame_after_resume = is_first_frame || (frame == mds->cache_frame_pause_data);
 
   effecobjs = BKE_collision_objects_create(
       depsgraph, ob, mds->effector_group, &numeffecobjs, eModifierType_Fluid);
@@ -1212,7 +1213,7 @@ static void update_obstacles(Depsgraph *depsgraph,
       }
 
       /* Optimization: Static objects don't need emission computation after first frame. */
-      if (is_static && !is_first_frame) {
+      if (is_static && !is_first_frame_after_resume) {
         continue;
       }
       /* Optimization: Skip effector objects with disabled effec flag. */