You can create nParticles in a scene in a number of ways. You can draw them on the grid, use an emitter to spawn them into a scene, use a surface as an emitter, or fill a volume with nParticles.
When you create an nParticle object, you also need to specify the nParticle’s style.
Choosing a style activates one of a number of preset settings for the nParticle’s attributes, all of which can be altered after you add the nParticle object to the scene. The nParticle styles include balls, points, cloud, thick cloud, and water.
The simplest way to create nParticles is to draw them on the grid using the nParticle tool, as follows:
1. Create a new scene in Maya. Switch to the nDynamics menu set.
2. Choose nParticles Create nParticles, and set the style to Balls (see Figure 13.1).
3. Choose Create nParticles nParticle Tool. Click six or seven times on the grid to place individual particles.
4. Press the Enter key on the numeric keypad to create the particles.
You’ll see several circles on the grid. The ball-type nParticle style automatically creates blobby surface particles. Blobby surfaces are spheres rendered using Maya Software or mental ray. Blobby surfaces use standard Maya shaders when rendered and can be blended together to form a gooey surface.
5. Set the length of the timeline to 600. Rewind and play the animation. The particles will fall in space.
6. Open the Attribute Editor for the nParticle1 object, and switch to the nucleus1 tab. The settings on this tab control the Nucleus solver, which sets the overall dynamic attributes of the connected nDynamic systems (see Figure 13.2).
Figure 13.1 Using the nParticle menu to specify the nParticle style.
Figure 13.2 The settings on the nucleus1 tab define the behavior of the environment for all connected nDynamic nodes.
7. By default a Nucleus solver has Gravity enabled. Enable Use Plane in the Ground Plane settings (Figure 13.3). This creates an invisible floor that the nParticles can rest on. Set the Plane Origin’s Translate Y to -1.
8. The Nucleus solver also has wind settings. Set Wind Speed to 3 and Wind Noise to 4. By default Wind Direction is set to 1, 0, 0 (Figure 13.4). The fields correspond to the x-, y-, and z-axes, so this means that the nParticles will be blown along the positive x-axis. Rewind and play the animation. Now the nParticles are moving along with the wind, and a small amount of turbulence is applied.
By increasing the Air Density value, you adjust the atmosphere of the environment. A very high setting is a good way to simulate an underwater environment. Using wind in combination with a high air density pushes the nParticles with more force; this makes sense since the air is denser.
The Solver Attributes section sets the quality of the solver. The Substeps setting specifies how many times per frame the solver calculates nDynamics. Higher settings are more accurate but can slow down performance. Increasing the Substeps value may alter some of the ways in which nDynamics behave, such as how they collide with each other and with other objects, so when you increase this value, be aware that you may need to adjust other settings on your nDynamic nodes.
The Scale Attributes section has Time Scale and Space Scale sliders. Use Time Scale to speed up or slow down the solver. Values less than 1 slow down the simulation; higher values speed it up. If you increase Time Scale, you should increase the number of substeps in the Solver Attributes section to ensure that the simulation is still accurate. One creative example of Time Scale would be to keyframe a change in its value to simulate the “bullet time” effect made famous in The Matrix movies.
Space Scale scales the environment of the simulation. By default nDynamics are calculated in meters even if the Maya scene unit is set to centimeters. You should set this to 0.1 if you need your nDynamics simulation to behave appropriately when the Maya scene units are set to cen- timeters. This is more noticeable when working with large simulations. You can also use this setting creatively to exaggerate effects or when using more than one Nucleus solver in a scene.
Most of the time it’s safe to leave this at the default setting of 1. For the following examples, leave Space Scale set to 1.
Figure 13.3 The ground plane creates an invisible floor that keeps the nParticles from falling.
Figure 13.4 You can find the settings for Air Density, Wind Speed, Wind Direction, and Wind Noise under the Nucleus solver’s attributes.