Caching ICE or Rigid Body Simulations

You can cache ICE simulations into a point cache file and simulation environment cache, and optionally to a cache file source and clip — see Caching ICE Simulations below. You can then play it back as usual, whether it’s using the ICE tree or the animation mixer.

You can cache rigid body simulations to a simulation environment cache, and optionally to an action source and clip — see Caching Rigid Body Simulations.

Notes

• Only the simulated frames of an ICE tree are written to the cache, which doesn’t include the first frame of the scene. This frame is considered to be the initial state and is therefore not simulated. For example, if your scene starts at frame 1 and ends at frame 100 frames, 99 simulated frames are written to the cache, beginning with frame 2.

• If you’re caching instanced geometry for ICE particles, make sure to keep the master object in the scene when writing or reading a cache file: even if the particles are cached, they still depend on the instance master to be there. If you don’t want the master objects to be displayed or rendered, you can simply move them out of the camera’s view, or you can hide them by selecting the Instance Master Hidden option in each master object’s Visibility property editor (Rendering tab).

Caching ICE Simulations

You can cache ICE simulations into a point cache file for the current simulation environment. You can then load it and play it back as usual, whether it’s in the ICE tree or the animation mixer.

At the same time as you cache a point cache file, a simulation environment cache is created. This cache allows you to scrub the simulation back and forth in the timeline without needing to load a cache file.

Once you have created a cache file, you can also create a cache file source and clip based on it to use in the animation mixer — see Creating Cache File Sources and Clips below. The sources are kept with the model, which lets you import and export models with their cached simulation intact.

To save the simulation to a cache file

1. Select one or more ICE-simulated objects whose simulation you want to cache.

2. Do either of the following:

- Open the Cache Manager (see Opening the Cache Manager), then click the Simulation tab at the top of its window.

or

- Open the Simulation Time Control property editor for the current simulation environment. (In the explorer, open the current Environment and click the Simulation Time Control icon).

 

You can select any of the Play Mode options (on the Simulation page) for caching — see Simulation Time Control Property Editor [Properties Reference]. However, if you’re doing distributed rendering or using motion blur, it’s recommended that you use the Standard mode.

3. Click the Caching Files tab.

 

4. Select the Cache on Playback option.

5. Select the Path, File Name, Version, and Format you want to use for the point cache file — see Caching Files [Properties Reference].

You can see the current selection in gray in the Resolved Path text box.

 

If there is a cache file being read from a Cache on File node in any scene object’s ICE tree, information about the object and its cache file appears in the Scene Simulation Cache on File Nodes area. Select an object in the table, then click the Inspect Obj button to open the object’s Cache on File property editor.

6. Play the frames of the simulation that you want to cache.

You can also cache the frames by jumping to the last frame of the simulation that you want to cache: all the frames of the simulation up to that frame are cached.

When you play the simulation, you create a point cache file, as well as a simulation environment cache.

7. If you want to keep making changes to the simulation and update the contents of the cache files every time you play it, keep the Cache on Playback option on.

If you don’t want to do this, make sure to turn off the Cache on Playback option when you’re done playing back the simulation.

8. You can now load the point cache files (see Reading Cache Files) on the same or different objects, or create a cache file source and clip (see below).

Creating Cache File Sources and Clips

After you have created a cache file of an ICE simulation, you can create a cache file source to keep with the model.

You can also create cache clip from this cache file source and apply it in the animation mixer. Note that applying the cache clip to the animation mixer removes the simulation from the object. If you want to keep the simulation intact, you can duplicate this object or copy your scene before applying the cache clip.

To save the ICE simulation in a cache source and optionally apply a cache clip

1. Select one or more ICE-simulated objects whose simulation you have already cached to a file.

2. Click the Save Cache to Mixer button on the Caching Files tab.

3. In the Store Environment Cache in Mixer dialog box, click OK and the cache file source is created in the model’s Mixer folder.

4. If you want to also apply the cache file source as a clip in the model’s animation mixer, select the Add Clip to Mixer option in the Store Environment Cache in Mixer dialog box.

You will get this message when you click OK in the dialog box:

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 after caching, and the cache clip is added to the mixer. The ICETree operator is deleted from the object’s Simulation construction region and is replaced by a MixerOp in its Modeling region.

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

Caching Rigid Body Simulations

You can cache the simulation of the rigid bodies current environment into a simulation environment cache. The environment cache stores the simulation as global transformation function curves that you can edit in the animation editor. The fcurves are raw curves, meaning that there is a key at every frame.

