MAXScript Language Reference > 3ds Max Objects > Modifier : MAXWrapper and SpacewarpModifier : MAXWrapper > Modifier and SpacewarpModifier Types > Modifiers > Animation Modifiers >

# Point_Cache : Modifier

    Point_Cache - superclass: modifier; super-superclass:MAXWrapper - 7:0 - classID: #(655302627, 61950361)

Value > MAXWrapper > Modifier > Point_Cache

| Modifier Classes - Quick Navigation

In 3ds Max 9, the PointCache Modifier has been replaced with a version of the PointCache2 modifier previously available as a free plug-in. Its cache format has also been adapted to allow interchangeability with the new PointCache in Autodesk Maya for easier animation transfer between the two applications.

The documentation of the old PointCache Modifier in versions prior to 3ds Max 9 is provided at the bottom of this page for users developing scripts for earlier versions of 3ds Max.

Constructors

    Point_Cache...
    PointCache...

Properties

    <Point_Cache>.fileName String default: "" -- filename

Get/set the cache file name.

### Record

    <Point_Cache>.fileCount Integer default: 0 -- integer; File_Count

Get/Set the state of the file count radio buttons.

Possible values are:

0 - One File

1 - One File Per Frame

Available in 3ds Max 2008 and higher.

    <Point_Cache>.recordStart Float default: 0.0 -- float; Record_Start

Get/Set the cache record start time in Frames.

    <Point_Cache>.recordEnd Float default: 100.0 -- float; Record_End

Get/Set the cache record end time in Frames.

    <Point_Cache>.sampleRate Float default: 1.0 -- float; Sample_Rate

Get/Set the cache sample rate in samples per frame.

### Load Type

    <Point_Cache>.loadType Integer default: 0 -- integer; Load_Type

Get/Set the Load Type mode when using the Point Cache on a local workstation. Possible values are:

0 - Stream- Keeps the cache file open for fast access, but only loads a single frame at a time to conserve memory.

1 - Per-Sample- Opens the cache file, reads a single frame, and then immediately closes the file. This is slower than the stream load type, but is useful if you have many users reading/writing the same set of cache files since the cache files won't be locked open as you read from them.

2 - Pre-Load- Loads the entire cache file into RAM for very fast access, and then closes the file. Specifically useful for networks, or when a few caches are used by many objects in one scene (in which case, turning this on will prevent each object from thrashing the disk on playback). Be conservative in using this, as it can eat up RAM fast (though if one cache file is used by several objects, the cache will only be loaded into RAM once). See the pointCacheMan.GetUsedMemory() method for more info.

    <Point_Cache>.loadTypeSlave Integer default: 1 -- integer; Load_Type_Slave

Get/Set the Load Type mode when using the Point Cache on a network slave. Possible values are:

1 - Per-Sample

2 -Pre-Load

### Playback Options

    <Point_Cache>.strength Float default: 1.0 -- animatable; float

Get/Set the cache Strength. Default is 1.0. Lower values will influence the mesh less than the vertex positions stored in the cache file. Higher values will exaggerate the animation.

    <Point_Cache>.relativeOffset BooleanClass default: false -- boolean; Relative_Offset

Get/Set the state of the Relative Offset option.

When true, only the differences from the first frame of the cache are used to distort the current object. If you would record a cache, set this option to true, add another modifier below the cache and modify the mesh, the recorded deformations will be added on top of the new deformations. Similarly, if the original recorded modifiers are still enabled, the object will get a double deformation.

When false, the point positions in the cache file explicitly set the point positions of the current object, overriding any additional deformations below the cache.

    <Point_Cache>.applyToWholeObject BooleanClass default: true -- boolean; Apply_To_Whole_Object

Get/Set the state of the Apply to Whole Object option.

### Playback Type

    <Point_Cache>.playbackType Integer default: 0 -- integer; Playback_Type

Get/Set the Playback type. Possible values are:

0 - Original Range- This will always play back the cache over the range it was originally recorded (so the animation will always be the same as the original).

1 - Custom Start- This will play back the cache from a custom start time, but the animation length/playback speed will be the same as the original animation).

2 - Custom Range- This allows you to set a start and end frames that the current cache plays back within. Using a range that is smaller than the original record range will play the cache back faster, a larger range plays the cache back slower.

3 - Playback Graph- Allows you to animate which cache frame is played at any given time. For example, if you record a cache from frame 0 to 100, set this parameter to 0 at frame 0, and animate it to 100 at frame 100. The function curve of this parameter in trackview shows how the cache is played back. Animating this lets you do interesting effects like slowing a cache down over time, or ping pong the cache playback, etc.

    <Point_Cache>.playbackStart Float default: 0.0 -- float; Playback_Start

Get/Set the Playback Start value.

    <Point_Cache>.playbackEnd Float default: 100.0 -- float; Playback_End

Get/Set the Playback End value.

    <Point_Cache>.playbackFrame Float default: 0.0 -- animatable; float; Playback_Frame

Get/Set the Playback Frame. This value can be keyframes to control the playback when in Playback Graph mode.

    <Point_Cache>.clampGraph BooleanClass default: false -- boolean; Clamp_Graph

Get/Set the state of the Clamp Graph option. It controls what gets loaded when the playback graph frame is out of the original recorded range.

For example if the playback frame is set to 105, but the original cache was recorded from 0 to 100. With clampGraph set to true, the loaded frame will be 100. When set to false, the cache will "wrap around" and load frame 5. This way, you can loop caches more easily. In the example above, you could simply have a two key playback graph. Key 1 would be at frame 0 with a value of 0, and key 2 would be at frame 100 with a value of 100. Then you would set the out-of-range type for the graph to "linear extrapolate", and the cache would smoothly loop back to the beginning at frame 101.

