Set user attributes per instance possible ?

Hello !

I’m trying to use a different texture on each instance of vrayProxy.
I manage to set an ID for each instance in the useScalar1PP. I could use a MutliSubTex but I want to keep the shading graph as simple as possible.

So the idea is to use the userAttributes in the texture path, so that the userAttributes looks like “texture_id=INSTANCE_ID”. I found a topic (see link) but it’s about the SDK. Is it possible to do something like this in Maya ?

if there is another way to handle my issue i’m totally open to it.

Thanks !

GeomRayserverInstancer User Attributes per instance - Chaos Group Forums

Not sure about doing it per instance but you can use this MEL script to add User attributes with a name and value (replace red marked parts to fit your scenario) to selected objects:


$usrAttr = "[COLOR=#c0392b]texture_id[/COLOR]";
for($o in `ls -sl`){
vray addAttributesFromGroup $o "vray_user_attributes" 1;
setAttr ($o+".vrayUserAttributes") -type "string" ($usrAttr+"="+[COLOR=#c0392b]1[/COLOR]);
}