Some notes on caches and caching.

This section needs to be updated to reflect the new Time Independent and Post-Cache options in TP 6.8+

Pressing ESC to Cancel a Cache

There is a critical difference between pressing ESC ONCE vs HOLDING IT DOWN until the cache cancels.

Pressing ONCE and confirming a cancel: ALLOWS the .mat to be written out.

Holding ESC down until cancel: PREVENTS the .mat from being written.

Instanced Caches

You can use the Size of an emitter particle to affect the size of the playback cache.

Hierarchy Record

The Hierarchy Record window only shows dynamic sets where the cache file path is set.

Master vs Dynset Caching

With Master Dynamic you can move back and forth and also frame jumps are possible - no simulation is done, so interaction is very fast.

Dynamic set cache will be used in simulation, so it will be called like a operator during simulation, therefore move back triggers TP to recalculate the whole simulation from start to the new frame, or when moving from the last to the new frame. The behavior is the same without cache - the difference being the particle manipulation doesn't come from the underlying operators but from the cache.

Smoke channels

The cache can only write data from a particle that is globally known.

The key value is Temperature, which the renderer then gets info from TRanges - so this is the only value to cache with the particle.

When Temperature is cached, you can change the rendered look post-cache.

Cache Hierarchy

There is a new Maxscript function “RecordCacheHierarchy” with the a Progress function parameter option.

The Progress function gets the percentage along the timeline, and the Max "frame memory time elapsed time".

It is also possible to cancel the record with the return value.

Active re-records all caches in play mode (active).

Stopped cache are always ignored,

Invalid re-records active caches where something changed under this dynamicset, colored with the invalid color to mark,

Selected re-records the caches selected in the treeview (also inactive caches), with the control key you can multi select caches.

Inactive caches are colored darker than active.

The order in the list is the hierarchical record order from inside to out side.

The Active mode should work without checking, checking (selecting) deals with the “Selected” mode only.

Active mean record all caches in playback mode (active) colored in light green (valid) or red (invalid, the schematic has changed since the last record), caches in stop (simulation) position colored in dark green or red are always ignored in “Active” and “Invalid” mode!

Caching meshes

The problem are the meshes, in .tps when the particle mesh is static it will be write only one times, in .tpc it will be write per frame, so a single frame is a complete image and can exist alone. 

If you cache a master dynamic it open the file an jump from one time sample to the next till he find the proper time sample in the file and then he reads the particle data from there. In the particle data is a reference (position in the cache file) where the mesh is saved. In any time sample before where the mesh is set the last one.

Dynset Caches

Dynamicset caches work like a generator operator, tp make normal simulation steps, the Dynamic cache replaced only the circuit under the cache!

The master cache can step direct to a time without simulation, dynamic set cache is a normal simulation, only forward subsample per subsample and when the next time is smaller than the last time the simulation will reseted an starts a new simulation from 0 (start time) to the adjusted frame.

Offsetting Caches

Like many things in TP, think the opposite of normal! NEGATIVE offset values (e.g. -100) mean you want to play AHEAD in the cache. Imagine sliding the TP cache -100 frames to the left. What used to play at frame 100 now plays at frame 0.

POSITIVE offset values (e.g. 100) mean you want to DELAY the start of the cache. Imagine sliding the TP cache forward over the timeline, so TP's cache frame 0 will not appear until timeline frame 100. Dumb, but it works.

ALSO – set the dynset “Out of Range Hold Particle” type to “«»” to keep particles visible before/after the cache starts/ends (else TP will display no particles!)

Pressing ESC to cancel a cache

There is a critical difference between pressing ESC ONCE vs HOLDING IT DOWN until the cache cancels. Pressing once and confirming a cancel: ALLOWS the .mat to be written out Holding ESC down until cancel: PREVENTS the .mat from being written.

Resuming Caches

There is a way to continue a TP cache. If you cached up to frame 100 and now want to continue to frame 200, you can try the following in the new dynset branch:

1) make a rule that captures the Velocity and Spin of particles on frame 100

2) on frame 101 apply the Velocity and Spin to the particles

3) setup the rest of your rules for the new cache, include any forces or collisions, etc. These must be re-created.