---
title: "PxrAttribute"
canonical: "https://rmanwiki-26.pixar.com/space/REN26/19661579/PxrAttribute"
format: markdown
---
PxrAttribute allows the user to read attributes attached to (stored) on a node. Such an example would be to add a color attribute to a set of objects to be read by a material later. In this way, a material can change its result based on the object being rendered instead of a different material. Below there are color attributes attached to the sphere's of the shader ball. A single [PxrSurface](https://renderman.atlassian.net/wiki/spaces/REN26/pages/19661415) material renders with a different diffuse color as specific by each shape's defined attribute. Examples on usage are below.

![image](media://915f9a6e-a5e3-4fd0-aa3b-12b08eaa8677)

> ℹ️ There may be a performance penalty for using this node in many places in your scene. Efficiency is key to avoid too many evaluations of user attributes if not necessary.


### Input Parameters

#### Variable name

This field takes a string that identifies the attribute.  The string should include the namespace for the attribute and the attribute name separated by a colon.  For example, trace:maxdiffusedepth or user:Ball.

#### Variable Type

This specifies the type of variable to read and must match what was specified above on the other nodes.

- Integer
- Float
- Float 2
- Color
- Point
- Vector
- Normal

#### Default Float

If there is an error when retrieving an attribute of type float, this is the value that will be used.

#### Verbosity

Diagnostic output levels for scene debugging

- Silent
- Warnings
- Info

### Output Parameters

#### resultF

A float result.

#### resultRGB

The color result.


### Example Usage

DCC applications may use a different mechanism for applying a user attribute. Below are two examples for applying a color user attribute named "Ball" to a shape:

#### Maya:

Add a user attribute from the Maya Attribute editor transform node, Name: Ball Type: color Color: Light Pink. The resulting export is below, note that we assume a User attribute from the Maya Editor automatically and does not need to be specified.

`RiAttribute "user" "color Ball" 1 0.2 0.65`

#### Katana:

The below is an OpScript example of the same attribute in Katana

gb = GroupBuilder()  
gb:set("value", FloatAttribute({1.0, 0.2, 0.65}, 3))  
gb:set("type", StringAttribute("color"))  
Interface.SetAttr("prmanStatements.attributes.user.Ball", gb:build())

#### Houdini:

See [Using PxrMatteID](https://renderman.atlassian.net/wiki/spaces/RFH24/pages/21299353) as an example of how to add user attribute in Houdini.