Edit goal attributes
 
 
 

The following sections describe how to edit attributes to tune the effect of goals on trailing particle and nParticle objects.

Set goal weights on a per-object basis

When you add a goal to an object, Maya adds a corresponding goal weight attribute to the trailing particle object. The goal weight sets how much all particles of the trailing object are attracted to the goal. You can set the goal weight before you create the goal using the Goal options window, or you can adjust the goal weight afterwards using the Attribute Editor.

You can set goal weight to a value between 0 and 1. A value of 0 means that the goal’s position has no effect on the trailing particles. A value of 1 moves the trailing particles to the goal object position immediately.

A value between 0 and 1 causes the particles to move toward the goal as if bound to it by an elastic spring. The closer to 1, the faster the trailing particles settle at their final position. The goal weight value is 0.5 by default.

TipTo make the trailing particle object follow the goal object with less oscillation, set the trailing particle object’s Conserve attribute to a value less than 1, for instance, 0.8. A value of 0 prevents oscillation.

You can turn the effect of a goal object off or on without setting goal weight. With the trailing particle object attributes displayed in the Attribute Editor, turn off the Goal Active attribute associated with the goal object.

To display the Goal options window:

  1. Select Particles > Goal > . The attributes in this window affect goals you create after you change an attribute setting.

To change the goal weight in the Attribute Editor

  1. Select the particles (or soft body particles) affected by the goal.
  2. Display the Attribute Editor.
  3. Open the Goal Weights and Objects section.

    The goal weight is next to the name of the goal object. Change this weight to apply to the entire object.

    (If you change any of the per-particle settings, this goal weight will no longer apply.)

    If the particle object has multiple goal objects, you’ll see a goal weight section for each object.

    Tip

    In the Channel Box, the goal weight for the first goal object you added is Goal Weight[0]. The second is Goal Weight[1] and so on.

Set goal weights on a per-particle basis

For more control of trailing particle motion, you can tune the goal weight on a per particle basis. The per particle goal weight is controlled by the trailing object’s Goal PP attribute.

The per-particle Goal PP attribute is used for every goal object connected to the particles. By default, the Goal PP attribute has a value of 1 for each particle.

Warning

When using goalWeightPP, (a goal-specific per-particle goal weights attribute) on particle systems attached to an emitter, ensure that the goalWeightPP attribute values are initialized in the particle's creation expression, otherwise undesirable particle dynamic behavior will result.

Tip

Using the Paint Soft Body Weights Tool, you can set goal weights on a soft body on a per particle basis by painting on the soft body surface (see Paint Soft Body Weights Tool).

To set per particle goal weight

  1. Select the trailing particle object and display the Attribute Editor.
  2. Locate the Goal PP attribute in the Per Particle (Array) Attributes section of the Attribute Editor. See Set attributes on a per particle basis for details on how to set per particle attributes.

    The Goal PP value is multiplied by the per object goal weight to create the total goal weight for each particle.

    For example, if you have a per object goal weight of 0.5 and you add a per particle goal weight of 0.5 to some of the particles, the total goal weight of those particles is 0.25. If you have a second goal object and the corresponding per object goal weight is 0.1, the total goal weight of the particles is 0.05.

    Note

    If you create a ramp on goalPP, the ramp is mapped over the lifetime of the particles; it’s not mapped over the surface of the goal object. In addition, you cannot texture goals according to emission.

Set goal weights on a per-particle, per-object basis

For each goal object associated with a particle system, Maya provides a Goal Weight value that determines how strongly the particles will be attracted to that object. The basic per-particle Goal PP attribute can be used to diminish the overall effect of goal forces on each particle, but it cannot be used to selectively change the influence of a particular goal object on a particular-particle independently from other particle-object interactions—to make this change, you need to use dynamic attributes that will allow you to specify per-particle goal weight values for a particular goal object. These attributes are useful for creating varying goal attractions within a particle system to one goal object.

The dynamic attribute goalWeightNPP provides per-particle goal weights for the Nth goal object. Goal objects are numbered according to their indices in the particle system's sparse goalGeometry array. This ensures that per-particle goal weights will be preserved while goal objects are being added to and removed from the particle system. If no per-particle goal weight is found for a particular goal object, then the standard goal weight value for that object (specified by the slider next to the object's name in the particle Attribute Editor) is applied to all particles.

To set up per-particle goal weight attributes

  1. Ensure that you’ve created a goal for an object to which the particles are attracted. (Particles > Goal). For more information, see Create goals in the Dynamics guide.
  2. In Component mode, select the individual particles for which you’d like to edit per-particle goal weights.
  3. In the particle system node of the Attribute Editor, go to the Goals Weights and Objects section and click the Create goalWeightNPP button for the desired goal object.
  4. Do one of the following to open the Component Editor:
    • Go to the Per Particle (Array) Attributes section, right-click the empty box next to the corresponding Goal Weight N PP attribute and select Component Editor from the pop-up menu.
    • Select Window > General Editors > Component Editor.
      TipIf the goalWeight columns do not appear, in the Component Editor menu select Options > Hide Zero Columns (to show zero columns).

      Until you play the simulation, the values will be zero.

  5. Play the simulation. Optionally stop at certain frames and edit the goalWeight values in the Component Editor.

To turn off per-particle goal weight attributes

  1. In the particle system node in the Attribute Editor, go to the Goals and Weights section and click the Delete goalWeightNPP button for the desired goal object.

    Now the particles take on the goal weight defined for the system, not the particular particle.

