2 questions (or feature siggests) on soft body cloth

So, I am finally getting my hands dirty with the softbody system, trying to understand cloth creation at the level needed for character animation that does not involve nudes :confused:

I feel I am getting a good understanding of Blender’s soft bodies already, but there are two things that are causing me gray hairs:

  1. When a softbody piece of cloth stops moving, it does not seem to ever come to rest; it keeps wiggling around as if something beneath it is pushing at it. See this tank-top on a stick for an example:
    http://www.crispquality.com/siberia/ClothTest05.mov
    Note that after the stick stops waving it around, the cloth continues to ‘wiggle’ at the shoulders, far more than any actual textile would. Friction settings are at max, rigidity has been tried at max, and most stiffening properties are pretty high, and yet wiggling remains. If you wish to examine the file: http://www.crispquality.com/siberia/ClothTest05.blend

To produce even marginally realistic clothing, I need to make this wiggling stop once (or shortly after) the character or object wearing the cloth stops moving. Any help will be greatly apprieciated.

  1. Baking the softbody movements is fairly demanding in both processor power and time, and there is a tendency for the baking to crash in the more demanding cases. Is there a way to do step-by-step baking? I am thinking of something along the lines of rendering to JPEGs so that a crash simply means you continue rendering where it crashed, rather than starting all over again (in the end, all JPEGs are assembled in the video sequenser into a video file, of course). Something that allowed me to bake, for example, 50 frames, then let the processor cool, then bake the next 50 frames, would be nice. If the baking crashes the system, I could just pick up from the last ‘safe point’. Does something like that exist?

As always, thanks in advance to all who take the time to push me up the Blender learning curve. It is a great piece of software, but it clearly takes time to fully master!

A more general note on clothes with softbodys:
they have originally not been intended to be used as clothes. The simulation model doesn’t work well for clothes. The developers are working on an cloth simulation, we can expect it hopefully sometime later this year.

Having said that, let’s try and push softbodys to their limits.

  1. Try and avoid CFace.
    Not only that the baking time increases massivley, it’s pretty hard to stop the described wobbling. Well you could stop it, but therefore you have to increase MinS (and Choke), which increases the accuracy of the numerical simulation - but you will again pay a high price in terms of baking time.

But then your cloth just moves through the mesh? Yeah right. We come to the second point.

  1. The cloth needs a higher subdividing than the colliding object.
    But your beautiful mesh is highly subdivided? Than you most definitely need a proxy object with litte subdividing. It may become quite difficult to animate that though, because you have to work with three objects -> the body, the proxy object, the cloth.

This holds true even more if you work with “real” colliding objects, and not only a bar.
So lets go and see how to use softbodys to their best in clothing.

  1. At first you have to animate the cloth together with the body, not using softbodys but armatures. Then you use a GoalGroup to apply softbody effect only on certain regions of the cloth.

You can achieve pretty good effects with it, but softbodys are not a cloth simulation system.

Nevertheless, I really like softbodys. They are pretty cool.

Some notes on your blendfile:

  • Never ever use “Ev.M.Stack” for a collision object that has as subsurfacing modifier.
  • your outer collision zone is way to high. It is partially outside your softbody object.

I’ve changed your simulation somewhat (hopefully corrected some parameters, used a proxy object), but this approach leads you only so and so far. You would better use an armature and a goal group.

http://www.snapdrive.net/files/180816/cloth.zip
http://video.google.de/videoplay?docid=-6750622452813781296

P.S.:
And if we are at wishing - it’s a nuissance that the vertex group always changes to a bone if you switch to vertex painting. You always have to select the GoalGroup again. Argh! I will submit that as a feature request.

You were absolutely right, CFace was causing the (majority of the) bouncing. I removed it, expecting to end up trading bouncing for slip-through, but it turns out that our current human model did not cause that trouble. I did , however, realize the importance of setting the Inside and Outside Damping right, though it seems to work best when high, which you noted as a bad thing? (note that for inexplicable reasons, Blender seems to flip the normals of the Max character, but only when doing cloth/soft body simulation…) I also tried your alterations, but some of them, mainly Choke, has been hard to figure out. I still do not understand what Choke does in this case?

