# Freeze property

This modifier takes a snapshot of the current state of a per-particle property. It subsequently writes the stored values back to the selected particle property, overwriting any existing (time-dependent) values. Thus, this modifier can be used to freeze a particle property that, otherwise, is changing with simulation time.

The modifier automatically takes a snapshot of the current state whenever the user selects a new source property for the modifier. The snapshot is always taken at the current animation time. You can explicitly take a new snapshot by clicking the Take new snapshot button.

By default, the property values saved by the modifier are written back to the same property from which the snapshot was taken, overwriting the current values. If you want to preserve the current values, you can let the modifier write the stored snapshot to a new property by entering a different name into the Output property field. Then you will be able to access both the current values and the ones from the snapshot.

## Example 1

Initial frame: | Without Freeze Property modifier: | With Freeze Property modifier:

The first picture shows the initial frame of a simulation sequence where the Color coding modifier has been used to color particles according to their X coordinate. During the simulation the solid is sheared and particles move (second picture). If we look at an individual particle, its color varies with time, because its X position changes and the Color coding modifier re-assigns a new color on every simulation frame.

To suppress this dynamic updating of particle colors, we can use the Freeze property modifier. It allows the take a snapshot of the particle colors in the initial frame. Subsequently, it will overwrite any new colors generated by the Color coding modifier with its stored colors (third picture). Thus, the Freeze property modifier allows us to "bake in" a particle property such as color so that it stays constant.

## Example 2

The modifier is also useful if we want to compare per-particle properties that change over time with their initial values at the beginning of a simulation. Let's suppose, for instance, we want to determine the amount by which the charge of each particle changes during a simulation. We assume in this example that the current particle charges have been computed by our simulation code for each simulation frame and that they are stored in the particle property "Charge".

We can use the Freeze property modifier to take a snapshot of the initial particle charges at frame 0 by setting Property to freeze to "Charge". Since we don't want to overwrite the current charge values with the initial ones, we set the modifier's Output property to "InitialCharge". This will make the modifier write its stored values to a new property named "InitialCharge".

Finally, we can use the Compute property modifier to compute the difference between the particle properties "Charge" and "InitialCharge" at each frame of the simulation sequence.

## Implementation note

This modifier requires that the number of particles does not change between frames.

If available, the modifier makes use of particle identifiers to handle a changing particle order. That means it is okay if the storage order of particles changes between frames as long as each particle has a unique ID assigned that does not change over time. The modifier will correctly assign the stored property values to the right particles.