How Can We Help?

aiUserData – Tips

You are here:
< Back to Wiki

In order for Arnold use use a with a custom attribute the attribute needs:

  • Attribute name starts with mtoa_constant_*customName*
  • Added to the shape node not the transform.
  • aiUserDataInt piped into your material nodes only used the *customName* portion.

I have a geo piece named :

  • Box01
    • Box01.shape
      • Extra Attribute
        • mtoa_constant_textureSelect
  • AiSwitch01 INT node I want to change
    • Attribute
      • textureSelect
//To add these to a lot of mesh objects use the script below

import pymel.core as pmc

peoples = pmc.selected()

for people in peoples:
    peopleShape = pmc.listRelatives(people, children=True, shapes=True, type="mesh")

        peopleShape =  pmc.addAttr(peopleShape,at='long', ln='mtoa_constant_textureSelect', nn='Texture Select')
        print ( "Added: " + peopleShape )
		print ( "FAILED: " + peopleShape )	

Type of attributes

Leave a Reply

Table of Contents