FloatCurve

Show Deprecated

An instance representing a 1D float curve encoded via a sorted list of FloatCurveKeys.

FloatCurveKeys are value-time points that represent the changes in value over time. The changes of a single value over time are represented by a curve. Animators can edit keys to modify a curve. The shape of the curve is dictated by the KeyInterpolationMode chosen at each key.

Summary

Properties

Number of keys in the float curve.

READ ONLY
NOT REPLICATED

Events

Methods


Returns a copy of a key at a given index.


Returns key indices before and after time.

GetKeys(): Array  

Returns a copy of all the keys in the FloatCurve as a Lua array of FloatCurveKey.


Samples the float curve at a given time passed as argument.


Adds the key passed as argument to this curve.

RemoveKeyAtIndex(startingIndex: number, count: number): number  

Removes a given number of Keys starting from a given index. Returns the number of keys that were removed.

SetKeys(keys: Array): number  

Resets this curve's keys using the FloatCurveKey array passed as argument.

Properties

Length

Read Only
Not Replicated

Number of keys in the float curve.

Events

Methods

GetKeyAtIndex

Returns a copy of a key at a given index.

Parameters

index: number

GetKeyIndicesAtTime

The first returned value is the index of the last key with key.time <= time (or min(1,length) if no key was found). The second returned value is the index of the first key with key.time >= time or the length of the curve if no key was found satisfying the inequality.

Parameters

time: number

Returns

GetKeys

Returns a copy of all the keys in the FloatCurve as a Lua array of FloatCurveKey.


Returns

GetValueAtTime

Samples the float curve at a given time passed as argument.

Parameters

time: number

Returns

InsertKey

Adds the key passed as argument to this curve. If a key exists at the same time it will be replaced. First return value is true if a key was added, false if a previous key was replaced. Second return value is the index at which the marker was added.

Parameters


Returns

RemoveKeyAtIndex

Removes a given number of Keys starting from a given index. Returns the number of keys that were removed.

Parameters

startingIndex: number
count: number
Default Value: "1"

Returns

SetKeys

Resets this curve's keys using the FloatCurveKey array passed as argument. Keys in the keysArray are sorted in ascending time order before insertion. Keys at duplicated times are removed in a stable manner. Returns the number of keys actually inserted.

Keys previously stored in this curve are removed before the keys passed as arguments are added.

Parameters

keys: Array

Returns