# Freeze selection

This modifier can be used to preserve a particle selection over time. At the time the modifier is first inserted into the modification pipeline, it records the current selection state of all particles. During an evaluation of the modification pipeline, it will subsequently override any other selection state (generated by preceding modifiers in the pipeline) with its stored selection set. Thus, this modifier allows to freeze a particle selection state that, otherwise, would change with animation time.

## Usage example

A typical application of this modifier is to make the motion of (tracer) particles visible. For this, one first selects the group of tracer particles (for instance, using the Slice modifier, which allows to select particles within a thin slab). This initial selection is performed at the first frame of the simulation. One then applies the Freeze selection modifier to preserve this selection for all times. When jumping to a different simulation frame, the same set of particles remains selected, independent of where the tracer particles have moved.

Hint: If you want to preserve an arbitrary particle property over time (and not just the selection state), you can use the Freeze property modifier.

## Implementation note

The modifier can store the selection of particles in two ways: It either keeps a list of selected particle indices or a list of particle identifiers.

Index-based selection mode | Identifier-based selection mode
--- | ---
In this mode, the modifier stores a Boolean value for each particle index indicating the selection state. The number of input particles and their storage order must not change. Otherwise the modifier cannot apply the stored selection state to the particle dataset or may even assign it to the wrong particles. | This selection storage method is preferred and will automatically be used when the input dataset contains particle identifiers. The modifier stores the identifiers of all selected particles. When the modifier applies the stored selection state to the input particles during an evaluation of the modification pipeline, it checks for each input particle if its identifier is contained in the stored selection set. Note that this selection mode requires that particles have unique identifiers.