The Cache Disk operator works much like the Cache operator, except that it lets you store the cache in a disk file separately from the MAX file.
As with the Cache operator, it lets you pre-calculate and store all the activity in a particle system so that you can play or scrub the animation quickly without having to wait for calculations. The main difference, other than the use of the disk file, is that there is no option for automatic updating, because disk caching is slower than memory caching. The benefit is that the only limit on the size of the cache is the amount of free space on the hard drive.
To use Cache Disk, add it to the event you wish to cache, or to the global event if you want to cache the entire particle flow, click Select File, specify a file name, and then click Save. Then, to create the cache, play the animation or click the Update button.
Also, because disk caching is slower than memory caching, Cache Disk does not have an automatic-update option. If you change a parameter and want to see the changed results, you must click the Update button.
Tip: If you have a situation where particle systems are dependent on each other, use a Cache operator and solve the simulation before you can render, especially if you're rendering over a network, or rendering frames non-sequentially. Since the particle systems depend on each other, Particle Flow can iterate only one frame at a time.
For general background information on how caching works in Particle Flow, see the introduction to the Cache Operator topic.
Also see Cache Selective Operator.
Interface
- Use At
- Caches particle motion when playing back in the viewports, or at render time, or both. Default=Viewport.
Important: Choose the Viewport/Render option only when using the same number of particles in the viewports and for rendering. In other words, the two
Quantity Multiplier settings on the Emission Rollout of the global event (or Particle Flow source) must be identical. Otherwise, unpredictable results can occur.
- Range
- Sets the frame range within which the Cache Disk operator operates. Default=Active Segment.
- Active Segment Particle Flow caches only frames in the active segment, as defined by the Start Time and End Time settings on the Time Configuration dialog. This is the frame range shown on the track bar. You can also change the active segment by holding down + and dragging the track bar—for this operation, you can use the (left), (middle), or (right) mouse button.
- Custom Particle Flow caches only frames in the custom range, as defined by the Cache Disk operator's Start Time and End Time settings (see following).
Note: If you cache only part of the animation, Particle Flow calculates particle behavior in subsequent, non-cached frames using the cached data. For example, if you cache frames 0 to 50, and then jump to frame 60, Particle flow will calculate frame 51 based on the cached data, and frames 52 to 60 based on each previous frame.
- Start/End Time
- The first and last frames of the range considered for caching when Range=Custom (see preceding). Defaults=0, 30.
Note: The frame range time frame is in absolute time; that is, in terms of the entire animation. If you use a Cache Disk operator locally, and specify a frame range during which no particles are present in the event, Particle Flow won't use the cache.
- Sampling
- Determines how often the Cache Disk operator samples and caches the animation. Default=Every Frame.
- Every Frame Particle Flow caches animation data once per frame.
- Integration Step Particle Flow caches animation data at each integration step, using the Integration Step setting as specified by the Use At setting (see above) and on the System Management rollout for the flow (select the global event). If Use At is set to Viewport/Render, it uses lower of the two Integration Step values. For example, if Viewport is set to Half Frame, and Render to 1/8 Frame, the sampling rate would be eight per frame.
- Every Nth Frame Particle Flow caches animation data at frame intervals specified by the N value (see following).
- N
- Determines the frame interval for caching when Sampling (above) is set to Every Nth Frame. Default=5.
For example, with N set to the default value of 5, the cache stores animation data for every fifth frame.
- Cache Test Results
- When caching particle data, this caches the results of test actions as well. Default=on.
This is important if Cache Disk is used as a local operator, and the next event doesn't have a Cache-type operator. For the next event to work properly, it should receive particles from the current event. Those particles result from the activity of a test action. The Cache Disk operator can record the test activity to play it back later.
If the Cache Disk operator is used as a global operator, there is no need to cache the test results. This is because the system has cache data for every event, and is able to jump to an arbitrary frame without the need for test results.
Cache Files group
Each Cache Disk operator stores its data in a sequence of disk files; one for each animation frame. The filename uses the format base_name####.pfc, where base_name is the name you supply, #### is a four-digit number with leading zeroes, and .pfc (Particle Flow Cache) is the filename extension.
- [Select File button]
- Click this button to specify a location and base name for the cache files. After you do so, the base name appears on the button. You can see the entire path and base name on a tool tip by hovering the mouse cursor over the button.
Update And Reset group
Cache Disk does not have an option to update the disk cache automatically, because disk caching is slower than memory caching. If you change a parameter and want to see the changed results, you must click the Update button.
- Update
- If you change a parameter in the particle system, the cached data might become invalid. Click this button to update the cache manually, using the range specified in this group.
To cancel the update while in progress, press .
- Clear
- Deletes the cache files, using the range specified in this group.
- Range
- Sets the frame range within which the Cache operator recalculates data when you click Update or Clear. Default=Active Segment.
- Active Segment Particle Flow updates the cache only for frames in the active segment, as defined by the Start Time and End Time settings on the Time Configuration dialog. This is the frame range shown on the track bar. You can also change the active segment by holding down + and dragging the track bar—for this operation, you can use the (left), (middle), or (right) mouse button.
- Custom Particle Flow updates the cache only for only frames in the custom range, as defined by the Start Time and End Time settings (see following).
- Start/End Time
- The first and last frames of the range that's updated when Range=Custom (see above). Defaults=0, 30.
- Update Viewports
- When on, the animation plays in the viewports during manual updating of the cache. Turn this off to disable playing the animation in the viewports during manual caching; this can speed up the caching process, especially with large or complex particle systems. Default=on.
- Update All
- Updates the caches for all Disk Cache operators in the current flow. Use this to avoid having to update each cache individually after changing a parameter that affects the entire flow.
- Clear All
- Deletes the cache files for all Disk Cache operators in the current flow.
- Exclude Data From Cache
- Prevents Particle Flow from saving the specified animation data in the cache files. Turn on an option to exclude that type of data from the cache. The data types are: Shape, Script Data, Scale, Material ID, Mapping, and Rotation.
Using these options helps reduce the size of the cache files, especially if the excluded data will be calculated by the post-cache operators (see following). Usually Shape data consumes the most storage. If particle shapes are defined by a post-cache operator then there is no need to keep the data in the cache files, as it will be disregarded anyway.
- Use Post-Cache Operators
- Lets you apply operators after the caching operation, so their actions are not stored in the cache. After turning this on, click Add By List to open a dialog that lists all behavior-affecting operators in the current flow, and then choose the operators from the dialog. Thereafter they appear in the Post-Cache Operators list.
Use post-cache operators to fine-tune the pre-calculated particle system. Sometime the majority of calculations are spent for particle movement (due to collisions with reference object, and possibly inter-particle collisions). In this case it is best to calculate the motion first and store it in the cache files. The other particle aspects (size, shape, color, mapping, orientation) can be calculated after caching, and applied later.
- Post-Cache Operators
- Lists the operators specified with Use Post-Cache Operators.
- Add By List
- Opens a dialog that lets you choose operators whose affects should be applied after the caching operation, so their actions are not stored in the cache.
- Remove
- Deletes any highlighted operators from the Post-Cache Operators list.
- Memory Limit
- For optimal performance, the Cache Disk operator keeps part of the cache in memory. This parameter determines the maximum size of the RAM cache. If the total cache size exceeds the Memory Limit value, the operator keeps only the most recent frames in RAM. Once the cache info for a particular frame becomes available, it is written on disk in the form of file with extension .pfc.
- Clear Memory
- Purges the RAM cache and forces the operator to get the cache data from files (if available) or recalculate it (if cache files are not available).
- Clear All
- Performs the Clear Memory function (see preceding) for all Cache Disk operators.