15
$\begingroup$

I have created a waving flag simulation by pinning a set of points, adding cloth physics, and setting up wind forcefields. The result is just fine when I render the scene except that I want the resulting png files to be a continuously looping animation. The resulting animation is currently jumping when the loop transitions from the last frame to the first frame.

I have tried exporting to lightwave format, importing it back in and inserting appropriate shapekeys to get an interpolation between the last and first frame, (as described here), but it seems the export-import step messes up both the orientation and the basis for the shape keys. I tried exporting-importing twice and I also tried using a custom plug-in that fixes the orientation issue, but my shape keys at 1.0 value are always stretched out and rotated compared to the same shape key at 0.0. The result is that after interpolation, the flag not only waves, but also rotates and stretches.

I am thinking about trying one of the following routes:

  1. Somehow edit the necessary shapekeys at value 1.0 so that it matches the orientation and rotation at 0.0.

  2. Look into the export-orientation problem and see if I can fix it myself.

  3. Try to morph from last frame to first frame of the rendered result using some other tool.

What do you think is the easiest and best way to go to get a nice loop transition?

Edit:

After trying sambler's suggestion using two modifiers with varying influence in the transition between last and first frame, the mesh seems to be rotated and scaled in the frames where the modifier influence is interpolated.

Good mesh Bad mesh

$\endgroup$
4
  • $\begingroup$ Looks like the corner of the cloth is 'snapping' back on itself in the wind. Maybe be selective of the start and end frames of the sim to be close to each other in shape to ease the transition. $\endgroup$
    – sambler
    May 27, 2014 at 20:38
  • $\begingroup$ I don't think this is an issue with the simulation. Everything looks just fine until I start interpolating between the modifiers. I ended up finding similar start and end frames and made a 'transition' frame with these in Gimp. $\endgroup$
    – Torleif
    May 28, 2014 at 7:04
  • $\begingroup$ Try looking at this post from Blender Artist, yogyog's idea may help? blenderartists.org/forum/… $\endgroup$
    – user3661
    May 29, 2014 at 8:43
  • $\begingroup$ I can verify that this method works well when indeed - as Joey said - all transforms are applied before exporting the MDD file and I will add that if anything went wrong beforehand and you mean to export it anew that one should export it to a new file. It seems that overwriting an already existing MDD file can create a faulty file which in my case had the same secondary issues still. When exporting the exact same object or simulation onto a new file it worked perfectly. $\endgroup$ Sep 9 at 13:45

3 Answers 3

15
$\begingroup$

My first choice would be to run the simulation for the entire animation, but the idea of using the MDD exporter could be applied a bit differently than the example you gave.

Export the cloth simulation to an mdd file.

Remove the cloth simulation from the object and add a Mesh Cache modifier. Set the File path to the mdd file you saved previously.

enter image description here

This will play the cloth simulation using the exported data. By using keyframes on the modifier values we can make it repeat the same simulation data. By using two mesh cache modifiers we can have a chance to smoothly transition between repeats.

Lets say we have a cloth simulation of 100 frames.

We have modifier1 with a frame start of 1 and then keyframe the influence to go from 1.0 on frame 95 to 0.0 at frame 100.

Then we have modifier2 with a frame start of 95 and influence keyframed to go from 0.0 on frame 95 to 1.0 on frame 100.

This should give us a smooth transition between the last and first simulation frames.

By keyframing the start frame we can re-use the two modifiers to repeat the simulation over and over again.

$\endgroup$
2
  • $\begingroup$ Your explanation makes sense. However, for the frames where the influences of the modifiers vary between 0 and 1, the mesh rotates and seems to scale. I will add a screen shot of it to my original question. $\endgroup$
    – Torleif
    May 26, 2014 at 18:24
  • $\begingroup$ Works for me in same exact project context. Except I did not like the idea of blending both Mesh Cache modifiers 0-1 on one and 1-0 on the other, I simply had one Mesh Cache modifier playing at full 1, but overridden by the second, and then fade second from 1-0. Also sambler's example of a 100-frame animation and using 0-94 in one anim then blend from 95-100 requires an animation MDD length of 105 frames, the full length (100) plus the additional blend length in order to have no choppiness before or after blend $\endgroup$
    – Tom Pace
    Jul 29, 2017 at 20:44
0
$\begingroup$

You could make the flag randomly sway in wind and then reverse it at the end to bring it back to the beginning. Make sure you don't just stop it then suddenly play it in reverse. Slow it down then slowly speed up in reverse.

Dan

$\endgroup$
1
  • 1
    $\begingroup$ Thanks for the suggestion, but I already tried this; It makes it look like the wind blows the other way. $\endgroup$
    – Torleif
    May 24, 2014 at 9:32
0
$\begingroup$

To solve the secondary issue (object transforming incorrectly when the influence is changed), you need to make sure that you apply the object's transformations (with CTRL+A) to the object BEFORE you export it using sambler's method.

1.) Create your cloth simulation.
2.) Select your cloth object.
3.) Press CTRL + A to bring up the Apply menu and choose All Transforms (or at least the transforms you've noticed moving when changing the Mesh Cache influence)
4.) Now export the .mdd and continue with samber's solution.

I just had this same secondary issue and this solved it immediately.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .