tyCache Object

The tyCache object can be used to load tyCache or PRT files, which store particle data.

The tyCache (.tyc) format is a custom data format used to store tyFlow particle data. The PRT (.tyc) is a data format developed and authored by Thinkbox. PRT files can hold raw particle data with a variety of optional attributes. Both formats can be exported from Export Particles operators.


PRT Support

PRT file support is preliminary, and limited to a select number of channels. Multiple PRT partitions for a particular sequence will be automatically imported if detected (partition naming format: “[baseFilename]_partXXXofXXX_XXXXX.prt”).

Supported channels (not case-sensitive):

  • “id”: particle ID (unique identifier)

  • “position”: particle position;

  • “rotation/orientation”: particle rotation (quaternion)

  • “scale”: particle scale

  • “velocity”: particle velocity

  • “age”: particle age

  • “matid/mtlindex”: particle material ID

  • “color”: particle mapping channel 0

  • “texturecoord/texturecoord1”: particle mapping channel 1

  • “textruecoord2”: particle mapping channel 2

  • “texturecoord3”: particle mapping channel 3


tyCache Rollout

Sequence

  • Filename: choose a .tyc or .prt sequence to load. You can choose any single file from a sequence and the rest of the matching files will be loaded automatically.

Having “convert local file paths to relative” enabled in 3ds Max preferences can prevent tyCache files from loading correctly. If you are having issues with tyCache files loading, try disabling that setting first.

  • Clear this: clears particle data in the selected object and reloads the current frame.

  • Clear all: clears all particle data in all tyCache objects in the scene and reloads the current frame.

  • Preload this: loads all particle data for all timeline frames for the selected object.

  • Preload all: loads all particle data for all timeline frames for all tyCache objects in the scene.

Time

  • Frame offset: offsets the timing of sequence playback.

  • Clamp frame range: controls whether the input sequence frame range will be clamped.

  • Clamp range: define the clamped frame range of the sequence.

Out-of-range
  • Hold: requested frames outside of the clamp range will be set to the nearest frame within the clamp range.

  • Blank: requested frames outside of the clamp range will be empty/ignored.

  • Loop: requested frames outside of the clamp range will be set to loop within the clamp range.

In hold mode, a requested frame of 125 in a clamp range of 0-100 will be set to 100. In loop mode, a requested frame of 125 in a clamp range of 0-100 will be set to 25.

  • Round to nearest frame: prevents sub-frame evaluation. Can alleviate some rendering errors caused by changing topology.

When “round to nearest frame” is enabled, deformation motion blur will no longer occur.

Retimer

  • Enable retimer: controls whether playback will be controlled by the retimer frame value.

  • Retime type: controls whether the retimer affects playback frame or speed.

By frame
  • Frame: the retimer frame value that controls playback. Animate this value to control the current playback frame.
By speed
  • Speed %: the percent value that controls playback speed.

  • Ref Frame: the reference frame that the speed multiplier will be relative to.

Setting a proper reference frame is important for the speed multiplier. The reference frame should typically be the start frame of your playback sequence, not necessarily the start frame of the tyCache.

The equation for the speed retimer is:

playbackFrame = [referenceFrame + abs(time - referenceFrame) * speed * sign(time - referenceFrame)].


Coordinates

  • Local/Global: controls the coordinate system that the processed particles will be displayed in. Setting this to local means the loaded transforms will be displayed relative to the transform of the tyCache object.

Particle Scale

  • Multiplier: controls the global scale multiplier for particles.

  • X/Y/Z: controls the per-axis scale multiplier for particles.

Press the “>>” checkbutton to switch between scale modes.

  • Variation %: the per-particle percentage of variation to apply.

Uniqueness

  • Seed: the seed value for all varied parameters.

Memory

  • Keep frames in RAM: loaded data will be kept in RAM, for faster previews. Disable this to conserve memory.

Misc

  • Cache file enumeration: when enabled, tyCache objects will report all dependent cache files (*.tyc, *.max, etc) to 3ds Max when 3ds Max makes a dependent file request.

In most cases, this setting should be kept enabled, however, in situations where cache files are loaded/saved to a very slow network, enumeration can take a long time resulting in very slow Max file load/save times when tyCache objects are present in the scene. Disabling this setting should drastically improve load/save performance in those situations.


Elements Rollout

Enable tyCache Elements

  • Particles: load particle data from the input file sequence.

  • Deforming meshes: load deforming mesh data from the input file sequence.

tyCache files may contain both particle data and deforming mesh data. Deforming mesh data corresponds to the cloth/skin meshes of the originating flow.

Particle Processing

  • Sort particles by ID: sorts loaded particles by their ID.

When particle sorting is enabled, particle shapes converted to meshes will have properly ordered face/vertex indices (assuming particle count and particle mesh topology doesn’t change over time). This ensures that modifiers applied to the cache (which require temporally consistent topology) will function correctly. For caches that do not require mesh temporal consistency (ie, for caches that are rendered as instances, or for caches that have no modifiers placed on them), this setting can be disabled (and as a result, loading times will be reduced).

  • Track particle IDs: when enabled, the cache will have the ability to track particle birth/death across multiple cache frames.

When “track particle IDs” is enabled, an internal map is created for each particle that provides a quick ID-to-index lookup for the cache’s internal algorithms. This lookup allows the cache to check which frame(s) a particle is alive/dead on, and from those checks the cache can determine if verlet velocities can be extracted, if subframe transforms can be interpolated, and if birth/dead scaling is possible. Usually this setting should be left on, but in cases where you have a heavy cache that is not retimed and does not have birth/death scaling enabled, you can turn this off for a little extra performance boost and less per-frame memory usage.

ParticleObject Interface

  • Enable Particle Interface: controls whether the particle interface will be returned when the tyCache object is queried for its default interface. Returning this interface allows third-party plugins to query a tyCache for its particles.

  • Incl. legacy interface: when enabled, 3ds Max’s legacy particle interface (I_PARTICLEOBJ) will be enabled, as well as its modern interface (IParticleObjectExt).

Disabling the “incl. legacy interface” setting can improve compatibility with certain 3rd party plugins.

  • Prefer verlet velocities: when enabled, particle velocities will be calculated from a particle’s current position in relation to its position on the previous frame, when relevant previous frame data is available. When previous frame data is not available for a particle, its velocity value will fall back to whatever velocity value is stored in the cache for that frame.

Verlet velocities may more accurately reflect particle positional motion over time, but disabling “prefer verlet velocities” can improve performance where cache sizes are very large and “keep frames in RAM” is disabled.

Born/Deleted Particles

  • Subframe scale up: new particles will by scaled up from zero between the first and second whole frames of their life.

  • Subframe scale down: deleted particles will be scaled down to zero between the second last and last frames of their life.

  • X/Y/Z: the axis which will be scaled to/from zero.

Enable up/down scaling when slowing down tyCache playback with the retimer, to avoid jarring pops as particles appear or disappear.

If “subframe scale up” is enabled, particles will be scaled to zero (and therefore invisible) on their birth frame.


Material Overrides Rollout

The Material Overrides rollout allows you to define instance material overrides for all/some of the particles in a tyCache.

Instance materials are only visible at rendertime, on particles rendered as instances.

Cache

  • Load instance materials: controls whether instance materials exported from the source flow will be loaded (if available) onto render instances.

Instance material overrides

  • Enable material overrides: controls whether particle material overrides will be enabled.

  • Override list: the list of active overrides. Click an item in the list to change its settings.

Material override info
  • Material: the material that will be used to override particle instance materials.

  • Frequency %: the probability that a particular override will be chosen for applicable particles, relative to other override frequencies.

  • Override any particle: the override can affect any particle in the tyCache.

  • Override by ID: the override can only affect the particle with the matching ID.

  • Override by shape ID: the override can affect any particles with a matching shape ID.

The Display rollout has an option to display shape IDs in the viewport. Enable this setting to find the shape ID of a particular particle mesh you want to override.

  • ID: the specific ID to override.

Uniqueness

  • Seed: the seed value for all varied parameters.

Mesh Overrides Rollout

The Mesh Overrides rollout allows you to define mesh overrides for all/some of the particles in a tyCache.

Cache meshes

  • Import smoothing groups: controls whether smoothing groups of cached particle meshes will be imported. When disabled, all cache mesh face smoothing groups will be set to 0 (faceted).

