KeyframeBuffer

class Animation.KeyframeBuffer()

This class contains a collection of keyframes. A Keyframe consists of a scalar value T, representing the linear time in seconds, and a vector of scalars described by [[KeyType]]. Optionally, a Keyframe can also have a vector of tangents described by [[KeyType]], that are used for cubic spline interpolation. Keyframes are stored in the times, values, and tangents arrays. For example, with [[KeyType]] of Vec3: times: t0, t1, … tn values: v0x, v0y, v0z, … vnx, vny, vnz tangents: in_v0x, in_v0y, in_v0z, out_v0x, out_v0y, out_v0z, … in_vnx, in_vny, in_vnz, out_vnx, out_vny, out_vnz

Constructors


Constructors

KeyframeBuffer.constructor(keyType)
Arguments:
  • keyType (KeyType()) – The type of keyframes that will be stored in the buffer.

Creates a new buffer for storing keyframe data.

Return type:KeyframeBuffer

Properties

KeyframeBuffer.keyOffset
Type:number

The number of elements between successive keyframes in the array.

KeyframeBuffer.keyType
Type:KeyType

The type of keyframes that will be stored in the buffer.

KeyframeBuffer.tangents
Type:[number]
KeyframeBuffer.times
Type:[number]
KeyframeBuffer.values
Type:[number]

Methods

deleteKeyframe

KeyframeBuffer.deleteKeyframe(index)
Arguments:
  • index (number()) – None

Deletes a keyframe at the specified index.

Return type:void

getKeyframeIndex

KeyframeBuffer.getKeyframeIndex(t)
Arguments:
  • t (number()) – None

Returns the index of the keyframe at the specified time.

Return type:number

insertQuatKeyframe

KeyframeBuffer.insertQuatKeyframe(t, x, y, z, w[, inTanX[, inTanY[, inTanZ[, inTanW[, outTanX[, outTanY[, outTanZ[, outTanW]]]]]]]])
Arguments:
  • t (number()) – None
  • x (number()) – None
  • y (number()) – None
  • z (number()) – None
  • w (number()) – None
  • inTanX (number()) – optional None
  • inTanY (number()) – optional None
  • inTanZ (number()) – optional None
  • inTanW (number()) – optional None
  • outTanX (number()) – optional None
  • outTanY (number()) – optional None
  • outTanZ (number()) – optional None
  • outTanW (number()) – optional None

Inserts a Quat keyframe with the specified time. The type of this buffer should be [[KeyType.Quat]]

Returns:Index at which keyframe was inserted
Return type:void

insertScalarKeyframe

KeyframeBuffer.insertScalarKeyframe(t, val[, inTan[, outTan]])
Arguments:
  • t (number()) – None
  • val (number()) – None
  • inTan (number()) – optional None
  • outTan (number()) – optional None

Inserts a Scalar keyframe with the specified time. The type of this buffer should be [[KeyType.Scalar]]

Returns:Index at which keyframe was inserted
Return type:number

insertVec3Keyframe

KeyframeBuffer.insertVec3Keyframe(t, x, y, z[, inTanX[, inTanY[, inTanZ[, outTanX[, outTanY[, outTanZ]]]]]])
Arguments:
  • t (number()) – None
  • x (number()) – None
  • y (number()) – None
  • z (number()) – None
  • inTanX (number()) – optional None
  • inTanY (number()) – optional None
  • inTanZ (number()) – optional None
  • outTanX (number()) – optional None
  • outTanY (number()) – optional None
  • outTanZ (number()) – optional None

Inserts a Vec3 keyframe with the specified time. The type of this buffer should be [[KeyType.Vec3]]

Returns:Index at which keyframe was inserted
Return type:number

updateQuatKeyframe

KeyframeBuffer.updateQuatKeyframe(index, t, x, y, z, w[, inTanX[, inTanY[, inTanZ[, inTanW[, outTanX[, outTanY[, outTanZ[, outTanW]]]]]]]])
Arguments:
  • index (number()) – None
  • t (number()) – None
  • x (number()) – None
  • y (number()) – None
  • z (number()) – None
  • w (number()) – None
  • inTanX (number()) – optional None
  • inTanY (number()) – optional None
  • inTanZ (number()) – optional None
  • inTanW (number()) – optional None
  • outTanX (number()) – optional None
  • outTanY (number()) – optional None
  • outTanZ (number()) – optional None
  • outTanW (number()) – optional None

Updates a Quat keyframe at the specified index. The type of this buffer should be [[KeyType.Quat]]

Return type:void

updateScalarKeyframe

KeyframeBuffer.updateScalarKeyframe(index, t, val[, inTan[, outTan]])
Arguments:
  • index (number()) – None
  • t (number()) – None
  • val (number()) – None
  • inTan (number()) – optional None
  • outTan (number()) – optional None

Updates a Scalar keyframe at the specified index. The type of this buffer should be [[KeyType.Scalar]]

Return type:void

updateVec3Keyframe

KeyframeBuffer.updateVec3Keyframe(index, t, x, y, z[, inTanX[, inTanY[, inTanZ[, outTanX[, outTanY[, outTanZ]]]]]])
Arguments:
  • index (number()) – None
  • t (number()) – None
  • x (number()) – None
  • y (number()) – None
  • z (number()) – None
  • inTanX (number()) – optional None
  • inTanY (number()) – optional None
  • inTanZ (number()) – optional None
  • outTanX (number()) – optional None
  • outTanY (number()) – optional None
  • outTanZ (number()) – optional None

Updates a Vec3 keyframe at the specified index. The type of this buffer should be [[KeyType.Vec3]]

Return type:number