And yes, I quickly realized that cloth simulation was not an intended part of the soft bodies. However, it seems to me that all, or nearly all, of the functionality is there. What is really needed is good tutorial documentation. 4-5 video tutorials would work wonders for the soft bodies, but something tells me very few users have dug into them beyond making the mandatory “Jell-O tests”. Okay, some of the tests are very… creative, but the softbodies still look like highly unexplored territory to me.

Speaking of Jell-O (aren’t we always?), with the bouncing pretty much gone, it seems the next problem is the soft body cloth having a tendency to ‘drip’, as if it was, yes, Jell-O dripping down the character’s body. I did an animation with Max that shows the cloth falling nicely into place, but then sloooooowly ‘dripping’ down his shoulders and torso (don’t worry, the video is not inappropriate in any manner :eek: ). I have tried Rigidity with little or no effect, I’ve used increased Stiffness with the result that the cloth just goes, well, stiff, refusing to fall into place on Max’s shoulders, and I have toggled the various settings in several ways. Either the cloth continues to ‘drip’, or it goes so rigid that it can hardly be considered cloth at all.

If you or anyone else can inform me of possible solutions, I would be extremely grateful.

The video: http://www.crispquality.com/siberia/MaxClothAnim02.mov
The file: http://www.crispquality.com/siberia/MaxClothes01ANIM08.blend

And while a dedicated cloth simulation system would be more than welcome, I do feel that the soft bodies have what it takes. Except proper tutorial documentation. The code is very good!

At first: yes, the code is very good for Softbodys. (Apart from the fact that you always have damping)

  1. The normals qualify for a bug report. There have been several posts about wrong normals in the past.
  2. The damping of the collision object is not the amount of damping, but the size of the damping zone. If a vertex penetrates that zone it is repelled in the direction of the face normal.
    If your inner damping zone is larger than the diameter of the mesh, it sticks out at the other side. This means, that the vertex is pulled in the wrong direction. Basically, the vertex is than pulled through the mesh instead of beeing repelled.

But apart from that, large collision zones are good! The larger the better, because it’s more likely that the simulation system finds the vertices before they could tunnel the collision zone.

If you case there is nothing wrong with the size of the inner collision zone, because your mesh is large enough.

  1. The veolcity of the vertex depends on the penetration depth. And that’s the point, why softbodys are not well suited for suits. :eyebrowlift: If a vertex gets “caught” in the collision zone, it’s new velocity is proportional to the exponent of the collision depth. (~ e(depth)) So, if a vertex gets deep into the collision zone, it gets a really high velocity into the direction of the face normal. This is not something that you would expect from a piece of cloth.

  2. Choke damps this velocity. The higher the choke parameter, the higher the damping.

  3. Your cloth has a high friction. It does not move through air, it moves through oil. This is not a bad thing per se, because you have lowered the Edge damping to zero. So instead of damping the movement with the egdes, you damp the velocity of the vertices. But it will lead to problems if you try and move the mesh, because the vertices will resist to move. Lower the friction to something reasonable like 0.5, and increase E Damp to 20 or so.

  4. Your cloth has a large weight. This may be what you want, but the cloth is more difficult to accelerate. And the vertices dip into the collision zone (thats the reason why they penetrate the shoulders at last). Your outer collision zone is to small for that weight.

  5. I would consider to increase E Stiff. This parameter governs the amount an edge may be stretched. If you want little stretching set it something like 0.9.

So far so good. Now go ahead and try and move your character foreward.

Well, after doing ritual combat with the soft body system for cloth simulation for several days now, I have to agree that there are some serious lapses in the application of soft body to cloth. I still have a distinct feeling that the code is usable for cloth, but there are things that need to be added UI-wise. You state some of the variables that will need to be mutable for true cloth emulation yourself.

Do you know of any patches existing for doing cloth at this moment?

