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
Methods
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()
) – Nonex (
number()
) – Noney (
number()
) – Nonez (
number()
) – Nonew (
number()
) – NoneinTanX (
number()
) – optional NoneinTanY (
number()
) – optional NoneinTanZ (
number()
) – optional NoneinTanW (
number()
) – optional NoneoutTanX (
number()
) – optional NoneoutTanY (
number()
) – optional NoneoutTanZ (
number()
) – optional NoneoutTanW (
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()
) – Noneval (
number()
) – NoneinTan (
number()
) – optional NoneoutTan (
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()
) – Nonex (
number()
) – Noney (
number()
) – Nonez (
number()
) – NoneinTanX (
number()
) – optional NoneinTanY (
number()
) – optional NoneinTanZ (
number()
) – optional NoneoutTanX (
number()
) – optional NoneoutTanY (
number()
) – optional NoneoutTanZ (
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()
) – Nonet (
number()
) – Nonex (
number()
) – Noney (
number()
) – Nonez (
number()
) – Nonew (
number()
) – NoneinTanX (
number()
) – optional NoneinTanY (
number()
) – optional NoneinTanZ (
number()
) – optional NoneinTanW (
number()
) – optional NoneoutTanX (
number()
) – optional NoneoutTanY (
number()
) – optional NoneoutTanZ (
number()
) – optional NoneoutTanW (
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()
) – Nonet (
number()
) – Noneval (
number()
) – NoneinTan (
number()
) – optional NoneoutTan (
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()
) – Nonet (
number()
) – Nonex (
number()
) – Noney (
number()
) – Nonez (
number()
) – NoneinTanX (
number()
) – optional NoneinTanY (
number()
) – optional NoneinTanZ (
number()
) – optional NoneoutTanX (
number()
) – optional NoneoutTanY (
number()
) – optional NoneoutTanZ (
number()
) – optional None
Updates a Vec3 keyframe at the specified index. The type of this buffer should be [[KeyType.Vec3]]
- Return type
number