Simulating Cloth in Maya - By Aziz
This tutorial will teach you how to simulate a cloth effect in Maya using a uniform field that reacts to forces. This tutorial requires you to have some basic knowledge of Maya. You can follow this tutorial using any version of Maya.
Start off by creating a new scene in Maya. Create a scene similar to the image below using a NURBS plane. You can optionally download the scene that I created and use it to follow this tutorial.
For an object to have a cloth reaction, we have to add soft bodies to it. Make sure that our UI set type is configured to the "Dynamics" set. To create a soft body, you will have to go through the Soft/Rigid Bodies > Create Soft Body, click on the small cube to open up the Soft Options.
Use the settings displayed in the image below for your Soft effect.
A green outlined container should surround your curtains to signify the addition of particles to the plane so that it reacts to effects such as wind in the scene.
We now need to add the wind to simulate the cloth effect. To do this go through the Fields > Uniform. Click on the small cube icon to open up the options panel.
Copy the name of the curtain object from the channel box and paste it in the uniform field name. Click on the create button once you do that.
.
You should now see the uniform field at the origin 0,0,0 as illustrated in the image below.
We will now move the uniform field vertically to the middle of the curtain. Once put there, hit the "T" key on your keyboard while having the uniform field still selected to view its attributes. Select the handle to change the direction at which the wind will blow so that it is directed towards the middle of our curtain.
Nothing will happen now if you play the scene because we haven't used the soft body paint yet which allows us to have a dynamic motion. Select the curtains and then go through Soft/Rigid Bodies > Paint Soft Body Weights Tool and click on the small cube to configure it.
Apply the changes illustrated in the image below.
We will now start painting the curtain. Start off with a black colour paint to show that the area will be stimulated as a cloth in a uniform field.
Hit the play button to see something similar to the image below. You might need to change the attenuation value to a higher value if you are not satisfied with the result you acquired.
It is possible to smoothen the curtain in a more realistic manner by changing the operation type from "Replace" to "Smooth". After choosing "Smooth", you will have to paint your curtains once again.
Play it once again to see something similar to the image below.
We will now add more realism to the motion of the wind by adding a "Spring". Select the curtain first and then go through Soft/Rigid Bodies > Create Springs and click on the small cube next to it to configure the effect.
Apply the settings illustrated in the image below then click on "Create".
This should result in something similar to the image below.
Play the animation now to see a result more realistic than the previous one.
The final addition to our scene would be to randomise the look of our motion a little bit. Select the uniform field on our scene and then open the Uniform Attribute Editor . Scroll down to "Magnetite" and right click on it to find the "Create New Expression" Command.
Highlight the "Obj & Attr" Box and drag it into the expression field.
Set the following value as the expression to generate a random motion that varies from 1 to 6 as illustrated in the image bel.
The magnetite box colour should change to to indicate that this is an expression.
This should do it, you can try playing around with the settings until you get satisfied with the outcome.
This concludes our tutorial, I hope that you learnt something new that you can use in your own projects.
In the end, I would like to thank you for the support that you have shown by reading this article, for more articles please keep visiting...