Lesson 4: Simulating the low resolution shirt
 
 
 

In this lesson, you simulate the character’s shirt using the workflow described in Lesson 3. Although there are some variations in attributes and values, the principles are the same.

In this lesson you will:

Lesson Setup

To ensure the lesson works as described, do these steps before beginning:

  1. If you have not already done so, copy the nCloth Advanced Tutorial folder from the following location: www.autodesk.com/maya-advancedtechniques. Then, set the nCloth AdvancedTechniques directory as your Maya project.

    For this lesson, you need to access Maya geometry cache files in addition to the lesson scene file.

  2. Open the scene file named Character_LowRes_4.mb.

    This file can be found in the AdvancedTechniques directory that you set as your Maya project.

  3. Import the geometry caches which animate the character’s body and shoes. See Importing geometry caches.
  4. To speed up the simulation of the nCloth shirt, either create a new cache for the nCloth pants, or use the pants nCache from the previous lesson.

    To create a new nCache, in the Outliner select nCloth_Pants, and select nCache > Create New Cache.

    To use the nCloth pants nCache from the previous lesson, you may need to reconnect the cache to the nCloth object. See Reconnecting objects to existing caches.

If you use a Maya scene file from a previous lesson, ensure that you:

Converting the shirt to nCloth

To convert the shirt to nCloth

  1. Show the Shirt_LowRes object by selecting it in the Outliner, and then selecting Display > Show > Show Selection.
  2. Select the low resolution shirt object (Shirt_LowRes) and select nMesh > Create nCloth > .

    The Create nCloth Options window appears.

    NoteIf the nCloth menu set appears in the Maya interface do not use it. You must use the nDynamics menu set to create and control nCloth. See nCloth menu set appears in Maya for information about removing the nCloth menu set from Maya.
  3. From the Solver drop down list, select nucleus1.
  4. Click Create Cloth.

    The low resolution shirt is converted to an nCloth object, and is added to the existing Maya Nucleus solver.

  5. To ensure that the low resolution nCloth shirt is easy to identify in your scene, rename it. To do this, in the Outliner, double-click nCloth1, type nCloth_Shirt, then press .

  6. Cache the nCloth shirt simulation by selecting nCloth_Shirt in the Outliner and selecting nCache > Create New Cache.
  7. Play back the simulation.

Applying an nCloth preset to the shirt

When you play back the simulation, you notice the following:

A useful way to solve a number of these simulation problems simultaneously is to apply an nCloth attribute preset to the nCloth shirt object.

To apply an nCloth preset to the shirt

  1. In the scene view, select the nCloth shirt.
  2. In the Attribute Editor, select the nCloth_ShirtShape tab.
  3. Click-hold the Presets button.
  4. Select the tshirt preset, and then Replace (tshirt > Replace).

Some important attribute adjustments made by the t-shirt preset are the following:

Cache the simulation by selecting the nCloth shirt and selecting nCach > Replace Cache and then play it back to observe the results.

Wrapping the high resolution mesh

In this section of the lesson, you use a wrap deformer to create an influence object for the high resolution shirt.

To wrap the high resolution mesh

  1. Show the Shirt_HighRes object by selecting it in the Outliner, and then selecting Display > Show > Show Selection.
  2. In the scene view, -select the nCloth shirt object.
  3. From the Animation menu set, select Create Deformers > Wrap> .
  4. In the Create Wrap Options window, turn on Exclusive Bind.
  5. Click Create.

    A wrap node appears in the Attribute Editor, and a Shirt_LowResBase object appears in the Outliner.

  6. Hide the Shirt_HighRes object.

Identifying problem areas in the simulated nCloth

When you play back the simulation, you notice the following:

The nCloth t-shirt preset has improved many of the simulation issues, however some Dynamic Properties attributes need further adjustment.

When editing the Dynamic Properties attributes, cache your simulation and then play it back between attribute adjustments to see how your new settings affect the nCloth shirt's behavior. For comparison purposes, you can also display the reference character in the scene. To do this, in the Display Layer Editor, turn on Visible.

To edit the shirt's Dynamic Properties

  1. In the Attribute Editor, click the nCloth_ShirtShape tab.
  2. In the Dynamic Properties section, make the following settings:
    • Stretch Resistance: 55
    • Compression Resistance: 3
    • Bend Resistance: 0.3

  3. Cache your simulation, and play it back.

Editing the Quality Settings and resolving interpenetrations

When you play back the simulation, you notice the following:

To smooth the mesh and reduce instances of interpenetrations, edit the Collisions and Quality Settings.

To edit the Collisions and Quality Settings

  1. In the Attribute Editor, select the nCloth_ShirtShape tab.
  2. In the Collisions section, set the Self Collision Flag to Full Surface.
  3. In the Quality Settings section, set the following:
    • Max Iterations: 12000.
    • Max Self Collision Iterations: 8.
    • Turn on Trapped Check.
    • Turn on Self Trapped Check.

  4. Cache the simulation ( nCache > Replace Cache) and play it back.

Fine tuning the simulation

To further improve the quality of the simulation and reduce the instances of interpenetration in problem areas, such as the bunching of the shirt in the chest area (see frame 1040) you can set Push Out and Push Out Radius. Try setting the attributes values between the following ranges:

Experiment with your settings by creating duplicates of the meshes at specific frames of the simulation. For example, create mesh duplicates at frames 1040 and 1043. Cache the simulation, and then scrub through the Time Slider and compare your simulation with your duplicate mesh to see the results of your attribute edits.

Comparing the final low resolution simulation with the simulated reference character mesh

In this lesson, you compare the final simulation result of the nCloth shirt and nCloth pants objects with the simulated reference character object (the original simulated high resolution mesh).

To compare the simulations

  1. Hide the Shirt_LowRes and Pants_LowRes objects, selecting by selecting them in the Outliner, and then selecting Display > Hide > Hide Selection.
  2. Show the Shirt_HighRes and the Pants_HighRes objects by selecting them in the Outliner, and then selecting Display > Show > Show Selection.
  3. Using the Display Layer editor, turn on Visible to display the Reference_Character object.
  4. In the Shading menu, turn off Wireframe on Shaded.
  5. Scrub through the Timeline, to compare how the nCloth meshes behave in the animation. Dolly and tumble the scene so that you can closely observe the problem areas.
    NoteIf the Reference_Character is not animated in the scene view when you play back or scrub the simulation, you may need to reconnect the reference character’s caches to their respective objects. See Reconnecting objects to existing caches.

There are subtle differences in the way the high resolution and reference character objects simulate, but overall the nCloth behaves in similar ways. Considering the amount of time saved by repeatedly working through the simulation workflow of caching the simulation and adjusting attributes on the low resolution mesh, this workflow provides good results. Although the reference character object can be improved by optimizing the simulation, the higher resolution mesh slows down caching and simulation time and might require more attribute adjustments.