GCubeSDK
©2026 FenixFox®Studios

AnimationAction

Controls playback of a single AnimationClip.
An instance of AnimationAction schedules the playback of an animation which is stored in AnimationClip.

Methods

AnimationAction(AnimationMixer* mixer, const AnimationClip& clip, Object3D* root)

Constructor to create an animation action

mixer Animation mixer that manages this action
clip Animation clip to play
root Root object to apply animation to

AnimationAction& crossFadeFrom(AnimationAction& fadeOutAction, f32 duration, bool warp)

Cross-fades from another action

fadeOutAction Action to fade out from
duration Fade duration in seconds
warp Whether to warp time scale

AnimationAction& crossFadeTo(AnimationAction& fadeInAction, f32 duration, bool warp)

Cross-fades to another action

fadeInAction Action to fade in to
duration Fade duration in seconds
warp Whether to warp time scale

AnimationAction& fadeIn(f32 duration)

Fades in this action

duration Fade duration in seconds

AnimationAction& fadeOut(f32 duration)

Fades out this action

duration Fade duration in seconds

f32 getEffectiveTimeScale() const

Gets the effective time scale

f32 getEffectiveWeight() const

Gets the effective blend weight

const AnimationClip& getClip() const

Gets the animation clip

AnimationMixer* getMixer() const

Gets the animation mixer

Object3D* getRoot() const

Gets the root object

AnimationAction& halt(f32 duration)

Halts the animation

duration Halt duration in seconds

bool isRunning() const

Checks if the action is currently running

bool isScheduled() const

Checks if the action is scheduled to run

AnimationAction& play()

Starts playing the animation

AnimationAction& reset()

Resets the animation to initial state

AnimationAction& setDuration(f32 duration)

Sets the duration of the animation

duration Duration in seconds

AnimationAction& setEffectiveTimeScale(f32 timeScale)

Sets the effective time scale

timeScale Time scale factor

AnimationAction& setEffectiveWeight(f32 weight)

Sets the effective blend weight

weight Blend weight value

AnimationAction& setLoop(LoopModes loopMode, f32 repetitions)

Sets the loop mode and repetitions

loopMode Loop mode (LoopOnce, LoopRepeat, LoopPingPong)
repetitions Number of repetitions

AnimationAction& startAt(f32 startTimeInSeconds)

Sets the start time of the animation

startTimeInSeconds Start time in seconds

AnimationAction& stop()

Stops the animation

AnimationAction& stopFading()

Stops any active fade

AnimationAction& stopWarping()

Stops any active time warp

AnimationAction& syncWith(AnimationAction& otherAction)

Synchronizes time with another action

otherAction Action to sync with

AnimationAction& warp(f32 startTimeScale, f32 endTimeScale, f32 duration)

Warps the time scale over duration

startTimeScale Starting time scale
endTimeScale Ending time scale
duration Warp duration in seconds

void update(f32 globalTime)

Updates the animation state

globalTime Global time delta in seconds

PropertyBinding* getOrCreateBinding(const string& trackName)

Gets or creates a property binding for a track

trackName Name of the animation track

Properties

blendMode AnimationBlendModes Blend mode for mixing animations
clampWhenFinished bool Pause on last frame
clip AnimationClip The animation clip
enabled bool Whether action is enabled
loop LoopModes Loop mode (LoopOnce, LoopRepeat, LoopPingPong)
mixer AnimationMixer* Reference to the mixer
paused bool Whether action is paused
repetitions f32 Number of repetitions
root Object3D* Root object
time f32 Local time
timeScale f32 Time scale factor
weight f32 Blend weight
zeroSlopeAtEnd bool Smooth interpolation at end
zeroSlopeAtStart bool Smooth interpolation at start