Adding cloth

To follow this tutorial you can download this attachment and unzip it somewhere on your disk.

Atoms Crowd does not have its own cloth solver and it relies on nCloth in Maya.

For adding cloth to your crowd simulation you will have to:

  • Run the variation builder on a character which has some nCloth or nRigid meshes.
  • Build a simulation, apply the cloth variations on your agents and create an atoms cache.
  • Use the Cloth Simulation Exporter to create a clothcache file sequence.
  • Set up an Atoms Proxy with cloth cache.

The simulated cloth meshes will only be visible in the viewport with the AtomsProxy and not with live simulation.


Open the man.ma.

The scene does contain a variation (named "variation") with nCloth mesh (cape_GEO).

The shirt mesh has been set up as nRigids. Finally the nCloth mesh has been constrained to the shirt.

Now open the variation builder and fill the fields as you would when exporting standard variations.

Click on the "Run" button.

The variation builder will find any nCloth and nRigid mesh belonging to your variations and it will export a clothsetup file. The clothsetup file will be referenced by the exported variation json file.





Build a new scene and create an agent group.

Assign a gridLayout and a stateMachine to the agent group.

Change the size of the gridLayout to (1, 1, 4).  Change the state of the stateMachine to 1.

Change the draw mode of your agent group to "variations".

Now import the variation file you just exported with the variation builder in your scene: Atoms > Variations >  Import Variation Json

Add a new variations module to your agent group and select "variation" in the "Variation name" field.

Rewind your simulation and the agents will appear in the viewport.

Open the Cache Exporter: Atoms > Export > Cache Exporter

Provide a cache path, change the end frame to 50 and click on the Export button.



Open the CFX Simulation Exporter:  Atoms > Export > CFX Simulation Exporter

Change the "Cloth Cache File" destination path.

Disable "Fur".

Change the "Cache File" so that it points to the atoms cache you just created.

Click on the Run Button.

A dialog will ask you if you want to clear your scene, click yes.

A clothcache file sequence will be exported into the destination path you provided.



Make a new scene and create an atoms proxy.

Set the cache path to the atoms cache you exported in the second step of this tutorial, the variation file to the json file exported in the first step and finally the cloth cache path to the cloth cache we just created .

Please always select the file with no padding when picking a cache file.

Change the draw mode to variation.

Now select arnold renderer in the render settings.

Create an arnold area light, change its scale to (400, 400, 400) and move it above the agents. Set its intensity to 2.

Render, you should see an image like the one on the right.





Copyright © 2017, Toolchefs LTD.