To follow this tutorial you can download the 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 AtomsRobotTestCloth.ma.
The scene does contain few variations with nCloth meshes (Robot3 to Robot7): Cape, LeftArmCape and RightArmCape.
Also all the body and arm meshes have been set up as nRigids. Finally the nCloth meshes have been constrained to different part of the body and arms.
Now open the variation builder and fill the fields as you would when exporting standard variations.
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, 6). Change the state of the stateMachine to 1.
Change the draw mode of your agent group to "variations".
Now import the variation file you exported previously with the variation builder in your scene: Atoms > Variations > Import Variation Json
Open the Variation Randomizer( Atoms > Variations > Variation Randomizer), select variations Robot3 to Robot7 and move them to the table on the right. Click Run and close the Variation Randomizer.
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 Cloth Simulation Exporter: Atoms > Export > Cloth Simulation Exporter
Change the "Cloth Sim File" destination path.
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 at 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 exported.
Please always select the file with no padding when picking a cache file.
Change the draw mode to variation. In the viewport you should see something similar to the image on the right.
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 30 and exposure to 16.
Render, you should see an image like the one on the right.