3
$\begingroup$

I'm having trouble trying to understant how cloth simulation pinning works. I want to modify the pinning group during animation so that I can have characters grabbing and dropping pieces of cloth without interrupting the flow of the simulation. For this purpose I tried to use dynamic paint, but it seems like once the animation starts playing you can only remove vertex from the pinning group, not add or modify them.

The red ball in the exmaple below paints vertex red and the blue ball deletes paint.

Dynamic painting cloth

What is the problem here? Is there a workaround to this so that cloth can be pinned and unpinned mid-animation?

$\endgroup$
2
$\begingroup$

There is no simple solution to this.

Animating the group itself is not a problem, you can use the AnimAll addon or just stack multiple vertex groups with the Vertex Group Mix modifier where you can animate the influence of participating groups on the final one.

The problem is that when you need to change the pinned vertices, you need the simulation to continue where it ended the frame before. But the simulation will not pin the vertices where they currently are, but where they were before the simulation started. Those newly pinned vertices would just jump from frame to frame to their un-simulated location.

To solve this in Blender, you need to create multiple simulations that closely start where the previous ends (and they need to start-end with similar motion also). Then you need to create one extra mesh so you can interpolate between all those simulations and smooth merge them into shapekey animation:

How to bake softbody animation into keyframes?

You will have to modify the script to sample from multiple meshes and to smoothly transition between them, but most of the code is there.

When sampling the simulations you take locations from first simulation and when you approach the second you smoothly switch to it's vertex coordinates.

The results can be very good and convincing. It is common practice in many simulation applications when the simulation is not precise enough like you want and you need to hand sculpt some key poses of the cloth into the simulation.

If you want to avoid the scripting, you can also use multiple Mesh Deform modifiers to those simulations and then blend between them with influence. But when your simulation changes, you can simply re-run the script while otherwise you need to rearrange, re-bind and re-animate those modifiers.

$\endgroup$
-1
$\begingroup$

the animAll addon in the addons contained in blender. This addon will allow you to animate the group of vertices that is pinned to the cloth.animate group of vertices

$\endgroup$
  • $\begingroup$ Sadly this won't work, because when changing the pinned group it will not take the location from the simulation but the old location when the mesh was static before simulation. It results in non-smooth simulation and sudden jump frame to frame. $\endgroup$ – Jaroslav Jerryno Novotny Mar 25 '18 at 18:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.