---
title: BlobObjectExtensions
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/blobobjectextensions
latest_url: https://docs.unity.com/en-us/engine/7000.0/script-reference/unity/animations/blobobjectextensions.md
last_updated: 2026-11-30
generated_at: 2026-11-30T20:39:28.943Z
locale: en-us
---

# BlobObjectExtensions

> Extension methods for a BlobObject that you reference with a UnityObjectRef.

## Definition

* **Type:** Class
* **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 class BlobObjectExtensions
```

## Remarks

Use [BlobObjectExtensions.AcquireReference](/engine/7000.0/script-reference/unity/animations/blobobjectextensions/acquirereference.md) when you hold the [BlobObject](/engine/7000.0/script-reference/unityengine/blobobject.md) as a [UnityObjectRef\<T>](/engine/7000.0/script-reference/unity/entities/unityobjectref1.md), for example in a component in the Entities package. The method returns a [BlobObjectReference\<T>](/engine/7000.0/script-reference/unityengine/blobobjectreference1.md) that you dispose when you finish with it. To store data in the object, and for the type and version rules of the data, refer to `BlobObject.SetBlobAsset`.

The following example uses the `Unity.Animations`, `Unity.Entities`, and `UnityEngine` namespaces. It reads a custom blob through a `UnityObjectRef` to a `BlobObject`, and returns 0 if the reference is invalid.

Additional Resources: [BlobObject](/engine/7000.0/script-reference/unityengine/blobobject.md), [BlobObjectReference\<T>](/engine/7000.0/script-reference/unityengine/blobobjectreference1.md)

## Examples

```csharp
// This example reads the marker times of a BlobObject that a component holds as a UnityObjectRef.
// A custom blob type can hold only unmanaged data, such as values and BlobArray fields.
public struct MarkerTable
{
    public BlobArray<float> Times;
}

public static float SumMarkerTimes(UnityObjectRef<BlobObject> objectRef)
{
    const int version = 1;

    // The reference is invalid if the object is missing, empty, or stores another version of the data.
    using BlobObjectReference<MarkerTable> reference = objectRef.AcquireReference<MarkerTable>(version);
    if (!reference.IsValid)
    {
        return 0f;
    }

    ref MarkerTable table = ref reference.Value;
    float sum = 0f;
    for (int i = 0; i < table.Times.Length; ++i)
    {
        sum += table.Times[i];
    }
    return sum;
}
```

## Static Methods

| Method                                                                                                        | Description                                                                                 |
| ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
| [AcquireReference](/engine/7000.0/script-reference/unity/animations/blobobjectextensions/acquirereference.md) | Acquires a reference to the blob data stored in the object that a UnityObjectRef points to. |
