UsdAttributeSet

In USD, the attributes are essentially the defining properties of the prim. As a simple example, one of the properties of cube prim is “size”, which could appear as follows:

#usda 1.0
def Cube "myCube"
{
float size = 2.0
}

An attribute has a data type (the type is “double” in the example above), name, and value. The value may be numeric, a string, or an array. Unlike metadata, the value of an attribute may be time-sampled, in that the attribute may have several values, each of which is active at a given timecode or frame.

Attributes are one of the two defining properties of a prim, together with relationships.

Note:  For more details see Attribute in Pixar’s USD Glossary.

Setting and Blocking Attributes

When assigning an attribute to a prim, you can choose between one of three actions:

  • Create/Override - Add a new attribute or override the value of an existing one.

  • Block - Disable the attribute, effectively blocking its effect on the prim.

  • Force Default - Force the attribute back to its default value.

As Block and Force Default don’t require a value, you need only supply the attributeName.

Create/Override requires all the attribute settings including attributeName, attributeType, and value. You also need to set isCustom to indicate if the attribute is pre-defined or a new, custom attribute.

For time-sampled values, set multisample to Yes. For example, say you’re animating a cube to grow in size, the attribute in USD code, could look like this:

def Cube “GrowingCube"
{
float size.timeSamples = {
  0: 1.0,
  2: 2.0,
  3: 4.0,
}
}

Inputs

Connection Type

Connection Name

Function

input in The incoming scene graph data that the node will operate on or modify.

Controls

Control (UI)

Default Value

Function

primPaths N/A The paths to the Prims that you want to assign this attribute to.
action  

Choose how you want to apply the attribute update.

  • Create/Override - Create the attribute, or if it exists already, assign the new value.

  • Block - Disable the attribute assignment in the prims, removing their effect from stage composition.

  • Force Default - Force the attribute to adopt its default value.

attributeName N/A Assign a name to the attribute.
attributeType Double Choose from one of the available data types for the attribute.
multisample Yes

Select Yes if the data is time-sampled.

Select No if the value should not vary over time.

isCustom No Select Yes if this is a custom attribute.
value N/A Assign a value to the attribute.