As for using the soft bodies (working with what we got is a part of life, after all), I will be scrutinizing your advice closely the coming week. You seem to know a lot about the details of each variable, even though I have been unable to get good intel on it. Did you have a part in designing the system, or did I miss a good source of information somewhere? I found only rough info, such as http://wiki.blender.org/index.php/Manual/Soft_Bodies

And there was the beep, my secondary workstation is done. The ‘dripping’ is dampened to almost a minimum by a stiffness of 0.95(!!), but the wobble is back. I’ll just print your helpful information and trod back to my drawing board in hopes of a brighter tommorrow :spin:

EDIT: I just found this:
http://wiki.blender.org/index.php/BlenderDev/ClothSimulation
I downloaded the patch, but it seems to be in a raw state. How do I go about getting a version that I can actually test?

It’s SOMEWHAT usable for cloth. But since it’s been built to possibly be able to do everything instead of optimized one specific object type (cloth), it’ll take a lot longer and you’ll have a lot more trouble. The actual cloth solver patch would be a better way to go. Unfortunately, both of the developers have been attacked by Darth Real Life, so we’ll have to wait a little longer.

The programmer of the softbody system was so kind to answer my many questions. I’m currently writing the german documentation on softbodys, when I’m finished I will go and update the english manual - at least the reference section.

Regards

BlackBoe: Darth RL is a nasty bugger. I doubt I would have gotten as far in the time I spent on Siberia Complex if I had not chased him away early on by outside financing. But it seems that they -did- achieve -some- level of progress, in that they left a patch. I simply do not know how to get that patch into a workable form (I think it’s called a ‘build’?). How does that usually work?

SoylentGreen: I am near-fluent in german (fluent speech and reading, somewhat lesser in writing), so please let me know when the DE version is ready!

Not finished yet, but this and the following pages is as far as I got.
http://de.wikibooks.org/wiki/Blender_Dokumentation:_Soft_Bodies

Regards

Neat! The link to the German video tutorial seems dead. I really wanted that (I rarely ever -hear- German these days…)

Before I get to my usual ranting, here is the animation that is causing my worries:
http://www.crispquality.com/siberia/FlyingShirt.mov
And the .blend file: http://www.crispquality.com/siberia/MaxClothes03ANIM10b.blend

Now, the explanation / rant:

I’ve come fairly far with the soft body system as cloth now, but I’ve hit a really strange problem. It seems that animating the vertices that are left as ‘stable’ (i.e. ‘goal’ vertices) has some strange effects. In my latest run, Max now has a full shirt. I have already made the sleeves fall kind of nice as his arms move down to his side. But I needed to have the collar and cuffs (the last two vertices before the sleeve opens to allow for the hand) be stiff, so I made them Goal vertices, which makes the soft body system consider them a reference for other vertices, but not soft body vertices in and of themselves. In effect, it’s like having your standard cloth simulation with the falling hankerchief, and the Goal vertices are where someone is grabbing the cloth with his fingers; they do not move unless animated manually to do so.

Well, I animated them manually to do so. The softbody system accepts deforming modifiers above (before) it in the modifier stack. So I tied up the collar and two cuffs with 3 independent hooks and moved them above the soft body modifier (well, it isn’t a modifier really, but it has a similar representation in the stack). True enough, Max lowers his arms, the cuff vertices do as required, and the shirt sleeves even follow suit (no pun intended) and fall fairly nicely at Max’s side. But then, just as everything is expected to come to rest, the vertices of the sleeves rise again! To the naked eye, it seems they are trying to revert to their original position, from when Max’s arms were stretched out to the side. But why they would do that makes absolutely no sense to me.

I have tried fitting the Goal parameters to the E parameters. I have toggled the Goal min and max. I have even revisited the whole slew of parameters for the cloth/softbody itself (Friction was my first guess, after having it so nicely explained to me by SoylentGreen). Either I cancel out the unstretchiness(?) of the cuffs and collar, or I get the Flying Shirt Phenomenon all over again.

Max when all is good, and Max when the shirt tries to go back to whence it came:
http://www.crispquality.com/siberia/ShirtGood.jpghttp://www.crispquality.com/siberia/ShirtFlies.jpg

