3
$\begingroup$

I am trying to learn more about cloth and collision simulations. I built a plane with a subdivision and cloth modifier, pinned it's top edge, then had an impermeable cube animate upwards to "bunch" it up:

enter image description here

Then when the cube drops away, the cloth drops back down as well:

enter image description here

enter image description here

The problem is as shown in the third image, the cloth spends a great deal of time bouncing/flapping around and trying to "settle" after it is disturbed.

I tried playing with the damping and stiffness controls as well as air viscosity but couldn't find any settings that would let the cloth return very rapidly to its original "flat" resting position more quickly.

Is there any set of parameters that would let it return to its "flat" resting position faster after such a disturbance?

Simple example project is here:

https://ufile.io/fj7v4oqx

Thanks

$\endgroup$
2
  • $\begingroup$ Think of cloth that would actually do what you want. Either very heavy leather or rubber that falls down tight right away, or very light silk with almost no inertia to swing about with. Make sure the cloth properties match that. If it still fails, hmm… $\endgroup$
    – TheLabCat
    Jan 20 at 5:30
  • 1
    $\begingroup$ Thank TheLabCat! I didn't see you could access presets for cloth. That plus the answer I accepted below for vertex weighting helped solve the issue. $\endgroup$
    – mike
    Jan 20 at 7:17

1 Answer 1

6
$\begingroup$

The quickest, easiest way to get cloth to retain its resting shape more is to take advantage of pinning. You're already using pinning on 2 of your verts, at 1.0 weight, but pinning can be used at different weights as well. You can assign a vertex to the pinning group at half weight to pin it halfway, at 0.25 strength to pin at quarter strength, etc.

In fact, you're already doing this, although you might not realize it. By starting with a plane and creating all your vertices via subdivision, you're actually smoothly interpolating your pinning from one end of the cloth to the other. The high weights near the top are part of the reason it's penetrating collision.

We could control pinning through manual weight painting on other meshes, but here, where all our verts are being created by subdivision, we can't do that. But instead, we can use a vertex weight edit modifier between the subdivision and the cloth to control the pinning strength:

enter image description here

I've created a custom curve that increases our low pinning and decreases our high pinning. Even without subdiv modifiers in play, this is often easier for tuning pinning than manual painting is, because we never have to enter edit or weight paint mode and lose the physics cache.

In fact, we can even animate this, so that we can change the pinning live, during playback, simply by adjusting and keyframing modifier values.

$\endgroup$
5
  • 1
    $\begingroup$ that's a pretty good idea! ;) +1 $\endgroup$
    – Chris
    Jan 20 at 6:28
  • $\begingroup$ That's fantastic Nathan. Cranking up the pinning at the bottom of the "cloth" helped solve this issue along with accessing the presets for cloth types (leather, silk, cotton, etc) to see how the various settings affect behavior. Your explanation also showed me why when I went to weight painting it was showing a gradient of weight painting in the original example project. I didn't understand that before. I always also prefer mathematical/procedural effects that are quick to change rather than things like manual "painting." Thanks. $\endgroup$
    – mike
    Jan 20 at 7:15
  • $\begingroup$ I just figured out also cranking up the speed multiplier gets you to the settling point faster as well. Kind of like cheating the speed of time. $\endgroup$
    – mike
    Jan 20 at 7:24
  • $\begingroup$ @mike: we are cheating all the time - so don't worry. Don't forget: we are rendering 2D and pretending it to be 3D... ;) $\endgroup$
    – Chris
    Jan 20 at 11:17
  • $\begingroup$ @mike Like Chris says, yeah, there's no such thing as cheating-- or rather, you have to cheat to make it do what you want. But think about your gravity settings as well. Default Blender gravity is based around the 1 unit = 1 meter scale. If you're thinking about your cloth as a window's curtain, there's not nearly enough force of gravity acting on it. There's enough gravity just for it to act like a huge banner. It's weird, but in a way, big things fall more slowly. $\endgroup$
    – Nathan
    Jan 20 at 16:44

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.