---
title: "init(name:format:offset:bufferIndex:)"
framework: modelio
role: symbol
role_heading: Initializer
path: "modelio/mdlvertexattribute/init(name:format:offset:bufferindex:)"
---

# init(name:format:offset:bufferIndex:)

Initializes a vertex attribute object with the specified property values.

## Declaration

```swift
init(name: String, format: MDLVertexFormat, offset: Int, bufferIndex: Int)
```

## Parameters

- `name`: An identifier for the semantic use of the vertex attribute.
- `format`: The format of per-vertex data for the attribute.
- `offset`: The offset, in bytes, of vertex data for the attribute in a vertex buffer, relative to the start of data for each vertex.
- `bufferIndex`: The index of the vertex buffer containing data for this attribute in a mesh’s doc://com.apple.modelio/documentation/ModelIO/MDLMesh/vertexBuffers array.

## Return Value

Return Value A new vertex attribute object.

## Discussion

Discussion Use this initializer when constructing a new mesh from custom data, or when building a new MDLVertexDescriptor object to change the vertex buffer formatting of an existing mesh. When you load a mesh from a MDLAsset object, Model I/O  automatically creates vertex descriptor and vertex attribute objects describing the mesh’s vertex data.
