Skip to main content

Editor.AnimationClip

Class

Represents an animation clip instance with playback configuration.

Index

Example

const model = this.pluginSystem.findInterface(Editor.Model.IModel) as Editor.Model.IModel;
const scene = model.project?.scene;
if (!scene) {
console.log('No scene loaded.');
return;
}

// Walk scene objects looking for AnimationPlayer components
function walk(obj: Editor.Model.SceneObject): void {
const players = obj.getComponents('AnimationPlayer');
for (const player of players) {
for (const clip of player.animationClips) {
console.log(
`Clip: ${clip.name} | frames: ${clip.begin}–${clip.end}` +
` | weight: ${clip.weight} | reversed: ${clip.reversed}`
);
}
}
for (const child of obj.children) walk(child);
}
for (const root of scene.rootSceneObjects) walk(root);

Extends

Properties

animation

animation: AnimationAsset

The animation asset this clip references.


begin

begin: number

Start of the clip, in seconds, relative to the start of the animation asset.


blendMode

blendMode: AnimationLayerBlendMode

How this clip blends with other layers.


disabled

disabled: boolean

Whether this clip is disabled.


end

end: number

End of the clip, in seconds, relative to the start of the animation asset.


id

readonly id: Uuid

The unique id of the entity.

Inherited from

Entity.id


meta

readonly meta: Meta

Metadata associated with this entity, providing access to its unique identifier and other descriptive properties.

Inherited from

EntityStructure.meta


name

name: string

Name of the clip.


playbackMode

playbackMode: PlaybackMode

Determines playback behavior (loop, clamp, etc).


playbackSpeed

playbackSpeed: number

Multiplier for playback speed.


reversed

reversed: boolean

Whether playback is reversed.


scaleMode

scaleMode: AnimationLayerScaleMode

How the clip scales to fit the frame range.


type

readonly type: string

The entity's type.

Inherited from

EntityStructure.type


weight

weight: number

Blend weight of this clip (0-1 range).

Methods

getDirectlyReferencedEntities()

getDirectlyReferencedEntities(): Entity[]

A list of entities which this entity has a reference to.

Returns

Entity[]

Inherited from

EntityStructure.getDirectlyReferencedEntities


getMeta()

static getMeta(): Meta

Returns metadata about this type.

Returns

Meta

Overrides

EntityStructure.getMeta


getOwnedEntities()

getOwnedEntities(): Entity[]

A list of entities which has a reference to this entity.

Returns

Entity[]

Inherited from

EntityStructure.getOwnedEntities


getTypeName()

static getTypeName(): string

Returns the type name of this class.

Returns

string

Overrides

EntityStructure.getTypeName


getTypeName()

getTypeName(): string

Returns the name of this object's type.

Returns

string

Inherited from

EntityStructure.getTypeName


isOfType()

isOfType(type): boolean

Returns true if the object is of the specified type.

Parameters

ParameterType
typestring

Returns

boolean

Inherited from

EntityStructure.isOfType


isSame()

isSame(other): boolean

Returns true if this object refers to the same instance as the given object.

Parameters

ParameterType
otherScriptObject

Returns

boolean

Inherited from

EntityStructure.isSame