Examine goal point data per particle

After you’ve created goal objects, you can add several per-particle dynamic attributes to the particle node. When the particle system is being attracted to goal objects, these attributes are filled with data about the specific point on each goal object to which each particle is being attracted. You can view this information in the Particles tab of the Component Editor. While you cannot change this information (you can edit it, but the values will be replaced once you re-run the simulation), you may find it useful for run-time particle expressions. For example, you can change the particle color so that the color intensifies as it approaches the goal object.

Since a particle system can have multiple goal objects, these new attributes are numbered to indicate to which goal object their data corresponds to. Goal objects are numbered according to their indices in the particle system's sparse goalGeometry array. This strategy ensures that these per-particle attributes do not change their meanings as goal objects are added to and removed from the particle system.

Note

These attributes do not support animated UVs. If the UVs on a goal object are animated, the tangents generated will correspond to the original UV parameterization. Adding a slight deformation or control point animation to the mesh will trigger a refresh of the mesh data at every frame, thereby working around the problem.

Many different types of objects can be used as goal objects for particle systems in Maya, but tangents and normals are only properly generated for NURBS surface and polygon surface goal objects. NURBS curves, other particle systems used as goal objects, or other control-point-based primitives will not generate proper normals and tangents.

To set up goal point data per-particle attributes

  1. Ensure that you’ve created a goal for an object to which the particles are attracted. (Particles > Goal) For more information, see Create goals in the Dynamics guide.
  2. In Component mode, select the individual particles for which you’d like to view goal point per-particle attributes.
  3. In the particle system node of the Attribute Editor, go to the Goals Weights and Objects section and, for the desired goal object, click the Create button next to the desired Goal Point attribute (Position, Normal, Tangent U, Tangent V).
  4. Do one of the following to open the Component Editor:
    • Go to the Per Particle (Array) Attributes section, right-click the empty box next to the corresponding goalWorldNPP attribute and select Component Editor from the pop-up menu.
    • Select Window > General Editors > Component Editor.
      NoteIf the goalWorld columns do not appear, in the Component Editor menu select Options > Hide Zero Columns (to show zero columns).

      Until you play the simulation, the values will be zero.

  5. Play the simulation. Optionally stop at certain frames and view the goalWorld values in the Component Editor.

To turn off goal point data per-particle attributes

  1. In the particle system node in the Attribute Editor, go to the Goals and Weights section and, for the desired goal object, click the Delete button next to the Goal Point attribute.

Specify NURBS or polygonal UV positions for goals

When you use the CVs of a NURBS or polygonal surface as a goal, the trailing particles move directly to the CVs. The CVs, however, are usually positioned at distant or undesired positions. You can make the particles move more directly or evenly to the surface by adding and setting the predefined goalU and goalV attributes of the trailing particle object’s shape node. These per particle attributes set exact locations on a NURBS or polygonal surface where the particles are attracted.

You can also add and set the predefined goalOffset attribute to more conveniently accomplish similar results (see Specify an offset to goal positions).

If the trailing object has multiple goal objects, the same per particle U and V values are used for each goal object.

If the attributes don’t specify a valid position on the object, the closest position on the surface or curve is used as the goal position instead. A position is invalid if it is out of the object’s U and V range or it’s on a part of the curve or surface that you’ve trimmed. To ensure the closest point is used, specify a value of -1.

See Add dynamic attributes for details on adding attributes. You can set the value of these attributes with an expression, MEL script, or other attribute editing technique.

Work with polymesh goal objects

When per-particle goalU/goalV attributes apply to polymesh goal objects, you specify particular points on the goal mesh surface to which particles will be attracted. Animation of goalU/goalV values, as well as the goal object and its UV coordinates, is fully supported.

For each polymesh object, a UV Set control appears to let you decide which UV set to use when determining the goal position of a particle given its goalU/goalV values.

Since UV mappings on polymesh objects are arbitrary, it is possible that a given goalU/goalV pair may map to more than one point on the goal surface. If there are multiple potential goal points for a particle, Maya selects the point that is closest to the particle’s current position in world space, and uses that as the goal position. This decision is recomputed at every frame, so if the particle moves closer to one of the other potential goal positions, the particle will be attracted to that goal position instead of the original goal position.

Similarly, it is also possible that no point on the object matches the specified goalU/goalV values for a particular particle. In that case, the mesh vertex that is closest in UV space to the specified goal point is used. This decision is updated at every frame.

Note

For polymesh goal objects, if a particle’s goalU/goalV values are not present on the goal surface (that is, they are unmapped), the particle is attracted to the vertex nearest to the specified values. This may lead to the particle hopping between vertices of the mesh if the goal UV values are animated through unmapped space.

Specify an offset to goal positions

If you add the predefined goalOffset attribute to the trailing particle object’s shape node, you can set an offset to the world space position of the goal object. For example, if you have particles moving towards a goal that consists of a curve’s CVs, the offset directs the particles to each CV plus the goalOffset. The goalOffset attribute is a per particle vector attribute.

See Add dynamic attributes for details on adding attributes. You can set the value of this attribute with an expression, MEL script, or other attribute editing technique.

Tip

To create an evenly distributed attraction to an object with symmetrically positioned CVs, use a sphrand( ) function in an expression to assign random values to goalOffset.