FloatCurve
A sorted list of time-value pairs that define a curve. Used to animate a single numerical value.
Memory category | Instances |
---|
Member index 9
Description
An instance representing a 1D float curve encoded via a sorted list of FloatCurveKeys. The shape of the interpolation curve between two keys is determined by the FloatCurveKey.Interpolation type.
History 11
- 553 Add
- 553 Change Default of Length from to 0
- 496 Add SetKeys
- 496 Add RemoveKeyAtIndex
- 496 Add InsertKey
- 496 Add GetValueAtTime
- 496 Add GetKeys
- 496 Add GetKeyIndicesAtTime
- 496 Add GetKeyAtIndex
- 496 Add Length
- 496 Add FloatCurve
Members 9
GetKeyAtIndex
Parameters (1) | ||
---|---|---|
index | int | |
Returns (1) | ||
FloatCurveKey |
Returns a copy of a key at a given index.
Thread safety | Unsafe |
---|
History 1
- 496 Add GetKeyAtIndex
GetKeyIndicesAtTime
Parameters (1) | ||
---|---|---|
time | float | |
Returns (1) | ||
Array |
The first item in the returned array is the index of the last key with
time less than or equal to time
(or the lesser of either 1 or the curve
length if no key was found). The second item in the returned array is the
index of the first key with time greater than or equal to time
(or the
curve length if no key was found satisfying the inequality).
Thread safety | Unsafe |
---|
History 1
GetKeys
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
Array |
Returns a copy of all the keys in the FloatCurve as a Lua array of FloatCurveKeys.
Thread safety | Unsafe |
---|
GetValueAtTime
Parameters (1) | ||
---|---|---|
time | float | |
Returns (1) | ||
float? |
Samples the float curve at a given time passed as argument.
Thread safety | Unsafe |
---|
History 1
- 496 Add GetValueAtTime
InsertKey
Parameters (1) | ||
---|---|---|
key | FloatCurveKey | |
Returns (1) | ||
Array |
Adds the key passed as an argument to this curve. If a key at the same
time is found, it will be replaced. In the returned array, the first value
is true
if a key was added or false
if a previous key was replaced;
the second value is the index at which the marker was added.
Thread safety | Unsafe |
---|
Length
Type | Default | |
---|---|---|
int | 0 |
Number of keys in the float curve.
Thread safety | ReadSafe |
---|---|
Category | Data |
Loaded/Saved | false/true |
RemoveKeyAtIndex
Parameters (2) | Default | |
---|---|---|
startingIndex | int | |
count | int | 1 |
Returns (1) | ||
int |
Removes a given number (count
) of keys starting from the startingIndex
index and returns the number of keys that were removed.
Thread safety | Unsafe |
---|
History 1
- 496 Add RemoveKeyAtIndex
SetKeys
Parameters (1) | ||
---|---|---|
keys | Array | |
Returns (1) | ||
int |
Resets this curve's keys using the FloatCurveKey array passed
as an argument. Keys in the keys
array are sorted in ascending time
order before insertion, and 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.
Thread safety | Unsafe |
---|