AnimationClip
Introduction
vtkAnimationClip is a container for multiple animation tracks that together define a named animation. Each track targets a specific bone and transform channel. The clip computes its duration as the maximum duration across all contained tracks.
Methods
addTrack
Add a track to this clip.
| Argument | Type | Required | Description |
|---|---|---|---|
track | vtkAnimationTrack | Yes | The animation track to add. |
boneIndex | number | No | The bone the track animates, for a skeletal clip. Read the tracks of a bone back with getTracksForBone(). |
clear
Clear all tracks from the clip.
extend
Method used to decorate a given object (publicAPI+model) with vtkAnimationClip characteristics.
| Argument | Type | Required | Description |
|---|---|---|---|
publicAPI | Yes | object on which methods will be bounds (public) | |
model | Yes | object on which data structure will be bounds (protected) | |
initialValues | IAnimationClipInitialValues | No | (default: {}) |
getDuration
Get the duration of the clip (maximum duration of all tracks).
getName
Get the clip name.
getNumberOfTracks
Get the number of tracks in this clip.
getTrack
Get a track by index.
| Argument | Type | Required | Description |
|---|---|---|---|
index | number | Yes | The track index. |
getTrackByName
Find a track by name.
| Argument | Type | Required | Description |
|---|---|---|---|
name | string | Yes | The track name. |
getTracks
Get all tracks in this clip.
getTracksForBone
Get the tracks that animate a bone, in the order they were added. The clip owns this association, so a track carries keyframes only.
| Argument | Type | Required | Description |
|---|---|---|---|
boneIndex | number | Yes | The bone index. |
newInstance
Method used to create a new instance of vtkAnimationClip.
| Argument | Type | Required | Description |
|---|---|---|---|
initialValues | IAnimationClipInitialValues | No | for pre-setting some of its content |
removeTrack
Remove a track by index. The duration shortens only when the track that set it goes away.
| Argument | Type | Required | Description |
|---|---|---|---|
index | number | Yes | The track index, a whole number, zero or more. |
setDuration
Set the duration of the clip.
| Argument | Type | Required | Description |
|---|---|---|---|
duration | number | Yes | The duration. |
setName
Set the clip name.
| Argument | Type | Required | Description |
|---|---|---|---|
name | string | Yes | The name. |