<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "macOS: 26.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/MeshResource/meshPartIndex(modelID:partID:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation12MeshResourceC13meshPartIndex7modelID04partI0SiSgSS_SStF"
  },
  "title" : "meshPartIndex(modelID:partID:)"
}
-->

# meshPartIndex(modelID:partID:)

Get the mesh part index for a given model and part identifier.

```
@MainActor @preconcurrency func meshPartIndex(modelID: String, partID: String) -> Int?
```

## Discussion

You can use this to resolve string names to part indices for use in [`MeshInstancesComponent`](/documentation/RealityKit/MeshInstancesComponent).

---

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)