Page MenuHome

Softbody with "Maintain Volume"-Feature
Needs ReviewPublic

Authored by Steffen Kühn (skn) on Mar 7 2019, 4:36 PM.
Subscribers
None
Tokens
"Like" token, awarded by hitrpr."Like" token, awarded by TheAngerSpecialist."Like" token, awarded by Schamph.

Details

Summary

The patch adds a new feature to Softbody that allows you to force the volume of a softbody to be preserved. This can leads to much more realistic simulation results. The basic idea is to regulate the internal and external pressure of an object so that the volume remains constant. The feature is switched off by default and can be switched on at "Softbody -> Object-> Maintain Volume".

Note: To make the feature work, a mesh surface should be as closed as possible.

See also:

https://blender.community/c/rightclickselect/nKcbbc/softbody-should-have-a-preserve-volume-button
https://youtu.be/ou26MR6L-mw
https://youtu.be/NGZsliXpHiI

Diff Detail

Repository
rB Blender

Event Timeline

Brecht Van Lommel (brecht) requested changes to this revision.Mar 13 2019, 1:29 PM

I don't think this approach is correct. It tries to preserve total volume of the mesh, but that doesn't make a lot of sense for more complex shapes or meshes that have multiple disconnected components.

For example if you have a character mesh, if one arm collides with something it would cause the entire mesh to expand?

I think volume preservation in physics simulation is usually done with more local forces.

source/blender/blenkernel/intern/softbody.c
3241–3242

This multiplication by 1000 seems rather arbitrary, it might only work on specific mesh shapes that you tested?

source/blender/makesrna/intern/rna_object_force.c
1517

Rename to "maintain" to "preserve", we use "preserve" in other places for similar functionality.

This revision now requires changes to proceed.Mar 13 2019, 1:29 PM
  • instead of a switch, the coupling constant (previously 1000) can now be set directly
  • use "preserve" instead of "maintain".

Many Thanks!

I don't think this approach is correct. It tries to preserve total volume of the mesh, but that doesn't make a lot of sense for more complex shapes or meshes that have multiple disconnected components.

Well, it is not always guaranteed that the procedure will work in every case. One has to try whether one likes the result or not. If not, one should switch it off. It's the same with many things in Blender.

For example if you have a character mesh, if one arm collides with something it would cause the entire mesh to expand?

The example with the arm shows the problem of softbodies in general: If the change of the arm volume is big, the simulation is bad in every case, even without "Preserve Volume".

A solution could be to make the arm to an separate object and to connect it to the body on the shoulder. The same could be done with other parts of the body if one want to simulate a human body.

I could imagine to extend the feature to vertex groups in the future. What do you think?