How to Bake cloth simulations

Hi :slight_smile:

I can’t find a simple tutorial on how to bake a cloth simulation (which allows me to play the animation smoothly in viewport, and save time in the rendering process). I only found content on how to bake rigid body physics, or textures.

I have 120frames of multiple cloth simulation that I want to bake. How do I achieve that properly ? Do I need to bake the rig actions before ?

Is it possible to bake all the cloths simulations from frame 1 to 120 in one time ? The “bake all dynamics” just goes smoothly through my 120 frames without any effect.

I saw some “bake to shape keys”, or .mdd things, but it is not what I need, I think. Or at least, I don’t understand the point of it

I would gladly take your advices and details about baking workflow :slight_smile:

Thanks a lot

Hi @Pdhm,

In order to save out the cache files for the cloth sims, you need to EXPORT them to an external file in either the Alembic, MDD or pc2 format. You can them disable or delete the actual cloth sim on that geometry and add a Mesh Cache modifier and select the MDD/pc2 file or for Alembic use the Mesh Cache Sequence.

Dj.

Thanks for your reply !

Okay, so I understand this is the only (and, the right) way to do so. Thanks. Which of these formats do you advice me ?

Then, if I bake the animation (Pose Mode, Pose, Bake Animation), then the physics effects as you said, is it possible to store the Pose animation AND the physics baking in sort of a library ? The goal would be to be able to have a blend file with, lets say 5 or 6 different actions and baking ready to use in other scenes.

Which format you choose really depends on if you are planning to use the animation cache in another piece of software. You’ll need to pick a format that can be read properly. For use in Blender any will work, though it’s worth saving them out in all 3 formats to start with in case you find that one format allows you to do extra things. For instance the Alembic format can save all this data:


but the pc2 just this:
image

Obviously the Alembic is going to be a larger file as a result, so you might need to take that into account too.

The Alembic also allows you to save multiple caches into one Alembic file ( use the Seleceted Objects check box in the export to group things ) just be sure to select which mesh to use for each mesh cache:

I recommend you experiment with the various export options - as long as you keep the original Blender file with the cloth sims you can always regenerate new caches.
Dj.

Ok I’ll try this out

To be sure : before I export a cloth simulation, can you confirm that I HAVE to bake the simulation in cache ?

Thanks for your help :slight_smile:

Hey,

If you don’t in some way save the simulation to an external format, at some point the sims will get reset. Having had play around with multiple cloth sims:-

these are my findings . . .
On the LEFT side: In this example the Shirt and Cape are 2 separate meshes each with a cloth sim. The shirt additionally has collision. The manequinn torso has collision too but is a rigged mesh with an armature and simple animation.
In the cloth panel I selected Disc cache and then Bake all dynamics:
image

This did the sims on BOTH pieces of cloth at the same time. At this point if you save the blender file all is fine. It saved the cache to an external folder of Blenders naming ( in the same place the Blender file exists) which came in at 19Mb. HOWEVER, I discovered that you cannot change anything about the two sims - not even rename the meshes - without the caches failing :confused:

Finally, I exported as individual pc2 files the shirt sim; the cape sim; and the Manequinn. All three of these together came in at 8Mb.

On the RIGHT, I duplicated the meshes of the torso, shirt and cape, deleted all modifiers ( including the armature on the torso) and all the sims. then added to each a Mesh Cache Modifier and assigned the related pc2 file.

In summary - export you caches if you want to keep them or have no need to resimulate ( if you’re focusing on materials or rendering say) . Whether you want to export as individual pc2/MMD or use multiple meshes together ( Alembic) is entirely up to your work flow.

Here is the Blender file. You will need to follow the steps I’ve outlined above to recalculate the cloth and save out the pc2 files if you want to see the results shown in the video above.ClothSims.blend (2.9 MB)

Hope that’s of help,
Dj.

That helps a lot thank you ! :smiley:

It is pretty clear now ! I tried to export one of my cloth sim and it worked well. I’ll stick with it to import my character’s action in other scenes.

In your reply you also wrote about the “Bake all dynamics” button, but in my project this button only bake 1 of the 5 cloth simulation, the 4 last have a “0 frame on disk : cache is outdated !” on their properties panel. Deleting bake of one of them doesnt reset the cache, and then hit “Bake” only goes through the frames without any calculation, any idea on this ? Thats weird.

In any case, thanks for your help, this is a solved post ! :smiley:

I’ve also made a post a few days ago about my cache issue, if you wanna save me two times in a week haha : 0 frames on disk, cache is outdated : unable to reset multiple cloth physics cache

Thanks again for your time, bye ! :slight_smile:

I’m not sure why it’s not baking all your cloth sims at the same time, but I have noticed that pressing the “delete all Bakes” doesn’t necessarily do so - to force the cached frames to clear, ON EACH CLOTH mesh click, then Unclick, one of the other properties ( like Pressure) this seems to force a reset and the blue status bar ( along the bottom of the timeline) that shows calculated sim frames will get purged. Then try another Bake All.

Best of luck with your project.

Cheers,
Dj.