nuke.MenuItem¶
-
class
nuke.
MenuItem
¶ Bases:
object
Methods
Get the action associated with this menu item.
Returns the name of the icon on this menu item as path of the icon.
Perform the action associated with this menu item.
Returns the name of the menu item.
Returns the script that gets executed for this menu item.
Enable or disable the item.
Set the icon on this menu item.
Set the script to be executed for this menu item.
Set the keyboard shortcut on this menu item.
Show or hide the item.
Returns the keyboard shortcut on this menu item.
-
action
() → None¶ Get the action associated with this menu item.
-
icon
() → String¶ Returns the name of the icon on this menu item as path of the icon.
-
invoke
() → None¶ Perform the action associated with this menu item.
-
name
() → String¶ Returns the name of the menu item.
-
script
() → String¶ Returns the script that gets executed for this menu item.
-
setEnabled
(enabled, recursive) → None¶ Enable or disable the item. :param enabled: True to enable the object; False to disable it. :param recursive: True to also setEnabled on submenu actions.
-
setIcon
(icon) → None¶ Set the icon on this menu item. :param icon: the new icon as a path
-
setScript
(script) → None¶ Set the script to be executed for this menu item. Note: To call a python script file, you can use the execfile() function. i.e: menu.setScript(“execfile(‘script.py’)”)
-
setShortcut
(keySequence) → None¶ Set the keyboard shortcut on this menu item. :param keySequence: the new shortcut in PortableText format, e.g. “Ctrl+Shift+P”
-
setVisible
(visible) → None¶ Show or hide the item. :param visible: True to show the object; False to hide it.
-
shortcut
() → String¶ Returns the keyboard shortcut on this menu item. The format of this is the PortableText format. It will return a string such as “Ctrl+Shift+P”. Note that on Mac OS X the Command key is equivalent to Ctrl.
-