Point_Cache : Modifier

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

new.gif NEW 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 ...

Note: This class is not available in Autodesk VIZ.

Properties

.filename : filename

Get/set the cache file name.

 

.recordStart (Record_Start) : float

Get/Set the cache record start time in Frames.

.recordEnd (Record_End) : float

Get/Set the cache record end time in Frames.

.sampleRate (Sample_Rate) : float

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

 

.loadType (Load_Type) : integer

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.

.loadTypeSlave (Load_Type_Slave) : integer

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

1 - Per-Sample

2 - Pre-Load

 

.strength : 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.

.relativeOffset (Relative_Offset) : boolean

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.

.applyToWholeObject (Apply_To_Whole_Object) : boolean

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

 

.playbackType (Playback_Type) : integer

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.

.playbackStart (Playback_Start) : float

Get/Set the Playback Start value.

.playbackEnd (Playback_End) : float

Get/Set the Playback End value.

.playbackORTbefore (Playback_Out_Of_Range_Before) : integer

.playbackORTafter (Playback_Out_Of_Range_After) : integer

.playbackFrame (Playback_Frame) : float

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

.clampGraph (Clamp_Graph) : boolean

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:

.preLoadCache (PreLoad_Cache) : boolean

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

.forceUncPath (Force_UNC_Path) : boolean

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

.interpolationType (Interpolation_Type) : integer

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

.applyMeshToSpline (Apply_To_Spline) : boolean

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

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 ...

Note: This class is not available in Autodesk VIZ.

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