<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "USDKit",
  "identifier" : "/documentation/USDKit/USDPrim/Attribute",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "USDKit"
    ],
    "preciseIdentifier" : "s:6USDKit7USDPrimV9AttributeV"
  },
  "title" : "USDPrim.Attribute"
}
-->

# USDPrim.Attribute

```
struct Attribute
```

## Topics

### Protocols

[`protocol Value`](/documentation/USDKit/USDPrim/Attribute/Value)

A value that can be stored on an attribute in a Universal Scene Description file.

### Structures

[`struct Spec`](/documentation/USDKit/USDPrim/Attribute/Spec)

A handle to an attribute definition stored in a layer.

[`struct ValueType`](/documentation/USDKit/USDPrim/Attribute/ValueType)

A type that describes the kind of value an attribute can store, such as `float3` or `token[]`.

### Initializers

[`init()`](/documentation/USDKit/USDPrim/Attribute/init())

An invalid attribute handle.

[`init?(USDStage.Object)`](/documentation/USDKit/USDPrim/Attribute/init(_:)-8gu7p)

Casts an object handle to an attribute handle.

[`init?(USDPrim.Property)`](/documentation/USDKit/USDPrim/Attribute/init(_:)-8mm8c)

Casts a property handle to an attribute handle.

### Instance Properties

[`var connections: [USDLayer.Path]`](/documentation/USDKit/USDPrim/Attribute/connections)

The connection target paths authored on this attribute.

[`var isValid: Bool`](/documentation/USDKit/USDPrim/Attribute/isValid)

A Boolean value indicating whether this attribute is valid.

[`var name: USDToken`](/documentation/USDKit/USDPrim/Attribute/name)

The name of this attribute.

[`var path: USDLayer.Path`](/documentation/USDKit/USDPrim/Attribute/path)

The complete scene path to this attribute, relative to its stage.

[`var prim: USDPrim`](/documentation/USDKit/USDPrim/Attribute/prim)

The nearest prim that contains this attribute.

[`var primPath: USDLayer.Path`](/documentation/USDKit/USDPrim/Attribute/primPath)

The complete path to the nearest prim that contains this attribute.

[`var roleName: USDToken`](/documentation/USDKit/USDPrim/Attribute/roleName)

The name of this attribute type’s role, which clarifies the semantic purpose of its values.

[`var stage: USDStage`](/documentation/USDKit/USDPrim/Attribute/stage)

The stage that owns this attribute.

[`var timeSamples: [USDStage.TimeCode]`](/documentation/USDKit/USDPrim/Attribute/timeSamples)

The composed set of time codes for which this attribute has authored time samples.

[`var typeName: USDPrim.Attribute.ValueType`](/documentation/USDKit/USDPrim/Attribute/typeName)

The type of the values this attribute stores.

[`var variability: USDPrim.Property.Variability`](/documentation/USDKit/USDPrim/Attribute/variability)

The variability of this attribute, which indicates whether its value can change over time.

### Instance Methods

[`func clear() -> Bool`](/documentation/USDKit/USDPrim/Attribute/clear())

Clears the authored value of this attribute.

[`func setValue<T>(T, at: USDStage.TimeCode) -> Bool`](/documentation/USDKit/USDPrim/Attribute/setValue(_:at:))

Sets this attribute’s value at the given time.

[`func value<T>(at: USDStage.TimeCode) -> T?`](/documentation/USDKit/USDPrim/Attribute/value(at:))

Returns this attribute’s value at the given time, or `nil` if unauthored.

### Default Implementations

[CustomStringConvertible Implementations](/documentation/USDKit/USDPrim/Attribute/CustomStringConvertible-Implementations)

## Relationships

### Conforms To

[`Hashable`](/documentation/Swift/Hashable)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`Copyable`](/documentation/Swift/Copyable)

[`Escapable`](/documentation/Swift/Escapable)

[`Equatable`](/documentation/Swift/Equatable)

[`MetadataCollection`](/documentation/USDKit/USDStage/Object/MetadataCollection)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)