Instance Method

vertexAttributeData(forAttributeNamed:)

Returns the vertex data for the specified attribute.

Declaration

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 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.