Mesh overrides

  • Enable mesh overrides: controls whether particle mesh overrides will be enabled.

  • Render-time only: when enabled, mesh overrides will only be applied at rendertime.

  • Override list: the list of active overrides. Click an item in the list to change its settings.

Mesh override info
  • Object: the scene object whose mesh will be used to override particle meshes.

By selecting the head of a group object, all of its group member objects can be added to a single override. The group member chosen to override a particular particle will be picked at random, while still respecting the frequency settings of the override as a whole.

  • Frequency %: the probability that a particular override will be chosen for applicable particles, relative to other override frequencies.

  • Scale %: the scale multiplier applied to the override mesh.

  • Override any particle: the override can affect any particle in the tyCache.

  • Override by ID: the override can only affect the particle with the matching ID.

  • Override by shape ID: the override can affect any particles with a matching shape ID.

The Display rollout has an option to display shape IDs in the viewport. Enable this setting to find the shape ID of a particular particle mesh you want to override.

  • ID: the specific ID to override.

  • Treat as single mesh: when enabled, group heads and tyCollections chosen as the scene object will have their child meshes combined and treated as a single mesh for each particle’s mesh override. When disabled, a random child mesh of the group head or tyCollection will be chosen for each particle’s mesh override. This setting has no effect if the selected scene object is not a group head or tyCollection.

Uniqueness

  • Seed: the seed value for all varied parameters.

Culling Rollout

ID

  • Cull by ID: allows you to cull particles by their birth ID.

  • Invert: inverts the cull by ID operation.

  • ID List: the list of IDs to cull, separated by commas.

  • Cull by Nth ID: allows you to cull particles with a modulus operation (particles will be culled based on their ID order - every 2nd, 3rd, 4th, etc particle will be culled).

  • Invert: inverts the modulus operation, so that instead of every 2nd, 3rd, 4th, etc particle being culled, only the 2nd, 3rd, 4th, etc particles will remain.

  • Offset: offsets particle IDs by a specified value, shifting the modulus operation.

Material ID

  • Cull By material ID: allows you to cull particles by their material ID.

  • MatID: the material ID value.

  • Equal/Not Equal: determines whether particles will be culled if their material ID is equal to the specified value, or not equal to it.

Surface Area

  • Cull by surface area: allows you to cull particles by the surface area of their mesh.

  • Area: the surface area value.

  • Smaller/Larger: determins whether particles will be culled if their surface area is smaller or larger than the specified value.

Misc

  • Cull if no shape assigned: particles without an assigned shape mesh will be culled.

Simulation Groups

  • Simulation Groups: controls which particle simulation groups will be culled by the tyCache.

Export Groups

  • Export Groups: controls which particle export groups will be culled by the tyCache.

Volume

  • Cull by volume: allows you to cull particles by volume (cull depending on whether they’re inside or outside of a piece of geometry).

  • Inside/Outside: the volume culling mode. “Inside” will cull particles inside volume(s), “outside” will cull particles outside volume(s).

  • Object List: the objects to use for volume culling.

Camera frustum

  • Cull by camera frustum: allows you to cull particles by camera frustum (cull depending on whether or not they’re inside a camera’s view frustum).

  • Object List: the cameras to use for camera culling.

  • Expand: the amount of expand a camera’s FOV. Values larger than zero will preserve particles outside of the camera’s FOV.


Display Rollout

Display Cache Geometry

  • Display in viewport: controls whether loaded particles will be displayed in the viewport. Disabling this (as well as particle display) will prevent any data from being loaded outside of rendering, increasing viewport performance when loading a large number of particles.

  • Meshes/Bounding boxes: controls whether particles will be displayed in the viewport as full meshes, or bounding boxes. Depending on the resolution of the particle geometry, setting this to “bounding boxes” can dramatically increase viewport performance.

Acceleration
  • Use GPU instancing: controls whether particles are displayed as a single mesh, or as individual meshes instanced with the GPU. Enabling this setting will dramatically increase viewport performance if compatible hardware is found.

