Using the aiUserData shaders

The aiUserData shaders, such as aiUserDataFloat, allow you to read user data from Maya nodes. So you can add user data to shape nodes and then use that user data in your shading networks.

Here’s the basic recipe:

  1. Create an extra attributes to add user data to a shape node (the shape node, not the transform node 🙂
    Select the shape node, and add an extra attribute using the naming convention “mtoa_constant_“. For example, an attribute named “mtoa_constant_MyRed” would add the user data “MyRed” to the shape node.
  2. Add an aiUserData node to a shading network and connect it.
    For example, you could connect an aiUserDataFloat to the red, green, or blue color of a Standard shader.
  3. In the aiUserData attributes, set Float Attr Name to the name of the user data.
    For example, if you added an attribute named “mtoa_constant_MyRed”, then set Float Attr Name to “My Red”.

2 thoughts on “Using the aiUserData shaders

  1. great blog!! Not really the correct place to reply but it is concerning user attributes. I am trying to override AA_samples per geometry and cant figure out where to add the attribute. I tried adding a user option to a set with AA_samples 6 and numerous other things but to no avail. Any ideas??

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s