How to reverse cloth animation?

Hello everybody,

today I tried to get a cloth animation playing reversed to get some nice effect but no luck so far :cry:.
For testing this out I have a simple cube as collision object and a plane above the cube as cloth. The simulation works well. The cloth plane falls onto the cube and gets deformed as expected.
The animation for the cloth falling down takes 100 frames. And now I want to get these 100 frames playing reversed.
Of course I can render this out and make it playing reversely using the sequencer but this is not what I want. I want to use the reversed animation as part of my whole movie and need to do some further modelling etc… So reversing in sequencer is not an option for me.
I think I need a way to get keyframes out of the cloth simulation but had no luck.
I baked the 100 frames of cloth animation but could not find any option ‘bake to keyframes’ or ‘bake to shape keys’.
I also tried to create an action but also the action does not have any keyframes.

Is there any way to get keyframes / shapekeys out of the cloth simulation?
If yes how? And how to reverse the 100 frames afterwards?
Or is there a simpler way to get a cloth simulation (or any other simulation) reversed?

Thanks for any help!

I would think that for baking 100 keyframes, you’d want to do some scripting. The new changes in 2.9 (save modifier as shapekey) should help with that, although I haven’t even downloaded 2.9 yet, just read about the changes.

The script would be relatively simple: advance one frame, save modifier as shapekey.frame, repeat *100; disable cloth modifier; go back to frame 1; advance 1 frame, register shapekey.2 at 1.0, register shapekey.1 and shapekey.3 at 0.0; repeat * 100; scale keyframes about frame 50, -1 in x axis.

I wouldn’t be surprised if you could get away with fewer shapekeys, at least down to 1 every couple of frames. Some people might like to use relative shapekeys for this kind of thing.

Wouldn’t be surprised if there was some mesh cache solution to this, although I don’t know anything about mesh cache.

You should be able to export it out as an Alembic file and then load it back in and reverse the cache playback.

2 Likes

Hi,

thanks for reply. So it seems there is no ‘easy’ way to achieve that :frowning:

It’s not that hard, here’s how:

  1. Do your cloth animation. I have an animation from frame 1 to frame 150.
    Peek 2020-09-08 20-15

  2. Enable the MDD exporter addon

  3. Select your cloth object and export to MDD, leave settings as default.

  4. Remove your cloth simulation modifier and a MeshCache modifier.
    Load your exported cache as file path. Make sure your object’s scale is applied, and your position is reset to (0,0,0).

  5. Set TimeRemapping mode to Frame and Custom
    Set the first frame of the scene, set a keyframe for Evaluation Frame at 150, and vice-versa. Hover over the Timeline bar on the bottom, and set the keyframe interpolation mode to Linear (Shift E)

  6. That’s it! The animation plays in reverse.
    Peek 2020-09-08 20-20

1 Like

Here’s an even easier way!

  1. Make your clothsim the way you want.
    Peek 2020-09-08 20-34

  2. Select your object and go to File > Export > Alembic (.abc). Make sure to select Only Selected Objects

  3. Go to File > Import > Alembic (.abc) and import your file you just exported.

  4. Select Override Frame and add a keyframe on frame 0, setting the Override Frame to 150. add a keyframe at frame 150 as frame 1.

  5. In the dope sheet (found in the Animation workspace tab by default), set the keyframe interpolation to Linear. Disable Only Show Selected button (is this a bug?)

  6. Enjoy your reversed animation!
    Peek 2020-09-08 20-42

2 Likes

Hi Thomas,

thanks for your detailed reply - its working as expected!

No problem, enjoy!

Thank you helped so much!

1 Like