A desktop contains one or more panes. Each pane contains one or more pane tabs of various types (scene viewer, parameters, network editor, etc.) The main desktop window can be split horizontally or vertically into two panes, and each pane can itself be split horizontally or vertically.
Note that a floating panel also contains one or more panes and a floating panel may optionally be attached to a desktop.
The methods in this class that return pane tabs, panes, and floating panels only return those objects that are attached to (i.e. saved with) the desktop. To access all the visible pane tabs, panes, and floating panels, including those not attached to any desktop, use the functions in hou.ui.
See also hou.ui.curDesktop, hou.ui.desktops, hou.Pane, hou.PaneTab, and hou.FloatingPanel.
Methods ¶
name()
→ str
Return the desktop’s name.
Each desktop has a unique name. The desktop’s name cannot be changed through either the scripting interface or through Houdini.
setAsCurrent()
Make this desktop the currently selected one. See also hou.ui.desktops.
This example changes to the animate desktop:
desktops_dict = dict((d.name(), d) for d in hou.ui.desktops()) desktops_dict['Animate'].setAsCurrent()
panes()
→ tuple of hou.Pane
Return the panes inside this desktop. Note that the result includes panes in floating panels as long as they are attached to the desktop.
The following function will return all visible panes, regardless of whether or not they are attached to a desktop:
def allPanes(): '''Return a tuple of all visible panes, regardless of whether or not they are attached to a desktop.''' # Loop through all the pane tabs and add each tab's pane to the result # if it's not already there. Note that the only way to uniquely # identify a pane is using its id. ids_to_panes = {} for pane_tab in hou.ui.paneTabs(): pane = pane_tab.pane() if pane.id() not in ids_to_panes: ids_to_panes[pane.id()] = pane return ids_to_panes.values()
floatingPanels()
→ tuple of hou.FloatingPanel
Return all the floating panels attached to this desktop.
Use hou.ui.floatingPanels to get all the visible floating panels, including those not attached to this desktop.
See also hou.Desktop.floatingPaneTabs.
paneTabs()
→ tuple of hou.PaneTab
Return the pane tabs that are contained in this desktop or are in floating panels attached to this desktop.
This method does not return floating pane tabs that are not attached to this desktop. Use hou.ui.paneTabs to get all the visible pane tabs, regardless of whether they are attached to this desktop.
currentPaneTabs()
→ tuple of hou.PaneTab
Return the pane tabs that are contained in this desktop or are in floating panels attached to this desktop and are currently selected in their containing panes.
This method does not return floating pane tabs that are not attached to this desktop. Use hou.ui.currentPaneTabs to get all the selected pane tabs, regardless of whether they are attached to this desktop.
floatingPaneTabs()
→ tuple of hou.PaneTab
Return all the pane tabs in floating panels that are attached to this desktop.
paneTabOfType(type, index=0)
→ hou.PaneTab or None
Find and return the pane tab with the desired type. If no such tab exists, return None. Like hou.Desktop.paneTabs, this method searches pane tabs in the desktop or in floating panels attached to the desktop.
Use hou.ui.paneTabOfType to search all the visible pane tabs, regardless of whether they are attached to this desktop.
type
A hou.paneTabType enumerated variable.
index
If there are multiple tabs with the desired type, this parameter
determines which one is returned. Use index=0
to return the first
found tab, index=1
to return the second found tab, etc. By default,
index is 0.
This method can be approximately implemented as follows:
def paneTabOfType(self, tab_type, index=0): pane_tabs = [t for t in self.paneTabs() if t.type() == tab_type] if max(index, 0) > len(pane_tabs): return None return pane_tabs[max(index, 0)]
findPane(pane_id)
→ hou.Pane or None
Return the pane with the given unique id, or None
if no such pane exists.
Like hou.Desktop.panes, this method searches panes in the
desktop or in floating panels attached to the desktop.
Use hou.ui.findPane to search all the visible panes, regardless of whether they are attached to this desktop.
findPaneTab(name)
→ hou.PaneTab or None
Return the pane tab with the given name, or None
if no such tab exists.
Like hou.Desktop.paneTabs, this method searches pane tabs in the
desktop or in floating panels attached to the desktop.
The name may optionally be prefixed by the desktop name and a period.
Use hou.ui.findPaneTab to search all the visible pane tabs, regardless of whether they are attached to this desktop.
createFloatingPaneTab(pane_tab_type, position=(), size=(), python_panel_interface=None, immediate=False)
→ hou.PaneTab
Create and return a new floating window containing a single pane tab. Note that this method creates a floating panel with a single pane tab, and the graphical interface to add more tabs or split the pane inside the panel is not exposed.
pane_tab_type
A hou.paneTabType enumerated variable.
position
A tuple of two floats specifying the X and Y positions of the new window, respectively. The window will open near this position, not necessarily exactly at this position. If this value is an empty tuple, Houdini will choose a default location.
size
A tuple of two floats specifying the width and height of the new window, respectively. If this value is an empty tuple, Houdini will choose a default size.
python_panel_interface
The name of the Python Panel interface to be displayed in the floating
pane tab. Specifying the interface name additionally hides the Python
Panel toolbar. If python_panel_interface
is None or points to an
interface that does not exist then the default Python Panel pane tab is
displayed along with the toolbar.
This argument is ignored if pane_tab_type
is not set to
hou.paneTabType.PythonPanel.
immediate
Open the window immediately to help setting the window position correctly.
Also note that the floating panel containing the new pane tab does not contain any panes: calling hou.PaneTab.pane on the pane tab returns None, and calling hou.FloatingPanel.panes on its floating panel returns an empty tuple. See hou.FloatingPanel for more information on these stripped down floating panels.
See also hou.Desktop.createFloatingPanel.
The following example function takes a hou.OpNode and opens a floating parameter pane pinned to that node.
def openParmPane(node): '''Open a floating parameter pane for a particular node.''' pane_tab = hou.ui.curDesktop().createFloatingPaneTab(hou.paneTabType.Parm) pane_tab.setCurrentNode(node) pane_tab.setPin(True) return pane_tab
createFloatingPanel(pane_tab_type, position=(), size=(), python_panel_interface=None, immediate=False)
→ hou.FloatingPanel
Create a floating panel and return it. The returned floating panel contains one pane which contains one pane tab of the desired type.
See hou.Desktop.createFloatingPaneTab for a description of the parameters. This method differs from createFloatingPaneTab in two ways: First, it returns the floating panel instead of the pane tab. Second, the floating panel that is created from this method is not locked down, and the user can add more pane tabs and split the panes.
The following example creates a floating panel with a parameters pane tab and a channel viewer (motion viewer) pane tab:
panel = hou.ui.curDesktop().createFloatingPanel(hou.paneTabType.Parm) pane1 = panel.panes()[0] pane2 = pane1.splitVertically() pane2.tabs()[0].setType(hou.paneTabType.ChannelViewer)
shelfDock()
→ hou.ShelfDock
Return the shelf dock for the current desktop.
displayHelp(node_type)
Loads the help for the specified node type in the last opened help browser pane tab. Creates a help browser pane tab if no such pane tab already exists.
displayHelpPath(help_path)
Loads the help for the specified help path in the last opened help browser pane tab. Creates a help browser pane tab if no such pane tab already exists. The path can either be a Houdini help URL (i.e. op:Sop/copy, tool:curve) or a raw help path (i.e. /nodes/sop/copy, shelf/curve).
displayHelpPyPanel(interface_name)
Loads the help for the python panel with the specified name in the last opened help browser pane tab. Creates a help browser pane tab if no such pane tab already exists.
Raises HOM_Error if the interface name is invalid.
displaySideHelp(show=True)
→ hou.PaneTab
Show or hide the side help pane.
If show is set to True (default) this method displays the help pane and returns a help browser pane tab. If set to False then this method hides the help browser pane at the side of the desktop and returns None.
paneUnderCursor()
Return the hou.Pane object located under the mouse cursor. Return
None
if no pane is located under the mouse cursor.
This method does not search floating panes that are not attached to this desktop. Use hou.ui.paneUnderCursor to search all the visible panes, regardless of whether they are attached to this desktop.
paneTabUnderCursor()
Similar to hou.Desktop.paneUnderCursor but return the
hou.PaneTab object instead located under the mouse cursor. Return
None
if no pane tab is located under the mouse cursor.
This method does not search floating pane tabs that are not attached to this desktop. Use hou.ui.paneTabUnderCursor to search all the visible pane tabs, regardless of whether they are attached to this desktop.