You can use this cache to scrub the simulation back and forth in the timeline. It also provides you with an easy way of testing variations to your simulation: every time you change something in the simulation, you can simply play the simulation again to update the cache with the changes.

You can also save the environment cache to an action source and optional clip to use in the animation mixer — see Creating Action Sources and Clips from the Cache below. You can cache one action source per model, which lets you import and export models with their cached simulation intact.

 

Some deformation and topology edits can cause cycles with rigid body simulations, and therefore unpredictable behavior. The cyclic dependency happens because some geometry operators require the position of the rigid body to be computed, while the rigid body simulation requires the geometry of the rigid body in order to calculate collisions. The solution is to freeze the rigid body, or freeze its modeling.

To cache the rigid body simulation environment

1. Select the environment you want to be current for the rigid bodies simulation cache, then right-click on it and choose Set as Current Environment.

2. Do either of the following:

- Open the Cache Manager (see Opening the Cache Manager), then click the Simulation tab at the top of its window.

or

- Open the Simulation Time Control property editor for the current simulation environment. (In the explorer, open the current Environment and click the Simulation Time Control icon).

 

You can select any of the Play Mode options (on the Simulation page) for caching — see Simulation Time Control Property Editor [Properties Reference]. However, if you’re doing distributed rendering or using motion blur, it’s recommended that you use the Standard mode.

3. Click the Caching Files tab.

4. Select the Cache on Playback option.

5. Play the frames of the simulation that you want to cache. This creates an environment cache file that you can find in the current environment’s Caches node.

You can also cache the frames by jumping to the last frame of the simulation that you want to cache: all the frames of the simulation up to that frame are cached.

6. If you want to keep making changes to the simulation and update the contents of the environment cache every time you play it, keep the Cache on Playback option on.

If you don’t want to do this, make sure to turn off the Cache on Playback option when you’re done playing back the simulation.

Creating Action Sources and Clips from the Cache

After you have created an environment cache of the rigid body simulation, you can also create an action source to keep with the model. You can have one cache file source per model, which lets you import and export models with their cached simulation intact.

At the same time you create an action source, you can also create an action clip from this source and apply it in the animation mixer. Note that creating a clip removes the simulation from the rigid body objects. If you want to keep the simulation intact, you can copy the objects or your scene before creating the clip.

Once you have an action clip in the animation mixer, you can use it like any other action clip. For example, you can load other simulation action sources on tracks in the mixer, then play each one separately (solo), or mix the weights of two or more simulations together.

For information in general about action sources and clips in the animation mixer, see Actions [Nonlinear Animation].

To save the rigid body simulation in an action source and optionally apply an action clip

1. Click the Save Cache to Mixer button to open the Store Environment Cache in Mixer dialog box.

2. In this dialog box, enter an Action Name for the action source that contains the cached simulation. This source is kept in the model’s Mixer > Sources > Animation node. Click OK in the dialog box to create the action source.

3. You can optionally select the Add Clip to Mixer option to create and apply the action source as an action clip in the model’s animation mixer.

The simulation is removed from the rigid body objects when you click OK in this dialog box.

Selecting the Storage Type for the Action Source

By default, the action source is stored as an Internal type of source. However, you can change it if you like:

1. In the explorer, click the action source’s icon (in the model’s Mixer > Sources > Animation folder) or click the current environment’s Environment Cache icon to open its property editor.

2. In the Action Source or Environment Cache property editor, select the cache file’s Storage type as Internal (saved with the scene) or as External (saved to a file).

 

- If you select Internal as the storage type, the source is saved as any other action source in the current model’s Mixer > Sources > Animation folder.

- If you select any of the External options as the storage type, select a location and File name for the simulation source. This allows you to export the cached simulation in a separate file.

For information on external action sources, see Creating External Action Sources [Nonlinear Animation].

Locking the Cache File

Once you have created a simulation environment cache file, you can lock it so that its contents can’t be resimulated once it is complete. This is particularly useful when you’re happy with the current state of the simulation and want to make sure that it won’t change.

You should lock a cache file before sending it to a render farm.

To lock the cache

• Create a cache file, then select the Lock Playback Cache option in the Simulation Time Control property page.

Softimage looks for the cache file that is specified, then locks the frames that have already been cached so that they can’t be resimulated.



Autodesk Softimage 2011 Subscription Advantage Pack