Scripting API
AnimationModule
AnimationModule Overview

AnimationModule

The AnimationModule class implements object animation.

Example

Properties

PropertyDescription
animationClips
(get) animationClips: AnimationClips
(set) (Not Available)


Get an object that allows access to animation clips.
playbackControllers
(get) playbackControllers: AnimationPlaybackControllers
(set) (Not Available)


Get an object that allows access to animation playback controllers.
samplers
(get) samplers: SamplerFactory
(set) (Not Available)


Returns an instance of a SamplerFactory object that can be used to construct animation samplers.

Methods

MethodDescription
animate
animate(driver: TimeDriver | ValueDriver, sampler: ScalarSampler): ScalarSignal
animate(driver: TimeDriver | ValueDriver, sampler: ArrayOfScalarSamplers): ArrayOfScalarSignals
animate(driver: TimeDriver | ValueDriver, sampler: RotationSampler): QuaternionSignal
animate(driver: TimeDriver | ValueDriver, sampler: ColorSampler): RgbaSignal


Combines the driver and the sampler to create a signal that can be used to animate arbitrary properties of arbitrary objects.
For TimeDriver-based animations the animation will start only when TimeDriver.start is invoked.
timeDriver
timeDriver(params?: {durationMilliseconds?: number, loopCount?: number, mirror?: false | true}): TimeDriver


Returns a TimeDriver object that drives an animation for the specified parameters.
Optional parameters that can be used:
- durationMilliseconds - desgnates overall duration that driver should use. Default: 0 aka no specified duration.
- loopCount - defines the number of iterations before the time driver stops. Default: 0.
- mirror - boolean value that controls whether the drive should replay the animation backwards on every other iteration.
valueDriver
valueDriver(value: ScalarSignal, min: number, max: number): ValueDriver


Returns a ValueDriver object that drives an animation based on values emitted from a ScalarSignal.
The signal values are normalized and clamped to specified min and max values.

Classes

ClassDescription
AnimationClipThe AnimationClip class gives you access to the name, duration and identifier of each animation clip.
AnimationClipsThe AnimationClips class allows access to animation clips.
AnimationPlaybackControllerThe AnimationPlaybackController class describes an animation playback controller asset.
AnimationPlaybackControllersThe AnimationPlaybackControllers class allows access to animation playback controllers.
ArrayOfScalarSamplersThe ArrayOfScalarSamplers class describes an array of scalar samplers.
It extends the implementation of Array<ScalarSampler> type in JavaScript,
and adds a single additional method to get a sampler at a particular index - get().
ArrayOfScalarSignalsThe ArrayOfScalarSignals class describes an array of scalar signals.
It extends the implementation of Array<ScalarSignal> type in JavaScript,
and adds a single additional method to get a sampler at a particular index - get().
ColorSamplerThe ColorSampler class encapsulates a color sampler.
DriverThe Driver class represents an animation driver, a class that can drive an animation using a sampler and time, value or other means.
All animation drivers extend this base class and it's used to represent any animation driver in all APIs.
RotationSamplerThe RotationSampler class is an animation sampler for object rotation. It does not expose its own methods or properties, but inherits from the Animation module.
SamplerFactoryThe SamplerFactory class creates different types of animation samplers.
ScalarSamplerThe ScalarSampler class encapsulates a scalar value sampler.
TimeDriverThe TimeDriver class allows driving an animation sampler using time.
ValueDriverThe ValueDriver class allows driving an animation sampler using raw values.