# KeyframeSequenceProvider

Roblox Engine API class from Roblox Studio 0.744.0.7441077 (version-7aaa6838d36c4448).

- Inherits from, nearest first: [Instance](https://rapi.sleaze.dev/classes/Instance.md), [Object](https://rapi.sleaze.dev/classes/Object.md)
- Tags: Not creatable, Not replicated, Service
- Memory category: Animation
- HTML page: https://rapi.sleaze.dev/classes/KeyframeSequenceProvider/
- Roblox documentation: https://create.roblox.com/docs/reference/engine/classes/KeyframeSequenceProvider

Provides functions to load and preview [`KeyframeSequence`](https://rapi.sleaze.dev/classes/KeyframeSequence.md).

## Methods

### GetAnimationsAsync

```luau
KeyframeSequenceProvider:GetAnimationsAsync(userId: User): Instance
```

- Tags: Yields, Capabilities: Animation

This function returns an [`InventoryPages`](https://rapi.sleaze.dev/classes/InventoryPages.md) object which can be used to iterate over animations owned by a specific user.

Parameters:

- `userId`: The user ID of the user.

Returns: An [`InventoryPages`](https://rapi.sleaze.dev/classes/InventoryPages.md) of animations.

### GetKeyframeSequenceAsync

```luau
KeyframeSequenceProvider:GetKeyframeSequenceAsync(assetId: string): Instance
```

- Tags: Yields, Capabilities: Animation

Returns a KeyframeSequence based on the specified assetId asynchronously.

Parameters:

- `assetId`: The content ID of the animation.

Returns: The [`KeyframeSequence`](https://rapi.sleaze.dev/classes/KeyframeSequence.md) found.

### GetMemStats

```luau
KeyframeSequenceProvider:GetMemStats(): { [string]: any }
```

- Tags: Roblox script security, Capabilities: Animation

### RegisterActiveKeyframeSequence

```luau
KeyframeSequenceProvider:RegisterActiveKeyframeSequence(keyframeSequence: Instance): string
```

- Tags: Capabilities: Animation

Generates a temporary asset ID from a [`KeyframeSequence`](https://rapi.sleaze.dev/classes/KeyframeSequence.md) that can be used for localized testing of an animation. Generates an *active://* URL.

Parameters:

- `keyframeSequence`: The [`KeyframeSequence`](https://rapi.sleaze.dev/classes/KeyframeSequence.md) to be used.

Returns: A temporary asset ID generated for localized animation playback.

### RegisterKeyframeSequence

```luau
KeyframeSequenceProvider:RegisterKeyframeSequence(keyframeSequence: Instance): string
```

- Tags: Capabilities: Animation

Generates a temporary asset ID from a [`KeyframeSequence`](https://rapi.sleaze.dev/classes/KeyframeSequence.md) that can be used for localized testing of an animation. Generates a hash.

Parameters:

- `keyframeSequence`: The [`KeyframeSequence`](https://rapi.sleaze.dev/classes/KeyframeSequence.md) to be used.

Returns: A temporary asset ID generated for localized animation playback.

### GetAnimations

```luau
KeyframeSequenceProvider:GetAnimations(userId: User): Instance
```

- Tags: Deprecated, Yields, Capabilities: Animation
- Use instead: [`KeyframeSequenceProvider.GetAnimationsAsync`](https://rapi.sleaze.dev/classes/KeyframeSequenceProvider.md)

**Deprecated:**

This function returns an [`InventoryPages`](https://rapi.sleaze.dev/classes/InventoryPages.md) object which can be used to iterate over animations owned by a specific user.

Parameters:

- `userId`: The user ID of the user.

Returns: An [`InventoryPages`](https://rapi.sleaze.dev/classes/InventoryPages.md) of animations.

### GetKeyframeSequence

```luau
KeyframeSequenceProvider:GetKeyframeSequence(assetId: string): Instance
```

- Tags: Deprecated, Plugin security, Capabilities: Animation
- Use instead: [`KeyframeSequenceProvider.GetKeyframeSequenceAsync`](https://rapi.sleaze.dev/classes/KeyframeSequenceProvider.md)

**Deprecated:** This function is deprecated and can lead to the game freezing until the animation is loaded. Developers are recommended to use [`KeyframeSequenceProvider:GetKeyframeSequenceAsync()`](https://rapi.sleaze.dev/classes/KeyframeSequenceProvider.md) instead.

Returns a [`KeyframeSequence`](https://rapi.sleaze.dev/classes/KeyframeSequence.md) from a given asset URL.

Parameters:

- `assetId`: The content ID of the animation.

Returns: The [`KeyframeSequence`](https://rapi.sleaze.dev/classes/KeyframeSequence.md) found.

### GetKeyframeSequenceById

```luau
KeyframeSequenceProvider:GetKeyframeSequenceById(assetId: number, useCache: boolean): Instance
```

- Tags: Deprecated, Plugin security, Capabilities: Animation
- Use instead: [`KeyframeSequenceProvider.GetKeyframeSequenceAsync`](https://rapi.sleaze.dev/classes/KeyframeSequenceProvider.md)

**Deprecated:** This function is deprecated and can lead to the game freezing until the animation is loaded. Developers are recommended to use [`KeyframeSequenceProvider:GetKeyframeSequenceAsync()`](https://rapi.sleaze.dev/classes/KeyframeSequenceProvider.md) instead.

Returns a [`KeyframeSequence`](https://rapi.sleaze.dev/classes/KeyframeSequence.md) from the supplied assetId.

Parameters:

- `assetId`: The content ID of the animation.
- `useCache`: True if a cached version can be returned.

Returns: The [`KeyframeSequence`](https://rapi.sleaze.dev/classes/KeyframeSequence.md) found.

## Inherited members

- From [Instance](https://rapi.sleaze.dev/classes/Instance.md): `Archivable`, `archivable`, `Attributes`, `AttributesReplicate`, `AttributesSerialize`, `HistoryId`, `Name`, `Parent`, `PredictionMode`, `PropertyStatusStudio`, `RobloxLocked`, `SerializedOverrides`, `SourceAssetId`, `Tags`, `UniqueId`, `numExpectedDirectChildren`, `DataCost`, `Capabilities`, `DefinesCapabilities`, `IsInSandbox`, `Sandboxed`, `AddTag`, `ClearAllChildren`, `Clone`, `Destroy`, `FindFirstAncestor`, `FindFirstAncestorOfClass`, `FindFirstAncestorWhichIsA`, `FindFirstChild`, `FindFirstChildOfClass`, `FindFirstChildWhichIsA`, `FindFirstDescendant`, `GetActor`, `GetAttribute`, `GetAttributeChangedSignal`, `GetAttributes`, `GetChildren`, `GetDebugId`, `GetDescendants`, `GetFullName`, `GetStyled`, `GetStyledPropertyChangedSignal`, `GetTags`, `HasTag`, `IsAncestorOf`, `IsDescendantOf`, `IsPropertyModified`, `QueryDescendants`, `RemoveTag`, `ResetPropertyToDefault`, `SetAttribute`, `WaitForChild`, `Remove`, `children`, `clone`, `destroy`, `findFirstChild`, `getChildren`, `isDescendantOf`, `remove`, `AncestryChanged`, `AttributeChanged`, `ChildAdded`, `ChildRemoved`, `DescendantAdded`, `DescendantRemoving`, `Destroying`, `StyledPropertiesChanged`, `childAdded`
- From [Object](https://rapi.sleaze.dev/classes/Object.md): `ClassName`, `className`, `GetPropertyChangedSignal`, `IsA`, `isA`, `Changed`
