Skip to content

AnimationScene

Introduction

vtkAnimationScene orchestrates the playback of multiple animation cues. It manages global time, supports looping, and dispatches tick events to all registered cues each frame. Scenes can be played, paused, stopped, and seeked to arbitrary times.

Methods

addCue

Add a cue to this scene.

ArgumentTypeRequiredDescription
cuevtkAnimationCueYesThe animation cue to add.

extend

Method used to decorate a given object (publicAPI+model) with vtkAnimationScene characteristics.

ArgumentTypeRequiredDescription
publicAPIYesobject on which methods will be bounds (public)
modelYesobject on which data structure will be bounds (protected)
initialValuesIAnimationSceneInitialValuesNo(default: {})

getCue

Get a cue by index.

ArgumentTypeRequiredDescription
indexnumberYesThe cue index.

getCues

Get a copy of the list of cues in this scene.

getCuesByReference

Get the list of cues without copying it.

getFrameRate

Get the frames per second used in PlayMode.SEQUENCE.

getLoop

Get whether the scene loops.

getNumberOfCues

Get the number of cues in this scene.

getPlayMode

Get how the scene turns a tick into a time step.

isInPlay

Alias of isPlaying().

newInstance

Method used to create a new instance of vtkAnimationScene.

ArgumentTypeRequiredDescription
initialValuesIAnimationSceneInitialValuesNofor pre-setting some of its content

pause

Pause the scene and every cue it holds. Does nothing unless the scene plays. A caller that drives the scene itself can stop ticking it instead.

play

Play the scene and every cue it holds. A playing scene ignores the call, a paused scene continues from the time it holds, and a stopped scene plays again from the start time.

removeAllCues

Remove every cue from this scene.

removeCue

Remove a cue from this scene.

ArgumentTypeRequiredDescription
cuevtkAnimationCueYesThe animation cue to remove.

seek

Alias of setAnimationTime().

ArgumentTypeRequiredDescription
timenumberYesThe time to move to, clamped to the scene bounds.

setAnimationTime

Move to a time without changing the state, so a paused scene stays paused. A cue outside the time stops, and a cue inside it moves to that same time and reports it through its own tick event.

ArgumentTypeRequiredDescription
timenumberYesThe time to move to, clamped to the scene bounds.

setCueState

Move the scene to a state and carry that state into every cue. Does nothing when the scene already holds that state. Read it back with the inherited getCueState().

ArgumentTypeRequiredDescription
statenumberYesOne of SceneState.

setFrameRate

Set the frames per second used in PlayMode.SEQUENCE.

ArgumentTypeRequiredDescription
frameRatenumberYes

setLoop

Set whether the scene should loop.

ArgumentTypeRequiredDescription
loopbooleanYesTrue to enable looping.

setPlayMode

Set how the scene turns a tick into a time step. In PlayMode.SEQUENCE every tick advances by one frame of the frame rate, whatever the caller reports, so a run is repeatable. In PlayMode.REALTIME every tick advances by the delta the caller reports, which is what a render loop supplies.

ArgumentTypeRequiredDescription
playModenumberYesOne of PlayMode.

setPlayModeToRealTime

Play by the time step the caller reports.

setPlayModeToSequence

Play by steps of one frame, the same on every run.

start

Alias of play().

stop

Stop the scene, reset it to the start time and stop every cue. Does nothing when the scene is already stopped, so a scene that ran to its end time keeps reporting that end time until it starts again.

tick

Advance the scene and every cue it holds. The scene owns its clock, so it moves by deltaTime and ignores the time the caller reports. The unused first argument keeps the signature of the cue this class derives from.

ArgumentTypeRequiredDescription
currentTimenumberYesUnused.
deltaTimenumberYesThe time delta since last frame.
clockTimenumberNoWall clock time, handed down to the cues.