Cloth Modifier

The Cloth modifier is the heart of the Cloth system, and is applied to all objects in your scene that need to be part of the Cloth simulation. This is where you define cloth and collision objects, assign properties, and execute the simulation. Other controls include creating constraints, interactively dragging the cloth, and erasing parts of the simulation.

Left: Cloth modifier not yet applied

Right: Cloth modifier applied and simulated

Basic Concepts

In a Cloth simulation, you will let Cloth know which objects will be part of the simulation, and which objects will not. Once you have done this, you define what the objects are made of. You can specify what is made of cloth, and what is a solid, collision object.

Because Cloth is a modifier, an instance of it is assigned to each object to be included in the Cloth simulation. This includes all cloth and collision objects. Be aware that two cloth objects with two separate applications of the Cloth modifier will not interact with one another. There are a couple of ways to include objects in the simulation:

Units of Measure

Attention: The following information is necessary only if you change the system unit after applying the Cloth modifier. If you change the system unit before applying Cloth, the modifier automatically adjusts the cm/unit setting.

It is important to think about size in doing clothing simulations. A very large flag behaves differently from a handkerchief. If the scale is off, then the simulation will be off. Because Cloth deals with real-world physics, it works in real-world units. This means that Cloth needs to know the relationship between units in 3ds Max and units in its own world.

For example, suppose you create a plane that is 10 x 10 3ds Max units. If you want this plane to behave like a 10-inch x 10-inch handkerchief, you would tell Cloth that 1 3ds Max unit=1 inch. If you want it to behave like a 10-foot x 10-foot bed sheet, you would tell Cloth that 1 3ds Max unit=1 foot.

Except as noted at the start of this section, Cloth ignores the 3ds Max System Units Setup (under Customize menu Units Setup System Units Setup). Cloth has its own units setup, which is determined by the cm/unit parameter on the Simulation Parameters rollout. This tells Cloth how many centimeters (cm) correspond to each 3ds Max unit. One inch equals 2.54 cm, so the default setting of 2.54 means that one 3ds Max unit corresponds to 1 inch.

Following is the procedure to follow to determine what setting to use here.

  1. Use the measure utility or tape helper to measure some dimension of your cloth (or character) in 3ds Max units (call this number x).
  2. Decide how big you want this object to be in the real world Convert this number to centimeters. If you have the dimension in inches, simply multiply by 2.54 (call this number y).
  3. cm/unit=y/x

Here is a quick example: You import a file, man.obj, into 3ds Max, and want to put a shirt on him.

  1. Using the Measure utility, you find that the man is 170 3ds Max units tall. So y=170.
  2. You determine that this man is about 6 feet tall.
    • 6 feet=72 inches.
    • And 72 inches=72x2.54=182.88cm. So x=182.88
  3. So now you have the values to make sure the shirt behaves correctly. Cm/unit=y/x=170/182.88=0.929. Or you can round the spinner's value up to 1.0, since pinpoint accuracy is not needed here.

Fabric Behavior

Cloth provides many different ways to set up fabric behaviors. You can make your cloth behave like leather, silk, burlap, and anything in between.

The Simulation

Once all of your parameters are set and you’re ready to go, it’s time to simulate. In many cases, you will first perform a local simulation to fit your fabric to your character. Once your fabric is in place, you can simulate over time.

Running a simulation in Cloth is very freeform. You are able to make many changes and edits to a simulation, making it more of a work in progress than a click and a “hope for the best” scenario.

Constraints

You can constrain fabric in various ways to create different fabric effects during simulations. Cloth can constrain cloth to have extra drag as it flies through the air, or can cause it to be affected by a space warp in the scene. Linking a portion of the fabric to an animated object or attaching to a surface are other common constraints. If you wanted to create a pair of pants you would constrain the top portion of the pants to the waist of the character or a curtain can be constrained to a rod. Constraints are a very important and robust part of Cloth. Cloth has the ability to make multiple groups of constrained vertices for great flexibility. You can constrain many different parts of a piece of clothing to different nodes' surfaces or other cloth objects.

You build constraints in Cloth at the modifier's Group sub-object level. At this level, you can see vertices of all selected objects, both cloth and collision. You can then select these and place them in groups. Once a group is defined, you can then attach or "constrain" the selection set to another object, or have it affected by some external force.

Tearing Cloth

You can tear cloth. For an example of how to do so, see this procedure.

Cloth tears during the course of a simulation under a couple of circumstances:

  • The forces affecting the cloth pull it in a way that causes it to tear.

    A Strength or Tear Threshold value (they are the same) lets you set how easily cloth is torn.

  • The cloth collides with a collision object that is set to Cuts Cloth. See Collision Properties.

You must specify where the cloth will tear before you run the simulation. There are a few different ways to do this:

Tearing Cloth and the Point Cache Modifier

If you use a Point Cache modifier to optimize a Cloth animation, there is a chance that tears will not be smoothed correctly before tearing occurs. To fix this problem, you can add a Welder modifier to the stack. Place the Welder above the Point Cache modifier.

Procedures

