Painting nCloth Properties

While global settings for cloth can sometimes be all you need, there are many instances where it would be nice to control the value of a property, such as cloth thickness or bend resistance, over the cloth's surface on a vertex-by-vertex basis. There are two ways to accomplish this task: applying grayscale texture maps to the relevant attribute or painting the properties directly in Maya's viewport. While texture maps can potentially allow for more detailed control of these settings, painting them on is more intuitive and normally faster to accomplish, so we will discuss this method here.

The following cloth and dynamic attributes can be painted on an nCloth object: Thickness, Bounce, Friction, Mass, Stretch, Bend, Wrinkle, Rigidity, Deformability, and Input Attract (for information on each of these properties, see the previous section). You can paint these attributes on either as a texture map or as a vertex map. A texture map can have a higher resolution than the density of vertices on a cloth mesh, but the object must have a clean UV map for this method to function. A vertex map, on the other hand, will work on any cloth object, UV mapped or not.

For more on texturing and UV mapping, see Chapter 12.

As painting any property works in pretty much the same way, we will create two maps: a thickness map using the vertex method and a stretch map using the texture mapping method. From these examples you should be able to extrapolate how painting other attributes will work.

First, let's create the thickness map using the vertex map method. Use the flag simulation you have been using, or open the flagProperties.ma file from the CD. Select the cloth mesh and then, from the nCloth menu set, choose Edit nCloth * Paint Vertex Properties * Thickness □. This brings up the standard Tool Settings window for the Paint tool, and you will notice that the flag mesh turns black, indicating that the vertices all have a 0 thickness

Figure 23.17 (a) Painting a thickness pattern on the flag. (b) The resulting thickness values displayed. (c) the modified flag during playback.

Figure 23.18 Painting a Stretch pattern on the flag

Figure 23.17 (a) Painting a thickness pattern on the flag. (b) The resulting thickness values displayed. (c) the modified flag during playback.

c value, so they will collide as if the cloth is extremely thin. Adjust Opacity to something like 0.25, be sure Paint Operation is set to Replace and Value is set to 1, and paint on the cloth mesh. You can try for something reasonable, like a thicker material near the flag pole and thinner as it moves toward the tip of the cloth, but we opted for a more creative design, as shown in Figure 23.17a. As Figure 23.17b shows (by displaying the Self Collision Thickness values as spheres), the lighter the painted area, the thicker the cloth "appears" during self-collisions. Figure 23.17c shows the flag playing back during simulation.

Now let's paint on a stretch map as a texture map. First, go back to your saved file so that you don't have the thickness map painted on anymore (we do this to make it easier to see the effects of painting on the wrinkle map). Select the cloth object, then choose Edit nCloth * Paint Texture Properties * Stretch □. This time you will notice that the color begins as all white, indicating that the entire flag is highly resistive to stretching. Leave the color set to black (so that it subtracts from the current color), reduce the opacity to something small like 0.2, and paint on the surface of the object. Figure 23.18 shows the results of painting on a stretch attribute: the top (black) section of the flag stretches and droops more than the white section below it.

0 0

Post a comment

  • Receive news updates via email from this site