![]()
Cache nCloth
Create or import nCloth caches
You can create single or multiple nCloth caches for your nCloth objects, each of which can be comprised of a single frame, multiple frames, or a range of frames. If you create more than one nCloth cache for an nCloth object, you can then blend its caches to create new nCloth effects. See Blend and set the weighting of nCloth caches.
In addition to creating new nCloth caches, you can also import nCloth caches that you have previously created. Importing nCloth caches will not override or replace any existing cache data attached to your nCloth objects.
To create a new nCloth cache
- Select the nCloth object or objects for which you want to create an nCloth cache.
- In the nCloth menu set, select nCache > Create New Cache.
- (Optional) If an nCloth cache file with the same name already exists in the directory specified in the Create nCloth Cache Options window, the Create Cache Warning message appears.
Do one of the following:
- Click Rename to change the name of the cache you want to create. The Create nCloth Cache Options window appears. Type a new name for the new cache in the Cache Name field and click Create.
- Click Auto-rename to create a new nCloth cache file. The new cache file is saved to a new folder on disk, the nCloth object’s current nCloth cache file is detached from its cache node, and the new nCloth cache file is attached to the nCloth object’s cache node.
- Click Cancel to exit the Create New Cache operation.
- Click Replace Existing to create a new nCloth cache file. The nCloth object’s current nCloth cache file on disk is replaced with the new nCloth cache file, and the new nCloth cache file is attached to the nCloth object’s cache node.
Your nCloth objects’ simulations are cached using the Create nCloth Cache Options window’s current settings. See nCache > Create New Cache.
Single or multiple
.mccache files and an.xmldescription file are generated and stored in the directory you specified in the Create nCloth Cache Options window. cacheFile nodes (named nClothShape#Cache# by default) are also added to your nCloth objects, and any existing nCloth cache nodes are disabled so that you can see only the new caches playback.
Note
When an nCloth cache exceeds the 2GB nCloth cache size limit, it is automatically split and the resulting cache segments are blended.
If you selected a single nCloth object, the following files are created:
File Distribution # of nCloth cache files created # of XML description files created # of nCloth cache nodes createdOne File
1
1
1
One File Per Frame
Multiple, 1 for each frame
1
1
If you selected multiple nCloth objects, the following files are created:
Tip
If you cache all the nCloths in a single Maya Nucleus system, disable the system’s Maya Nucleus solver to avoid playback slow downs.
To import an nCloth cache
- Select the nCloth object for which you want to import an existing nCloth cache from disk.
- In the nCloth menu set, select nCache > Attach Existing Cache File.
The Import file browser window appears. See nCache > Attach Existing Cache File.
- Navigate to the nCloth cache file(s) you want to use for your nCloth object and do one of the following:
- For a single nCloth cache file, select either the
.mccache file or the.xmldescription file for the One File cache you want to import to the current object.- For multiple nCloth cache files, select the
.xmldescription file for the One File Per Frame cache files you want to import to the current object.
Note
The nCloth cache you want to import must have been generated from the same topology as the selected nCloth object.
- Click Import.
A new cacheFile node is created for the imported nCloth cache and it is automatically attached to the selected nCloth object’s cacheBlend node. This allows you to combine the imported cache with any of the selected nCloth object’s existing caches.
Rename nCloth caches
To rename an nCloth cache
- Select the object whose nCloth cache you want to rename.
- In the Attribute Editor, select the tab of the nCloth cache you want to rename.
- In the cacheFile field, delete the current name, type a new name for your cache, and press
.
The name of the selected nCloth cache tab, and its corresponding cache clip, change to the name you typed in the cacheFile field.
Replace nCloth caches
You can replace an entire nCloth cache file with a new simulation, or you can strategically replace individual cache frames in an nCloth cache file. For example, you can improve an nCloth object’s cached simulation by resimulating specific frames and replacing only those frames in its nCloth cache file.
To replace an nCloth cache
- Select the nCloth object for which you want to replace a cache.
- In the nCloth menu set, select nCache > Replace Cache.
- (Optional) If an nCloth cache file with the same name already exists in the directory specified in the Replace nCloth Cache Options window, the Create Cache Warning message appears.
Do one of the following:
- Click Rename to change the name of the replacement cache you want to create. The Replace nCloth Cache Options window appears. Type a new name for the replacement cache in the Cache Name field and click Replace.
- Click Auto-rename to create a new nCloth cache file. The new cache file is saved to a new folder on disk, the nCloth object’s current nCloth cache file is detached from its cache node, and the new nCloth cache file is attached to the nCloth object’s cache node.
- Click Cancel to exit the Replace Cache operation.
- Click Replace Existing to create a new nCloth cache file. The nCloth object’s current nCloth cache file on disk is replaced with the new nCloth simulation, and the new nCloth cache file is attached to the nCloth object’s cache node.
After the simulation, a cache is created for the selected nCloth object, replacing its current cache at the time range specified in the Replace nCloth Cache Options window. See nCache > Replace Cache.
To replace nCloth cache frames
- Select the nCloth object for which you want to replace individual nCloth cache frames.
Note
You cannot replace nCloth cache frames for an nCloth object that has more than one enabled cache.
- In the nCloth menu set, select nCache > Replace Cache Frame.
After the simulation, a cache is created for the frame or range of frames specified in the Replace nCloth Cache Frame(s) Options window, replacing your nCloth object’s current cache at the specified time range, and backups of the original unchanged cache and description files are generated (named backup#_originalCacheName by default). This is required for undo operations.
See nCache > Replace Cache Frame.
To undo a replace nCloth cache frames operation
Note
If Delete backup files was on when you replaced your nCloth cache frames, then you cannot undo the Replace operation because the frames that were replaced were also deleted from disk.
When you replace nCloth cache frames, backup files of the original cache data are automatically generated and named by prefixing the original cache file names with backup_, backup1_ and so on. To undo a Replace nCloth Cache Frames operation, the backup files that were generated need to be renamed to the original file names. For example, to undo a Replace nCloth Cache Frames operation on an nCloth cache named Cape, you would rename its backup_Cape.xml and backup_Cape.mc backup files to Cape.xml and Cape.mc.
When you replace nCloth cache frames on a One File Per Frame cache, only the frames that are replaced are backed up. To undo a Replace nCloth Cache Frames operation on a One File Per Frame cache, the backup frame files that were generated need to be renamed to the original frame file names. For example, to undo a Replace nCloth Cache Frames operation on the nCloth One File Per Frame caches named CapeFrame1, CapeFrame2, and CapeFrame3, you would rename their backup_Cape.xml file to Cape.xml, and the replaced frame backup files backup_CapeFrame1.mc, backup_CapeFrame2.mc, and backup_CapeFrame3.mc to CapeFrame1.mc, CapeFrame2.mc, and CapeFrame3.mc.
Append nCloth caches
To append to an nCloth cache
- Select the nCloth object to which you want to append an nCloth cache frame or range of frames.
- In the Attribute Editor, enable the nCloth cache you want to append to and disable all other nCloth caches.
- In the nCloth menu set, select nCache > Append to Cache. See nCache > Append to Cache.
After the simulation, an nCloth cache is created for the frame or range of frames specified in the Append to Cache Options window and is added or appended to the enabled cache.
If the appended cache frames overlap in time with the enabled nCloth cache, then they are automatically blended with that cache. However, if there is a gap in time between the enabled nCloth cache and the appended cache frames, then the gap range is simulated but no data for the gap is saved to the appended cache.
Detach nCloth cache files
To detach all nCloth cache files
- Select the nCloth object from which you want to detach all of its nCloth cache files.
- In the nCloth menu set, select nCache > Delete Cache >
.
The Delete nCloth Cache Options window appears. See nCache > Delete Cache.
- Turn on Keep Files and then click Delete or Apply.
All the selected nCloth object’s Attribute Editor cache tabs, nodes, and clips are deleted and their corresponding cache files on disk are detached from the object.
To detach single or multiple nCloth cache files
- Select the nCloth object from which you want to detach nCloth cache files.
- In the nCloth menu set, select nCache > Delete Cache >
.
The Delete nCloth Cache Options window appears. See nCache > Delete Cache.
- Turn on Keep Files.
- In the Select caches to delete list, do one of the following:
the name of the single nCloth cache you want to detach from your nCloth object.
-
the names of the multiple nCloth caches you want to detach from your nCloth object.
- Click Delete or Apply.
The selected nCloth caches’ Attribute Editor tabs, nodes, and clips are deleted and their associated cache files on disk are detached from their object and retained on disk.
Enable or disable nCloth caches
To enable or disable all of an nCloth object’s caches
- Select the nCloth object for which you want to enable or disable all of its caches.
- In the nCloth menu set, do one of the following:
- Select nCache > Disable All Caches On Selected.
All your current nCloth object’s active cache nodes and cache clips are disabled and are now not used by their nCloth object on playback.
- Select nCache > Enable All Caches On Selected.
All your current nCloth object’s inactive cache nodes and cache clips are enabled and are now used by their nCloth object on playback.
To enable or disable individual nCloth caches
- Select the nCloth object for which you want to enable or disable individual caches.
- In the Attribute Editor, select the tab for the nCloth cache you want to enable or disable.
- In the Cache File section, do one of the following:
- Turn Enable on to activate the cache.
The nCloth cache node and its corresponding cache clip become active and are now used by their object on playback.
- Turn Enable off to deactivate the cache.
The nCloth cache node and its corresponding cache clip become inactive and are now not used by their nCloth object on playback.
Delete nCloth caches
To delete all nCloth caches
- Select the nCloth object for which you want to delete all caches.
- In the nCloth menu set, select nCache > Delete Cache.
All of your object’s nCloth cache Attribute Editor tabs, nodes, and corresponding cache clips are deleted. Whether or not your Cloth object’s cache files on disk are also deleted depends on your current Delete nCloth Cache Options window settings. See nCache > Delete Cache.
To delete nCloth cache frames
- Select the nCloth object from which you want to delete an individual cache frame or a range of frames.
- In the Attribute Editor, enable the nCloth cache you want to delete frames from and disable all other caches.
- In the nCloth menu set, select nCache > Delete Cache Frame. See nCache > Delete Cache Frame.
The frame or range of frames specified in the Delete nCloth Cache Frames Options window are deleted from your nCloth object’s cache. The gap in your nCloth cache resulting from the deletion of frames is interpolated linearly.
Merge nCloth caches
You can merge your nCloth caches to bake them into a single cache. The caches you want to merge can be positioned sequentially or non-sequentially in time.
If the caches you want to merge overlap in time, the regions of the caches that overlap are blended according to their current Input Weight settings and any of their weight maps.
If the caches you want to merge aren’t overlapping, but have gaps between them, then the gaps are linearly interpolated and no cache data for those gaps is saved to the merged cache. For example, you have three caches that you want to merge: cache 1 (frames 15-25), cache 2 (frames 25-35), and cache 3 (frames 40-50). When you merge these caches, the length of the resulting merged cache will be frames 15-50, but frames 36-39 will contain no cache data.
To merge nCloth caches
- Select the nCloth object whose caches you want to merge.
- In the Attribute Editor, enable the caches you want to merge and disable all other caches. Only your object’s enabled caches will be merged.
- In the nCloth menu set, select nCache > Merge Caches >
.
The Merge Caches Options window appears. See nCache > Merge Caches.
- Set the merge options and click Merge or Apply.
All your nCloth object’s enabled caches merge according to the settings in the Merge nCloth Cache Options window, creating a new nCloth cache Attribute Editor tab, node, cache file, and XML description file.
The original nCloth caches you merged are disabled and their corresponding cache files on disk are not overridden or deleted.
Blend and set the weighting of nCloth caches
To blend nCloth caches and set their weights
If an nCloth object has more than one nCloth cache attached to it, then a cacheBlend node is automatically created to define and manage the weighting of the nCloth’s multiple nCloth caches. See cacheBlend.
When nCloth caches overlap in time, their overlapping cache regions are automatically blended together using the caches’ current Input Weight values on their
cacheBlendnodes.Also, cache weights are normalized between overlapping caches. So if two overlapping caches have the same weight values (i.e. 1.0 and 1.0, 0.5. and 0.5 and so on), then they will both equally contribute to the nCloth simulation in their cache blend regions on playback.
- Select the nCloth object whose cache weights you want to adjust.
- In the Attribute Editor, select the cacheBlend tab.
- In the Input Weights section, adjust the weight values for each of your nCloth object’s caches by dragging their respective sliders or by entering values into their weight fields.
When an nCloth cache’s weight is 1.0, it is blended with the current nCloth object’s other caches and it fully contributes to the nCloth object’s cloth effects during playback.
When an nCloth cache’s weight is 0.0, it is not blended with the current nCloth object’s other caches and it does not contribute to the nCloth object’s cloth effects during playback.
- (Optional) Animate your nCloth caches’ weights to increase or decrease their contributions to their blended cloth effects over time.
After you adjust each cache’s weight value,
-click on their weight attributes and select Key Selected from the context-sensitive menu that appears.
This adds keys to your nCloth caches, creating weight curves. You can then manipulate these weight curves to smooth the transitions between your nCloth object’s overlapping (blended) caches.
To paint nCloth cache weights
You can interactively apply, distribute, and blend the weights of multiple caches on a single nCloth object by painting your nCloth object’s cache weights directly on its surface. This allows you to direct and manipulate the weights of an nCloth in an artistic. For example, with the Paint Cache Weights Tool you can paint one cache on the sleeve of an nCloth jacket, paint another cache on the main body of the nCloth jacket, and then blend the two caches at the jacket’s shoulder to create a smooth transition from the sleeve’s nCloth cache to the main body of the jacket’s nCloth cache.
- Select the nCloth object whose cache weight values you want to paint.
- In the nCloth menu set, select nCache > Paint Cache Weights Tool.
The Paint Cache Weights Tool settings appear in the Tool Settings window. See nCache > Paint Cache Weights Tool.
- In the Tool Settings window, select the nCloth cache you want to paint the weights for from the Cache list.
- Select a Paint operation, and then adjust the Value and Opacity of the tool’s brush.
For descriptions of these tool settings, see Common Artisan Brush Tool Settings in the Artisan guide.
- (Optional) In the Attribute Maps section of the tool settings, import an existing nCloth cache weight map for the nCloth cache whose weights you want to paint on your object. See Attribute Maps section in the Artisan guide.
- In the scene view, drag the Paint Cache Weights Tool along the surface of your nCloth object to change its cache weighting vertex by vertex.