GetUserDataScalar Shader

The Crowd Get User Data Scalar Shader for MentalRay is a Mental Ray shader which is able to read a float 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 (such as a Crowd HSL Shader). Refer to the Shader Attributes page to know how to store float user data in a mesh.

Result of a Get User Data Scalar Shader combined with a Crowd HSL Shader and different user data values.


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

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


Param Name Name of the float user data attribute to read in the rendered mesh and which will be returned. 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 the corresponding user data is not found

Shading Graph Integration

This shader can be used to feed a float value of any other shader. The output attribute of this shader is called outValue.
In the following example the Crowd HSL Shader has a texture connected to its In Color attribute. Its Saturation value is fed by a GetUserDataScalar shader and its output is connected to the Color attribute of a Blinn Tshirt shader.
In the Character Maker Geometry Tab,, the Tshirt Shader has an Float Attribute named "saturation" which will have a random value between -1.0 and 1.0 (notice that this value can also be controlled with a ppAttribute) :

Then, the Crowd Get User Data Scalar is configured to read the parameter "saturation":
At render time, Entities having this Blinn Tshirt shader listed in their Assets, you get the following result: