<!--
{
  "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:topology:)",
  "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:topology:"
  },
  "title" : "init(name:indexBuffer:indexCount:indexType:geometryType:material:topology:)"
}
-->

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

Initializes a named submesh with a specific topology.

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

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

`topology`

An object describing the arrangement of geometric primitives in the index buffer.

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

Use this method when the index buffer from which you’re creating a submesh does not contain a uniform array of geometric primitives. Pass  [`MDLGeometryType.variableTopology`](/documentation/ModelIO/MDLGeometryType/variableTopology) for the `geometryType` parameter, and provide an `MDLSubmeshTopology` object for the `topology` parameter to describe how the points in the index buffer combine to produce the submesh’s shape. Otherwise, this method is equivalent to the [`init(name:indexBuffer:indexCount:indexType:geometryType:material:)`](/documentation/ModelIO/MDLSubmesh/init(name:indexBuffer:indexCount:indexType:geometryType:material:)) method.

---

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)