---
title: "SpatialGltfModelState"
description: "A state object that can be hoisted to observe and control a SpatialGltfModel."
type: "class"
lastmod: "2026-05-08T01:17:01.392857Z"
---
## API Reference

> Source set: Android

```kotlin
public class SpatialGltfModelState(internal val source: SpatialGltfModelSource) : AutoCloseable
```

A state object that can be hoisted to observe and control a [SpatialGltfModel](/jetpack-compose/androidx.xr.compose/compose/composable-functions/SpatialGltfModel).

A `SpatialGltfModelState` can be used to query loading and animation status, and to start or stop
animations on the associated `SpatialGltfModel`.

To create and remember a `SpatialGltfModelState`, use [rememberSpatialGltfModelState](/jetpack-compose/androidx.xr.compose/compose/composable-functions/rememberSpatialGltfModelState). If a
`SpatialGltfModelState` instance is manually created using the constructor then the caller needs
to call `close` to free its resources when it is no longer needed.

#### Parameters

| | |
| --- | --- |
| source | The [SpatialGltfModelSource](/jetpack-compose/androidx.xr.compose/compose/interfaces/SpatialGltfModelSource) that defines where to load the 3D model from. |

## Properties

### status

> Source set: Android

```kotlin
public val status: SpatialGltfModelStatus
```

The current [SpatialGltfModelStatus](/jetpack-compose/androidx.xr.compose/compose/classes/SpatialGltfModelStatus) of the glTF model.

It will initially be [SpatialGltfModelStatus.Loading](/jetpack-compose/androidx.xr.compose/compose/classes/SpatialGltfModelStatus.Loading) until the model is loaded and ready to
be displayed at which point it should be [SpatialGltfModelStatus.Loaded](/jetpack-compose/androidx.xr.compose/compose/classes/SpatialGltfModelStatus.Loaded). However, if the
model fails to load for any reason, the `status` will be a [SpatialGltfModelStatus.Failed](/jetpack-compose/androidx.xr.compose/compose/classes/SpatialGltfModelStatus.Failed)
with the exception that was thrown.

### nodes

> Source set: Android

```kotlin
public val nodes: List<GltfModelNode>
```

The subnodes defined in the glTF model.

These nodes allow access and manipulation of the pose and scale of the node which could be
useful for manipulating the glTF model or positioning content relative to a particular node
in the glTF model.

### animations

> Source set: Android

```kotlin
public val animations: List<SpatialGltfModelAnimation>
```

The animations defined in the glTF model.

Each animation can be controlled individually and multiple animations may be playing at one
time as long as those animations affect different parts of the model.
