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:
- 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.
- 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.
- 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”.