---
title: "init(type:length:)"
framework: modelio
role: symbol
role_heading: Initializer
path: "modelio/mdlmeshbufferdata/init(type:length:)"
---

# init(type:length:)

Initializes a buffer of the specified length.

## Declaration

```swift
init(type: MDLMeshBufferType, length: Int)
```

## Parameters

- `type`: doc://com.apple.modelio/documentation/ModelIO/MDLMeshBufferType/vertex to create a buffer for a mesh’s vertex attribute data, or doc://com.apple.modelio/documentation/ModelIO/MDLMeshBufferType/index to create a buffer for a submesh’s index data.
- `length`: The size, in bytes, of the buffer to create.

## Return Value

Return Value A new memory buffer for mesh data.

## Discussion

Discussion All bytes in the newly created buffer are zero.

## See Also

### Creating a Buffer

- [init(type:data:)](modelio/mdlmeshbufferdata/init(type:data:).md)
