nuke.AnimationCurve

class nuke.AnimationCurve

Bases: object

Methods

addKey

Insert a sequence of keys.

changeInterpolation

Change interpolation (and extrapolation) type for the keys. :param keys: Sequence of keys. :param type: Interpolation type. One of: nuke.HORIZONTAL nuke.BREAK nuke.BEFORE_CONST nuke.BEFORE_LINEAR nuke.AFTER_CONST nuke.AFTER_LINEAR. :return: None.

clear

Delete all keys.

constant

return:

True if the animation appears to be a horizontal line, is a simple

derivative

The n'th derivative at time 't'.

evaluate

Value at time 't'.

expression

Get the expression.:return: String.

fixSlopes

return:

None.

fromScript

param s:

String.

identity

return:

True if the animation appears to be such that y == x everywhere. This

integrate

Calculate the area underneath the curve from t1 to t2.

inverse

The inverse function at value y.

keys

return:

List of keys.

knob

Return knob this animation belongs to.:return: Knob.

knobAndFieldName

Knob and field name combined (e.g.

knobIndex

Return the knob index this animation belongs to.:return: Int.

noExpression

return:

True if the expression is the default expression (i.e. the keys

removeKey

Remove some keys from the curve.

selected

return:

True if selected, False otherwise.

setExpression

Set expression.

setKey

Set a key at time t and value y.

size

return:

Number of keys.

toScript

param selected:

Optional parameter. If this is given and is True, then only

view

The view this AnimationCurve object is associated with.

addKey(keys) None.

Insert a sequence of keys. :param keys: Sequence of AnimationKey. :return: None.

changeInterpolation(keys, type) None.

Change interpolation (and extrapolation) type for the keys. :param keys: Sequence of keys. :param type: Interpolation type. One of:

nuke.HORIZONTAL nuke.BREAK nuke.BEFORE_CONST nuke.BEFORE_LINEAR nuke.AFTER_CONST nuke.AFTER_LINEAR.

Returns:

None.

clear() None.

Delete all keys. :return: None.

constant() bool
Returns:

True if the animation appears to be a horizontal line, is a simple

number, or it is the default and all the points are at the same y value and have 0 slopes. False otherwise.

derivative(t, n) Float.

The n’th derivative at time ‘t’. If n is less than 1 it returns evaluate(t). :param t: Time. :param n: Optional. Default is 1. :return: The value of the derivative.

evaluate(t) float

Value at time ‘t’. :param t: Time. :return: The value of the animation at time ‘t’.

expression() String.

Get the expression.:return: String.

fixSlopes() None.
Returns:

None.

fromScript(s) None.
Parameters:

s – String.

Returns:

None.

identity() bool
Returns:

True if the animation appears to be such that y == x everywhere. This

is True only for an expression of ‘x’ or the default expression and all points having y == x and slope == 1. Extrapolation is ignored.

integrate(t1, t2) Float.

Calculate the area underneath the curve from t1 to t2. :param t1 The start of the integration range. :param t2 The end of the integration range. :return: The result of the integration.

inverse(y) Float.

The inverse function at value y. This is the value of x such that evaluate(x) returns y. This is designed to invert color lookup tables. It only works if the derivative is zero or positive everywhere. :param y: The value of the function to get the inverse for. :return: Float.

keys() List of keys.
Returns:

List of keys.

knob() Knob.

Return knob this animation belongs to.:return: Knob.

knobAndFieldName() string.

Knob and field name combined (e.g. ‘translate.x’). :return: string.

knobIndex() Int.

Return the knob index this animation belongs to.:return: Int.

noExpression() bool
Returns:

True if the expression is the default expression (i.e. the keys

control the curve), False otherwise.

removeKey(keys) None.

Remove some keys from the curve. :param keys: The sequence of keys to be removed. :return: None.

selected() bool
Returns:

True if selected, False otherwise.

setExpression(s) None.

Set expression. :param s: A string containing the expression. :return: None.

setKey(t, y) Key.

Set a key at time t and value y. If there is no key there one is created. If there is a key there it is moved vertically to be at y. If a new key is inserted the interpolation and extrapolation are copied from a neighboring key, if there were no keys then it is set to nuke.SMOOTH interpolation and nuke.CONSTANT extrapolation. :param t: The time to set the key at. :param y: The value for the key. :return: The new key.

size() Number of keys.
Returns:

Number of keys.

toScript(selected) str
Parameters:

selected – Optional parameter. If this is given and is True, then only

process the selected curves; otherwise convert all. :return: A string containing the curves.

view() String.

The view this AnimationCurve object is associated with. :return: String.