Skip to content

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.

ArgumentTypeRequiredDescription
trackvtkAnimationTrackYesThe animation track to add.
boneIndexnumberNoThe 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.

ArgumentTypeRequiredDescription
publicAPIYesobject on which methods will be bounds (public)
modelYesobject on which data structure will be bounds (protected)
initialValuesIAnimationClipInitialValuesNo(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.

ArgumentTypeRequiredDescription
indexnumberYesThe track index.

getTrackByName

Find a track by name.

ArgumentTypeRequiredDescription
namestringYesThe 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.

ArgumentTypeRequiredDescription
boneIndexnumberYesThe bone index.

newInstance

Method used to create a new instance of vtkAnimationClip.

ArgumentTypeRequiredDescription
initialValuesIAnimationClipInitialValuesNofor pre-setting some of its content

removeTrack

Remove a track by index. The duration shortens only when the track that set it goes away.

ArgumentTypeRequiredDescription
indexnumberYesThe track index, a whole number, zero or more.

setDuration

Set the duration of the clip.

ArgumentTypeRequiredDescription
durationnumberYesThe duration.

setName

Set the clip name.

ArgumentTypeRequiredDescription
namestringYesThe name.