Fluid simulation stopping collide after pause/resume #74794

Closed
opened 2020-03-15 22:50:07 +01:00 by Ivan · 13 comments

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
#74794.blend
Start to bake, press ESC to stop, press resume to make collisions disappear.

2020-03-18 12-10-46.mp4
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.
**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** [#74794.blend](https://archive.blender.org/developer/F8412397/T74794.blend) Start to bake, press ESC to stop, press resume to make collisions disappear. [2020-03-18 12-10-46.mp4](https://archive.blender.org/developer/F8413699/2020-03-18_12-10-46.mp4) 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.
Author

Added subscriber: @cblpop

Added subscriber: @cblpop

Added subscriber: @mano-wii

Added subscriber: @mano-wii

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

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

Added subscriber: @iss

Added subscriber: @iss

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'

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

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

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

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

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

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

ok i baked simple scene and put cache folder there. ~88 Mb [BBUG.rar](https://archive.blender.org/developer/F8412764/BBUG.rar) As you can see, i clicked pause on 50th frame (of 100)
Member

Added subscriber: @sebbas

Added subscriber: @sebbas
Member

Added subscriber: @JacquesLucke

Added subscriber: @JacquesLucke
Member

@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. */
@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. */ ```
Member

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Jacques Lucke self-assigned this 2020-05-27 14:09:52 +02:00
Member

This has been fixed in master and blender-v2.83-release branch. Not sure which commit fixed it exactly.

This has been fixed in `master` and `blender-v2.83-release` branch. Not sure which commit fixed it exactly.
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#74794
No description provided.