<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ModelIO",
  "identifier" : "/documentation/ModelIO/MDLMesh/vertexAttributeData(forAttributeNamed:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Model I/O"
    ],
    "preciseIdentifier" : "c:objc(cs)MDLMesh(im)vertexAttributeDataForAttributeNamed:"
  },
  "title" : "vertexAttributeData(forAttributeNamed:)"
}
-->

# vertexAttributeData(forAttributeNamed:)

Returns the vertex data for the specified attribute.

```
func vertexAttributeData(forAttributeNamed name: String) -> MDLVertexAttributeData?
```

## Parameters

`name`

The attribute name for which to retrieve data. See Vertex Attributes for standard attribute names.

## Return Value

The vertex data for the specified attribute, or `nil` if the mesh does not contain vertex data for the specified attribute.

## Discussion

Calling this data is equivalent to using the mesh’s [`vertexDescriptor`](/documentation/ModelIO/MDLMesh/vertexDescriptor) object to find the index of the [`MDLMeshBuffer`](/documentation/ModelIO/MDLMeshBuffer) object corresponding to the specified vertex attribute in the mesh’s [`vertexBuffers`](/documentation/ModelIO/MDLMesh/vertexBuffers) array, then using the vertex buffer’s [`map()`](/documentation/ModelIO/MDLMeshBuffer/map()) method to gain read-only access to the vertex buffer’s data.

> Important:
> The buffer’s storage remains mapped for as long as the returned ``doc://com.apple.modelio/documentation/ModelIO/MDLVertexAttributeData`` object exists, potentially restricting other uses of that storage. For example, if a buffer’s storage is shared with GPU memory, that buffer may be unavailable for use in rendering until the data object is deallocated.

---

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)