Example: To use the Keep Shape option:

    If your cloth object starts out with 3D shape that you'd like to retain during the simulation, you can use the Keep Shape option and setting to preserve this shape, or even reverse it. This simple procedure provides an example of how to use Keep Shape.

  1. In the Top or Perspective viewport, create a Plane primitive object of about 90 x 90 units, with 20 x 20 segments.
  2. Apply a Bend modifier, set Angle to 250.0, and set Bend Axis to X.

    This produces the initial tubular shape.

  3. Copy the bent plane twice so you have three planes in a row. Rename the planes as follows:
    • don't keep shape
    • keep shape
    • reverse shape
  4. Select all three planes and apply the Cloth modifier.
  5. On the Simulation Parameters rollout, turn off Gravity and set cm/unit to 0.5.

    Turning off Gravity keeps the cloth objects from falling during the simulation, so they stay in view, and lowering the cm/unit setting compensates for the planes' relatively large size.

  6. On the Object rollout, click Object Properties.

    This opens the Object Properties dialog.

  7. In the Objects In Simulation list, highlight all three planes (by dragging), and then, above the Cloth Properties group, choose Cloth. Also set U Bend to 500.0.

    This also sets V Bend to 500.0 automatically.

    Using high Bend values allows the simulation to proceed more quickly.

    Next, you'll set different Keep Shape properties separately for each object.

  8. Highlight the reverse shape object in the list and set the Bend % value to –100.0.
    Note: The default value is 100.0.
  9. Click OK to exit the dialog.
  10. Select the don't keep shape object and note that Object rollout Selected Objects Manip group Use Target State is off.
  11. Select both the reverse shape and the keep shape objects, but not don't keep shape, and then turn on Use Target State.
  12. On the Object rollout, click Simulate Local.

    After a few seconds, the don't keep shape object starts to flatten out, the keep shape object doesn't change, and the reverse shape object has, in fact, reversed its shape, effectively creating a negative bend angle.

    Tip: You can also use Use Target State with Grab State to maintain or reverse a shape created with a previous cloth simulation or shape-changing modifier.

Example: To tear a piece of cloth:

  1. In the Top viewport, create a Plane. Make it about 150 units on each side. Set its Length Segments and Width Segments both equal to 7.
  2. Also in the Top viewport, create two Dummy objects: one on each side of the plane.

    The plane flanked by two dummy objects

  3. Turn on (Auto Key). Go to frame 100, then animate each dummy object so it moves about 300 units away from the plane along its X axis: Move the left-hand dummy to the left, and the right-hand dummy to the right.
  4. Turn off (Auto Key).
  5. Go back to Frame 0.
  6. Select the plane. Go to the Modify panel, and apply a Cloth modifier to the plane.
  7. On the Object rollout, click Object Properties. 3ds Max opens the Object Properties dialog for cloth. In the list of objects, click Plane01 to highlight it, choose the Cloth radio button to make Plane01 behave as cloth, and then click OK (keep all the default Cloth Property settings).
  8. In the Modifier stack, go to the Group sub-object level.
  9. Select the vertices along the left-hand side of the plane, and then on the Group rollout, click Make Group. Click OK to accept the default name of Group01. With Group01 still highlighted in the Group list, click Node, and then in a viewport click the left-hand dummy object to assign it to this group.
  10. Repeat step 9 for the right-hand column of vertices and the right-hand dummy object.
  11. Select the two center columns of plane vertices, and then on the Group rollout, click Make Tear. Click OK to accept the default name.

    Central vertices selected to create a tear in the cloth

    3ds Max creates a new Weld constraint that comprises the vertices at the center of the cloth plane.

    After clicking Make Tear

  12. On the Modifier stack, click Cloth to return to the top level.
  13. In the Object rollout Simulation group, click Simulate.

    3ds Max animates the dummies pulling at the cloth. As this happens, the cloth tears along the vertices that you set to tear.

    Cloth tearing in the center as its edges are pulled apart

    Depending on the position of the dummy objects, the tear you see in your example might differ from the one shown in these illustrations.

To run a cloth simulation with a networked render farm:

    A complex cloth simulation can require extensive computation and take a long time. Cloth includes commands that make it easy to run a simulation on a networked machine (part of a render farm), freeing up your machine for working on other parts of the scene.

  1. Set up the simulation.
  2. For each cloth object in the simulation, select the object, and then on the Selected Object rollout click Set and specify a path and file name for the cache.

    For best results, specify a mapped drive and turn on Force UNC Path. This specifies the path using the Universal Naming Convention so that it can be found by all computers in the network. Also, it's probably a good idea to keep all the cache files in the same directory.

  3. On the Simulation Parameters rollout, turn on Sim On Render.
  4. Save the scene file.
  5. Open the Render Setup dialog.
  6. From the Render button drop-down menu, choose Submit To Network Rendering.
  7. 3ds Max opens the Network Job Assignment dialog. Submit the job to a single Server.

    Unlike rendering, network Cloth simulation cannot be split up among multiple Server machines.

    Note: You needn't render the entire animation to trigger the cache creation; a single frame suffices.

    As soon as the Server machine starts the render, it begins computing the simulation and saving it to disk. At any point you can load the simulation in its current state from the cache file to check its progress by clicking the Load button.