Inheritance |
|
Methods ¶
Bounds and Transformations ¶
cursorPosition(confine_to_view=True)
→ hou.Vector2
Return the current mouse cursor position expressed in network view
coordinates. If confine_to_view
is True
, the returned value
will be clipped to the area of the network currently visible in the
network editor.
Here is an example of moving a node underneath the mouse cursor:
# Get the network editor. net_editor = hou.ui.paneTabOfType(hou.paneTabType.NetworkEditor) # Get the node. node = hou.node("/obj/myNode") # Set the node's new position. node.setPosition(net_editor.cursorPosition())
isShowingConnectors()
→ bool
Return True if the network editor zoom level is high enough that input and output connectors are visible. This can be useful in network editor event handlers that expect the user to click on a connector. If the connectors are not visible, some alternative interaction is required.
isUnderCursor()
→ bool
Return True if the network view is directly under the mouse cursor. Return False if the mouse cursor position is outside of the network view or if another window is directly under the mouse cursor.
isPosInside(pos, ignore_floating_windows=True)
→ bool
Return True if the hou.Vector2 passed as the pos
parameter is
inside the network view. The values in pos
are mouse coordinates
expressed relative to the network editor pane.
ignore_floating_windows
When set to True, isPosInside
will ignore any windows floating over
the network view at the given position and will return True as long as
the position is inside the network view area. When set to False,
isPosInside
will additionally check for floating windows and will
return True if the position is inside the network view and if no other
window is on top of the network view at the given position.
setCursorPosition(pos)
Moves the mouse cursor to the position specified by the hou.Vector2
pos
parameter.
screenBounds()
→ hou.BoundingRect
Return the screen space bounds of the network editor viewing area. This
does not include the menu bar, toolbar, or other UI elements. Only the area
where the network contents are displayed is returned. The bounds are
relative to the network area itself, so the lower left corner of the
returned bounding box will always be (0, 0)
.
visibleBounds()
→ hou.BoundingRect
Return the network space bounds of the network editor viewing area.
setVisibleBounds(bounds, transition_time=0.0, max_scale=0.0, set_center_when_scale_rejected=False)
Sets the visible bounds of the network editor viewing area, expressed in
network space coordinates. This method will never alter the screen space
size or location of the network editor. If the area specified by the
bounds
parameter has a different aspect ratio from the actual network
editor, this method will automatically adjust the bounds to ensure that
the area specified is fully visible.
bounds
A hou.BoundingRect specifying the area that should be visible in the network editor.
transition_time
The amount of time, in seconds, over which the network editor will animate the transition from the current visible bounds to the new visible bounds.
max_scale
If set to a non-zero value, this parameter controls the maximum zoom level that will be allowed. The default maximum scale used by the network editor code is 100.
set_centered_when_scale_rejected
If set to True
, but the new zoom level is determined to be the same
as the previous zoom, no change is made to the bounds at all. This
prevents a bounds change, that was intended as a pure zoom, from
inadvertently panning the view if the zoom doesn’t actually change.
requestZoomReset()
Request zoom reset so that all the items in the network will be visible. Actual calculation happens in the next drawing.
isZoomResetRequested()
Return True if there has been a request to reset zoom. This means the visible bounds are not vaild until the next drawing. After the reset this function will return False.
setLocatingEnabled(enabled)
Enables or disables highlighting of UI elements under the mouse in the network editor. When disabled, mouse events sent to the network editor event processing code will never specify a located or selected UI element. In some modes (such as when in a viewing state where mouse events only modify the view) it is desirable to disable this behavior.
locatingEnabled()
→ bool
Return True if the network editor will highlight UI elements under the mouse, and allow clicking on those UI elements.
lengthToScreen(len)
→ float
Given a length value len
, expressed in network units, return the
equivalent length in screen units (pixels). The result will depend on the
current zoom level of the network editor.
lengthFromScreen(len)
→ float
Given a length value len
, expressed in screen units (pixels), return the
equivalent length in network units. The result will depend on the
current zoom level of the network editor.
sizeToScreen(size)
→ hou.Vector2
Given a box size value size
as a hou.Vector2, expressed in network
units, return the equivalent size in screen units (pixels). This is
equivalent to making two separate calls to lengthToScreen()
for the
width and height. The result will depend on the current zoom level of the
network editor.
sizeFromScreen(size)
→ hou.Vector2
Given a box size value size
as a hou.Vector2, expressed in screen
units (pixels), return the equivalent size in network units. This is
equivalent to making two separate calls to lengthFromScreen()
for the
width and height. The result will depend on the current zoom level of the
network editor.
posToScreen(pos)
→ hou.Vector2
Given a position value pos
as a hou.Vector2, expressed in network
units, return the equivalent position in screen units (pixels). The result
will depend on both the current zoom level and view position of the
network editor.
This method is intended to be used for drawing and positioning within the network editor, so the returned screen coordinates are in pixels relative to the lower left corner of the network editor window, rather than being relative to a specific position on the user’s monitor. If the specified position is not currently visible in the network editor pane, the resulting screen position may be negative, or larger than the size of the network editor pane (see hou.NetworkEditor.visibleBounds).
posFromScreen(pos)
→ hou.Vector2
Given a position value pos
as a hou.Vector2, expressed in screen
units (pixels), return the equivalent position in network units. The result
will depend on both the current zoom level and view position of the
network editor.
See hou.NetworkEditor.posToScreen for more detail about the way the screen position is interpreted by this method.
overviewPosToScreen(pos)
→ hou.Vector2
Given a position value pos
as a hou.Vector2, expressed in network
units, return the equivalent position in screen units (pixels) within the
overview gadget in the network editor. This method returns a value that
assumes the overview area is visible, even if it is not.
overviewPosFromScreen(pos)
→ hou.Vector2
Given a position value pos
as a hou.Vector2, expressed in screen
units (pixels) within the overview gadget, return the equivalent position
in network units. This method returns a value that assumes the overview
area is visible, even if it is not. If the provided position is outside
the overview area, this method returns a value that assumes the overview
gadget extends as far as required to reach the specified coordinates.
overviewVisible()
→ bool
Return a boolean indicating whether or not the overview gadget is currently visible. This result reflects the true state of the overview gadget even if the overview is configured to display automatically.
overviewVisibleIfAutomatic()
→ bool
Return a boolean indicating whether or not the overview gadget would
currently be visible if it was configured to display automatically. In
other words, this method returns True
if any part of the network is
currently outside the visible bounds of the editor.
Selection and Highlighting ¶
networkItemsInBox(pos1, pos2, for_drop=False, for_select=False)
→ tuple
of (hou.NetworkItem, str
, int
)
Return any network items inside the bounding box defined by the
hou.Vector2 points pos1
and pos2
. These points are specified in
screen space, which makes it easy to call this function given a mouse
position.
The returned tuple of triples are sorted in increasing distance from the
center of the specified bounding box. Each triple consists of a network
item (which may be a node, sticky note, wire, etc.), a string which
describes the part of the UI for that item that was found in the box, and
an optional index value which differentiates between different instances
of the same item/name combination. For example, if the connector for input
2 of the node geo1
was the only thing inside the provided box, the
return value would be:
>>> editor = hou.ui.paneTabOfType(hou.paneTabType.NetworkEditor) >>> editor.networkItemsInBox(pos1, pos2) ((<hou.ObjNode of type subnet at /obj/subnet1>, 'input', 2),)
One of for_drop
or for_select
may be set to True
to use a different
criteria for deciding what a valid target is. By default, any UI widget
that highlights with the mouse over it will be returned by this method.
Setting for_drop
to True
will return only UI widgets that can be drop
targets. Setting for_select
to True
will only return UI widgets that
result in the item being selected when box picking.
setDragSourceData(items)
Controls the network items that are put into the drag and drop buffer. The values in this buffer are only used when dragging items out of the network editor (such as when the user drags a node from the network editor onto a textport, or a parameter dialog.
setDragSourceWorkItem(work_item_id)
Controls the Id of the pdg.WorkItem that is stored into the drag and drop buffer. The work item ID in the buffer is used when when dragging an item from a TOP node into a textport, Python shell, etc.
setDropTargetItem(item, name, index)
When the user is performing a drag and drop operation within the network
editor, it is important that they receive some feedback about where the
thing they are dragging will be dropped if they let go of the mouse
button. This indication is provided by highlighting the drop target in the
UI. This method allows the current drop target to be specified in python
code. Usually the item
, name
, and index
will be values returned in
one of the tuples from the networkItemsInBox
method.
dropTargetItem()
→ (hou.NetworkItem, str
, int
)
Return the currently set drop target item information. These are just the
values passed into the last call to setDropTargetItem
.
setDecoratedItem(item, interactive)
This method is similar to setDropTargetItem
in that it tells the
network editor to highlight a particular item when drawing it. In the case
of the decorated item, however, only the network item needs to be provided.
The result of setting a node as the decorated item is to bring up the node
ring. Network dots may also be the decorated item, in which case the input
and output connectors for the dot are shown. The interactive
boolean flag
indicates whether the user is allowed to interact with the decorations. If
not, the node ring is drawn faded, and its buttons cannot be clicked. This
non-interactive mode corresponds to having the Control key pressed while
moving the mouse around the network editor.
decoratedItem()
→ hou.NetworkItem
Return the currently set decorated item. This is just the item
value passed into the last call to setDecoratedItem
.
decorationInteractive()
→ bool
Return whether the currently decorated item is interactive. This is just
the interactive
value passed into the last call to setDecoratedItem
.
setPreSelectedItems(items)
When box selecting items in the network, it is useful to be able to see what will be selected if the mouse button is released. These items are drawn to the overlay layer of the network editor canvas in a light blue color with transparency. The network items passed as a tuple to this method are the ones that get drawn with this pre-selection highlight.
preSelectedItems()
→ tuple of hou.NetworkItem
Return the currently pre-selected items. These are just the
values passed into the last call to setPreSelectedItems
.
selectedConnections()
→ tuple of hou.NodeConnection
Return the currently selected wires.
clearAllSelected()
For an OP network editor, the behavior is equivalent to hou.clearAllSelected(), deselecting all network items and wires. For an APEX network editor, this clears the selection for the current APEX graph.
setNetworkBoxPendingRemovals(items)
When moving items around the network, network boxes automatically resize to contain their child items as they move. To indicate that items will be removed from their network box, pass them as a tuple to this method. Doing so will cause their network box containers to not resize to fit the items as they move.
networkBoxPendingRemovals()
→ tuple of hou.NetworkMovableItem
Return the items currently pending remove from their network box. These
are just the values passed into the last call to
setNetworkBoxPendingRemovals
.
Decoration ¶
nodeShapes()
→ tuple of str
Return a list of all valid node shape names. These are the values that can be set into the user data of a node to control the shape of a specific node. They are also the shape names that can be used as defaults for node types.
This code sets a node to a random shape:
>>> import random >>> editor = hou.ui.paneTabOfType(hou.paneTabType.NetworkEditor) >>> shapes = editor.nodeShapes() >>> hou.node('/obj/geo1').setUserData('nodeshape', random.choice(shapes))
reloadNodeShapes()
→ tuple of str
Forces all node shape files to be reloaded. This may cause new shapes to
become available, or existing shapes to be removed. Returns a tuple of
strings that indicate the name of each loaded node shape, and any error
messages generated while parsing each shape. Use nodeShapes()
to get a
simple list of all successfully loaded shapes after calling this method.
setFootprints(footprints)
Configure the footprint rings that the network editor should display.
The footprints
parameter must be a tuple of hou.NetworkFootprint
objects. See that class for more information.
footprints()
→ tuple
of hou.NetworkFootprint
Return the current footprint configuration as a tuple of
hou.NetworkFootprint objects. These are just the values passed into
the last call to setFootprints
.
setCursorMap(cursors)
Tells the network editor which mouse cursor to use based on what UI widget
is under the mouse. This configuration is specified as a dictionary
mapping a tuple to a string. The string is the name of the cursor, which
can be any of the cursor file names from the $HFS/houdini/config/Cursors
directory. Each tuple consists of a string and an integer. The string is
the name of the UI widget, and the integer represents the specific index
value within that UI widget.
The following code sets the network editor to show a “connect” cursor for all node inputs and outputs:
>>> editor = hou.ui.paneTabOfType(hou.paneTabType.NetworkEditor) >>> editor.setCursorMap({ ... ('input', -1): 'wire', ... ('output', -1): 'wire' ... })
The following code sets the network editor to show an appropriate resize icon based on the specific section of the sticky note border under the mouse:
>>> editor = hou.ui.paneTabOfType(hou.paneTabType.NetworkEditor) >>> editor.setCursorMap({ ... ('stickynoteborder', 0): 'arrowSWNE', ... ('stickynoteborder', 1): 'arrowLeftRight', ... ('stickynoteborder', 2): 'arrowNWSE', ... ('stickynoteborder', 3): 'arrowUpDown', ... ('stickynoteborder', 4): 'arrowSWNE', ... ('stickynoteborder', 5): 'arrowLeftRight', ... ('stickynoteborder', 6): 'arrowNWSE', ... ('stickynoteborder', 7): 'arrowUpDown' ... })
cursorMap()
→ dict
of (str
, int
) to str
Return the current mouse cursor configuration. This will just be the
dictionary passed into the last call to setCursorMap
.
setDefaultCursor(cursor_name)
Tells the network editor which mouse cursor to use when none of the UI
mentioned in the dictionary sent to setCursorMap()
is under the mouse.
defaultCursor()
→ str
Return the default mouse cursor set by the last call to
setDefaultCursor()
.
setBackgroundImages(images)
Configures the background images to be displayed in the network editor. The network editor saves and loads the image descriptions into the user data for each network, which allows a different set of background images for each network. The images are specified as a tuple of hou.NetworkImage objects. See the documentation of that class for more information.
backgroundImages()
→ tuple
of hou.NetworkImage
Return the descriptors for the current set of background images being
displayed in the network editor. This will be the tuple passed into the
last call to setBackgroundImages
.
setAdjustments(items, adjustments, auto_remove=False)
Configures temporary adjustments to the sizes and locations of network
items in the editor. The items
parameter is a tuple of
hou.NetworkMovableItem objects. The adjustments
parameter is a
tuple of hou.NetworkAnimValue objects to associate with each
network item in the items
tuple. See the documentation of that class
for more information about specifying adjustments.
The auto_remove
parameter may be set to True
to indicate that the
network editor should automatically delete the adjustments once the
animation on them has completed. This is useful for animations performed
at the end of a user action, where the following events do not relate to
the changes being made, and so it is easier not to have to manage the
reset of the adjustment values explicitly in the future.
setShapes(shapes)
The shapes
parameter specifies a tuple of hou.NetworkShape objects
which will be drawn into the network editor. See documentation of the
network shape class and its subclasses for more information.
setOverlayShapes(shapes)
The shapes
parameter specifies a tuple of hou.NetworkShape objects
which will be drawn into the overlay layer of the network editor canvas.
See documentation of the network shape class and its subclasses for more
information.
redraw()
Forces the network editor to redraw. This may be necessary in cases where your code updates aspects of your Houdini session which indirectly affect the drawing of the network editor (such as changing default node shapes and colors). Direct changes to the network (such as changing the shape or color of a specific node) should automatically cause the network editor to redraw. Only use this function when you see that a redraw is not being triggered automatically by the your code.
Network Item Information ¶
itemRect(item, adjusted=True)
→ hou.BoundingRect
Return the bounding rectangle of the hou.NetworkMovableItem
specified by the item
parameter. If the adjusted
parameter is set to
True
, any adjustments to this item’s size and position set in the most
recent call to setAdjustments()
will be taken into account. If False
,
these adjustments will be ignored. Note that for nodes, only the node
body is taken into account, not the node name, badges, or other
decorations.
itemInputPos(item, input_index, adjusted=True)
→ hou.Vector2
Return the center point of the input connector of the
hou.Node or hou.NetworkDot specified by item
. The
input_index
parameter specifies the specific input of interest. For
network dots, this value must be zero. If the adjusted
parameter is set
to True
, any adjustments to this item’s size and position set in the
most recent call to setAdjustments()
will be taken into account.
If False
, these adjustments will be ignored.
itemInputDir(item, input_index)
→ hou.Vector2
Return a normalized vector indicating the direction at which the wire
connected to the specified input should emerge from its connector. The
item
parameter may be a hou.Node or hou.NetworkDot. The
input_index
specifies which input is of interest. This value must be
zero if the item is a network dot.
itemOutputPos(item, output_index, adjusted=True)
→ hou.Vector2
Return the center point of the output connector of the
hou.Node, hou.NetworkDot, or hou.SubnetIndirectInput
specified by item
. The output_index
parameter specifies the specific
output of interest. For network dots and subnet indirect inputs, this value
must be zero. If the adjusted
parameter is set to True
, any
adjustments to this item’s size and position set in the most recent call to
setAdjustments()
will be taken into account. If False
, these
adjustments will be ignored.
itemOutputDir(item, output_index)
→ hou.Vector2
Return a normalized vector indicating the direction at which the wire
connected to the specified output should emerge from its connector. The
item
parameter may be a hou.Node, hou.NetworkDot, or
hou.SubnetIndirectInput. The output_index
specifies which output
is of interest. This value must be zero if the item is a network dot or
subnet indirect input.
allVisibleRects(ignore_items)
→ tuple
of (hou.NetworkMovableItem, hou.BoundingRect)
This method is equivalent to calling itemRect()
for every network item
that is currently visible in the network editor. Getting these results in
a single method call is significantly faster, and eliminates the need to
test each item for visibility. This method is used for finding items to
snap against when moving nodes. The ignore_items
parameter is a tuple
of hou.NetworkMovableItem objects that should not be returned in
the result tuple.
Prompts ¶
setTooltip(tooltip)
Sets the tooltip string that should be shown under the mouse if it remains
stationary for a short time. This string should generally be set to
correspond to the network item currently under the mouse cursor. Because
it appears after a delay, it is okay to make this text more verbose than
the prompt text passed to setPromptText()
.
tooltip()
→ str
Return the current tooltip string. This is the value that was last passed
to the setTooltip()
method.
setPrompt(prompt)
Sets the prompt text that appears at the bottom of the network editor.
This string should generally be set to correspond to the network item
currently under the mouse cursor. This text should be fairly brief.
More detailed information can be put into the tooltip through the
setTooltip()
method.
prompt()
→ str
Return the current prompt string. This is the value that was last passed
to the setPromptText()
method.
flashMessage(image, message, duration)
Causes a message to appear briefly in the upper left corner of the network
editor, then fade away. The image
parameter specifies an icon or image
file that should be displayed along with the text specified in the
message
parameter. Either of these parameters may be None
if only
an image or only text is desired. The duration
parameter specifies the
time in seconds before the message should fade away.
Standard Menus and Editors ¶
Event Handling ¶
scheduleTimerEvent(seconds)
→ int
Requests that a timer event be sent to the network editor after seconds
has elapsed. The returned integer id is included in the triggered event
to differentiate between timers if more than one is scheduled at a time.
handleCurrentKeyboardEvent(resend=False)
Requests that the network editor handle the current keyboard event. This method only makes sense when handling a keyboard event.
If the resend
parameter is set to True
, the keyboard event is sent to
the network editor’s python handling code a second time rather than the
network editor handling the keyboard event itself. This is useful if the
network editor is in a state or mode that does not know how to handle a
key, but which the state recognizes as one that should exit the current
state, and possibly trigger some other python event handling code. This
parameter is used in the state for selecting the position of a new node if
the Tab key is pressed (which exits the positions selection state, and
triggers a new Tab menu instead).
If this method is not called when handling a keyboard event, the network editor assumes that the python event handling code has handled the keyboard event.
setVolatileHotkeys(hotkey_symbols)
The hotkey_symbols
parameter specifies a tuple of hotkey symbols whose
bound keys should be processed as volatile keys. This means they generate a
"keydown"
event when the key is pressed, and a "keyup"
event when the
key is released. All other keys simply send a "keyhit"
event after the
key is released, with no notification when the key is first pressed.
isVolatileHotkeyDown(hotkey_symbol)
→ bool
Return True
if a key bound to the specified hotkey symbol is currently
pressed. This allows the current state of a volatile key to be tested
without seeing the "keydown"
event triggered when the user pressed the
key. Calling this method with a hotkey symbol that has not been registered
through the setVolatileHotkeys
method will always return False
even if
a key bound to the hotkey symbol is currently pressed.
hotkeyAssignments(hotkey_symbols)
→ tupleof
tupleof
str`
Return a tuple of strings that represent the hotkeys currently assigned to
each action associated with a tuple hotkey symbols. The key strings are of
the form returned by the hou.ui.hotkeys method, which is a
combination of the symbol on the key, and any modifier keys involved, such
as "Ctrl+Shift+G"
.
pushEventContext(module, data)
→ bool
Causes all future events generated in the network editor to be passed to
the python module specified by module
(which is import
ed by the event
handling code). The data
parameter should be a python dict
which can
contain any additional information required by the module. It can also
be populated to return values from the module to the code that calls
this method.
This method does not return until the pushed module calls
hou.NetworkEditor.popEventContext, so it is very important that
the provided module always provide some means of exiting the module
with a call to that method. The return value will be True
unless the
event context could not be pushed as requested, in which case False
is returned immediately without a call to popEventContext
. This will
happen only in exceptional circumstances involving the order of event
processing, and should usually be handled as if the user explicitly
cancelled out of the new context by pressing Escape.
This method name starts with the word “push” to indicate that there can be a stack of event contexts, not just a single alternate context.
popEventContext()
Pops an event context off the stack, returning control to the python code which most recently called hou.NetworkEditor.pushEventContext.
eventContextData()
→ dict
Accesses the context data passed into the most recent call to the
hou.NetworkEditor.pushEventContext method. If no calls have been
made to this method, there is still a python dict
available to store
any global information that may be used by the network editor event
handling code. As an example, the current view bounds for each network
visited by the editor are stored as part of this context data dictionary.
Preferences ¶
setPref(pref, value)
Sets the preference named pref
to value
. The value is always a string,
and must be converted to or from a number, enum, or other format as
appropriate. If the preference specified by pref
is a global preference,
all network editors will automatically update with the new value.
Otherwise the change will only affect this network editor.
getPref(pref)
→ str
Return the value of the preference named pref
. This preference may be
a global or local preference. The returned value is always a string which
can be interpreted as a number or other data structure as appropriate for
the specific preference.
setPrefs(prefs)
Sets a number of preference values with a single method call. The prefs
parameter must be a python dictionary mapping preference name strings to
value strings. The preferences may be local or global, but this method is
most often used for saving and loading the local preferences for a single
network editor.
getPrefs()
→ dict
of str
to str
Return all global and local preferences for this network editor as a python dictionary mapping preference name strings to value strings.
registerPref(pref, value, global)
Registers a preference with the name pref
, and default value value
.
If global
is True
, this preference is treated as a global preference
that is applied to all network editors and saved in
$HOUDINI_USER_PREF_DIR/networkeditor.pref
. Otherwise the preference is
considered local to each network editor, and will be saved to the desk
file with each network editor instance.
Registering a preference is required to ensure the preference is saved when it is not a preference used internally by the network editor. The preference that enables snapping, or the one to enable dropping a node onto an existing wire are examples of preferences that are only used by the python event handling code, and so must be explicitly registered. This registration should be done in response to the network editor initialization event which is sent once to each network editor when it is first created.
badges()
→ tuple
of tuple
of str
Return descriptions of the optional node badges that can be shown in the network editor. Each tuple contained in the returned value contains three strings describing the badge. The first is the preference value that controls whether the badge is hidden, or appears as a small or large icon. The second string is a description of the badge. The third string is the name of the badge icon. These values can be used to present an interface for configuring the badges.
textBadges()
→ tuple
of tuple
of str
Return descriptions of the optional node text that can be shown in the network editor. Each tuple contained in the returned value contains three strings describing the text. The first is the preference value that controls whether the text is hidden, or appears as truncated or full text. The second string is a description of the text. The third string is the name of an icon that can be used to represent the meaning of the text. These values can be used to present an interface for configuring the text.
Parameter Editor ¶
parmFilterEnabled()
→ bool
Return True if Parameter Editor filtering is enabled.
setParmFilterEnabled(self,on)
Enable Parameter Editor filtering. hou.parmFilterCriteria.
parmFilterMode()
→ hou.parmFilterMode
Return the Parameter Editor hou.parmFilterMode.
setParmFilterMode(self,mode)
Set the Parameter Editor filter mode. The hou.parmFilterMode defines on which parameters to apply the filter pattern.
parmFilterCriteria()
→ hou.parmFilterCriteria
Return the Parameter Editor hou.parmFilterCriteria.
setParmFilterCriteria(self,criteria)
Set the Parameter Editor filter criteria. The hou.parmFilterCriteria defines how the filter pattern is applied to parameters.
parmFilterPattern()
→ str
Return the Parameter Editor filter pattern.
setParmFilterPattern(self,pattern)
Set the Parameter Editor filter pattern.
The filter pattern is applied on a hou.parmFilterCriteria string from parameters that match the hou.parmFilterMode.
The pattern matching can use exact name matching or find the pattern within the string.
The filter pattern can be a list of pattern separated by commas and can also contain wildcard *
character.
parmFilterExactMatch()
→ bool
Return True if Parameter Editor filtering uses exact pattern matching.
setParmFilterExactMatch(self,on)
Set Parameter Editor filtering to use exact pattern matching.
parmScrollPosition()
→ hou.Vector2
Return the Parameter Editor scroll bars position as percentages.
setParmScrollPosition(self,pos)
Set Parameter Editor scroll bars position as hou.Vector2 percentages.
parmScrollTo(parms, scroll_pos)
Adjust the Parameter Editor vertical scroll bar to align one or more parameters using hou.scrollPosition mode.
The parms
argument can be a list
or a single str
, hou.Parm or hou.ParmTuple. The types can also be mixed in the list. If an entry is a str
, you can pass a comma seperated list of parameter names but wildcards are not supported.
The scroll_pos
argument defines how to align the vertical bounding box of the affected parameters. See hou.scrollPosition.
parmMoveFocusTo(parm)
Try to move keyboard focus to the specified parameter in the Parameter Editor.
Deprecated ¶
frameSelection()
Centers the nodes within the network editor to show the current selection and zooms to its extents. This method wraps a call to hou.NetworkEditor.setVisibleBounds.
homeToSelection()
Centers the nodes within the network editor to show the current selection. This method wraps a call to hou.NetworkEditor.setVisibleBounds.
listMode()
→ bool
Return True if the network editor is in list mode and False otherwise.
setListMode(on)
Set the network editor to enter list mode if on
is True and to exit list
mode if on
is False.
selectPosition(input_node=None, output_index=0, output_node=None,
input_index=0)
→ hou.Vector2
This method wraps a call to hou.NetworkEditor.pushEventContext,
with the event context set to 'nodegraphselectpos'
, and appropriate
context data to give behavior similar to the old network editor.
Prompt the user to select a position in the network editor for a new node to be placed. The network editor visualizes the position with a dotted outline of a node placeholder. The user can then move the mouse to change the position and to confirm. The user can also press ⎋ Esc instead to cancel the selection.
You can optionally pass in hou.Node objects to the input_node
and
output_node
arguments to visualize the node placeholder with connections
to the specified input and output nodes.
Return a hou.Vector2 containing the x,y coordinates of the selected position.
Raise hou.OperationInterrupted if the user canceled the selection. Raise hou.OperationFailed if the network editor is in list mode.
This method can be useful for scripts that create new nodes and prompts for node positions. Here is an example:
# Get the input and output nodes that the new node will connect to. input_node = hou.node("/obj/myInput") output_node = hou.node("/obj/myOutput") # Set the new node to connect to the first output of the input node # and the second input of the output node. output_index = 0 input_index = 1 # Get the network editor. network_editor = hou.ui.curDesktop().paneTabOfType( hou.paneTabType.NetworkEditor) # Prompt the user to select a position for the new node. position = network_editor.selectPosition( input_node, output_index, output_node, input_index) # Create the new node. new_node = hou.node("/obj").createNode("geo") # Position the new node and wire it to the input and output nodes. new_node.move(position) new_node.setInput(0, input_node, output_index) output_node.setInput(input_index, new_node, 0)
autoAddToNetbox(node)
This method is deprecated in the new network editor and does nothing.
insertIntoUnderlyingConnections(node, x, y)
This method is deprecated in the new network editor and does nothing.
modifyPositionForNode(vector2, node)
→ Vector2
This method is deprecated in the new network editor, and simply returns the position passed into the function.
autoPlaceNodes()
→ bool
This method is deprecated in the new network editor and always
returns False
.
autoScrollNodes()
→ bool
This method is deprecated in the new network editor and always
returns False
.
Methods from hou.PaneTab ¶
name()
→ str
Return the name of this tab.
setName(name)
Set the name of this pane tab. A pane tab name may contain spaces.
Note that this name is the internal name of the tab, and is different from the label displayed in the interface.
type()
→ hou.paneTabType enum value
Return the type of this tab (i.e. whether it is a scene viewer, parameter editor, network editor, etc.).
setType(type)
→ hou.PaneTab
Create a new pane tab of the given type, replace this tab with it, and return the new pane tab. Use the returned pane tab afterward; references to this tab become invalid.
close()
Close the pane tab.
pane()
→ hou.Pane or None
Return the pane in the desktop that contains this pane tab. Note that pane tabs in regular floating panels are always in a pane, since regular floating panels contain one or more panes.
However, some floating panels have their content stripped down to only contain one particular pane tab type, and do not display the user interface to add more pane tabs, split the pane, etc. This method returns None for these stripped down floating panels.
floatingPanel()
→ hou.FloatingPanel or None
Return the floating panel that contains this pane tab or None if the pane tab is not in a floating panel.
isCurrentTab()
→ bool
Return whether this tab is the selected tab in the containing pane.
setIsCurrentTab()
Set this tab as the selected tab in the containing pane.
isFloating()
→ bool
Return whether this pane tab is in a floating panel.
This method can be approximately implemented as follows:
def isFloating(self): return self.pane() is None or self.pane().floatingPanel() is not None
clone()
→ hou.PaneTab
Create a floating copy of the pane tab and return the cloned pane tab. The new pane tab is in a new floating panel.
linkGroup()
→ hou.paneLinkType enum value
Return the link group that this pane tab belongs to.
See also hou.PaneTab.isPin.
setLinkGroup(group)
Set the link group membership of this pane tab.
isPin()
→ bool
Return whether this pane tab is pinned. This method is equivalent to
(self.linkGroup() == hou.paneLinkType.Pinned)
See also hou.PaneTab.linkGroup.
setPin(pin)
If pin is True
, set the link group membership to hou.paneLinkType.Pinned.
Otherwise, set it to hou.paneLinkType.FollowSelection. This method can be
implemented using hou.PaneTab.setLinkGroup as follows:
def setPin(self, pin): if pin: self.setLinkGroup(hou.paneLinkType.Pinned) else: self.setLinkGroup(hou.paneLinkType.FollowSelection)
See also hou.PaneTab.setLinkGroup.
size()
→ tuple
of int
Return a 2-tuple containing the pane tab’s width and height.
The width and height include the content area, network navigation control area (if any) and borders.
The width and height do not include the pane tab’s tab area.
contentSize()
→ tuple
of int
Return a 2-tuple containing the pane tab’s content area width and height.
The width and height do not include the network navigation control area (if any), pane tab borders or tab area.
hasNetworkControls()
→ bool
Return True if this pane tab type supports network controls.
isShowingNetworkControls()
→ bool
Return whether this pane tab is showing its network control bar. Return False if the pane tab doesn’t have network controls. See also hou.PaneTab.hasNetworkControls.
setShowNetworkControls(pin)
Show or Hide the network control bar. Has no effect if the pane tab doesn’t have network controls. See also hou.PaneTab.hasNetworkControls.
This method is deprecated in favor of showNetworkControls
.
showNetworkControls(pin)
Show or Hide the network control bar. Has no effect if the pane tab doesn’t have network controls. See also hou.PaneTab.hasNetworkControls.
displayRadialMenu(menu)
Launch the specified radial menu in the pane tab.
qtParentWindow()
→ QWidget
Return a PySide2.QtWidgets.QWidget
instance that represents the window
containing the pane tab.
qtScreenGeometry()
→ QRect
Return the geometry of the pane as a PySide2.QtCore.QRect
object. The x
and y
properties of the returned QRect
object
point to the top-left corner of the pane in screen coordinates.
Methods from hou.PathBasedPaneTab ¶
cd(path)
currentNode()
→ Node
pwd()
→ Node
setCurrentNode(node, pick_node = True)
setPwd(node)