GPU instancing’s efficiency comes from the fact that no per-particle meshes need to be generated or combined for display. Since raw mesh data is sent directly to the GPU, tyCache objects themselves will contain no mesh data corresponding to what is displayed in the viewport. This means that while you will be able to see the particles in the viewport, you will not be able to see the effects of any mesh modifiers added to the tyCache object itself, since it contains no modifiable mesh data. If you need to see the effects of mesh modifiers in the viewport, GPU instancing must be disabled.

GPU instancing will only work with Nitrous viewport display drivers.

  • Ignore UVW overrides: Controls whether UVW (mapping) overrides on particles will be ignored.

Nitrous GPU instancing does not support UVW (mapping) overrides on instances. Therefore, if particles have active UVW overrides, instead of being instanced they will be combined into a single (potentially gigantic) mesh. Depending on the number of particles in the cache, this can eat up huge amounts of system resources. For example, a million identical particles with no mapping override can be sent to the GPU as a single mesh and a million transforms. But, a million particles with mapping overrides will be sent to the GPU as a million different meshes – something even the most powerful systems will have a hard time processing. By enabling “ignore UVW overrides”, mapping overrides on particles will be ignored for viewport display, maximizing the number of particles that can be efficiently instanced in the GPU. The drawback is that with “ignore UVW overrides” enabled, particle mapping channels will not have a visible effect on particle material display in the viewport.

Mesh Optimization
  • Simplify meshes: enabling this option will only display a subset of tyCache mesh faces in the viewport, for potentially faster viewport display.

  • Max faces: the maximum number of mesh faces to draw when simplification is enabled.

Display Cache Particles

  • Display particles: displays cached particles in the viewport as points

  • Display IDs: displays cached particle birth IDs in the viewport

  • Display shape IDs: displayed cached particle shape IDs in the viewport

Viewport Optimization

  • Display %: controls the percentage of loaded particles to display in the viewport.

Icon

  • Show icon: controls whether the tyCache icon is displayed in the viewport.

  • Icon size: controls the size of the tyCache icon.

  • Show name: displays the name of the tyCache next to its icon in the viewport.


Render Rollout

Rendering

  • Meshes: when enabled, particle meshes will be combined into a single mesh and rendered as full geometry.

tyCache objects set to render as meshes that contain a changing number of particles will not render with correct motion blur. This is due to the fact that changing particle counts will result in changes to the topology of the rendered mesh over time. The only way to ensure correct motion blur on particles is to render as instances (with a compatible renderer), or ensure that particle counts do not change over time.

  • Instances: when enabled, particle meshes will be sent to the renderer directly and any duplicates will be instanced.

Rendering as instances can vastly improve rendering speed and efficiency for any given group of particles. However, modifiers added to a tyCache object set to render as instances will not work, since the tyCache object will not return any modifiable mesh data for them to modify during the evaluation of the modifier stack. If you want to assign modifiers to a tyCache object, you must render as meshes, not instances.

  • Point Cloud: when enabled, all particles will be converted into isolated vertices in a single mesh.

Point Cloud mode allows you to render particles as raw points in a point-renderer like Krakatoa.

  • Render %: controls the percentage of loaded particles to render.

  • Enable VRay Interface: controls whether the I_VRAYGEOMETRY interface will be returned when the tyCache object is queried by VRay for its VRay-compatible interface.

  • Pre/post render refresh: controls whether tyCache will send reset notifications to objects which depend on it (before and after rendering), if its viewport display is not necessary identical to its render output.

A tyCache has several ways to display its data in the viewport (Mesh vs GPU instances, Display %, etc). These methods may not align with its rendered representation. Because of this, a tyCache will send reset notifications to Max telling Max that it has changed and needs to be updated before and after rendering. Normally, this ensures that the tyCache’s viewport representation remains consistent and its render meshes are not displayed in the viewport after rendering completes. However, because a tyCache has no way of knowing the manner in which other objects reference it, it is pretty liberal in how it determines whether or not to send the reset notifications (to ensure maximum compatibility), and sometimes these notifications are technically unnecessary. Not only are they sometimes unnecessary, but if you have a tyFlow object that depends on your tyCache object (ex: the tyCache is the input object in a Birth Flow operator), the reset notifications will cause your tyFlow to refresh its simulation when rendering begins or ends, which can undesirable. This setting allows you to disable the reset notifications, thereby avoiding that potentially unwanted behavior.