Reading Cache Files

 
 
 

Once you've created a point cache file, you can read it and load it into an object's animation mixer. You can apply the cache file to the same object for which you created the cache file, or to another object. If you're loading a cache file onto a different object, the number of points on this object must match the number of points that were on the object whose data was cached.

If you created a .cacheslist file for multiple objects (see Creating Cacheslist Files for Multiple Objects), you can also load it from this property page. Cacheslist files let you easily manage multiple objects and cache files.

You can also read a cache file in the ICE tree using the Cache on File node — see Reading a Cache File in the ICE Tree.

Reading and Loading Cache Files into the Animation Mixer

  1. Open the Cache Manager — see Opening the Cache Manager.

  2. In the Cache Manager, click the Read tab at the top of the window.

  3. Click the browser (…) button for the Add to Cache List text box.

  4. In the browser, select a cache file to load. Click OK to load the file and close the browser. The file appears in the Cache List.

    You can continue to load individual cache files this way.

    You can also load a .cacheslist file — see Loading Cacheslist Files for Multiple Objects.

  5. Select one or more objects in the scene to which you want to apply cache files and click the Add button to add them to the Apply to Objects list.

    These objects can be the same objects for which you created the cache files, or other objects to which you want to apply the cache files.

    If you're loading a cache file onto a different object, the number of points on this object must match the number of points that were on the object whose data was cached.

    You can:

    • Select either a cache file or an object in their list and click the Up or Down buttons until the appropriate cache file and object match up accordingly (they must have matching list numbers). If you select either the cache file or the object in the list, its corresponding mate is also selected.

    • Select one or more objects in the scene and click the Add button to add them to the Apply to Objects list.

    • Select one or more cache files or objects in their list and click the Remove button to remove them from that list.

    • Click the Clear button to remove all items from that list.

  6. Click the Apply button to load the cache files in the Cache List into the animation mixer for the corresponding objects in the Apply to Objects list.

    A MixerOp operator is created in the Modeling region for each object and its corresponding cache file is loaded. See Using Cache Files in the Animation Mixer for more information.

    Note

    If the selected object is simulated, you will get this message when you click the Apply button:

    Warning: You are about to load a file cache onto a geometry, but the operator stack contains simulation. Do you want to remove the simulation?

    • If you select Yes, the simulation on the object is deleted and the cache clip is added to the mixer. If this is an ICE simulation, the ICETree operator is deleted from the object's Simulation construction region and is replaced by a MixerOp in its Modeling region. If you want to keep the simulation intact, you can duplicate this object or copy your scene before removing the simulation from this object.

    • If you select No, the simulation is not removed from the object, but the cache clip is not added to the mixer.

Feedback on the Loaded Cache Files

After the cache files are read and applied, information is displayed in gray about the Created Sources in the models' Mixer node, and which cache files were Applied on Objects.

As well, you can edit the cache paths in the Scene Animation Cache Path table that appears at the bottom of the page. This table gives you feedback about which cache files are applied to which scene object and whether or not that object or file is valid.

You can also load different cache files or edit their path strings, or use the buttons to do things like open the animation mixer, select scene objects, or delete file cache sources and clips.

For details on the table and its buttons, see Scene Animation Cache Path.

Loading Cacheslist Files for Multiple Objects

If you created a .cacheslist file for multiple objects (see Creating Cacheslist Files for Multiple Objects), you can load it here. When you do this, all the caches listed in this file are read and applied to the object that you want.

  1. On the Read tab in the Cache Manager, click the browser (…) button for the Add to Cache List text box.

  2. In the browser, select a .cacheslist file to load. Click OK to load the file and close the browser.

    When you load this file, the Cache List displays all the recorded cache files and the Object List displays all the matching objects in the scene.

  3. Make sure that the cache files in the Cache List match the order of the objects in the Apply to Objects list by selecting cache files or objects and using the Up and Down buttons to match up accordingly (they must have matching list numbers).

    If you select either the cache file or the object in the list, its corresponding mate is also selected.

    NoteChanging the items in these lists does not change the contents of the .cacheslist file itself.
  4. Click the Apply button to load the cache files into the animation mixer for the corresponding listed objects.

    A MixerOp operator is created in the Modeling region for each object and its corresponding cache file is loaded.

Using Cache Files in the Animation Mixer

Once you have read and applied a cache file, you can open the animation mixer and see the clips created for each cache file.

To open the animation mixer, do either of the following:

  • Select an object from the Scene Animation Cache Path table at the bottom of the Read Animation Cache page, then click the Open Mixer button.

  • Select an object and press Alt+0. Click the Update icon in the mixer to display the object's clips.

Being able to use cache files in the animation mixer allows you to manipulate the cache files in essentially the same way that you can for action clips.

See The Animation Mixer for general information.

For example, you can:

  • Create cycles for looping the animation or simulation.

  • Offset the starting frame of each cache clip.

  • Timewarp the cache clip to change the animation or simulation speed, or to reverse the animation or simulation.

  • Overlap two cache clips in time and blend between them, as shown below.

     

A wave deformation is cached for the grid.

A twist deformation is cached for the grid.

The cache clips for each of the deformations are loaded into the object's mixer. Each clip has a blend weight of 1 (100%).

To make the effect of one clip more dominant, lower the blend weight for the other clip, or mute its track to prevent it from being evaluated at all.

NoteCurrently, you cannot create compound clips for cache files.

Loading the Cache File Manually

If you didn't use the Cache Manager or you have some cache files you want to load in manually, you can create a file cache track and create a cache clip by following these steps:

  1. Create one or more FileCache tracks in the animation mixer by choosing Track Add File Cache Track from the mixer's toolbar.

    If you want to blend between multiple cache files, you need a track for each cache file clip so that they can overlap each other at the same frames.

  2. Import a cache file directly onto a File Cache track by right-clicking it and choosing Insert Source or Load Source From File. Then select the cache file you want.

  3. When you do this, you may get the same warning about simulated objects as in Creating Cache File Sources and Clips. Select Yes or No as you like.

Normalizing the Cache Clips

The Normalize option in the Mixer property editor is important when you're loading cache files into the mixer — keep reading to see why.

To open the Mixer property editor, select Mixer Shape Mixer from the mixer's toolbar, or access it from the explorer by expanding the model's Mixer Compounds FileCache CompoundContainer node and clicking the Mixer icon.

  • When loading the cache file into the mixer, you can use the Normalize mode in the Mixer property editor to drive the cache file blending. If you want to overlay the clips, deselect the Normalize option (values are additive); if you want to blend the cache files per particle, select the Normalize option (values are averaged).

  • If you're caching a simulation and manipulate the clip, such as scaling it, you should turn off the Normalize option in the Mixer property editor. This is because at each frame, the original simulation applied to the point cloud or object changes the number of points and their index value. So, if you're scaling the clip, the interpolation tries to normalize these values, but it can't because they change at each frame.

See Controlling How Weight Is Mixed for more information.

Playing Cache Files

Once the cache file is in the object's animation mixer, you can play it back like any other clip in the animation mixer, using the playback controls in the timeline.

You can delete or mute any simulation, deformation, or ICE operators on the cached objects to play only the cache file clip in the mixer.

If you created an action source for a simulation, you can delete the object's simulation and reapply the action source back to the object as animation.

Playing cached files is usually faster than playing back the simulation, but here are two reasons why it might not be:

  • The speed of the network on which your cache files are stored, which may be slow at times.

  • Simulation uses all cores of a machine, while caching uses only one.