Cloth Simulation: Controlling it with Weight Maps
While I was working on an animation project, I was struggling a little bit on how to get a localized effect on getting cloth simulation to work on a character. So, I took a small hiatus on my own character and opened and old scene to test my theory on a way to control my cloth. A lot of artists like me having tried many different ways to get cloth simulation working and have struggled constantly. And pulled out my hair trying to get good results. With this tutorial, I am going to share with you how to control your cloth simulations using weight maps on the mesh directly (this is especially useful on things like clothing on characters or a burning table cloth where you would actually have to create an image that changes over time to control the effect.). This is aimed at those who want to learn a bit on how to create localized effects on cloth for their projects and have some familiar knowledge of the weight paint tools. I am using SOFTIMAGE|XSI 5.11 FND, but this should work in other packages just fine as long as it supports connecting parameters like weight maps.
So, to begin this exercise, let's open up a scene in XSI where you have an object driven by Cloth Simulation. I am using a default character from XSI Model Primitives, but the examples will work regardless. It will also help to have some sort of animation on the model to sell this effect and all of the collisions already in place.
Here is a screenshot of my scene with the character in the bind pose. The bind pose is a good way to let the cloth "set" onto the model and prepare it to sync with the animation. And make sure that cloth has room to settle.
Now with your character in place (okay, at the time of this test, I didn't have my own character so I am using this one), let us set up the cloth to be simulated. You should already have the Cloth Op applied on the cloth object, in this case the dress which also has and envelope applied as well. If you look at my explorer, you can see how the operators are set up so the cloth responds properly.
Oh, and if you wondering why there is a Mesh Local Subdivision Op in my explorer, you may be asking yourself, "Ok, why is Kashif using that operator when his cloth is going to be a Subdivision surface anyway?". Well, for the purposes of getting some good cloth, you need to have some polygons so the cloth will look natural and respond properly to the characters motion. So, in XSI, to get this operator, select the polygons on the cloth and right click on the object, and select Local Subdivision Refinement. And on the pop up, set the Subdivision Level to 2 (or more depending on how fine you want the cloth to look and your system resources available. 3 is the highest I would go depending on your object's density. Also this would be a great time to apply UV maps to your model and freeze the UV's. You don't have to, but it would serve as a backup if you want to use Texture maps instead to drive parameters. But I love the localized nature of Weight Maps J . And also decide on a mesh resolution before you apply/paint weight maps and cloth sim) and leave the rule to Catmull-Clark.
Here is the result of the cloth.
Now with all of this set up, let's review your cloth sim settings before we apply weight maps. On my skirt (crudely modeled), I have all of my parameters set up so that it looks like it is very silky.
In my case of the dress, I am concerned with the Initial Tension, Shear, and Bend parameters that I want to control with weight maps. See the nice "plugs" next to some of the parameters? Those are controllable with controls like Shrinkwraps, push, and my favourite, Weight Maps. Now with this setup, let's create the weight maps. Select all the points on the cloth (remember, we want natural cloth) and go to Model>Properties>Weight Maps.
When the property editor pops up, leave everything at its default; we'll deal with our weight in a moment.
And feel free to name your weight map. Give a name that you'll remember later on like "Tension Map". Create two more weight maps and name them "Bend Stress Map" and "Shear Stress Map"...they will appear in your clusters in the explorer.
With that out of the way, let's see the cloth sim without the weight maps applied. Click play on the animation panel and watch a few frames and see the cloth go into place. (It may take some time depending on your system resources) Ehh, my mom would not like that my model's dress is too high...it sure makes a nice tanktop though. But I want to make it look like a dress (wahhhh!!). Let's do a little painting to get the effect we want.
So, with the weight maps created, let's begin painting each map the way we want it... take your time on this, it will take a few paintings to get your maps the way you like. (and more polygons=more control). To start painting, just press "w" on your keyboard (XSI shortcut to paint weight) with the weight map you made such as the tension map. If you have a tablet, it will make it easier to paint and paint the cloth object. If you want to see the weight map when you are done and keep it displaying, in your viewport, click on the little eyeball and highlight "Weight Maps". Now you'll see them.
You'll notice that there is some red on the dress (don't worry, I did not spill wine on her). What I did, on the weight map pop up, I set the minimum weight to -1 which allows some negative weight to offset your parameters.
We are now going to test our weight maps on the cloth now. And the cool thing about this is that, you can have the maps connected, paint them, and watch the effects after re-simulating. So, with your cloth op pop up open, let's start with the Initial Tension. I set it to 80 percent on my model but you can have it set to whatever you want, the weight map will work on it regardless. Right click on the plug, and select "connect". Then a list will pop up next to the plug. Select the weight map called "Tension Stress" and click it; the plug will now turn red to indicate connection. Do the same thing for Shear and Bend with their appropriate weight maps.
If you have gotten this far in the process you are doing a great job. J Now play the simulation again and the result will be different...notice how the top part of the dress is tightly relaxed on the character because of the weight map. What happens is, when the weight is set to 1 (light blue) the simulation will take that into account, and when the weight is set to 0 (black) the parameters are ignored. If you painted negative weight, it will be as if the setting was set to negative, like it will make the object very bendy or super stretchy. In between values (can be achieved by smoothing the weight maps) will weaken the parameters such as wanting to created a nice sundress or flowing skirt.
And the Initial Tension set lower...let's say 12%. Notice how the effect is barely noticeable but the weight map will affect it in some way. Same goes for the shear and bend.
So, I hope this tutorial was useful in some way, and even those who have done cloth sim before, this will hopefully add some reference when you want to do cloth sim with weight maps in XSI. Thank you very much for reading my tutorial and happy simulating.