nuke.Gsv_Knob
- class nuke.Gsv_Knob
Bases:
Knob
A knob which supports the interaction with Graph Scope Variables
Methods
- return
Class name.
- return
Class ID.
Adds a GsvSet with the given path relative to the Node.
Clear animation for channel 'c'.
Clear flag.
Returns True if the path exist relative to the GsvKnob.
- param message
message to put the knob in error, and do a popup.
- param message
message to put out to the error console, attached to the knob, if the verbosity level is set high enough.
- return
True if the knob is enabled, False if it's disabled.
- param message
message to put the knob in error.
Initialise from script.
Returns the fully-qualified name of the knob within the node.
Returns the authoring mode currently set on the knob.
Returns the names of the authoring modes of the knob if the knob is an authoring knob, otherwise an empty list.
Return derivative at time 't' for channel 'c'.
Returns whether the input flag is set.
Return value of the Graph Scope Variable.
Return integral at the interval [t1, t2] for channel 'c'.
Return keyframe index at time 't' for channel 'c'.
Get all unique keys on the knob.
Return index of the keyframe at time 't' for channel 'c'.
Return nth derivative at time 't' for channel 'c'.
Return number of keyframes for channel 'c'.
Return the Gsv sets as a dictionary.
Return value at time 't' for channel 'c'.
Return True if animation at index 'index' has an expression.
Return True if channel 'c' is animated.
Return True if there is a keyframe at the current frame for channel 'c'.
Return True if there is a keyframe at time 't' for channel 'c'.
- return
label.
Returns an instance of the QWidget subclass used to edit the knob's value.
- return
name.
Return the node that this knob belongs to.
- return
True if any of the values is not set to the default, False otherwise.
Removes a GSV with the given path from it's GsvSet.
Removes a GsvSet with the given path from it's Group node entry.
Remove key for channel 'c'.
Remove key at time 't' for channel 'c'.
Renames a GSV with the given path.
Renames a GsvSet with the given path.
Set channel 'c' to be animated.
Sets the authoring mode on the knob.
Enable or disable the knob.
Set the expression for a knob.
Logical OR of the argument and existing knob flags.
Set the current value for the given path.
- param s
New label.
- param s
New name.
- param s
New tooltip.
Set the gsv sets as a dictionary for the current node.
Sets the value 'val' at channel 'chan' for time 'time'.
Show or hide the knob.
Return the value of the knob in script syntax.
- return
tooltip.
getValue() -> dict
- return
True if the knob is visible, False if it's hidden.
- param message
message to put a warning on the knob.
- Class() Class name.
- Returns
Class name.
- ClassID() Class ID.
- Returns
Class ID.
- addGsvSet(path) bool.
Adds a GsvSet with the given path relative to the Node. :param path: String. :return: bool. Example: nuke.root()[‘gsv’].addGsvSet(‘Character’)
- clearAnimated()
Clear animation for channel ‘c’. Return True if successful.
- clearFlag(f) None.
Clear flag. :param f: Flag. :return: None.
- contains(path) Bool.
Returns True if the path exist relative to the GsvKnob. This function does not make distinction between the element types for the given path i.e. the path must include the GsvSet name when checking for a variable in the Default variable set. :param path: String. :return: Bool. Example: nuke.root()[‘gsv’].contains(‘Group1.Custom.variable’)
- critical(message) None.
- Parameters
message – message to put the knob in error, and do a popup.
- Returns
None.
- debug(message) None.
- Parameters
message – message to put out to the error console, attached to the knob, if the verbosity level is set high enough.
- Returns
None.
- enabled() Boolean.
- Returns
True if the knob is enabled, False if it’s disabled.
- error(message) None.
- Parameters
message – message to put the knob in error.
- Returns
None.
- fromScript()
Initialise from script.
- fullyQualifiedName(channel=- 1) string
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
The string of the qualified knob or sub-knob, which can be used directly in expression links.
- getAuthorMode() Integer.
Returns the authoring mode currently set on the knob. This is a unique string identifier of the option, which is also used for serialisation and deserialisation. It is not meant to change,thus one can rely on it. :return: The string identifier of the current authoring mode set.
- getAuthorModes() List.
Returns the names of the authoring modes of the knob if the knob is an authoring knob, otherwise an empty list. :return: The names of the authoring modes of the knob if the knob is an authoring knob, otherwise an empty list. This is a list of strings.
- getDerivative()
Return derivative at time ‘t’ for channel ‘c’.
- getFlag(f) Bool.
Returns whether the input flag is set. :param f: Flag. :return: True if set, False otherwise.
- getGsvValue(path) string
Return value of the Graph Scope Variable. :return String. Example: value = nuke.root()[‘gsv’].getGsvValue(‘Default.var’)
- getIntegral()
Return integral at the interval [t1, t2] for channel ‘c’.
- getKeyIndex()
Return keyframe index at time ‘t’ for channel ‘c’.
- getKeyList()
Get all unique keys on the knob. Returns list.
- 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() dict
Return the Gsv sets as a dictionary. :return dict. Example: r = nuke.root() k = r[‘gsv’] k.getValue()
- getValueAt()
Return value at time ‘t’ for channel ‘c’.
- hasExpression(index=- 1) bool
Return True if animation at index ‘index’ has an expression. :param index: Optional index parameter. Defaults to -1 if not specified. This can be specified as a keyword parameter if desired. :return: True if has expression, False otherwise.
- 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.
- Returns
label.
- makeWidget() PySide2.QtWidgets.QWidget.
Returns an instance of the QWidget subclass used to edit the knob’s value. The widget will update the knob’s value when its value changes and should update its displayed value(s) when they change on the knob. Can return null if no widget should be created for the knob. :return: PySide2.QtWidgets.QWidget.
- name() name.
- Returns
name.
- node() nuke.Node
Return the node that this knob belongs to. If the node has been cloned, we’ll always return a reference to the original. :return: The node which owns this knob, or None if the knob has no owner yet.
- notDefault() True if any of the values is not set to the default, False otherwise.
- Returns
True if any of the values is not set to the default, False otherwise.
- removeGsv(path) Bool.
Removes a GSV with the given path from it’s GsvSet. :param path: String. :return: Bool. Example: nuke.root()[‘gsv’].removeGsv(‘Default.var’)
- removeGsvSet(path) Bool.
Removes a GsvSet with the given path from it’s Group node entry. :param path: String. :return: Bool. Example: nuke.root()[‘gsv’].removeGsvSet(‘Custom’)
- removeKey()
Remove key for channel ‘c’. Return True if successful.
- removeKeyAt()
Remove key at time ‘t’ for channel ‘c’. Return True if successful.
- renameGsv(path, name) Bool.
Renames a GSV with the given path. :param path: String. :param name: String. :return: Bool. Example: nuke.root()[‘gsv’].renameGsv(‘Default.var’, ‘variable’)
- renameGsvSet(path, name) Bool.
Renames a GsvSet with the given path. :param path: String. :param name: String. :return: Bool. Example: nuke.root()[‘gsv’].renameGsvSet(‘Custom’, ‘Other’)
- setAnimated()
Set channel ‘c’ to be animated.
- setAuthorMode(authorMode) None.
Sets the authoring mode on the knob. This accepts both the unique string identifier, which is also used for serialisation and deserialisation, or index of the option for convenience. These values are not meant to change, thus one can rely on them. :param authorMode: The string identifier or index of the authoring mode. :return: None.
- setEnabled(enabled) None.
Enable or disable the knob. :param enabled: True to enable the knob, False to disable it.
- setExpression(expression, channel=- 1, view=None) bool
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
True if successful, False if not.
- setFlag(f) None.
Logical OR of the argument and existing knob flags. :param f: Flag. :return: None.
- setGsvValue(path, value) None.
Set the current value for the given path. :param path: String. :param value: String. :return: None. Example: nuke.root()[‘gsv’].setGsvValue(‘Default.var’, ‘value’)
- setLabel(s) None.
- Parameters
s – New label.
- Returns
None.
- setName(s) None.
- Parameters
s – New name.
- Returns
None.
- setTooltip(s) None.
- Parameters
s – New tooltip.
- Returns
None.
- setValue(dict) None.
Set the gsv sets as a dictionary for the current node. :param dict: Dictionary of Gsv entries. :return: None. Example: r = nuke.root() k = r[‘gsv’] k.setValue({‘Default’: {‘dk1’: ‘dv1’, ‘dk2’: ‘dv2’}, ‘Custom’: {‘ck1’: ‘cv1’, ‘ck2’: ‘cv2’}})
- setValueAt(val, time, chan) bool
Sets the value ‘val’ at channel ‘chan’ for time ‘time’. :return: True if successful, False if not.
- setVisible(visible) None.
Show or hide the knob. :param visible: True to show the knob, False to hide it.
- toScript(quote, context=current) string.
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).
- tooltip() tooltip.
- Returns
tooltip.
- value()
getValue() -> dict
Return the Gsv sets as a dictionary. :return dict. Example: r = nuke.root() k = r[‘gsv’] k.getValue()
- visible() Boolean.
- Returns
True if the knob is visible, False if it’s hidden.
- warning(message) None.
- Parameters
message – message to put a warning on the knob.
- Returns
None.