---
title: "init(name:indexBuffer:indexCount:indexType:geometryType:material:)"
framework: modelio
role: symbol
role_heading: Initializer
path: "modelio/mdlsubmesh/init(name:indexbuffer:indexcount:indextype:geometrytype:material:)"
---

# init(name:indexBuffer:indexCount:indexType:geometryType:material:)

Initializes a named submesh with an index buffer and the specified properties.

## Declaration

```swift
init(name: String, indexBuffer: any MDLMeshBuffer, indexCount: Int, indexType: MDLIndexBitDepth, geometryType: MDLGeometryType, material: MDLMaterial?)
```

## Parameters

- `name`: A descriptive name for the submesh. This property is not used in rendering, but can be useful in debugging.
- `indexBuffer`: An object that provides index data for the submesh.
- `indexCount`: The number of indices in the index buffer.
- `indexType`: The data type of each index in the index buffer.
- `geometryType`: The type of geometric primitives described by the index buffer.
- `material`: A description of the intended surface appearance for rendering the submesh.

## Return Value

Return Value A new submesh object.

## Discussion

Discussion Typically, a submesh is imported from an asset file as a member of a MDLMesh object, but you can also use this method to create a submesh programmatically.

## See Also

### Creating a Submesh

- [init(indexBuffer:indexCount:indexType:geometryType:material:)](modelio/mdlsubmesh/init(indexbuffer:indexcount:indextype:geometrytype:material:).md)
- [init(name:indexBuffer:indexCount:indexType:geometryType:material:topology:)](modelio/mdlsubmesh/init(name:indexbuffer:indexcount:indextype:geometrytype:material:topology:).md)
- [init(mdlSubmesh:indexType:geometryType:)](modelio/mdlsubmesh/init(mdlsubmesh:indextype:geometrytype:)-4czyc.md)
