<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ModelIO",
  "identifier" : "/documentation/ModelIO/MDLSubmesh/init(name:indexBuffer:indexCount:indexType:geometryType:material:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Model I/O"
    ],
    "preciseIdentifier" : "c:objc(cs)MDLSubmesh(im)initWithName:indexBuffer:indexCount:indexType:geometryType:material:"
  },
  "title" : "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.

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

A new submesh object.

## Discussion

Typically, a submesh is imported from an asset file as a member of a [`MDLMesh`](/documentation/ModelIO/MDLMesh) object, but you can also use this method to create a submesh programmatically.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)