Should anyone have an explanation, or if someone can look at the (already baked) file, please enlighten me. I am prepared to blame digital poltergeists, but that only makes me look loony, it really won’t solve my difficulties :frowning:

…Well, I loaded up your file and nearly had a heart attack. Nothing says ‘the horror’ like 3 billion parented empties.

It’s unfortunate, because you’ve obviously spent a good deal of time on it, but why on earth would you ever use something as unreliable and arbitrary as empties for? Can’t you just use a skeleton?

You actually have seperate armatures for each leg and arm. Attached to empties. constrained to more free-floating, baseless, parented empties. I mean, I’m honestly you’ve managed to get this far with animation without the entire system exploding.

It’s incredible, you–you don’t even have the armature attached to the skeleton. You have empties as children objects to the bones, used as hooks on the mesh. They’re all empties, there’s no limits on anything! You could blow up the mesh and deform it beyond belief. Then, when you’d finished, you wouldn’t be able to put it back together again because none of the empties have base points. There is no ‘clear user transform’ for hundreds of empties, because there’s no reason why you’d ever use all of those for animation in the first place.

That and I’m not sure how you’d even keep track of them all outside of a giant, huge ‘outliner’ list. And… everything moves wrong. You move the legs and the body pulls along. I mean, the ‘body halfway between legs’ might be fine for basic poses, but people don’t walk don’t really like that. Walking is a controlled fall, not a hover with the feet shifting along underneath. In addition to the fact that the halfway thing isn’t a particularly good way to move the center of gravity, there’s no way to make anything except a vertical center of gravity. So if you want him to lean over, or be balanced on what foot, you’re completely screwed. Like, it’ll be impossible to make any actual poses besides ‘standing’.

This is… I mean, like, I managed to make the eyes turn inside out by moving the body a certain way, the fingers are like rubber hoses. I shift the body forward and the knees flip around, the legs snap off, and his head twists around like the exorcist. I know it’s all dependant on where the target empties are, but I can’t find them to move them into the proper position because there are over three hundred empties all over the place.

How will you keep track of them when you have more than one character, anyway? You’ll have arm empties called ‘arm’ and they won’t have any character prefixes. For my character skeleton I give all external objects the prefix “(character prefix)_ARMCON(object name)” to stop blender getting horribly confused and blowing up. You have no such safeguards.

I’m really, really sorry. But… wow.

EDIT: Ugh, yeah, I really am sorry. I know how hard you’ve worked, so this must seem like a smack in the face. But… you might want to–well, you should, in fact–start the rigging again, just for your sake, even.

http://wiki.blender.org/index.php/BSoD/Introduction_to_Rigging

You should read this, it’s pretty much the best rigging guide for blender. Study it, man.

EDIT: In all that, I forgot to reply to your original question, even. Sorry about that. Anyway, the whole thing with the empties is the main problem with your cloth. The empties, they’re deforming it completely the wrong way, as in they aren’t technically deforming it at all, they’re just offsetting the vertices around locally from their base points. When you learn how to use armatures and stuff, add the weighted vertices of the shirt to be deformed by the armature. You shouldn’t have any problems, then.

I know how it looks. That’s why I have no intention of debating character rigging yet; I have different methods from most Blender users, and indeed from many other riggers in the industry. The character has other needs than your basic “legbone connected to the hipbone” rig. Believe it or not, it is actually quite efficient when you know what it is, but since my question has nothing to do with it, I saw no reason to explain the architecture of my human model. It does need a bit of clean-up though. But for several reasons, it is what it is and it works (new arm rigs are coming up for better flexibility, though). It’s not a smack in the face; if I took the time to explain my reasons to you, you’d get it quite quickly.

I know armatures; it’s a choice, not a matter of knowledge (this time, anyway). But if armatures will fix the problem, I will look into that. However, that does not explain why the sleeves start out following the hooked cuffs, only to turn heel and run back to their original starting point?

PS: The eyes are working perfectly. They focus on a point in space that you moved the character past. You probably did the same with the points that control face and joint directions, too. The rig has independent controls for a lot of things.

The shirt drags with the arm as far as it can, but since your cuffs are still at the original point, eventually the strain become to great and it clips back through the shirt to meet the goal.

