Animated NVIDIA Flex soft body rig

Hi,
@DivideByZero

I have tested your method with great success.

But i have a question concerning softbodies and attach to rigid.

In editor, simulate mode, when i drag a rigidbody with a softbody attached to it, if for example i move too fast, or if i push it against something, the attached softbody starts to slide, and detach to the rigid body.
So i wanted to know if there is a way to lock the attachment totally. Because for an animated character, having the body slide away from the skeleton makes the entire system not usable.

I guess, since this is pbd, the particles are locked together due to overlapping, and when you tick the attach to rigid, it doesnt apply the constraint that would make them separate.
But is there a way in flex to lock them. i wonder.

And i have another question concerning the collision distance with softbodies.
The generation of particles volume/surface is automated. But i noticed, the particles are on the edge of the mesh so, if you take the particle radius, lets say 2.0.
If you set the collision distance to the minimum in the container : <= 0.1.

Then your softbody collision distance will have an offset of 1.1.
Because the outer particles are sitting on the mesh surface. Even if you set surface sampling to 0.0, and keep only volume sampling. Particles are still popping out of the mesh.

The only solution i can think of, is to scale these objects up. I tried a negative particle collision distance, but it wasnt a good idea lol.

I mean if you want to have a soft body animated hand, grabbing stuff around, your camera is close, and you see a big offset between fluids/and meshes. This is weird.
Flex looks good at distance. I hope, there are workarounds for these things i mentionned.

Also setting a smaller particle radius isnt an option, for softbody, it kills the frame rate. And causes tunnelling if you do not adjust the particle distance (but if you adjust you end up with 99999999999 particles on one object)
On fluids, it becomes too tiny.

Edit :
I took a look at the flex attach to rigid body implementation.
So it is just a bare copy of transforms from the rigid body to the particles.

in FlexComponent.cpp, line 894 :



const FVector AttachedPos = AttachTransform.TransformPosition(Attachment.LocalPos);

ContainerInstance->Particles[ParticleIndex] = FVector4(AttachedPos, 0.0f);
ContainerInstance->Velocities[ParticleIndex] = FVector(0.0f);


So i guess, since the particles position are forced to position, then it must be the softbody itself that becomes screwed up. I noticed that in simulate mode, when things go wrong, if i shake the rigidbody hard enough, the attached softbody returns to position.
The weird sliding effect may be related to the soft particles themselve, due to high forces, some of the links or constraint break, i dont know.