Instance Method


Returns the vertex data for the specified attribute.


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



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.


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