Announcement

Collapse
No announcement yet.

Controling UserAttribute with other UserAttribute

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

  • Controling UserAttribute with other UserAttribute

    Hi,
    is it possible to have a VRayUserAttribute on a transform be driven by another VRayUserAttribute.

    I would like to be able to control the value of a UserAttribute through another UserAttribute, so I can easily apply the values in the hypershade for multiple objects.
    Something like myUserAttribute = myOtherUserAttribute instead of using fixed values (myUserAttribute = 1).
    So if I change the value of "myOtherUserAttribute " in the hypershade (!) it automaticly applies its value to all objects with "myUserAttribute = myOtherUserAttribute".
    Otherwise I would have to go through every Node that has "myOtherUserAttribute " and change it with a fixed Value.

    I hope this is not too confusing to understand.

  • #2
    You can add a dynamic attribute to your meshes with a special name that V-Ray recognizes; you can then connect this attribute to other attributes. The format of the name for the dynamic attribute is described here:
    https://docs.chaosgroup.com/display/...userattributes

    where it says "Animated User Attributes". Adding float attributes is easy from the Attribute Editor, adding color attributes is a bit more complicated and can be done with a MEL script. Let me know you need more details.

    Best regards,
    Vlado
    I only act like I know everything, Rogers.

    Comment


    • #3
      Hi Vlado,
      thanks for the answer. I knew of the site you were referring to, but it was kind of confusing since ther was no real example. However I got it done, thanks to your help.
      Here is a step by step how I got it to work:
      create a custom float attribute on your transform node and name it VrayUserScalar_myAttr
      create a VrayUserScalar and use "myAttr" as user attribute name and connect it to where you want to use it (eg switchValue)
      create another VrayUserScalar that you want to use to control value of the custom attribute and respectively the value of "myAttr"
      connect the value of that VrayUserScalar to the value of the custom attribute on the transform

      Comment


      • #4
        There seems to be a problem still.
        I can use my attributes to control the switchValue of a VRaySwitchMaterial and a lot of other attributes. But when I tried to use them on the switchValue of a ColorSwitchTex I could not get it to work.

        Comment

        Working...
        X