Announcement

Collapse
No announcement yet.

Set user attributes per instance possible ?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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 !


    Hi, I'm using the GeomRayserverInstancer to generate millions of instances. Everything works except I can't get user attributes to work. I want to assign a

  • #2
    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:
    Code:
    $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]);
    }
    Aleksandar Hadzhiev | chaos.com
    Chaos Support Representative | contact us

    Comment

    Working...
    X