GSoC 2020: Soft Body Sim - Discussion and Suggestions

Nah it’s my fault for not being clear about it :slight_smile: . I’ve mentioned it in text but I don’t show what the problem looks like, so it’s hard for others to tell whether its a known bug or an unknown one.

I appreciate you testing things out and especially posting videos here. That’s super helpful for myself (and probably others) so I can see the behavior I need to correct and prioritize.

1 Like

After this commit the simulation appears to be slow motion and some glitches…
BUT the result of the softbody over the mesh is way better! I can see much more “jiggle” over the mesh, it’s becoming better and better.
In this example the subdivision is applied and with 3 levels we have the glitch.
ezgif.com-optimize (1)

3 Likes

Yeah, I’m still working out some bugs. I can’t promise that every commit will be stable. The slow-mo is just me reducing the time step, which is currently decoupled from the Blender frame-rate.

Edit: I just pushed another tag that doesn’t have this issue in case you wanted it: softbody-stable-v3. At the moment I’m experimenting with different constraint update strategies to see what might work the best.

Oh, Thanks!
Please, do not consider my posts as requests or claiming tasks to be resolved… I’m just testing and experimenting and I know that this is a “under construction” work, so please, I don’t want to cause pressure on you side but I also want to help testing the current implementation and see what I can get with it.
I’m loving your work! Previously I had to tweak so many things and workarounds to have this “soft keeping volume” effect and it’s now default and so fast! Do you think that the processing speed is something that could be improved later? Because it’s already faster than the traditional method.

Gotcha.

It’s not quite as fast as I want it to be, but I haven’t done a deep dive yet on optimizations. It could be a lot faster since the major bottleneck is collision detection. But improving CD can be a lot of work, so for now I’ll just use what’s working and save it for a to-do.

4 Likes

I want to show how I use the “Legacy” softbody method.
I just learned (reading the manual) that it’s all about “inner vertex connection”. Depending on how you build this inner connections you can reinforce the structure and it works better.


I use this method to build a “soft cage” and use it as a deformer via mesh deform modifier to deform the original model. This is why I would love to see some kind of “plasticity” or “cumulative deformation” whatever it can be called… it’s super useful.

The correct way to build it would have an automated way to build the inner grid connections, like a “volumetric subdivision” solution, a grid inside of the model. This is very time consuming process doing by hand so I just created three simple inner connections inside the “car cage” and connected then to create a spring stiffness inside of the model.

@mattoverby is this something related (of course not the same) to the new system you are building?
I know that there’s a tetrahedralization process that happens and this “low res” hidden version that carries the simulation and somehow deforms the desired model… Am I somehow right or not even closer?

9 Likes

That’s pretty much exactly what’s going on underneath. There are a number of interesting ways plasticity can be introduced. Unfortunately it’s not likely I’ll be able to implement or test any of them before the end of summer.

1 Like

translation: “Fortunately, I’m coming back for next year’s GSOC” :smiley:

3 Likes

@mattoverby Is it possible to animate the goal influence?
In this example, I need the goal to attach Suzanne to the boxer hands but after the uppercut, I want to release Suzanne from goal influence… I tried to use the Weigh Proximity modifier to control the vertex group dynamically but I can’t use this Weigh modifier before the softbody modifier in the stack… Also the goal stiffness seems to do nothing even when animated…
Goal

5 Likes

Yes. But you’re touching on a topic I haven’t explained fully in my weekly updates - certain simulation parameters may require a refactorization of the global matrix, which is computationally expensive. Changing goal influence (stiffness?) is not one of them, so that will be possible.

In fact, most parameters besides a change in topology do not require factorization, because I’m using preconditioned conjugate gradients. Mileage may vary, though, because the degrees of freedom may be fairly low for the coarse embedding mesh. In many cases the cost of factorization may be less than the added cost of more PCG iterations. It’s a subtle balance but important, because after collision detection the linear solve is the most expensive operation of the solver.

At the moment, many changes to parameters are ignored after simulation initialization because I haven’t set up a system to deal with the above issue.

1 Like

The whole cloth thing was very unexpected, which is very cool

Any thoughts on adding “inflation” for cloth ADMM-PD

Dont know how it would work as opposed to the cloth sim take on it

The ADMM-PD solver is very general to the type of energies it’s minimizing, so it’s capable of a lot of different things. The basic cloth sim stuff wasn’t much effort to add so I figured it would be worth the time.

When it comes to more complex behavior like inflation, I don’t think I’ll have time for that by the end of next week :wink:.

1 Like

Regardless, glad to hear your opinion about it :slightly_smiling_face:

Thank you.

Daily windows builds are up at https://blender.community/c/graphicall/spbbbc/ , sorry for the late addition, somehow this one slipped through the cracks.

1 Like

I imagine the cloth-sim may have performance improvements over the very old cloth solver Blender uses… maybe it could be used with the Sculpt cloth brush?

When I have more than one object set to have collisions in a scene, the soft body will “explode”(default settings).

It appears that when more than one collision object exists, the soft body breaks in contact with any collision while seeing collisions in the wrong place respectively. As well as it launching the soft body when colliding.This isn’t an issue with legacy soft body of course.

And if I have two active soft bodies, blender will crash.

Wasnt sure if to rather report this here or not https://blender.chat/channel/lazybuilds But for some reason that site wont load anyway.

2020-08-13 - [4e01e2580d2d], Windows 10 1909

2 Likes

Posting bugs here is best for now. Thanks @LethalDumpster, I will take a look when I get a chance.

I am able to reproduce this, and it should be an easy fix.

This on the other hand I cannot reproduce. I can simulate two active softbodies just fine. Is this with default parameters and no collision objects in the scene?

Can you specify how you are loading the scene? For example, there are some issues when you ctrl-z after a simulation has run, and there may be issues with loading blend files. Long story short, I had to make quite a few changes to how the softbody object is allocated/freed/loaded/saved/etc to faciliate ADMM-PD data. Depending on how the scene (and softbody objects) are loaded, there will certainly be some surprises.

Edit: It appears that the order in which I do things definitely effects it for me. If I add two objects, THEN give them both soft body, it wont crash. If I duplicate an existing soft body, then it WILL crash!

I’m hitting the crash through the following steps: Open blender.exe>select default cube>give soft body property>duplicate cube>crash
The crash initiates on frame one. So if I were on frame 2, it would loop around back to frame one then crash.
I change no settings, I dont undo. Of course the default cubes arent what do it, it happens with any primitive.

The only thing I can think of that got potentially adjusted, are when I selected to import my 2.90 settings.

Thanks for double checking. Strangely, I still can’t reproduce this even following your steps exactly (well, not exactly because I’m on linux). I even downloaded the experimental build from https://builder.blender.org/download/branches. I think I have an old windows machine lying around somewhere to test this out, but it would surprise me if that were the issue.

It’s unrelated to your problem, but one thing to mention is that certain meshes may cause issues. While the sim will usually run on non-closed meshes there is no guarantee that the embedding is correct due to the signed distance field calculation. I’m thinking I will just block the simulation from starting if this is the case since it may cause problems down the line. Same thing goes for collision obstacles - they need to be closed meshes, but I let it try and simulate anyway to see what happens.

The newer 325ab1a7883d is fixed of the crashing issue I was experiencing in 4e01e2580d2d. Dunno how or why, but aight

1 Like