Cache geometry
 
 
 
NoteGeometry caches only store the XYZ positions of an object’s vertices, not the translation, rotation, or scale of the object’s Transform node.

Create or import geometry caches

You can create single or multiple geometry caches for your objects, each of which can be comprised of a single frame, multiple frames, or a range of frames. If you create more than one geometry cache for an object, you can then blend its caches to create various deformation effects. See Blend and set the weighting of geometry caches.

In addition to creating new geometry caches, you can also import geometry caches that you have previously created. Importing geometry caches, even ones already used in your scene, will not override or replace any existing cache data attached to your objects.

To create a new geometry cache

  1. Select the object or objects for which you want to create a geometry cache.
  2. In the Animation menu set, select Geometry Cache > Create New Cache.
  3. (Optional) If a geometry cache file with the same name already exists in the directory specified in the Create Geometry Cache Options window, the Create Cache Warning message appears.

    Do one of the following:

    • Click Rename to change the name of the new cache you want to create. The Create Geometry 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 geometry cache file, save the new cache file to a new folder on disk, detach the object’s current geometry cache file from its cache node, and attach the new geometry cache file to the object’s cache node.
    • Click Cancel to exit the Create New Cache operation.
    • Click Replace Existing to create a new geometry cache file, replace the object’s current geometry cache file on disk with the new cache file, and attach the new geometry cache file to the object’s cache node.

    Your objects’ deformations are cached using the Create Geometry Cache Options window’s current settings. See Geometry Cache > Create New Cache.

    Single or multiple .mc files and an .xml description file are generated and placed in the file directory you specified in the Add New Geometry Cache Options window, cacheFile nodes (named objectShape#Cache# by default) are added to your objects, and all your objects’ current geometry cache nodes are disabled so that you can see only the new cache on playback.

    NoteWhen a One File or One File per Geometry cache exceeds the 2GB geometry cache size limit, it is automatically split and the resulting cache segments are blended.

    If you selected a single object, the following files are created:

    File Distribution # of Maya cache files created # of XML description files created # of geometry cache nodes created

    One File

    1

    1

    1

    One File Per Frame

    Multiple, 1 for each frame

    1

    1

    If you selected multiple objects, the following files are created:

    File Distribution # of Maya cache files created # of XML description files created # of geometry cache nodes created

    One File

    1

    1

    Multiple, one for each object

    One File Per Frame

    Multiple, one for each frame

    1

    Multiple, one for each object

    One File and One File per Geometry

    Multiple, one for each object

    Multiple, one for each object

    Multiple, one for each object

    One File Per Frame and One File per Geometry

    Multiple, one for each frame, for each object

    Multiple, one for each object

    Multiple, one for each object

To import a geometry cache

  1. Select the object for which you want to import an existing geometry cache from disk.
  2. In the Animation menu set, select Geometry Cache > Import Cache.

    The Import file browser window appears. See Geometry Cache > Import Cache.

  3. Navigate to the geometry cache file(s) you want to attach to your object and do one of the following:
    • For a single geometry cache file, select either the .mc cache file or the .xml description file for the One File cache you want to import to the current object.
    • For multiple geometry cache files, select the .xml description file for the One File Per Frame cache files you want to import to the current object.
      NoteThe geometry cache you want to import must be generated from the same topology as the selected object.
  4. Click Import.

    A new cacheFile node is created for the imported geometry cache and is automatically attached to the selected object’s cacheBlend node. This allows you to combine the imported cache with any of the selected object’s existing caches.

Rename geometry caches

To rename a geometry cache

  1. Select the object whose geometry cache you want to rename.
  2. In the Attribute Editor, select the node of the geometry cache you want to rename.
  3. In the cacheFile field, delete the current name, type a new name for your cache, and press .

    The name of the selected geometry cache node, and its corresponding cache clip, change to the name you typed in the cacheFile field.

Replace geometry caches

You can replace an entire geometry cache file, or you can strategically replace individual cache frames in a geometry cache file. For example, you can improve an object’s cached deformations by remodeling parts of the object at specific frames and replacing those frames in its geometry cache file.

To replace a geometry cache

  1. Select the object for which you want to replace its geometry cache.
    NoteYou cannot replace a geometry cache for an object that has more than one attached cache.
  2. In the Animation menu set, select Geometry Cache > Replace Cache.
  3. (Optional) If a geometry cache file with the same name already exists in the directory specified in the Replace Geometry 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 Geometry 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 geometry cache file, save the new cache file to a new folder on disk, detach the object’s current geometry cache file from its cache node, and attach the new geometry cache file to the object’s cache node.
    • Click Cancel to exit the Replace Cache operation.
    • Click Replace Existing to create a new geometry cache file, replace the object’s current geometry cache file on disk with the new cache file, and attach the new geometry cache file to the object’s cache node.

    A cache is created for the selected object, replacing its current cache at the time range specified in the Replace Geometry Cache Options window. See Geometry Cache > Replace Cache.

To replace geometry cache frames

  1. Select the object for which you want to replace individual geometry cache frames.
    NoteYou cannot replace geometry cache frames for an object that has more than one geometry cache node.
  2. In the Animation menu set, select Geometry Cache > Replace Cache Frame.

    A cache is created for the frame or range of frames specified in the Replace Geometry Cache Frames Options window, replacing your 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).

    See Geometry Cache > Replace Cache Frame.

