Package nuke :: Class Array_Knob
[hide private]
[frames] | no frames]

Class Array_Knob

object --+    
         |    
 nuke.Knob --+
             |
            nuke.Array_Knob
Known Subclasses:

A knob which holds an array of values.

Instance Methods [hide private]
a new object with type S, a subtype of T
__new__(T, S, ...)
AnimationCurve or None
animation(self, chan, view)
Return the AnimationCurve for the channel 'chan' and view 'view'.
AnimationCurve list
animations(self, view)
Returns: AnimationCurve list.
List of knob values
array(self)
Returns: List of knob values.
Number of elements in array
arraySize(self)
Returns: Number of elements in array.
True if succeeded, False otherwise
clearAnimated(self, index, view)
Delete animation.
None
copyAnimation(self, channel, curve, view)
Copies the i'th channel of the AnimationCurve curve to this object.
None
copyAnimations(self, curves, view)
Copies the AnimationCurves from curves to this object.
Default value
defaultValue(self)
Returns: Default value.
None
deleteAnimation(self, curve)
Raises ValueError if not found.
Dimensions in array
dimensions(self)
Returns: Dimensions in array.
Frame number
frame(self)
Returns: Frame number.
True if successful, False otherwise
fromScript(self, s)
Set value of the knob to a user defined script (TCL syntax, as in .nk file).
 
getDerivative(...)
Return derivative at time 't' and index 'i'.
 
getIntegral(...)
Return integral at time interval [t1, t2] and index 'i'.
 
getKeyIndex(...)
Return index of the keyframe at time 't' and channel 'c'.
 
getKeyTime(...)
Return time of the keyframe at time 't' and channel 'c'.
 
getNthDerivative(...)
Return n'th derivative at time 't' and index 'i'.
 
getNumKeys(...)
Return number of keys at channel 'c'.
Floating point or List of floating point values (in case some are different)
getValue(self, index, view, time)
Returns: Floating point or List of floating point values (in case some are different).
Floating point or List of floating point values (in case some are different)
getValueAt(self, time, index, view)
Return value for this knob at specified time, optional index and view.
True if has expression, False otherwise
hasExpression(self, index)
Returns: True if has expression, False otherwise.
Height of array of values
height(self)
Returns: Height of array of values.
True if animated, False otherwise
isAnimated(self, index, view)
Returns: True if animated, False otherwise.
True if succeeded, False otherwise
isKey(self, index, view)
Returns: True if succeeded, False otherwise.
True if succeeded, False otherwise
isKeyAt(self, time, index, view)
Returns True if there is a keyframe at specified time, optional index and view, otherwise returns False.
Maximum value
max(self)
Returns: Maximum value.
Maximum value
maximum(self)
Returns: Maximum value.
Minimum value
min(self)
Returns: Minimum value.
Minimum value
minimum(self)
Returns: Minimum value.
True if any of the values is not set to the default, False otherwise
notDefault(self)
Returns: True if any of the values is not set to the default, False otherwise.
True if succeeded, False otherwise
removeKey(self, index, view)
Remove key.
True if succeeded, False otherwise
removeKeyAt(self, time, index, view)
Remove keyframe at specified time, optional index and view.
True if successful, False otherwise
resize(self, w, h)
Resize the array.
True if succeeded, False otherwise
setAnimated(self, index, view)
Create an Animation object.
None
setDefaultValue(self, s)
Returns: None.
bool
setExpression(self, expression, channel=-1, view=None)
Set the expression for a knob.
None
setKeyAt(self, time, index, view)
Set a key on element 'index', at time and view.
None
setRange(self, f1, f2)
Set range of values.
None
setSingleValue(self, b, view)
Set to just hold a single value or not.
True if value changed, False otherwise
setValue(self, value, index, time, view)
Safe to ignore.
bool
setValueAt(self, value, time, index, view)
Set value of element 'index' at time for view.
True if holds a single value
singleValue(self, view)
Returns: True if holds a single value.
None
splitView(self, view)
Split the view away from the current knob value.
String
toScript(self, quote, context)
Return the value of the knob in script syntax.
None
unsplitView(self, view)
Unsplit the view so that it shares a value with other views.
Floating point or List of floating point values (in case some are different)
value(self, index, view, time)
Returns: Floating point or List of floating point values (in case some are different).
Floating point or List of floating point values (in case some are different)
valueAt(self, time, index, view)
Return value for this knob at specified time, optional index and view.
List of knob values
vect(self)
Returns: List of knob values.
Width of array of values
width(self)
Returns: Width of array of values.

Inherited from Knob: Class, __init__, clearFlag, critical, debug, enabled, error, fullyQualifiedName, getFlag, getKeyList, label, name, node, setEnabled, setFlag, setLabel, setName, setTooltip, setVisible, tooltip, visible, warning

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__new__(T, S, ...)

 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

