---
title: expectedMaterialCount
framework: realitykit
role: symbol
role_heading: Instance Property
path: realitykit/meshresource/expectedmaterialcount
---

# expectedMaterialCount

The number of material entries required to render the mesh resource.

## Declaration

```swift
@MainActor @preconcurrency var expectedMaterialCount: Int { get }
```

## Discussion

Discussion Use this value to determine the number of Material instances to provide in the materials array. When a mesh has multiple submeshes, each submesh references a material by index.

## See Also

### Configuring the resource

- [replace(with:)](realitykit/meshresource/replace(with:)-g0kn.md)
- [replace(with:)](realitykit/meshresource/replace(with:)-g0kn.md)
- [replaceAsync(with:)](realitykit/meshresource/replaceasync(with:).md)
