---
title: "User Attributes"
canonical: "https://documentation.chaos.com/space/VMAYA/111739139/User%20Attributes"
format: markdown
---
This page provides information on the User Attributes set that can be added to meshes.

 

## <span style="color: #000000">**Overview**</span>

---

## <span style="color: #000000">**User Attributes**</span>

---

## **Animated User Attributes**

---

If you need to animate the value of a user attribute, you can create a custom dynamic attribute attached to the shape or transform of an object, and animate that. The dynamic attribute must be named **vrayUserColor_attrName** or **vrayUserScalar_attrName** or **vrayUserString_attrName** depending on the attribute type. You can then use the tag *<attrName>* in textures like [VRayUserColor](https://docs-chaos.atlassian.net/wiki/spaces/VMAYA/pages/111740626) and [VRayUserScalar](https://docs-chaos.atlassian.net/wiki/spaces/VMAYA/pages/111740634) as well as the file name of a **File** node.

> Macro (ui-text-box)
> 
> Аnimated color attributes are created with scripting. See the [VRayUserColor](https://docs-chaos.atlassian.net/wiki/spaces/VMAYA/pages/111740626) page for more information.

 

---

 

### Example: Scalar User Attributes

 

In this example, the [VRayMtl](https://docs-chaos.atlassian.net/wiki/spaces/VMAYA/pages/111739405) Reflection Glossiness parameter is controlled with a VRayUserScalar texture. The [VRayMtl](https://docs-chaos.atlassian.net/wiki/spaces/VMAYA/pages/111739405) is applied to all objects, and the VRayUserScalar texture reads a user attribute from each object and passes the value to the material. In this way, the Reflection Glossiness parameter is controlled on the object level with a shared material.

Custom user attributes are assigned to the objects from Attributes > VRay > User attributes. Select each object and assign user attributes to it.

 

 

Set an attribute name and assign different values for each object, using the <attribute_name>=<value> syntax.

Note that to pass per-object values for the same attribute, the attribute name needs to be the same on each object.

 

 

Assign the same VRayMtl to both objects. Connect the VRayUserScalar's **Out Alpha** to the VRayMtl's **Reflection Glossiness** input.

The name of the attribute can be anything. In this example, reflectionGlossiness was chosen as the attribute name for simplicity. 

 

![image](media://68a71032-086e-4247-8973-b89796022d60)

 

The final step is linking the VRayUserScalar texture to the custom attribute. Enter the name of the attribute in the User attribute name parameter.

The VRayUserScalar texture will pass the attribute value from each object to the material.

 

![image](media://3e7af002-261d-46e9-95c2-4c030104dd3e)

 

 

---

 

### **Example: Animating a Scalar User Attribute**

 

In this example, the VRayUserScalar texture reads an animated custom scalar attribute and passes it to the [VRayMtl](https://docs-chaos.atlassian.net/wiki/spaces/VMAYA/pages/111739405) Reflection Glossiness parameter.

Note that the example shows the setup for a single object, but this setup is useful when multiple objects have different animated scalar values and all objects share the same material.

 

First, create a new custom dynamic attribute on the object. In this case, the attribute is created on a Cube's transform node.

With the object selected, open the Add Attribute window from **Attributes > Add Attributes...** in the Attribute Editor.

 

The attribute** Long name** must begin with **vrayUserScalar_ **in order to be read by VRayUserScalar later.

To create an animatable scalar attribute, make the attribute **Keyable**, then set the Data Type to **Float** and the Attribute Type to **Scalar**.

 

![image](media://372e4c65-6169-4387-ace6-94ee0f109095)

 

After clicking Ok or Add, the new attribute is available in the Channel Box and the Attribute Editor. To animate the value at different frames, move the timeline, enter a value for the desired frame and right click the value field to select **Key Selected**.

For this example, the attribute is keyed with a value of 0.6 on frame 1 and a value of 10 on frame 10.

 

> Macro (inline-media-image)

  
New user attribute with the value keyed

 

The attribute value can also be edited from the Extra Attributes rollout in the Attribute Editor.

 

![image](media://009614b5-0391-449a-9acd-73fd7c46ca91)

 

Next, set up the shader so that the VRayMtl's** Reflection Glossiness** is driven by VRayUserScalar's **Out Alpha**. The VRayMtl is then assigned to the Cube object.

 

![image](media://488f4d41-8bc9-440c-9153-c43f5e43c4d4)

 

The final step is linking the VRayUserScalar texture with the custom attribute. Enter the name of the attribute **without the vrayUserScalar_ prefix** in the VRayUserScalar **User attribute name** parameter.

 

![image](media://54c60baf-5204-4887-98df-35f58fcc2fd2)

 

The final rendered results show the Reflection Glossiness value animated between frames 1 and 10.

This example uses a single object, but the setup is useful when multiple objects have different animated scalar values.

 

 

---