animation(self, chan, view)

 

Return the AnimationCurve for the channel 'chan' and view 'view'. The view argument is optional.

Parameters:
  • channel - The channel index.
  • view - Optional view.
Returns: AnimationCurve or None
AnimationCurve or None.

animations(self, view)

 
Parameters:
  • view - Optional view.
Returns: AnimationCurve list
AnimationCurve list. Example: b = nuke.nodes.Blur() k = b['size'] k.setAnimated(0) a = k.animations() a[0].setKey(0, 11) a[0].setKey(10, 20)

array(self)

 
Returns: List of knob values
List of knob values.

arraySize(self)

 
Returns: Number of elements in array
Number of elements in array.

clearAnimated(self, index, view)

 

Delete animation.

Parameters:
  • index - Optional index.
  • view - Optional view.
Returns: True if succeeded, False otherwise
True if succeeded, False otherwise.
Overrides: Knob.clearAnimated

copyAnimation(self, channel, curve, view)

 

Copies the i'th channel of the AnimationCurve curve to this object. The view is optional and defaults to the current view.

Parameters:
  • channel - The channel index.
  • curve - AnimationCurve.
  • view - Optional view. Defaults to current.
Returns: None
None.

copyAnimations(self, curves, view)

 

Copies the AnimationCurves from curves to this object. The view is optional and defaults to the current view.

Parameters:
  • curves - AnimationCurve list.
  • view - Optional view. Defaults to current.
Returns: None
None.

defaultValue(self)

 
Returns: Default value
Default value.

deleteAnimation(self, curve)

 

Raises ValueError if not found. Deletes the AnimationCurve.

Parameters:
  • curve - An AnimationCurve instance which belongs to this Knob.
Returns: None
None. Raises ValueError if not found.

dimensions(self)

 
Returns: Dimensions in array
Dimensions in array.

frame(self)

 
Returns: Frame number
Frame number.

fromScript(self, s)

 

Set value of the knob to a user defined script (TCL syntax, as in .nk file). Return True if successful.

Parameters:
  • s - Nuke script to be set on knob.
Returns: True if successful, False otherwise
True if successful, False otherwise.
Overrides: Knob.fromScript

getDerivative(...)

 

Return derivative at time 't' and index 'i'.

Overrides: Knob.getDerivative

getIntegral(...)

 

Return integral at time interval [t1, t2] and index 'i'.

Overrides: Knob.getIntegral

getKeyIndex(...)

 

Return index of the keyframe at time 't' and channel 'c'.

Overrides: Knob.getKeyIndex

getKeyTime(...)

 

Return time of the keyframe at time 't' and channel 'c'.

Overrides: Knob.getKeyTime

getNthDerivative(...)

 

Return n'th derivative at time 't' and index 'i'.

Overrides: Knob.getNthDerivative

getNumKeys(...)

 

Return number of keys at channel 'c'.

Overrides: Knob.getNumKeys

getValue(self, index, view, time)

 

Return value at the current frame for channel 'c'.

Parameters:
  • index - Optional index. Default is 0.
  • view - Optional view.
  • time - Optional time.
Returns: Floating point or List of floating point values (in case some are different)
Floating point or List of floating point values (in case some are different).
Overrides: Knob.getValue

getValueAt(self, time, index, view)

 

Return value for this knob at specified time, optional index and view.

Parameters:
  • time - Time.
  • index - Optional index. Default is 0.
  • view - Optional view.
Returns: Floating point or List of floating point values (in case some are different)
Floating point or List of floating point values (in case some are different).
Overrides: Knob.getValueAt

hasExpression(self, index)

 

Return True if animation at index 'index' has an expression.

Parameters:
  • index - Optional index.
Returns: True if has expression, False otherwise
True if has expression, False otherwise.
Overrides: Knob.hasExpression

height(self)

 
Returns: Height of array of values
Height of array of values.

isAnimated(self, index, view)

 

Return True if channel 'c' is animated.

Parameters:
  • index - Optional index.
  • view - Optional view.
Returns: True if animated, False otherwise
True if animated, False otherwise.
Overrides: Knob.isAnimated

isKey(self, index, view)

 

Return True if there is a keyframe at the current frame for channel 'c'.

Parameters:
  • index - Optional index.
  • view - Optional view.
Returns: True if succeeded, False otherwise
True if succeeded, False otherwise.
Overrides: Knob.isKey

isKeyAt(self, time, index, view)

 

Returns True if there is a keyframe at specified time, optional index and view, otherwise returns False.

Parameters:
  • time - Time.
  • index - Optional index.
  • view - Optional view.
Returns: True if succeeded, False otherwise
True if succeeded, False otherwise.
Overrides: Knob.isKeyAt