Also, if you explain why your armature is efficient I’d be very interested.

EDIT: Also, what ‘other needs’?

Will it stop doing that if I substitute the hook Empties with Armature bones and Armature Modifiers (or simply a central shirt rig)?

Also, if you explain why your armature is efficient I’d be very interested.

EDIT: Also, what ‘other needs’?
The short of it: The rig (I use the term, Armature or not) is fully controllable as if rigged with bones. Empties have simply taken the same roles; twist, turn, bend, whatever, it works the same, if you know the empties. The hook usage was simply quick because I still feel uncomfortable with vertex groups. Once I no longer feel uncomfortable, I will re-rig. I may use armatures at that point, I may not; time will tell.

The efficiency of the many independent targets, such as the eyes you encountered, is that the character can be made more responsive towards the environment; eyes focus on external things, knees and elbows point the way I want them, etc. This can be done with bones, but there is no apparent benefit, and setting up the armatures takes longer than the empties. It’s a matter of habit.

“Other needs” is that the entire rig and mesh is under preparations for a parametric control structure allowing the base human to be modified from a central ‘control panel’ in all aspects, from height and girth to finger length and the size of eyes. Yes, armatures can do the same, but I learned hooks first, and the entire structure is portable if needed. The immediate advantage of hooks is(/was) that things like length of limbs and fingers are more easily controlled (IMHO) by handling the distance between empties than rearranging bones, especially if those bones are set to somehow respond to one another (long story).

Also, Blender makes a greater distinction between bones and non-bone hierachies than I am used to. I tend to rig in objects rather than bones because it allows greater flexibility in representation (yes, I know there are tricks for making a bone look like an arm. But this way, I don’t even need tricks), and bones have a lot of built-in reactions that, for Blender, I do not know and do not need. Essentially, the only advantage bones/armatures have (to me, at the moment) is IK, and that is why I have four isolated, completely unrelated, armatures for limbs. It’s a case of control vs. trust; I like full control of every detail, and I do not trust that bones will easily give me that.

Trust me, it works.

I am more than willing to discuss the deeper elements of alternate rigging methods with you; I am sure I would learn quite a lot about Blender in the process. However, I would prefer to do it in a different thread, to avoid the topic hijacking my original questions. If that interests you, let me know.

It probably would, unless something deeper is screwed up.

Anyway. I suppose I’ll trust you that it works. Good luck with all that.

http://www.crispquality.com/siberia/FloppyShirt.mov

I got it! Turns out it has nothing to do with armatures, at all. I simply needed to bend the entire sleeve, not just the cuffs, before applying the soft body modifiers, and then set the fixed and the ‘mobile’ vertices using weight paint. If I just stick to marking the cuffs, the algorithm thinks the rest of the sleeves should stay in place. Actually, it’s all rather logical and simple, once you figure it all out.

I will not go into more detail about it here, lest I flood the board :o If I get a good deal of requests, I’m up for trying my hands at an in-depth “soft body for cloth” video tutorial, though.

The file, pre-baked, for tinkerers: http://www.crispquality.com/siberia/FloppyShirt.blend

EDIT: One remaining mystery: The texture (or material, not sure how they are divided) does not grab the mesh at all during soft body calculations; it just races around wildly. The last second of the animation is 25 frames without soft body calculations, and in those, the texture is calm. Anyone know how to bind the texture to relative vertex positions during a massive deformation? I am guessing some UV work.

Err, when I recall my first post in this thread I have written:

  1. At first you have to animate the cloth together with the body, not using softbodys but armatures. Then you use a GoalGroup to apply softbody effect only on certain regions of the cloth.

Well - I should have included: or any other way you animate your mesh.

For the texture: yes, I think you should use UV-Mapping.

Nice to see you have got it working the way you need it. If I were you I would separate the vertices below the shirt and put them into another object. Move this object onto another - not renderer layer and use it only to collide. Therefore make the shirt object active on two layers, the renderer one and the layer of the collision object.

So even if there are some breakthroughs they will stay unnoticed.