Editor.AnimationClip
ClassRepresents an animation clip instance with playback configuration.
Index
Properties
Methods
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
readonlyid:Uuid
The unique id of the entity.
Inherited from
meta
readonlymeta:Meta
Metadata associated with this entity, providing access to its unique identifier and other descriptive properties.
Inherited from
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
readonlytype:string
The entity's type.
Inherited from
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()
staticgetMeta():Meta
Returns metadata about this type.
Returns
Overrides
getOwnedEntities()
getOwnedEntities():
Entity[]
A list of entities which has a reference to this entity.
Returns
Entity[]
Inherited from
EntityStructure.getOwnedEntities
getTypeName()
staticgetTypeName():string
Returns the type name of this class.
Returns
string
Overrides
getTypeName()
getTypeName():
string
Returns the name of this object's type.
Returns
string
Inherited from
isOfType()
isOfType(
type):boolean
Returns true if the object is of the specified type.
Parameters
| Parameter | Type |
|---|---|
type | string |
Returns
boolean
Inherited from
isSame()
isSame(
other):boolean
Returns true if this object refers to the same instance as the given object.
Parameters
| Parameter | Type |
|---|---|
other | ScriptObject |
Returns
boolean