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

Class Knob

object --+
         |
        nuke.Knob
Known Subclasses:

A modifiable control that appears (unless hidden) in the panel for a node. This is a base class that specific knob types inherit from.

Knobs can be animated, have expressions, be disabled or hidden and more.

Instance Methods [hide private]
Class name
Class(self)
Returns: Class name.
 
__init__(...)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
a new object with type S, a subtype of T
__new__(T, S, ...)
 
clearAnimated(...)
Clear animation for channel 'c'.
None
clearFlag(self, f)
Clear flag.
None
critical(self, message)
Returns: None.
None
debug(self, message)
Returns: None.
Boolean
enabled(self)
Returns: True if the knob is enabled, False if it's disabled.
None
error(self, message)
Returns: None.
 
fromScript(...)
Initialise from script.
string
fullyQualifiedName(self, channel=-1)
Returns the fully-qualified name of the knob within the node.
 
getDerivative(...)
Return derivative at time 't' for channel 'c'.
Bool
getFlag(self, f)
Returns whether the input flag is set.
 
getIntegral(...)
Return integral at the interval [t1, t2] for channel 'c'.
 
getKeyIndex(...)
Return keyframe index at time 't' for channel 'c'.
 
getKeyTime(...)
Return index of the keyframe at time 't' for channel 'c'.
 
getNthDerivative(...)
Return nth derivative at time 't' for channel 'c'.
 
getNumKeys(...)
Return number of keyframes for channel 'c'.
 
getValue(...)
Return value at the current frame for channel 'c'.
 
getValueAt(...)
Return value at time 't' for channel 'c'.
bool
hasExpression(self, index=-1)
Return True if animation at index 'index' has an expression.
 
isAnimated(...)
Return True if channel 'c' is animated.
 
isKey(...)
Return True if there is a keyframe at the current frame for channel 'c'.
 
isKeyAt(...)
Return True if there is a keyframe at time 't' for channel 'c'.
label
label(self)
Returns: label.
name
name(self)
Returns: name.
nuke.Node
node(self)
Return the node that this knob belongs to.
 
removeKey(...)
Remove key for channel 'c'.
 
removeKeyAt(...)
Remove key at time 't' for channel 'c'.
 
setAnimated(...)
Set channel 'c' to be animated.
None
setEnabled(self, enabled)
Enable or disable the knob.
bool
setExpression(self, expr, channel=-1, view=None)
Set the expression for a knob.
None
setFlag(self, f)
Logical OR of the argument and existing knob flags.
None
setLabel(self, s)
Returns: None.
None
setName(self, s)
Returns: None.
None
setTooltip(self, s)
Returns: None.
bool
setValue(self, val, chan)
Sets the value 'val' at channel 'chan'.
bool
setValueAt(self, val, time, chan)
Sets the value 'val' at channel 'chan' for time 'time'.
None
setVisible(self, visible)
Show or hide the knob.
string
toScript(quote, context=current)
Return the value of the knob in script syntax.
tooltip
tooltip(self)
Returns: tooltip.
 
value(...)
Return value at the current frame for channel 'c'.
Boolean
visible(self)
Returns: True if the knob is visible, False if it's hidden.
None
warning(self, message)
Returns: None.

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]

Class(self)

 
Returns: Class name
Class name.

__init__(...)
(Constructor)

 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__

__new__(T, S, ...)

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

clearAnimated(...)

 

Clear animation for channel 'c'. Return True if successful.

clearFlag(self, f)

 

Clear flag.

Parameters:
  • f - Flag.
Returns: None
None.

critical(self, message)

 
Parameters:
  • message - message to put the knob in error, and do a popup.
Returns: None
None.

debug(self, message)

 
Parameters:
  • message - message to put out to the error console, attached to the knob, if the verbosity level is set high enough.
Returns: None
None.

enabled(self)

 
Returns: Boolean
True if the knob is enabled, False if it's disabled.

error(self, message)

 
Parameters:
  • message - message to put the knob in error.
Returns: None
None.

fullyQualifiedName(self, channel=-1)

 

Returns the fully-qualified name of the knob within the node. This can be useful for expression linking.

Parameters:
  • channel - Optional parameter, specifies the channel number of the sub-knob (for example, channels of 0 and 1 would refer to the x and y of a XY_Knob respectively), leave blank or set to -1 to get the qualified name of the knob only.
Returns: string
The string of the qualified knob or sub-knob, which can be used directly in expression links.

getFlag(self, f)

 

Returns whether the input flag is set.

Parameters:
  • f - Flag.
Returns: Bool
True if set, False otherwise.

hasExpression(self, index=-1)

 

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

Parameters:
  • index - Optional index parameter. Defaults to -1 if not specified. This can be specified as a keyword parameter if desired.
Returns: bool
True if has expression, False otherwise.

label(self)

 
Returns: label
label.

name(self)

 
Returns: name
name.

node(self)

 

Return the node that this knob belongs to. If the node has been cloned, we'll always return a reference to the original.

Returns: nuke.Node
The node which owns this knob, or None if the knob has no owner yet.

removeKey(...)

 

Remove key for channel 'c'. Return True if successful.

removeKeyAt(...)

 

Remove key at time 't' for channel 'c'. Return True if successful.

setEnabled(self, enabled)

 

Enable or disable the knob.

Parameters:
  • enabled - True to enable the knob, False to disable it.
Returns: None

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

 

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

Parameters:
  • expr - 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.

setFlag(self, f)

 

Logical OR of the argument and existing knob flags.

Parameters:
  • f - Flag.
Returns: None
None.

setLabel(self, s)

 
Parameters:
  • s - New label.
Returns: None
None.

setName(self, s)

 
Parameters:
  • s - New name.
Returns: None
None.

setTooltip(self, s)

 
Parameters:
  • s - New tooltip.
Returns: None
None.

setValue(self, val, chan)

 

Sets the value 'val' at channel 'chan'.

Returns: bool
True if successful, False if not.

setValueAt(self, val, time, chan)

 

Sets the value 'val' at channel 'chan' for time 'time'.

Returns: bool
True if successful, False if not.

setVisible(self, visible)

 

Show or hide the knob.

Parameters:
  • visible - True to show the knob, False to hide it.
Returns: None

toScript(quote, context=current)

 

Return the value of the knob in script syntax. Pass True for quote to return results quoted in {}. Pass None for context to get results for all views and key times (as stored in a .nk file).

Returns: string

tooltip(self)

 
Returns: tooltip
tooltip.

visible(self)

 
Returns: Boolean
True if the knob is visible, False if it's hidden.

warning(self, message)

 
Parameters:
  • message - message to put a warning on the knob.
Returns: None
None.