Undoing a replace geometry cache frames operation

When you replace geometry 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 Geometry Cache Frames operation

  1. Rename the backup files that were generated to the original file names.

    For example, to undo a Replace Geometry Cache Frames operation on a geometry cache named Ball, you would rename its backup_Ball.xml and backup_Ball.mc backup files to Ball.xml and Ball.mc.

    NoteIf Delete backup files was on when you replaced your geometry cache frames, then you cannot undo the Replace operation because the frames that were replaced were also deleted from disk.

When you replace geometry cache frames on a One File Per Frame cache, only the frames that are replaced are backed up. To undo a Replace Geometry 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 Geometry Cache Frames operation on the geometry One File Per Frame caches named BallFrame1, BallFrame2, and BallFrame3, you would rename their backup_Ball.xml file to Ball.xml, and the replaced frame backup files backup_BallFrame1.mc, backup_BallFrame2.mc, and backup_BallFrame3.mc to BallFrame1.mc, BallFrame2.mc, and BallFrame3.mc.

Append geometry caches

To append to a geometry cache

  1. Select the object to which you want to append a geometry cache frame or range of frames.
  2. In the Attribute Editor, enable the geometry cache you want to append to and disable all other geometry caches.
  3. In the Animation menu set, select Geometry Cache > Append to Cache. See Geometry Cache > Append to Cache.

    A geometry cache is created for the frame or range of frames specified in the Append to Geometry Cache Options window and is added or appended to the enabled cache.

    If the appended cache frames overlap in time with the enabled geometry cache, then they are automatically blended with that cache. However, if there is a gap in time between the enabled geometry cache and the appended cache frames, then the gap is linearly interpolated and no cache data for the gap is saved to the appended cache.

Detach geometry cache files

To detach all geometry cache files

  1. Select the object from which you want to detach all of its geometry cache files.
  2. In the Animation menu set, select Geometry Cache > Delete Cache > .

    The Delete Geometry Cache Options window appears. See Geometry Cache > Delete Cache.

  3. Turn on Keep Files and then click Delete or Apply.

    All the selected object’s geometry cache nodes and clips are deleted and their corresponding cache files on disk are detached from the object.

To detach single or multiple geometry cache files

  1. Select the object from which you want to detach geometry cache files.
  2. In the Animation menu set, select Geometry Cache > Delete Cache > .

    The Delete Geometry Cache Options window appears. See Geometry Cache > Delete Cache.

  3. Turn on Keep Files.
  4. In the Select caches to delete list, do one of the following:
    • the name of the single geometry cache you want to detach from your object.
    • - the names of the multiple geometry caches you want to detach from your object.
  5. Click Delete or Apply.

    The selected geometry caches’ nodes and clips are deleted and their associated cache files on disk are detached from their object.

Enable or disable geometry caches

To enable or disable all of an object’s geometry caches

  1. Select the object for which you want to enable or disable all of its geometry caches.
  2. In the Animation menu set, do one of the following:

    All your current object’s active geometry cache nodes and cache clips become inactive and are now not used by their object on playback.

    All your current object’s inactive geometry cache nodes and cache clips become active and are now used by their object on playback.

To enable or disable individual geometry caches

  1. Select the object for which you want to enable or disable individual geometry caches.
  2. In the Attribute Editor, select the node for the geometry cache you want to enable or disable.
  3. In the Cache File section, do one of the following:
    • Turn Enable on to activate the cache node.

    The geometry 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 node.

    The geometry cache node and its corresponding cache clip become inactive and are now not used by their object on playback.

