Class
AnimationClipProvider
NotCreatableServiceNotReplicated
Provides functions to load and preview AnimationClips.
Provides functions to load and preview AnimationClips.
It includes a number of functions that are useful when working with an
Animation.
The AnimationClipProvider replaces the deprecated
KeyframeSequenceProvider that was used to download KeyframeSequences
by content ID.
The AnimationClipProvider has a number of uses.
- Download the
AnimationClipassociated with an animation content ID from the Roblox website, regardless of the underlying type ofAnimationClip(KeyframeSequenceorCurveAnimation). - Generate a temporary ID to locally preview an animation.
- Fetch the content IDs of animations owned by a particular user.
Methods 8#
| GetAnimationClip | Returns a AnimationClip from a given asset URL.PluginSecurity securityDeprecated |
| GetAnimationClipAsync | Returns a AnimationClip based on the specified assetId
asynchronously.Yields |
| GetAnimationClipById | Returns a AnimationClip from the supplied assetId.PluginSecurity securityDeprecated |
| GetAnimations | This function returns an InventoryPages object which can be used
to iterate over animations owned by a specific user.Yields |
| GetAnimationsAsync | This function returns an InventoryPages object which can be used
to iterate over animations owned by a specific user.Yields |
| GetClipEvaluatorAsync | Returns a ClipEvaluator for the AnimationClip at the given
content ID, loaded asynchronously.Yields |
| RegisterActiveAnimationClip | Generates a temporary asset ID from a AnimationClip that can be
used for localized testing of an animation. |
| RegisterAnimationClip | Generates a temporary asset ID from a AnimationClip that can be
used for localized testing of an animation. Generates a hash. |
GetAnimationClip(assetId: ContentId): AnimationClip#
DeprecatedPluginSecurity securityDeprecated
Deprecated. This function is deprecated and can lead to the game freezing until the
animation is loaded. Developers are recommended to use
GetAnimationClipAsync instead.
Returns a AnimationClip from a given asset URL.
| Name | Type | Default | Description |
|---|---|---|---|
assetId | ContentId | The content ID of the animation. |
Returns
AnimationClip— TheAnimationClipfound.
GetAnimationClipAsync(assetId: ContentId): AnimationClip#
Yields
Fetches an AnimationClip based on the specified assetId. The
assetId must correspond to an animation asset in Roblox. The function will
yield until the AnimationClip is loaded from the website and
should be wrapped in a pcall.
| Name | Type | Default | Description |
|---|---|---|---|
assetId | ContentId | The content ID of the animation. |
Returns
AnimationClip— TheAnimationClipfound.
GetAnimationClipById(assetId: int64, useCache: boolean): AnimationClip#
DeprecatedPluginSecurity securityDeprecated
Deprecated. This function is deprecated and can lead to the game freezing until the
animation is loaded. Developers are recommended to use
GetAnimationClipAsync instead.
Returns a AnimationClip from the supplied assetId. Can optionally
cache to reduce unnecessary loading freezes.
| Name | Type | Default | Description |
|---|---|---|---|
assetId | int64 | The content ID of the animation. | |
useCache | boolean | True if a cached version can be returned. |
Returns
AnimationClip— TheAnimationClipfound.
GetAnimations(userId: User): Instance#
YieldsDeprecated
This function returns an InventoryPages object which can be used
to iterate over animations owned by a specific user. It yields until the
first page of results is loaded from the website. The userId must be a
positive number; otherwise the call errors.
This function is deprecated. Use
GetAnimationsAsync
instead, which behaves identically.
| Name | Type | Default | Description |
|---|---|---|---|
userId | User | The user ID of the user. |
Returns
Instance— AnInventoryPagesof animations.
GetAnimationsAsync(userId: User): Instance#
Yields
This function returns an InventoryPages object which can be used
to iterate over animations owned by a specific user.
This function has a number of potential uses, such as allowing users to browse and import animations into a custom animation plugin.
| Name | Type | Default | Description |
|---|---|---|---|
userId | User | The user ID of the user. |
Returns
Instance— AnInventoryPagesof animations.
GetClipEvaluatorAsync(assetId: ContentId): ClipEvaluator#
Yields
Fetches the AnimationClip at the specified assetId and returns a
ClipEvaluator that wraps it. A ClipEvaluator samples the clip at an
arbitrary time to produce an animation pose, so you can read animation
data directly instead of playing it back through an Animator.
The assetId must be an animation asset on Roblox. Yields until the clip
is loaded and should be wrapped in a pcall. Loads through the same path
as
GetAnimationClipAsync,
at the local player animation priority.
| Name | Type | Default | Description |
|---|---|---|---|
assetId | ContentId | The content ID of the animation to load. |
Returns
ClipEvaluator— AClipEvaluatorthat can sample the loadedAnimationClip.
RegisterActiveAnimationClip(animationClip: AnimationClip): ContentId#
Generates a temporary asset ID from a AnimationClip that can be
used for localized testing of an animation. This performs the same
function as
RegisterAnimationClip()
but generates an active:// URL instead of a hash. The generated ID can
be used as an AnimationId property for
testing.
The asset ID generated by this function is temporary and cannot be used
outside of Studio. Developers wishing to generate an asset ID that can be
used online should upload the AnimationClip to Roblox.
| Name | Type | Default | Description |
|---|---|---|---|
animationClip | AnimationClip | The AnimationClip to be used. |
Returns
ContentId— A temporary asset ID generated for localized animation playback.
RegisterAnimationClip(animationClip: AnimationClip): ContentId#
Generates a temporary asset ID from a AnimationClip that can be
used for localized testing of an animation.
This function performs the same function to
RegisterActiveAnimationClip
yet generates a hash instead of an active:// URL.
The ID generated can be used for the Animation.AnimationId
property to test animations.
The asset ID generated by this function is temporary and cannot be used
outside of Studio. Developers wishing to generate an asset ID that can be
used online should upload the AnimationClip to Roblox.
| Name | Type | Default | Description |
|---|---|---|---|
animationClip | AnimationClip | The AnimationClip to be used. |
Returns
ContentId— A temporary asset ID generated for localized animation playback.
Inherited members#
Inherited from Instance 58
Properties (10)
Archivable, archivable, Capabilities, IsInSandbox, Name, Parent, PredictionMode, RobloxLocked, Sandboxed, UniqueId
Methods (39)
AddTag, children, ClearAllChildren, Clone, clone, Destroy, destroy, FindFirstAncestor, FindFirstAncestorOfClass, FindFirstAncestorWhichIsA, FindFirstChild, findFirstChild, FindFirstChildOfClass, FindFirstChildWhichIsA, FindFirstDescendant, GetActor, GetAttribute, GetAttributeChangedSignal, GetAttributes, GetChildren, getChildren, GetDebugId, GetDescendants, GetFullName, GetStyled, GetStyledPropertyChangedSignal, GetTags, HasTag, IsAncestorOf, IsDescendantOf, isDescendantOf, IsPropertyModified, QueryDescendants, Remove, remove, RemoveTag, ResetPropertyToDefault, SetAttribute, WaitForChild