Join Aaron F. Ross for an in-depth discussion in this video Building polygon primitives, part of Learning Maya nCloth 2012.
Let's build a kind of a hello world scene, where we just make a tablecloth, and just drop it onto a round circular table, and that will get us through the basic processes of nCloth. We want to decide on a scale convention to begin with, and as I said, I like to build my scenes at a 1 to 1 scale, because that's what most other programs use. So I just want to verify in my Settings Preferences, Preferences that my settings are currently Working Units set to centimeter, and that means that a grid line is currently 1 centimeter.
I want to resize the grid itself, because this is only currently 12 centimeters from center to edge. I'll go up to the Display menu, and choose the Grid options, and the first one here, Length and Width, is the extent of the grid in the perspective view. I'll set that to 200 centimeters. Hit Apply, and you'll see that extends now out to 200 units from the origin, but the spacing of the grid is too tight for me to be able to see what I'm doing.
I am going to change the number of grid lines to be 1 grid line every 100 units, and hit Apply. Now I have got a grid line every 100 units, but it's a little bit confusing, because we are also seeing subdivision lines here. Confusingly, the Maya subdivision and main grid lines are the same color by default, so it makes it really hard for you to know what you're doing. What I recommend is you set the grid lines and the subdivision lines to be two different colors.
I'll just change that grid lines color to slightly darker gray, and hit Apply, and now you can see what's going on here; this is a major grid line, and these are minor gridlines, or subdivision lines. Now, what we see here currently now is a major grid line every 100 units, and a subdivision line every 100 divided by 5, which is every 20 units, or every 20 centimeters. I'm just going to set the number of subdivisions to 10, and hit Apply.
Now what I've got is a major grid line every 100 units, and a minor gridline every 100 divided by 10, or every 10 units. If you're not quite sure what you're seeing here, you know, you can go scrolling down into this Display section, and turn on numbers on the axes, and hit Apply, and that will be a little bit easier for you to get a grasp on how big things are by just looking at the grid. So I know that the distance from here to here is 1 meter, or 100 centimeters.
Now I am ready to build my tabletop. nCloth only works with polygon objects; you can't use NURBS, and you can use subdivs, although you can smooth polygon objects after they have been built, but you'll always have to start from a polygon object.Drag out to create that cylinder, release the mouse, that sets the radius, and then I'll click and drag up to set the height, and I have got a primitive cylinder. I'll press the 5 key, so I can see shading. I'll just go into the Shape node here, into this input, and just increase the number divisions a little bit, just so it's a little bit smoother around the edges. I'll set that to, let's say, 30, just so it's a little bit smoother. That's my tabletop.
Now I need a tablecloth to drop on it. Go back to the Create menu, Polygon Primitives > Plane, and with nCloth, you'll actually get the best results if you use two-dimensional geometry. In other words, planar geometry; something that has no thickness to it. Later in the course, we'll see how you can create cloth objects that have real thickness, involving using a wrap deformer. But the cloth objects themselves, the ones that are going to be dynamic, should really be two-dimensional, and flat, no thickness, so that plane is perfect for that.
I just want to go into those Inputs once again, and I'll set the Width and Height to be 200, so that's a pretty big plane; that's 2 meters, or 6 feet on a side. Then I have got the number of subdivisions. This will not deform, because it's got no internal geometry. It has to have some grid structure to it in order for it to deform. I'm going to go ahead and select Subdivisions Width and Height, and set those both to a value of 20, and that should be fine. That's a pretty good level of detail for a cloth object.
Another important point about nCloth is that you are going to get best results if your polygons are square. That's not an absolute rule, but if the polygons are long, and skinny, and rectangular, then that's going to negatively affect the simulation. If I had something like this, I would not get a very good result from that, or likewise, if I had too few divisions running in the other direction. My advice is, try to make them square if possible. Also, try to avoid triangles, or n-gons, which is a polygon with more than four sides.
Just to keep on the safe side, I am going to delete the construction history on these. I have set the level of detail, and I want to protect myself from accidentally changing the level of detail later, which, if I am not careful about what I'm doing, I could actually break my simulation. So to prevent any negative outcomes from happening, I am going to delete the construction history on my entire scene. Edit > Delete All by Type > History, and now when I select either one of those primitives, you will see that there is no more input node, and there's no more parameters, like Radius.
And again, that just to safeguard myself against breaking the simulation later on.
- Understanding the nucleus solver
- Adopting a scale convention
- Adjusting nCloth and nRigid attributes
- Creating and animating nConstraints
- Editing nConstraint membership and influence
- Smoothing nCloth with subdivision surfaces
- Storing and manipulating simulation data with nCache
- Improving simulation quality and efficiency
- Dressing an animated character
- Painting dynamic attributes such as Stickiness
- Simulating many objects such as falling leaves