Delete geometry caches

To delete all geometry caches

  1. Select the object for which you want to delete all of its geometry caches.
  2. In the Animation menu set, select Geometry Cache > Delete Cache.

    All of your object’s geometry cache nodes and corresponding cache clips are deleted. Whether or not your object’s geometry cache files on disk are also deleted depends on your current Delete Geometry Cache Options window settings. See Geometry Cache > Delete Cache.

To delete geometry cache frames

  1. Select the object from which you want to delete an individual geometry cache frame or a range of frames.
  2. In the Attribute Editor, enable the geometry cache you want to delete frames from and disable all other caches.
  3. In the Animation menu set, select Geometry Cache > Delete Cache Frame. See Geometry Cache > Delete Cache Frame.

    The frame or range of frames specified in the Delete Geometry Cache Frames Options window are deleted from your object’s geometry cache. The gap in your geometry cache resulting from the deletion of frames is interpolated linearly.

Merge geometry caches

You can merge your geometry 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 geometry caches

  1. Select the object whose geometry caches you want to merge.
  2. 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.
  3. In the Animation menu set, select Geometry Cache > Merge Caches > .

    The Merge Geometry Cache Options window appears. See Geometry Cache > Merge Caches.

  4. Set the merge options and click Merge or Apply.
  5. All your object’s enabled caches merge according to the settings in the Merge Geometry Cache Options window, creating a new geometry cache node, cache file, and XML description file. See Geometry Cache > Merge Caches.

    The geometry caches you merged are disabled and their corresponding cache files on disk are not overridden or deleted.

Blend and set the weighting of geometry caches

If an object has more than one geometry cache attached to it, then a cacheBlend node is automatically created to define and manage the weighting of the object’s multiple geometry caches. See cacheBlend.

When geometry caches overlap in time, their overlapping cache regions are automatically blended together using the caches’ current Input Weight values on their cacheBlend nodes.

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 deformations in their cache blend regions on playback.

To blend geometry caches and set their weights

  1. Select the object whose geometry cache weights you want to adjust.
  2. In the Attribute Editor, select the cacheBlend node.
  3. In the Input Weights section, adjust the weight values for each of your object’s caches by dragging their respective sliders or by entering values into their weight fields.

    When a geometry cache’s weight is 1.0, it is blended with the current object’s other caches and it fully contributes to the object’s deformations during playback.

    When a geometry cache’s weight is 0.0, it is not blended with the current object’s other caches and it does not contribute to the object’s deformations during playback.

  4. (Optional) Animate your geometry caches’ weights to increase or decrease their contributions to their blended deformations 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 geometry caches, creating weight curves. You can then manipulate these weight curves to smooth the transitions between your object’s overlapping (blended) caches.

Painting geometry cache weights

You can interactively apply, distribute, and blend the weights of multiple caches on a single object by painting your object’s geometry cache weights directly on its surface. For example, with the Paint Cache Weights Tool, you can paint one cache on the arm of a biped model, paint another cache on the chest of the model, and then blend the two caches at the model’s shoulder to create a smooth transition from the arm’s geometry cache to the chest’s geometry cache.

To paint geometry cache weights

  1. Select the object whose geometry cache weight values you want to paint.
  2. In the Animation menu set, select Geometry Cache > Paint Cache Weights Tool > .

    The Paint Cache Weights Tool settings appear in the Tool Settings window. See Geometry Cache > Paint Cache Weights Tool.

  3. In the Tool Settings window, select the geometry cache you want to paint the weights for from the Cache list.
  4. Select a Paint operation, and then adjust the Value and Opacity of the tool’s brush.

    For descriptions of these tool settings, see Artisan Tool Settings.

  5. (Optional) In the Attribute Maps section of the tool settings, import an existing geometry cache weight map for the geometry cache whose weights you want to paint on your object. See Attribute Maps section.
  6. In the scene view, drag the Paint Cache Weights Tool along the surface of your object to change its geometry cache weighting vertex by vertex.
    NotePainted geometry cache weights are normalized.

    This means that if any of your geometry caches have the same painted weight values (i.e. 1.0 and 1.0, 0.5. and 0.5 and so on), then those caches will equally contribute to their object’s deformations on playback.

Related topics