Set Particle Sampler Info node attributes

 
 
 

The Particle Sampler Info node attributes provide all the functionality of the old particle color mapper, transparency mapper, incandescence mapper, and age mapper. See Particle Sampler Info node.

To set the Particle Sampler Info node attributes

  1. Select the particle shape and display the Attribute Editor. Click the particleSamplerInfo tab.

    The particle shape Attribute Editor includes a tab for each Particle Sampler Info node associated with that shape. The two sections in the Attribute Editor: Common Read-Only Attributes and More Read-Only Scalar Attributes list the attributes that the node knows about by default. You can also use your own user-defined attributes.

  2. You can set the attributes.

Re-use a Particle Sampler Info node

In most cases, you need to make a new Particle Sampler Info node only the first time you want to map attributes for a particular shading node. If you decide later that you want to map another attribute, you can re-use the existing Particle Sampler Info node.

By reusing the Particle Sampler Info node, you can reduce clutter. However, if you want different attribute settings for different purposes, you can use more than one Particle Sampler Info node.

To re-use a Particle Sampler Info node

  1. Select Window > Rendering Editors > Hypershade.
  2. In the Hypershade, under Maya, select Utilities then Particle Sampler.
  3. To make connections on the node, in the HypershadeWork Area do one of the following:
    • Middle-mouse-drag the node on top of the shading node.
    • Middle-mouse click the node and from the pop-up menu, select the listed connection, Default or Other.

      If you select Default or Other the Connection Editor appears to let you make the desired connections.

    Tip

    If you are not sure which Particle Sampler Info node goes with which shader, put the shader in the workspace and use Graph | Up and Downstream Connections to display the associated utility nodes.

Add user-defined attributes

To use any of these attributes, you must add an attribute of the identical name and type to the particle shape.

You cannot add attributes of arbitrary names and use them with the Particle Sampler Info node. However, you can assign the value of any of your attributes to the one that the particle sampler info node recognizes, using an expression.

To add a user-defined attribute

  1. Create an emitter.
  2. Display Attribute Editor and select Attributes > Add Attributes.
  3. Click the Particle tab in Add Attribute window.
  4. Scroll down the list and select a userScalar#PP or userVector#PP attribute. Click Add.

Example 1

Suppose you want to make the particles more noisy the further they are from the origin. To do this you would animate the noise parameter of the shader as a function of the magnitude of the particle’s position vector.

  1. Create an emitter.
  2. Select the particle shape and set the Particle Render Type to Cloud(s/w).
  3. Display the Attribute Editor and select Attributes > Add Attributes.
  4. Click the Particle tab in Add Attribute window.
  5. Add the userScalar1PP attribute to the particle shape.
  6. Assign it a value with this runtime expression (before or after dynamics calculation):
     userScalar1PP = mag(position);
    
    Tip

    Although this example uses an expression to achieve its effect. you can use a ramp to animate userScalar1PP.

  7. Select the particleCloud1 tab in the particle Attribute Editor.
  8. Click the (map) button next to the Noise attribute.

    The Create Render Node window appears.

  9. In the Create Render Node window, under Maya, click Utilities.
  10. In right panel, click .

    The Connection Editor appears.

  11. In the left column of the Connection Editor, select userScalar1PP and in the right column, select Noise. Click Close.

    This connects the Particle Sampler Info node’s User Scalar1 PP output to the shader’s Noise input.

    The Particle Sampler Info node will fetch the value of userScalar1PP and pass it to noise. In this example, we assigned userScalar1PP a value using an expression, but we could have used a ramp to assign it a value.

  12. Add a light, play the scene. Select Window > Rendering Editors > Render View and test render.

Example 2

Suppose you already had an attribute called myNoise, which you had already written an expression on or connected to a ramp, and you wanted to pass this value to the Particle Sampler Info node. Then you would do this:

  1. Add the userScalar1PP attribute to your particle shape.
  2. Add this as the last line of your expression:
     userScalar1PP = myNoise;
    
  3. Select the particleCloud1 tab in the particle Attribute Editor.
  4. Click the (map) button next to the Noise attribute.

    The Create Render Node window appears.

  5. In the Create Render Node window, under Maya, click Utilities.
  6. In right panel, click .

    The Connection Editor appears.

  7. In the left column of the Connection Editor, select UserScalar1 PP and in the right column, select Noise. Click Close.

    Now the Particle Sampler Info node fetches userScalar1 PP, which gets the value of myNoise, as desired. Do this with expressions and do not try to simply connect myNoise to one of the user-defined attributes such as userScalar1PP or userVector1PP.