GetUserDataVector Shader

The Crowd Get User Data Vector Shader for MentalRay is a Mental Ray shader which is able to read a vector user data of a given name stored in the currently rendered mesh, and return its value. This data can be used to feed other shaders in Maya that have a vector or color input. Refer to the Shader Attributes page to know how to store vector user data in a mesh.


Result of a Get User Data Vector Shader with random values feeding the Color attribute of a Blinn shader applied to the t-shirts

Creation

To create a Crowd Get User Data Vector for Mental Ray, the Mental Ray plugin must be loaded.

  • Hypershade: MentalRay / Miscellaneous /  CrowdGetUserDataVectorMentalRay
  • MEL command: createNode CrowdGetUserDataVectorMentalRay;

Configuration


Crowd Get User Data Vector for Mental Ray attributes

Param Name Name of the vector user data attribute to read in the rendered mesh. The name of the user data should be the same than the one defined in the Shader Attributes of the Mesh.
Default Default value to return if no matching user data was found in the Character File

Shading Graph Integration

This shader can be used to feed a vector or color value of any other shader. The output attribute of this shader is called outValue.

In the following example the GetUserDataVector shader directly feeds the Color attribute of a Blinn Tshirt shader.


Crowd Get User Data Vector for Mental Ray in the Hypershade

The Crowd Get User Data Vector is configured to read the parameter randColor as seen in the figure above.

In the Character Maker Geometry Tab, the Tshirt Shader has a vector Shader Attribute named randColor which will have a random value between 0 and 1.0 for each vector component (X, Y, Z). Notice that this value can also be controlled with a ppAttribute.


Random vector Shader Attribute values

At render time the t-shirt has a random color, as shown in the example above.