This is RenderMan 21 Documentation you are viewing. The Rmanwiki home page will redirect you to the current documentation.

Page tree

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Contents

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 it's result based on the object being renders. Below there are color attribuutes attached to the sphere's of the shader ball. A single PxrSurface material renders with a different diffuse color as specific by each shape's defined attribute.

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, for example: 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

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 attribute named "Ball" to a shape:

Maya:

Add a Pre Shape MEL attribute to the shape using the Attibutes > RenderMan menu

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())