# AnimationClipProvider

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/AnimationClipProvider/
- Roblox documentation: https://create.roblox.com/docs/reference/engine/classes/AnimationClipProvider

Provides functions to load and preview `AnimationClips`.

## Methods

### GetAnimationClipAsync

```luau
AnimationClipProvider:GetAnimationClipAsync(assetId: string): AnimationClip
```

- Tags: Yields, Capabilities: Animation

Returns a [`AnimationClip`](https://rapi.sleaze.dev/classes/AnimationClip.md) based on the specified assetId asynchronously.

Parameters:

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

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

### GetAnimationNodeDefinition

```luau
AnimationClipProvider:GetAnimationNodeDefinition(type: Enum.AnimationNodeType): { [string]: any }
```

- Tags: Roblox script security, Capabilities: Animation

### GetAnimationNodeTypes

```luau
AnimationClipProvider:GetAnimationNodeTypes(): { any }
```

- Tags: Roblox script security, Capabilities: Animation

### GetAnimationsAsync

```luau
AnimationClipProvider: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.

### GetAnimationValueNodeDefinition

```luau
AnimationClipProvider:GetAnimationValueNodeDefinition(type: Enum.AnimationValueNodeType): { [string]: any }
```

- Tags: Roblox script security, Capabilities: Animation

### GetAnimationValueNodeTypes

```luau
AnimationClipProvider:GetAnimationValueNodeTypes(): { any }
```

- Tags: Roblox script security, Capabilities: Animation

### GetClipEvaluatorAsync

```luau
AnimationClipProvider:GetClipEvaluatorAsync(assetId: string): ClipEvaluator
```

- Tags: Yields, Capabilities: Animation

Returns a [`ClipEvaluator`](https://rapi.sleaze.dev/index/types/ClipEvaluator.md) for the [`AnimationClip`](https://rapi.sleaze.dev/classes/AnimationClip.md) at the given content ID, loaded asynchronously.

Parameters:

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

Returns: A [`ClipEvaluator`](https://rapi.sleaze.dev/index/types/ClipEvaluator.md) that can sample the loaded [`AnimationClip`](https://rapi.sleaze.dev/classes/AnimationClip.md).

### GetMemStats

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

- Tags: Roblox script security, Capabilities: Animation

### RegisterActiveAnimationClip

```luau
AnimationClipProvider:RegisterActiveAnimationClip(animationClip: AnimationClip): string
```

- Tags: Capabilities: Animation

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

Parameters:

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

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

### RegisterAnimationClip

```luau
AnimationClipProvider:RegisterAnimationClip(animationClip: AnimationClip): string
```

- Tags: Capabilities: Animation

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

Parameters:

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

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

### GetAnimationClip

```luau
AnimationClipProvider:GetAnimationClip(assetId: string): AnimationClip
```

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

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

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

Parameters:

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

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

### GetAnimationClipById

```luau
AnimationClipProvider:GetAnimationClipById(assetId: number, useCache: boolean): AnimationClip
```

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

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

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

Parameters:

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

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

### GetAnimations

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

- Tags: Deprecated, Yields, Capabilities: Animation
- Use instead: [`AnimationClipProvider.GetAnimationsAsync`](https://rapi.sleaze.dev/classes/AnimationClipProvider.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.

## 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`
