Animation

Interfaces

Type Aliases


Type Aliases

ColorMap

RGB color values are specified in the 0-255 range. Positions are specified in the 0-1 range, pre-sorted in ascending order.

KeyframeIndex

Functions

createCameraChannels

Animation.createCameraChannels(animation, namePrefix, interpolationType)
Arguments
  • animation (Animation()) – Animation that will receive the new camera channels. This animation should not contain any camera channels.

  • namePrefix (string()) – Prefix to use for channel names.

  • interpolationType (InterpolationType()) – The type of interpolation that will be set on each sampler that is created.

Convenience method that sets up Animation channels, samplers, and keyframe buffers for the supplied camera.

The created channel and buffer names will have the form: <namePrefix>-<Property> where type is the corresponding value of [[CameraProperty]]

Return type

[CameraChannel]

exportAnimations

Animation.exportAnimations(animations)
Arguments
  • animations ([Animation]()) – None

Return the given animations and their dependent data in a form suitable for serialization via, e.g., JSON.stringify. The animation objects can be recreated by passing the output to [[importAnimations]].

Sharing of objects such as keyframe buffers and samplers is preserved.

The layout of the returned data is subject to change in future releases.

Return type

object

importAnimations

Animation.importAnimations(exportedObj)
Arguments
  • exportedObj (object()) – None

Recreate [[Animation]] objects exported by a call to [[exportAnimations]].

Return type

[Animation]

keyframeCamera

Animation.keyframeCamera(t, camera, animation)
Arguments
  • t (number()) – Animation time (in seconds) that will be used for the created keyframes

  • camera (Camera()) – Camera containing the current values to keyframe.

  • animation (Animation()) – An animation containing camera channels created using [[createChannelsForCamera]]

Convenience method that will update keyframe buffers for animation channels created with [[createChannelsForCamera]].

Return type

void