Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Obstacles that contain a cloth modifier do not not push around the fluid (FLIP Fluids 1.0.7) #485

Closed
rlguy opened this issue Dec 17, 2019 · 0 comments
Labels

Comments

@rlguy
Copy link
Owner

rlguy commented Dec 17, 2019

System Information

Blender Version (including hash): Blender 2.81 (master)
FLIP Fluids Version: 1.0.7 (worked in 1.0.6)
Operating System: Windows 10 Home
CPU: Intel i7-7700 @ 3.60GHz
GFX: GTX 1070 8GB
RAM: 32 GB

Describe the bug

Bug report submitted here: https://blenderartists.org/t/flip-fluids-addon-a-liquid-fluid-simulation-tool-for-blender/702503/831

If an obstacle object cottains a cloth physics modifier, the object will not push around the fluid in FLIP Fluids version 1.0.7. This was working in version 1.0.6.

In FLIP Fluids v1.0.7: https://giant.gfycat.com/ThunderousFatalAllosaurus.webm
In FLIP Fluids v1.0.6: https://giant.gfycat.com/PepperyImmaterialFrigatebird.webm

.blend file: https://blenderartists.org/uploads/short-url/qQPa7Q8q9eDTyLo5TBbqLXxxl13.blend

What causes this bug?

I just had a chance to look into this and it is caused by a small change between version 1.0.6 and 1.0.7. In v1.0.7 we added a check for whether an obstacle mesh changes topology between frames (changing vertices/triangle between frames). This check was added because we want to add support for topology changing meshes in the future.

The problem is that the obstacle is a cloth modifier object, and it looks like the cloth modifier structures the mesh triangles in a way that triggers a false positive in the changing topology check. Right now, meshes that are detected to change topology have all of their vertex velocities set to 0.0. This is what is causing the object not to push around the fluid.

I had not tested using the cloth modifier as an obstacle and had made some assumptions about how animated meshes are stored in Blender that has turned out not to be true. These are the assumptions I had about a mesh that does not change topology in Blender:

  1. Vertex count will be the same between frames
  2. Triangle count will be the same between frames
  3. The order of the mesh triangle list will be the same between frames

If any of the above checks are false, the simulator will mark the mesh as having changing topology. Number 1 and 2 are correct. Number 3 is what is causing the problem. It looks like the cloth modifier changes the order of triangles between frames. Check #3 is fast, but turns out it won’t be 100% accurate in Blender which I had assumed.

A fix for this is to do a proper topology check rather than a fast one. It will be slower to compute, but I really don’t think it will have any noticeable impact on simulation performance. This should be able to be fixed easily during tomorrow’s development.

Bug Fix

This bug has been fixed and will be added to the next FLIP Fluids release.

Workaround

A workaround until the next release is to add a Triangulate modifier with Quad Method set to fixed after the cloth modifier:

fixed_quads

@rlguy rlguy added the bug label Dec 17, 2019
@rlguy rlguy closed this as completed Dec 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant