



You can use the techniques in this chapter to manage your cloth simulation scenes.

This chapter includes:
Exporting and importing garments
|
You can export a garment with its solver or without its solver. You can also export a garment with or without its collision object.
If you export a garment without the solver, you will get the polygonal mesh of the cloth after it has been simulated. The cloth will no longer be simulated. For example, you could simulate a tablecloth and export it without the solver to use in a restaurant scene where the tablecloth doesn't have to simulate.
If you export a garment with the solver, you will get the solver and all the garments that are connected to the solver. For example, if you create a shirt and pants connected to the same solver, then you export the shirt with the solver, the pants are also exported. If you don't need the pants, you can delete them when you import the garment. Or you can transfer the garment you want to export to a separate solver (see "Using multiple solvers in a scene" on page 145).
To export a garment with the solver:
-
1
-
Select the garments you want to export.
-
The garments will be disconnected from their collision objects during export.
-
2
-
Select File > Export Selection
.
-
3
-
In the Export options box, turn on the History checkbox.
-
4
-
Enter a name for the new scene.
-
The scene will contain the exported items.
-
5
-
Click the Export Selection button.
To export a garment without the solver:
-
1
-
Select the garments you want to export.
-
The garments will be disconnected from their collision objects during export.
-
2
-
Select File > Export Selection
.
-
3
-
In the Export options box, turn off the History checkbox.
-
4
-
Enter a name for the new scene.
-
The scene will contain the exported items.
-
5
-
Click the Export Selection button.
To export a garment and its collision object:
-
1
-
Select the garment and the collision object.
-
2
-
If you want to export the solver also, select File > Export Selection
and turn on the History checkbox.
-
3
-
Enter a name for the new scene.
-
The scene will contain the exported items.
-
4
-
Click the Export Selection button.
To import a garment:
-
1
-
Select File > Import.
-
2
-
Navigate to the file that contains the garment you want to import.
-
3
-
Click Import.
Resetting initial position
|
If you want to import a garment that was modeled at the origin and place it on a character that is not at the origin, you can do it using Save as Initial Cloth State.
To reset initial position:
-
1
-
Import the garment.
-
The garment must have been exported with History turned on.
-
2
-
Select the cloth mesh and position the garment on the character.
-
You can drag the cloth using the Move tool, or you can copy the
transformation values of the character and enter the values in the Channel
Box.
-
3
-
Make sure the cloth is still selected. Select Simulation > Save as Initial Cloth State.
-
The current cloth vertex positions are saved in the solver, and the cloth
transform is reset to the origin.
Using multiple solvers in a scene
|
It can be computationally expensive to simulate several clothed characters at the same time. To reduce this problem, you can segment the cloth simulations into multiple independent simulations that are solved separately. You do this by using multiple solvers.
If two garments will not be colliding with each other, you can place them in separate solvers. You can turn a solver on or off independently of the other solvers. This lets you work on the simulation of one garment without having to wait for other simulations to solve.
In addition, caching is performed on a per-solver basis. This means you can build your animation in stages by solving simulations one at a time. You can view the previously solved simulations with the one you are currently working on.
Creating multiple solvers
|
To create a new solver:
- Select Simulation > Solvers > Create Solver.
-
A new cloth solver is created and added to the list of solvers in the Cloth
Solver menu. This new solver becomes the current solver. You can rename
the solver in the Channel Box.
You specify which simulation you want to work on by making its solver the current solver. All subsequent construction operations are applied to that simulation.
To make a solver current:
- Select Simulation > Solvers > cpSolvername.
-
The solver you select becomes the current solver. Any garments, cloth
objects, and collision objects you create while this solver is current are
controlled by this solver.
To change the solver's attributes:
-
1
-
Select Simulation > Solvers > cpSolvername
.
-
The solver attributes are displayed in the Attribute Editor.
-
2
-
Enter values for the attributes (see "Adjusting the cloth solver" on page 99 for information on the solver attributes).
Turning multiple solvers on or off
|
To disable a solver:
- Select Simulation > Solvers > cpSolvername
. Turn off Solver Enabled in the options window.
-
or
- Select the cloth belonging to the solver you want to disable. Select Simulation > Disable Solver.
To enable a solver:
- Select Simulation > Solvers > cpSolvername
. Turn on Solver Enabled in the options window.
-
or
- Select the cloth belonging to the solver you want to enable. Select Simulation > Enable Solver.
Transferring garments between solvers
|
To transfer a garment from one solver to another:
-
1
-
Make the solver you want to transfer the garment to current by selecting Simulation > Solvers > cpSolvername.
-
The solver you select becomes the current solver.
-
2
-
Select the garment you want to transfer to the current solver.
-
3
-
Select Simulation > Transfer Garment.
-
The garment is connected to the current solver.
Important!
When you transfer garments from one solver to another, the cache files of both solvers become invalid. You must resimulate using each solver to create a new cache files.
|
Deleting cache with multiple solvers
|
To delete the cache in scenes with multiple solvers:
-
1
-
Select the cloth.
-
2
-
Select Simulation > Delete Cache.
-
Maya Cloth ignores the current solver, finds the solver for the selected cloth,
and deletes the cache.
Using collision objects with multiple solvers
|
A collision object can be connected to more than one solver. Before creating or removing collision objects, you must select the solver that the collision object is connected to.
The collision object attribute settings apply to all the solvers that the collision object is connected to.
To create a cloth collision object:
-
1
-
Select Simulation > Solvers > cpSolvername.
-
Where cpSolvername is the name of the solver to which you want to add the
collision object. This makes it the current solver.
-
2
-
Select the object you want to be a collision object.
-
3
-
With the object still selected, select Cloth > Create Collision Object.
-
The object is made a collision object and connected to the current solver.
To remove a cloth collision object:
-
1
-
Select Simulation > Solvers > cpSolvername.
-
Where cpSolvername is the name of the solver from which you want to
remove the collision object. This makes it the current solver.
-
2
-
Select the collision object.
-
3
-
Select Cloth > Remove Collision Object.
To transfer a collision object from one solver to another:
-
1
-
Select Simulation > Solvers > cpSolvername.
-
Where cpSolvername is the name of the solver from which you want to
remove the collision object. This makes it the current solver.
-
2
-
Select the collision object.
-
3
-
Select Cloth > Remove Collision Object.
-
The object is no longer a collision object of the first solver.
-
4
-
Make the new solver current by selecting Simulation > Solvers > cpSolvername.
-
Where cpSolvername is the name of the solver that you want to add the
collision object to. This makes it the current solver.
-
5
-
Select the object and select Cloth > Create Collision Object.
-
The object becomes a collision object connected to the new solver.
Simulating cloth in batch or prompt mode
|
We've included a script, cpRunBatch.mel, which lets you run Maya in batch or prompt mode to solve a cloth animation. You can use this script to create the cache file without having to run Maya graphically.
Command syntax
cpRunBatch startFrame endFrame
To simulate cloth in batch mode:
- Start Maya in batch mode by entering:
-
maya -batch -file filename -command "cpRunBatch startframe endframe"
To simulate cloth in prompt mode:
-
1
-
Start Maya in prompt mode by entering:
-
maya -prompt -file filename
-
2
-
At the mel prompt, enter:
-
cpRunBatch startframe endframe
-
3
-
When the mel prompt is displayed, enter:
-
quit
To save the cache file in a specified directory:
-
1
-
Start Maya in prompt mode by entering:
-
maya -prompt -file filename
-
2
-
At the mel prompt, enter:
-
setAttr -type "string" cpSolver1.cacheName "path/filename"
-
3
-
At the mel prompt, enter:
-
cpRunBatch startframe endframe
-
4
-
When the mel prompt is displayed, enter:
-
quit
To rename the scene file:
- At the mel prompt, enter:
-
file -rename newfilename
-
file -save
Rendering with Maya Cloth View
|
Maya Cloth View mode is the configuration Maya Cloth runs in when a license is not found. You can render a cloth animation scene that was created using Maya Cloth Edit by running Maya Cloth in view mode.
If you have an edit license for Maya Cloth Edit, you can force Maya Cloth to run in view mode (and not use a Maya Cloth license) by using the -lic command line option or by setting the MAYA_LICENSE environment variable.
To run in view mode:
-
See "Limiting the use of optional floating licenses" on page 33 of Installing
Maya for IRIX Version 1.5 for details on these Maya command-line options
and environment variables.




clothdocs@aw.sgi.com
Copyright © 1999, Alias|Wavefront, an SGI company. All rights
reserved.