Inheritence |
|
Methods
graph()
→ hou.ChannelGraph
Return the channel graph for this pane.
channelListSplitFraction()
→ double
Return the width of the embedded channel list as fraction (0-1 value) of the pane’s width.
setChannelListSplitFraction(value)
Set the width of the embedded channel list as fraction (0-1 value) of the pane’s width.
displayFilter()
→ string
Return the filter pattern for which channels are displayed.
setDisplayFilter(filter)
Set the filter pattern for which channels are displayed. The channel name is used to match against the pattern.
editorMode()
→ hou.channelEditorMode
enum value
Return the animation editor mode.
setEditorMode(mode)
Set the animation editor mode.
templateFilter()
→ string
Return the filter pattern for which channels are templated.
setTemplateFilter(filter)
Set the filter pattern for which channels are templated. The channel name is used to match against the pattern.
colorsCallback()
→ string
Return the active channel colors callback name.
setColorsCallback(callback_name)
→ bool
Set the active channel colors callback name. If the callback name is invalid, the active callback will be reset to default. Return True if the callback was successfully changed. Return False if the callback name was invalid.
registerColorsCallback(callback_name, callback_object )
→ bool
Registers a callback to generate custom channel colors based on the node and parameter names.
callback_name
A name for the custom color scheme.
You can use this to remove the callback with the unregisterColorsCallback
method.
callback_object
A Python object with a getChannelColor
method. For example:
class MyChannelColors(object): def getChannelColor(self, node_path, channel_name): return 0, 0, 0
The node
argument is the path to the node (for example, /obj/table
).
The parm
argument is the internal name of the channel (for example, tx
).
The method must return a 3-tuple representing normalized (0-1
, not 0-255
) red, green, and blue values.
If the method returns (0, 0, 0)
Houdini uses the default channel color.
You should register the callback in a session-independent startup script.
When you register the callback, Houdini will call it once with empty string arguments to make sure it returns a triple. Your getChannelColor()
method needs to handle this case.
The following example object uses the custom color tint of a node to color its channels:
import hou class NodeColors: ''' Use hue variants of a node's color for parameter names ending in x, y or z. ''' def getChannelColor(self, node_path, channel_name): # Handle the empty string case if not node_path: return 0, 0, 0 # Get a Node object from the path n = hou.node(node_path) # Get the node's color as a hou.Color object color = n.color() # Get the color's HSV values as a triple hue, sat, val = n.color().hsv() # If the color is gray, use the default if not sat: return 0, 0, 0 # Hue-shift the node color for X, Y, and Z channels: if channel_name.endswith("x"): color.setHSV(hue - 50, sat * 2, val * 1.2) elif channel_name.endswith("y"): color.setHSV(hue, sat * 2, val * 1.2) elif channel_name.endswith("z"): color.setHSV(hue + 50, sat * 2, val * 1.2) # Return the color as normalized (r, g, b) return color.rgb()
unregisterColorsCallback(callback_name)
→ bool
Unregister a callback by name. It also resets the active callback if the callback to remove was the active one. Return True if the callback was successfully removed. Return False if the callback name was invalid.
colorsCallbacks()
→ tuple
of string
Return the list of registered channel colors callback.
Methods from hou.Pane
tabOfType(type, index=0)
→ hou.PaneTab or None
Find and return a pane tab with the desired type, or None
if no such tab
exists in the pane.
If there are multiple tabs in the pane with the desired type, then the
first found tab is returned. Use index
to return the other tabs. For
example, use index=0
to return the first found tab, use index=1
to
return the second found tab, etc.
See also hou.ui.paneTabOfType().
currentTab()
→ hou.PaneTab
Return the currently focused pane tab.
See also hou.PaneTab.setIsCurrentTab().
createTab(type)
→ hou.PaneTab
Create a new pane tab with the desired type and return it. The new pane tab will be current (i.e. it will be the pane tab that’s open).
splitHorizontally()
→ hou.Pane
Split the pane, adding a new pane to the right, and return the new pane. The new pane will have a single tab whose type is the same as the type of this pane’s current tab.
See also hou.Pane.splitVertically().
splitVertically()
→ hou.Pane
Split the pane, adding a new pane to the bottom, and return the new pane. The new pane will have a single tab whose type is the same as the type of this pane’s current tab.
See also hou.Pane.splitHorizontally().
desktop()
→ hou.Desktop or None
Return the desktop in which this pane exists, or None
if it is in
a floating panel that’s not attached to the desktop.
isMaximized()
→ bool
Return True
if this pane is maximized.
setIsMaximized(on)
Set the maximized state of this pane.
showsPaneBar()
showPaneBar(on)
sendKey(hotkey_name)
swapWithPane(pane)
getSplitParent()
→ hou.Pane or None
Return the parent split pane if the Pane is nested under a split.
getSplitChild(self,index)
→ hou.Pane or None
Return the split child Pane at index if the Pane is a split.
splitSwap()
Swap the left and right panes of an horizontal split Pane. Swap the top and bottom panes of a vertical split Pane.
splitRotate()
Turn an horizontal split Pane into a vertical split Pane.
isSplitMinimized()
→ bool
Return the true if the Pane is minimized on the split. A split can’t be minimized and maximized at the same time. In its default state, a split is not minimized and not maximized.
isSplitMaximized()
→ bool
Return the true if the Pane is maximized on the split. A split can’t be minimized and maximized at the same time. In its default state, a split is not minimized and not maximized.
setIsSplitMaximized(on)
→ bool
Set the maximized state of a split.
isSplit()
→ bool
Return True if the pane is a split.
setSplitFraction(self,fraction)
Set the split fraction of the parent split.
getSplitFraction(self,fraction)
→ double
Return the split fraction of the parent split.
setSplitDirection(self,dir)
Set the split direction of the parent split.
getSplitDirection(self,dir)
→ double
Return the split direction of the parent split.
Replaces |