Set nParticle Lifespan

You can set a lifespan to eliminate nParticle from the scene when they reach the specified age. Lifespan is typically set on emitted particles. For example, you can use lifespan to fade out emitted smoke or fire. You can set the lifespan for all the particles or on a per-particle basis. By default, nParticles are set to live for the duration of the simulation. See nParticle Lifespan attributes. See also How particle Lifespan is calculated.

For information about setting per-particle Lifespan using an expression, see Work with lifespan.

Set per-object lifespan

Setting per-object lifespan assigns the same lifespan to all particles in the particle object. You can make particles live forever or make all particles die at the same age.

To make particles live forever

  1. Select the nPartiicle object and select the object's nParticlesShape node tab in the Attribute Editor.
  2. In the Lifespan Attributes section, set Lifespan Mode to Live forever.

To make particles die at the same age

  1. Select the particle object. and display.
  2. In the Lifespan Attributes section of the nParticleShape node Attribute Editor, set Lifespan Mode to Constant.
  3. Set Lifespan to the desired value.

    The Lifespan value is the number of seconds that the particle object exists after it is created. A particle object you create with the nParticle Tool is considered to be created immediately at the beginning of the first frame of the scene. An emitter particle is created when it is emitted. The default value of 1 makes the particle object disappear after one second.

    Tip: If your particles aren’t dying, make sure you haven’t set Lifespan to a large number—one that exceeds the time duration of the scene’s Time Slider.

Set per-particle lifespan

Setting per-particle lifespan assigns different lifespans to each particle in the particle object. You can make particles die at random ages, assign a lifespan to individual particles, or use an expression to control the lifespan.

To make particles die at random ages

  1. Select the particle object and display the Attribute Editor.
  2. In the Lifespan Attributes section, set Lifespan Mode to Random range.
  3. Set Lifespan to the desired value.
  4. Set Lifespan Random to the desired value.

    The lifespan is uniformly distributed with Lifespan as the mean and Lifespan Random as the width of the distribution.

    For example, if Lifespan is 3 and Lifespan Random is 2, then each particle will have a lifespan between 2 and 4.

    The random number stream for Random range lifespan mode is maintained inside the particle object and is automatically re-seeded when you rewind. You do not have to reseed it yourself.

  5. If you want to change the random number stream for random range lifespan, specify a value for General Seed.

    Normally, you don’t need to change this value. If you want two identical looking particle objects, you can set this value to match the other particle object’s General Seed value.

    Note: While Lifespan = 4, Lifespan Random = 2 is mathematically equivalent to the expression $lifespanPP = 3 + rand(2);, these two methods of setting lifespan will not give identical results because the random number streams are different.

To control lifespan of individual particles

  1. Select the particle object and display the nParticleShape node Attribute Editor.
  2. In the Lifespan Attributes section, set Lifespan Mode to lifespanPP only.
  3. In the Per Particle (Array) Attributes section, right-click the Lifespan PP data box and select Component Editor from the pop-up menu.
  4. Click (the Select by Component Type icon).
  5. In the workspace, select the specific particles you want to edit, and click Load Components.

    See Set particle attributes with the Component Editor for more information on using the Component Editor.

  6. Click the entry box for lifespanPP and enter a value.

To use expressions to control lifespan

  1. Select the particle object and display the Attribute Editor.
  2. In the Lifespan Attributes section, set Lifespan Mode to lifespanPP only.
  3. In the Per Particle (Array) Attributes section, Right-click the Lifespan PP data box and select Creation Expression or Runtime Expression (before or after dynamics calculation) from the pop-up menu.
  4. Create a creation or runtime expression to assign a unique value to each particle (see Expressions).

    Note that you cannot key this attribute or other per particle attributes.