The following properties are not exposed to the UI and are not fully supported:

    <Point_Cache>.applyMeshToSpline BooleanClass default: false -- boolean; Apply_To_Spline

This option is not exposed to the UI. It should not be used.

    <Point_Cache>.forceUncPath BooleanClass default: true -- boolean; Force_UNC_Path

Get/Set whether to force the cache path to UNC path or not. This option is not exposed to the UI.

    <Point_Cache>.interpolationType Integer default: 0 -- integer; Interpolation_Type

This option is not exposed to the UI. It should not be used.

    <Point_Cache>.playbackORTafter Integer default: 0 -- integer; Playback_Out_Of_Range_After

This option is not exposed to the UI.

    <Point_Cache>.playbackORTbefore Integer default: 0 -- integer; Playback_Out_Of_Range_Before

This option is not exposed to the UI.

    <Point_Cache>.preLoadCache BooleanClass default: false -- boolean; PreLoad_Cache

Get/Set whether to preload the cache when the scene is loaded. This option is not exposed to the UI.

## PointCacheMan Struct

    pointCacheMan.GetMemoryUsed()

Returns the memory used by Point Caches in the scene.

## cacheOps Struct

    cacheOps.DisableBelow <PointCacheModifier>

Disables all modifiers below the Point Cache modifier.

    cacheOps.EnableBelow <PointCacheModifier>

Enables all modifiers below the Point Cache modifier.

    cacheOps.RecordCache <PointCacheModifier>

Records the cache data of the given Point Cache modifier to disk.

    cacheOps.Reload <PointCacheModifier>

Reloads the cache data of the given Point Cache modifier from disk.

    cacheOps.Unload <PointCacheModifier>

Unloads the cache data of the given Point Cache modifier from memory.

Old Definition Prior To 3ds Max 9

## Point_Cache : Modifier

    Point_Cache - superclass: modifier; super-superclass:MAXWrapper - 7:0 - classID: #(567311073, 1221790700)

This is a simple point caching system. It lets you store modifier animation to a disk file that records only changes in vertex positions, and then play back the animation using the information in the disk file instead of the modifier keyframes. It caches the points of an object across time and then reads them from the disk on play back. It is useful when you have large intricate stacks that you want to speed up or modifiers such as flex that you want to bake.

This modifier sacrifices memory for speed, it stores 3 caches of the points to allow for fast reading from the disk. You can instance this modifier but the instances must have the same number of points, otherwise the results will be inconsistent. This also only records point position, it does not store mapping, topology changes etc. It also cannot deal with animated topology changes.

Constructors

    Point_Cache... PointCache...

Properties

    <Point_Cache>.time Float default: 0.0 -- float

    <Point_Cache>.start_time Float default: 0.0 -- float

The frame number at which the cached animation starts playing back. Using decimal fractions lets you start at a sub-frame setting when using a Frame:Ticks time display. Default=0.0.

Sets the first frame for recording the vertex animation.

    <Point_Cache>.end_time Float default: 100.0 -- float

Sets the last frame for recording the vertex animation.

    <Point_Cache>.samples Integer default: 1 -- integer

    <Point_Cache>.cache_file Filename default: undefined -- string

Loads a vertex animation from a cache file on disk into the Point Cache modifier. If number of vertices in the cache file does not match the number of vertices in the object, a warning appears, but no error occurs.

    <Point_Cache>.relativeOffset Boolean default: false -- boolean; Relative_Offset

Makes the Strength setting available. This enables offsetting the animated vertex positions relative to their positions as recorded. Default=off.

Note

: When you turn on Use Relative Offsets and play back a cached animation with the modifiers turned on, the cached vertex positions are calculated relative to their positions as calculated by the modifiers. For example, if you record a Bend animation to a cache file, and then play it back with both Use Relative Offsets and the Bend modifier turned on and Strength=1.0, all vertex positions are doubled, resulting in exaggerated motion.

    <Point_Cache>.strength Float default: 1.0 -- animatable; float

Affects the motion relative to the original animation. Available only when Use Relative Offsets is turned on. Default=1.0. Range=-10.0 to 10.0.

At 1.0, the animation plays back the same as recorded. With strengths between 0 and 1, the animation is relatively restrained. At strengths greater than 1, the animation is exaggerated. With negative Strength settings, the motion is reversed.

Point Cache Interfaces:

    Interface:pointCache

Methods

    <void>record()

Stores the vertex animation to a disk file.

Call Record to activate the Save Points dialog, which lets you specify a path and file name for the cache file.

Click OK to record the file, and then load it into the Point Cache modifier, ready for playback.

    <void>setCache()

Loads a vertex animation from a cache file on disk into the Point Cache modifier. If number of vertices in the cache file does not match the number of vertices in the object, a warning appears, but no error occurs.

    <void>enableMods()

Turns on all stack modifiers below the Point Cache modifier. Use this when you want to change modifier settings.

    <void>disableMods()

Turns off all the object's stack modifiers below Point Cache so that only the cached vertex animation appears when you play back the animation.

WSM component of Point Cache.

Point_CacheSpaceWarpModifier

Note

The WSM version is identical to the local space version except it records points in World Space and exists higher in the stack.

#### See Also

- Point_CacheSpacewarpModifier - superclass: SpacewarpModifier