Cloth and collision modifiers and makehuman models

Discussions about MakeHuman, Blender and MPFB. It is ok to ask for general Blender support here, even if it isn't directly related to MakeHuman

Cloth and collision modifiers and makehuman models

Postby coz » Wed Nov 09, 2022 5:03 pm

I've been trying to get a cloth to fall on a MakeHuman character, and it was hard to do it without cloth crumpling around, or cloth passing through the character in multiple parts. The cloth itself is just a subdivided plane, and I was able to get this working right away by dropping the cloth on primitives.

I tried subdividing the cloth and character, increasing simulation and collision quality, decreasing distance for object collision, activating self-collisions, deleting the MakeHuman helper geometry, plus many other things, but nothing was good enough. After multiple tutorials, one suggested increasing the model 5 times, but I found 10 works better. It seems the Blender's cloth physics are not optimized to handle high poly models of around a meter in size, and you can tell it's taking into account more vertex than it should at small scales since it takes much longer to bake physics. When you increase the size, the effects of multiple variables is effectively smaller (for example, if you scale up 10 times, it's like gravity goes down to a 1/10th, but it's certainly not just gravity), and at times I found a x100 scale gave the desired effect but sometimes it was too much; but at least you only have to change one thing, the scale, in order to get decent results instead of fiddling with dozens of variables hoping you are getting the right combination without any feedback (when you get the right combination it works, but you can't just change a single variable and check if the result is closer to what it should be incrementally, because what matters is the combination of settings, not any individual one).

After increasing size, the plane still intersects at some points, so a Solidify modifier after the Cloth modifier with an offset of 1 (not -1) fixes it.

This is the problem, where you can see the cloth goes through the model and the vertices are jittery
Image

This is everything exactly the same, but scaled x10, notice the nose protruding near the end
Image

This is the solution, x10 scaling plus solidify
Image

Here's the video with the suggestions that worked. The biggest take away besides these tips, is that you should do your animations without relying on the Cloth modifier, and then add this modifier and tweak it so it looks realistic.

Hopefully this will prevent someone's frustration in the future.
coz
 
Posts: 9
Joined: Mon Oct 24, 2022 2:26 am

Re: Cloth and collision modifiers and makehuman models

Postby joepal » Sun Nov 13, 2022 3:31 pm

Thanks for the good tutorial and explanation. It is indeed a very annoying phenomenon at the 1bu=meter scale. You will run into the same type of problems with fluid simulations and softbodies.

A possible addenum: If you intend to use makeclothes after having done a cloth simulation, it might be beneficial to create the human model (for example in "new human" -> "from scratch" in mpfb2) at 1bu=decimeter scale rather than scale it 10x. This will also set the appropriate custom attribute for the scale, and the clothes fitting calculation should then take this into account when producing the clothes file.
Joel Palmius (LinkedIn)
MakeHuman Infrastructure Manager
http://www.palmius.com/joel
joepal
 
Posts: 4465
Joined: Wed Jun 04, 2008 11:20 am

Re: Cloth and collision modifiers and makehuman models

Postby coz » Tue Nov 15, 2022 11:20 pm

It seems it's a well known issue to the developers, but 'the math checks out', and there are workarounds, so they don't consider this a high priority.

Thanks for the addenum, curiously right now I'm wondering if I should use makeclothes or not, hoping that it will make rigging/skinning clothes easier.
coz
 
Posts: 9
Joined: Mon Oct 24, 2022 2:26 am

Re: Cloth and collision modifiers and makehuman models

Postby Worker11811 » Thu Dec 15, 2022 8:29 pm

Try keeping the cloth (mesh) stationary and moving the MH model into the cloth.

Set your timeline to frame #50 or #100. Lock a Loc/Rot keyframe to place your model in the FINAL position, relative to the cloth, where you want the model to be at the end of the simulation. Now, move timeline to frame #1 and move the model to a reasonable position for the simulation to start and lock another keyframe for the models Loc/Rot.

Select your cloth and go to edit mode. Select the vertices around the perimeter of the cloth and make them a vertex group. Go back to your cloth sim panel and check "Pinning" then select the name of the vertex group you just made. This will keep the cloth stationary except that the center vertices will be able to move during the simulation.

Make sure that both your MH model and the cloth are set for "Collision" in their respective sim panels.

Change your gravity settings to suit your purpose. (Usually 0.5 or 0.25, depending on what you want.

Also, change your cloth sim settings to change how the cloth flexes around the model.
(Suggested starting point: Mass = 0.5 - Structural = 0.1 - Bending =0.1 - Spring, Air & Velocity all = 1.0)

Start your simulation and let it run for at least 50 frames beyond your last keyframe. The model will move into the cloth over those 50-100 frames and the cloth will flex due to gravity then wrap around your MH model as it moves into the cloth.

Try the simulation with a few different settings (gravity & other params.) till you find the combination of settings that gives you what you want.

After your simulation has finished running and you have found a suitable result, apply your sim AS A SHAPE KEY. Now, create another shape key and edit that to smooth out and tweak your result to what you want it to look like.

Once you are done, you can delete/apply your shape keys to the cloth OR you can keep the shape keys and use them to adjust/tweak the cloth on the fly. You can even animate your shape keys to make your cloth move if you want to.

Since you are trying to make clothes for the MH model, you'll probably want to delete/apply all your sims and shapes then continue editing the cloth mesh into the final form. You can use a combination of vertex editing and sculpt mode to do that if you want.

Usually, when I make clothes for MH models, I create them as primitives (cube, sphere and cylinder, etc.) and combine them into one mesh before finally editing to the final form but, if you want to create clothes by draping a cloth/mesh over the MH model, the method above will probably get you close to where you want to go.
Worker11811
 
Posts: 19
Joined: Tue Apr 08, 2014 12:25 am


Return to Blender and MPFB

Who is online

Users browsing this forum: No registered users and 1 guest