<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 18.0.0 -",
    "macOS: 15.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/BlendShapeWeightsSet",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation20BlendShapeWeightsSetV"
  },
  "title" : "BlendShapeWeightsSet"
}
-->

# BlendShapeWeightsSet

A custom collection of named blend shape weights.

```
struct BlendShapeWeightsSet
```

## Overview

Retrieve a `BlendShapeWeightsSet` from a [`BlendShapeWeightsComponent`](/documentation/RealityKit/BlendShapeWeightsComponent) to access the
current weights and weight names for each blend shape managed by the component.

Set the current weights for a blend shape by assigning a `BlendShapeWeightsSet` to a
[`BlendShapeWeightsComponent`](/documentation/RealityKit/BlendShapeWeightsComponent) for a specific blend shape.

The collection allows:

- Access to elements by name.
- Protection that prohibits updating an element, where such an update would try to rename the stored element.

[`BlendShapeWeightsSet`](/documentation/RealityKit/BlendShapeWeightsSet) does not support addition/removal of elements, as the blend shape weights are defined in the asset
and the number and names of the weights are immutable.

## Topics

### Initializers

[`init()`](/documentation/RealityKit/BlendShapeWeightsSet/init())

Creates an empty set.

### Instance Properties

[`var count: Int`](/documentation/RealityKit/BlendShapeWeightsSet/count)

Number of blend shape weight data in the set.

[`var `default`: BlendShapeWeightsSet.Element?`](/documentation/RealityKit/BlendShapeWeightsSet/default)

The blend shape weights data set that drives the model.

[`var isEmpty: Bool`](/documentation/RealityKit/BlendShapeWeightsSet/isEmpty)

Checks if the set contains any blend shape weights data.

### Instance Methods

[`func contains(String) -> Bool`](/documentation/RealityKit/BlendShapeWeightsSet/contains(_:))

Checks if the set contains a blend shape weights data instance with the given name.

[`func index(of: String) -> BlendShapeWeightsSet.Index?`](/documentation/RealityKit/BlendShapeWeightsSet/index(of:))

Returns the index where the specified blend shape weights data appears in the collection.

[`func set(BlendShapeWeightsSet.Element) -> BlendShapeWeightsSet.Element?`](/documentation/RealityKit/BlendShapeWeightsSet/set(_:))

Updates a blend shape weights data instance in the set based on its name. If blend shape weights data with this ID does not exist, does nothing.

### Subscripts

[`subscript(_:)`](/documentation/RealityKit/BlendShapeWeightsSet/subscript(_:))

Accessor for reading a blend shape weights data in the set.

### Default Implementations

[Collection Implementations](/documentation/RealityKit/BlendShapeWeightsSet/Collection-Implementations)

## Relationships

### Conforms To

[`Collection`](/documentation/Swift/Collection)

[`Sequence`](/documentation/Swift/Sequence)

[`Escapable`](/documentation/Swift/Escapable)

[`Copyable`](/documentation/Swift/Copyable)

---

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)