Lesson 2: Adjusting nParticle attributes
 
 
 

nParticle object attributes determine the physical characteristics of all the nParticles belonging to the object. These attributes affect how the nParticles look and how the nParticle objects move and collide with other Nucleus objects. If you create an emitted nParticle system, the emitter attributes also affect the overall characteristics of your nParticle simulation.

Lesson setup

To ensure the lesson works as described, do these steps before beginning:

  1. Open the scene file named Smoke_Simulation_2.mb.

    This file can be found in the GettingStarted directory that you set as your Maya project:

    GettingStarted/nParticles/Smoke_Simulation_2.mb

    This scene includes textured models that have been created for you. The desk, ashtray, and cigarette provided are all polygon meshes.

Moving the nParticle emitter

When you play back the simulation, you notice that nParticles are being emitted at the scene origin. In this lesson, you move the emitter so that the particles are emitted from the tip of the cigarette.

To move the nParticle emitter object

  1. In the Outliner, select the Emitter_Smoke1 object.
  2. Select Display > UI Elements > Channel Box/Layer Editor to display the Channel Box.
  3. In the Channel Box enter the following values:
    • Translate X: 49.3
    • Translate Y: 120
    • Translate Z: -27.3
    • Rotate Y: -90
    • Scale Z: 1.5
  4. In the scene view, dolly and tumble so that you get a close-up view of the cigarette's tip.

    The nParticle emitter is now positioned at the tip of the cigarette.

  5. Play back the simulation.

    nParticles are emitted from the end of the cigarette and into the scene. The size and color of the nParticles are currently set to default values. In the next section you set nParticle size to give the particles the appearance of smoke.

Editing Lifespan and Radius

When you play back the simulation, you notice that the nParticles are not dissipating into the air as smoke would. This is because the nParticles lifespan is not yet defined. Using the nParticle Lifespan attributes you make the nParticle disappear from the scene after they reach a specified age. You can set the nParticle object’s size according to its lifespan so that nParticles decrease or increase in size as they age.

To set nParticle Lifespan

  1. In the Outliner, select nParticle1.
  2. In the Attribute Editor, click the nParticleShape1 tab.
  3. In the Lifespan section, select Random range from the Lifespan Mode list.
  4. Play back the simulation.

    The nParticles now die (disappear from the scene) shortly after they are emitted into the scene. nParticle Lifespan is measured in seconds, meaning that at a Lifespan of 1.0, the nParticles die after one second.

  5. Set Lifespan to 10.
  6. Rewind the simulation and then play it back.

    The nParticles die 10 seconds after they are emitted into the scene. For this tutorial, set Lifespan to 20.

  7. To add some randomization to the nParticle’s Lifespan, set Lifespan Random to 15.
  8. Rewind the simulation and play it back.

    The nParticle die off more randomly, but the nParticle object is not dense enough to look like smoke. You can make your nParticle object denser by increasing the nParticle Radius.

For a smoke simulation, the nParticles must gradually disperse as they rise in the air. You can use the Radius Scale ramp to increase the radius of each nParticle as they age, which creates the effect of smoke dispersing until it gradually disappears from the scene.

To set nParticle Size

  1. In the Particle Size section, set Radius to 1.0.
  2. In the Radius Scale section, click anywhere in the ramp to create a new point.

    Creating a new marker allows you to set a Selected Value and Selected Position. Selected Values specify the scaling value of the input attribute at the Selected Position. For example, each Selected Value specifies a scaling value for the nParticle object's Radius attribute. By default ramps define a scaling value of 1, meaning that only one mark exists on the ramp and that marker represents an attribute scaling factor of 1. Setting a selected position to 0.5 sets per-particle radius to half the Radius value.

  3. For the first marker in the ramp, set Selected Position to 0, and Selected Value to 0.50.
  4. Click the second marker in the ramp. Set Selected Position to 1, and Selected Value to 1.5.

  5. To map the nParticles Radius to the nParticles’ age, set Radius Scale Input to Normalized Age.

    When Normalized Age is used, per particle radius is mapped within the range of the nParticle object’s lifespan.

  6. Set Interpolation to Smooth for each marker in the ramp.
  7. Play back the simulation.

    You can continue to adjust the per-particle radius by adding more markers to the curve, or optimize the ramp’s values as the simulation plays back.

  8. To add randomization to the per-particle radius, set Radius Scale Randomize to 0.25.

Setting nParticle Shading attributes

To color the nParticles so they look like smoke, you use the Color ramp to specify a color gradient for the smoke. In addition, you adjust Opacity to help produce the effect of the smoke disappearing into the air as the nParticles age.

Like the nParticle Radius attribute, Color and Opacity can be set on a per nParticle object or per-particle basis. Using the nParticle objects's Shading ramps, you can map per-particle Color and Opacity to nParticle properties such as particle Age, Particle ID, and Radius.

To set nParticle Color attributes

  1. In the Outliner, select nParticle1.
  2. In the Attribute Editor, click the nParticleShape1 tab.
  3. In the Shading section, scroll to the Color section.
  4. To set the color of the nParticles when they are first emitted into the scene, click the ramp’s far left marker (at Selected Position 0), and then click the color swatch beside Selected Color.

    The Color Chooser appears.

  5. In the Color Chooser, choose a medium shade of grey, or use type the following color values into the HSV (Hue-Saturation-Value) fields:
    • H: 0
    • S: 0
    • V: 0.5

    Play back your simulation while you are choosing colors so you can see how the colors look while the nParticle are animated.

  6. To set the color of the nParticles when they continue to age, click the ramp’s far right marker (at Selected Position 1.0), and then click the color swatch beside Selected Color.

    The Color Chooser appears.

  7. In the Color Chooser, choose a shade of grey that is darker than the color you previously selected or type the following color values into the HSV (Hue-Saturation-Value) fields:
    • H: 0
    • S: 0
    • V: 0.25
  8. Set Color Input to Normalized Age.

    As each nParticle ages from its birth (emission), its color changes from the color specified by the left marker to the one specified by the right marker.

  9. To improve the way that the nParticles’ colors blend as they age, do the following:
    • Set Interpolation to Smooth for each marker.
    • Set Color Randomize to 0.75.

    When you play back the simulation, you notice that the smoke is too dense and heavy to resemble cigarette smoke. To make the smoke look thinner, you adjust the nParticle Opacity.

To Set nParticle Opacity

  1. In the Opacity Scale section, click in the ramp, and set an Opacity ramp by setting the following three markers:
    • Selected Position: 0, Selected Value: 1
    • Selected Position: 0.63, Selected Value: 0.22
    • Selected Position: 1, Selected Value: 0
  2. Set Interpolation to Smooth for each marker.
  3. Set Opacity Scale Input to Normalized Age.

  4. Play back the simulation.

Beyond the lesson

In this lesson you learned how to:

For more information and related techniques about nParticles, refer to the Maya Help.