Package nukescripts :: Module panels
[hide private]
[frames] | no frames]

Module panels

source code

Classes [hide private]
  PythonPanel
  WidgetKnob
Functions [hide private]
 
registerPanel(id, command) source code
 
unregisterPanel(id, command) source code
 
restorePanel(id) source code
 
PythonPanelKnobChanged(widget) source code
PythonPanel
registerWidgetAsPanel(widget, name, id, create=False)
Wraps and registers a widget to be used in a Nuke panel.
source code
Variables [hide private]
  __panels = dict()
Function Details [hide private]

registerWidgetAsPanel(widget, name, id, create=False)

source code 
Wraps and registers a widget to be used in a Nuke panel.

widget - should be a string of the class for the widget
name - is is the name as it will appear on the Pane menu
id - should the the unique ID for this widget panel
create - if this is set to true a new NukePanel will be returned that wraps this widget

Example ( using PySide2 )

import nuke
from PySide2 import QtCore, QtWidgets
from nukescripts import panels

class NukeTestWindow( QtWidgets.QWidget ):
  def __init__(self, parent=None):
    QtWidgets.QWidget.__init__(self, parent)
    self.setLayout( QtWidgets.QVBoxLayout() )
    
    self.myTable = QtWidgets.QTableWidget()
    headers = ['Date', 'Files', 'Size', 'Path' ]
    self.myTable.setColumnCount( len( headers ) )
    self.myTable.setHorizontalHeaderLabels( headers )
    self.layout().addWidget( self.myTable )

nukescripts.registerWidgetAsPanel('NukeTestWindow', 'NukeTestWindow', 'uk.co.thefoundry.NukeTestWindow' )

Returns: PythonPanel