max(self)

 
Returns: Maximum value
Maximum value.

maximum(self)

 
Returns: Maximum value
Maximum value.

min(self)

 
Returns: Minimum value
Minimum value.

minimum(self)

 
Returns: Minimum value
Minimum value.

notDefault(self)

 
Returns: True if any of the values is not set to the default, False otherwise
True if any of the values is not set to the default, False otherwise.

removeKey(self, index, view)

 

Remove key.

Parameters:
  • index - Optional index.
  • view - Optional view.
Returns: True if succeeded, False otherwise
True if succeeded, False otherwise.
Overrides: Knob.removeKey

removeKeyAt(self, time, index, view)

 

Remove keyframe at specified time, optional index and view. Return True if successful.

Parameters:
  • time - Time.
  • index - Optional index.
  • view - Optional view.
Returns: True if succeeded, False otherwise
True if succeeded, False otherwise.
Overrides: Knob.removeKeyAt

resize(self, w, h)

 

Resize the array.

Parameters:
  • w - New width
  • h - Optional new height
Returns: True if successful, False otherwise
True if successful, False otherwise.

setAnimated(self, index, view)

 

Create an Animation object. Return True if successful, in which case caller must initialise it by calling setValue() or setValueAt().

Parameters:
  • index - Optional index.
  • view - Optional view.
Returns: True if succeeded, False otherwise
True if succeeded, False otherwise.
Overrides: Knob.setAnimated

setDefaultValue(self, s)

 
Parameters:
  • s - Sequence of floating-point values.
Returns: None
None.

setExpression(self, expression, channel=-1, view=None)

 

Set the expression for a knob. You can optionally specify a channel to set the expression for.

Parameters:
  • expression - The new expression for the knob. This should be a string.
  • channel - Optional parameter, specifying the channel to set the expression for. This should be an integer.
  • view - Optional view parameter. Without, this command will set the expression for the current view theinterface is displaying. Can be the name of the view or the index.
Returns: bool
True if successful, False if not.
Overrides: Knob.setExpression

setKeyAt(self, time, index, view)

 

Set a key on element 'index', at time and view.

Parameters:
  • time - Time.
  • index - Optional index.
  • view - Optional view.
Returns: None
None.

setRange(self, f1, f2)

 

Set range of values. @param f1 Min value. @param f2 Max value.

Returns: None
None.

setSingleValue(self, b, view)

 

Set to just hold a single value or not.

Parameters:
  • b - Boolean object.
  • view - Optional view. Default is current view.
Returns: None
None.

setValue(self, value, index, time, view)

 

Safe to ignore. Set index to value at time and view.

Parameters:
  • value - Floating point value.
  • index - Optional index.
  • time - Optional time.
  • view - Optional view.
Returns: True if value changed, False otherwise
True if value changed, False otherwise. Safe to ignore.
Overrides: Knob.setValue

setValueAt(self, value, time, index, view)

 

Set value of element 'index' at time for view. If the knob is animated, it will set a new keyframe or change an existing one. Index and view are optional. Return True if successful.

Parameters:
  • value - Floating point value.
  • time - Time.
  • index - Optional index.
  • view - Optional view.
Returns: bool
True if value changed, False otherwise. Safe to ignore.
Overrides: Knob.setValueAt

singleValue(self, view)

 
Parameters:
  • view - Optional view. Default is current view.
Returns: True if holds a single value
True if holds a single value.

splitView(self, view)

 

Split the view away from the current knob value.

Parameters:
  • view - Optional view. Default is current view.
Returns: None
None.

toScript(self, quote, context)

 

Return the value of the knob in script syntax.

Parameters:
  • quote - Optional, default is False. Specify True to return the knob value quoted in {}.
  • context - Optional context, default is current, None will be "contextless" (all views, all keys) as in a .nk file.
Returns: String
String.
Overrides: Knob.toScript

unsplitView(self, view)

 

Unsplit the view so that it shares a value with other views.

Parameters:
  • view - Optional view. Default is current view.
Returns: None
None.

value(self, index, view, time)

 

Return value at the current frame for channel 'c'.

Parameters:
  • index - Optional index. Default is 0.
  • view - Optional view.
  • time - Optional time.
Returns: Floating point or List of floating point values (in case some are different)
Floating point or List of floating point values (in case some are different).
Overrides: Knob.value

valueAt(self, time, index, view)

 

Return value for this knob at specified time, optional index and view.

Parameters:
  • time - Time.
  • index - Optional index. Default is 0.
  • view - Optional view.
Returns: Floating point or List of floating point values (in case some are different)
Floating point or List of floating point values (in case some are different).

vect(self)

 
Returns: List of knob values
List of knob values.

width(self)

 
Returns: Width of array of values
Width of array of values.