---
title: ToWeightMaskReference(AvatarMask)
product: Unity Editor
version: '7000.0'
latest_version: '7000.0'
status: This page documents version 7000.0. The latest version is 7000.0.
canonical: https://docs.unity.com/en-us/engine/7000.0/script-reference/unity/animations/avatarmaskextensions/toweightmaskreference
latest_url: https://docs.unity.com/en-us/engine/7000.0/script-reference/unity/animations/avatarmaskextensions/toweightmaskreference.md
last_updated: 2026-11-30
generated_at: 2026-11-30T21:55:09.775Z
locale: en-us
---

# ToWeightMaskReference(AvatarMask)

> Acquires a reference to the weight mask of an avatar mask.

## Definition

* **Type:** Method
* **Namespace:** [Unity.Animations](/engine/7000.0/script-reference/unity/animations.md)
* **Assembly:** [UnityEngine.AnimationCoreModule](/engine/7000.0/script-reference/modules/unityengine-animationcoremodule.md)

```csharp
public static BlobObjectReference<WeightMask> ToWeightMaskReference(this AvatarMask mask)
```

### Parameters

**** (\[AvatarMask]\(/engine/7000.0/script-reference/unityengine/avatarmask)): The avatar mask to get the weight mask from. Can be null.

### Returns

| Type                                                                                                    | Description                                                                                                                                                                                                                                                                                                         |
| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [BlobObjectReference\<WeightMask>](/engine/7000.0/script-reference/unityengine/blobobjectreference1.md) | The reference to the [WeightMask](/engine/7000.0/script-reference/unity/animations/weightmask.md) of the avatar mask. Dispose the reference when you finish with it. [BlobObjectReference\<T>.IsValid](/engine/7000.0/script-reference/unityengine/blobobjectreference1/isvalid.md) is `false` if `mask` is `null`. |

### Remarks

Use this method to get the weight mask in a form that jobs and Burst-compiled code can read. The first call after the avatar mask changes builds the weight mask from the avatar mask. If the avatar mask has no transforms, the weight mask includes every transform. Otherwise, it includes only the transforms of the avatar mask, with their weights. The reference keeps the data alive until you dispose it, even if the avatar mask is destroyed or modified. Call this method from the main thread.
