Instance geometry to particles

 
 
 

Using Maya particle instancing lets you animate many identical objects in a scene. For example, you can use particle instancing to quickly create and animate a group of flying bugs where only the placement and orientation of the bugs differ. You can animate a single bug, then create instances of the bug’s geometry that move with the position and orientation of animated particles. You can also use nParticle per-particle attributes, such as per-particle rotations, with instanced geometry so that each object rotates individually.

Note

The following sections are also applicable to instancing geometry with nParticles.

Instances of geometry are not duplicates of an object, but are references (not file referencing) of the original object. Any changes you make to the original object also apply to the instanced objects. You can control the motion of the individual instanced objects by animating the per-particle attributes that control them. For example, you can use the nParticle rotation per-particle attributes for creating the realistic behavior of randomly moving objects, such flying debris in an explosion effect.

The instanced geometry object, called the source geometry, can be:

You can use object hierarchies instead of individual objects as the source geometry. Do not instance lights; they’ll have no effect in rendering.

Create animated instances

You can instance a single object to a particle shape or a sequence of objects to a particle shape.

Before creating the instance, you create the source geometry and apply shading groups to it. You can animate the source geometry and the particles either before or after instancing, and you can place the source geometry anywhere in the workspace. You can optionally hide it as described in the procedure. You cannot control the color of the instanced geometry on a per particle basis.

To instance a single object to particles

  1. Select source geometry.
  2. Shift-select the particle shape.
  3. Select Particles > Instancer (Replacement).
  4. To hide the source geometry, select the geometry and select Display > Hide > Hide Selection.

To instance a sequence of objects to particles

  1. Select the source geometry.
  2. Select Particles > Instancer (Replacement) > .

    The Particle Instancer Options window appears. The selected source geometry is listed in the Instanced Objects list.

  3. To instance different objects at different particles, include them all on the list.

    To instance a sequence of objects, list the objects in the order you want them to appear in the sequence.

    Use the Move Up and Move Down buttons to change the order of the objects. Use Add Selection if you want to add selected objects to the list. Use Remove Items to remove objects from the list.

    For example, suppose you create four birds in different flapping positions:

    • birdWingsHigh shows the wings over the bird’s head.
    • birdWingsMid shows the wings at mid position.
    • birdWingsLow shows the wings below its body.
    • birdWingsMidCopy, is a copy of birdWingsMid. This object is necessary so the wings cycle from low to high and high to low positions.

    An appropriate ordering for the objects in the Instanced Objects list is:

    0: birdWingsHigh 1: birdWingsMid 2: birdWingsLow 3: birdWingsMidCopy

    The number to the left of the object indicates the sequence position. The 0 indicates the first object in the sequence.

  4. From the Particle Object To Instance menu in the Particle Instancer Options window, select the animated particle object that the instances will follow.

    Note that you can use emitted particles as the animated particles. When the particles emit, the instanced geometry appears with the particles.

  5. Set the options as described in Particles > Instancer (Replacement), then click Create.

    Maya creates an instancer node that controls the instanced objects. This node is where you can alter the attribute settings you made in the Particle Instancer Options window.

  6. To hide the source geometry, select the geometry and select Display > Hide > Hide Selection.

    You might also choose to hide the particle object being instanced. The instancer doesn’t make the particles invisible. Note, however, that you don’t need to hide the particles if you will software render the animation. Particles don’t appear in software rendered images.

    Tip

    If you want to move the rotation pivot point of the source object, select the object and enter createInstancerPivot in the Command Line. Thereafter, when you manipulate the rotation pivot in the source geometry, the instanced geometry rotates the same. Maya reorients any animation you previously applied to the translate, rotate, scale, and shear attributes of the source object.

Rotate instanced geometry

If you are instancing geometry with nParticles, you can use rotationPP to rotate instanced geometry on a per-particle basis. The rotation per-particle attribute is automatically created on the nParticleShape node when Calculate Rotations is on. See Rotation in the nDynamics guide.

To rotate instanced geometry

  1. In the nParticleShape node Attribute Editor go to the Rotation section and turn on Compute Rotations.

    RotationPP is created on the nParticleShape node.

  2. Instance either a single object or sequence of objects as described in Create animated instances.
  3. In the Particle Instancer Options window or the nParticle Attribute Editor, set the following:
    • Turn on Allow all data types.

      This lets you use scalar attributes, such as radiusPP, to set vector attributes such as Scale.

    • In the Rotation Options section, select rotationPP from the Rotation list.
    • In the General Options section, select radiusPP from the Scale list.

      Selecting this ensures that your instanced geometry will be appropriately scaled to nParticle Radius. See Radius.

Aim instanced geometry

The following general procedure is a way to aim instanced geometry.

To aim instanced geometry

  1. Orient the geometry so the front points along the x-axis and the up-direction points along the y-axis.
  2. Group the geometry and instance the group.
  3. Set the AimDirection or AimPosition options to the direction you want the instanced objects to aim.

    For example, set Aim Direction to Velocity to aim the instanced objects in the direction of movement. See particleShape node for information.

    The choices in the General Options popup menus include all the per particle attributes. You can control the motion of the individual instanced objects by animating the per particle attributes that control them.

Command-line instancing limitations

The runup command may fail to create instanced geometry when rendering arbitrary frames in an animation. Adding a currentTime setting before the runup creates the instanced geometry properly; that is, if something like runup -mxf 60; does not create the proper results when rendering with instanced geometry, use:

currentTime -e 1; 
runup -mxf 60;

Particle instancing options