pymel.core.windows.hyperGraph

hyperGraph(*args, **kwargs)

The following is an overview of the basic features of the hypergraph. A more detailed description is given in the user manuals. The hypergraph provides the user with the ability to view and edit the maya scene graph. The hypergraph supports two types of graphs: the DAG or scene hierarchy and the dependency graph. The default view of the hypergraph editor is the DAG view. The user can show the dependency graph for a collection of nodes by first selecting the nodes and navigating to the dependency graph using one of the graph options. The user can save any view by setting a bookmark to that view. The user can also show previous views using the view options provided. The hypergraph supports a simple editing mechanism for editing hierarchy in the DAG view and connections in dependency graph view. In the DAG view, the user can reparent or reorder nodes in the graph using drag-and-drop. In the dependency graph view, the user can select connections and delete them or make new connections by dragging and dropping nodes or existing connections. The hypergraph supports two layout modes in the DAG view: automatic and freeform. In automatic mode, the graph nodes are automatically positioned according to the layout preferences. In freeform mode, the user can position nodes manually. The node position is saved in the scene. A background image can be placed behind DG or DAG in freeform mode. This can be used as a template for positioning nodes in a user-defined layout. Nodes in the DAG view can be expanded or collapsed. The state is saved in the scene. The performance of the graph drawing will increase as hierarchies are collapsed. In addition to hierachy relationships, the hypergraph can show expression, constraint and deformation relationships in the DAG. These can be enabled/disabled through the options provided. There are also additional filters for showing shape nodes and invisible nodes. The amount of detail show may affect the speed of the display of the graph. Most of the UI features of the hypergraph are addressable through the hypergraph command-line interface. The available command-line options are described in the next section.

Flags:
Long name (short name) Argument Types Properties
addBookmark (abk) bool ../../../_images/create.gif ../../../_images/edit.gif
 
Create a bookmark for the current hypergraph view.
addDependGraph (adg) PyNode ../../../_images/create.gif ../../../_images/edit.gif
 
Add a dependency graph starting at the named node to the view
addDependNode (adn) PyNode ../../../_images/create.gif ../../../_images/edit.gif
 
Add a dependency node to the dependency graph view
animateTransition (atr) bool ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Turns animate transitions off and on.
attributeEditor (ae) unicode ../../../_images/create.gif ../../../_images/edit.gif
 
Launches attribute editor on selected node.
backward (bak) bool  
   
bookmarkName (bn) bool ../../../_images/query.gif
 
Returns the bookmark name for the most recently created bookmark.
breakConnectionCommand (bco) unicode  
   
clear (clr) bool ../../../_images/create.gif ../../../_images/edit.gif
 
Clears the current hypergraph view and deletes the graph UI. (see also -rebuild flag)
collapseContainer (cc) bool ../../../_images/create.gif ../../../_images/edit.gif
 
Collapses containers selected in DG graph.
connectionDrawStyle (cds) unicode ../../../_images/create.gif ../../../_images/edit.gif
 

Specify how connections between nodes should be drawn. Valid values are center(draws connection lines from the center of one node to the center of the other) and side(draws connection lines from the right side of the source node to the left side of the destination node). The default is center. This flag does not apply to Hypershade graphs, which are always drawn with the sideconnection draw style.

control (ctl) bool ../../../_images/query.gif
 

Query only. Returns the top level control for this editor. Usually used for getting a parent to attach popup menus. Caution: It is possible, at times, for an editor to exist without a control. This flag returns NONEif no control is present.

currentEdge (ced) unicode  
   
currentNode (cno) unicode  
   
debug (deb) unicode  
   
defineTemplate (dt) unicode ../../../_images/create.gif
 

Puts a command in a mode where any other flags and args are parsed and added to the command template specified in the argument. They will be used as default arguments in any subsequent invocations of the command when templateName is set as the current template.

deleteBookmark (dbk) unicode ../../../_images/create.gif ../../../_images/edit.gif
 
Delete the bookmark with the corresponding node name.
dependGraph (dg) bool ../../../_images/create.gif ../../../_images/edit.gif
 
Displays dependency graph iterated from specified node.
dependNode (dn) unicode ../../../_images/create.gif ../../../_images/edit.gif
 
Displays dependency node in view.
directoryPressCommand (dp) unicode  
   
docTag (dtg) unicode ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Attaches a tag to the Maya editor.
down (do) bool ../../../_images/create.gif ../../../_images/edit.gif
 
Navigate down to the dependency graph containing the current selection. Shows upstream and downstream connections.
downstream (ds) bool ../../../_images/create.gif ../../../_images/edit.gif
 
Show downstream dependency graph of selected node(s).
dragAndDropBehaviorCommand (ddc) unicode ../../../_images/create.gif ../../../_images/edit.gif
 

Mel proc called when a drag and drop onto a hyperGraph node has occurred. Proc signature is procName (string $editor, string $sourceNode, string $destinationNode).

dropNode (dr) unicode ../../../_images/query.gif
 
Returns the name of the source node in a drag and drop connection, when called during processing of a drop.
dropTargetNode (drt) unicode ../../../_images/query.gif
 
Returns the name of the destination node in a drag and drop connection, when called during processing of a drop.
edgeDblClickCommand (edc) unicode ../../../_images/create.gif ../../../_images/edit.gif
 
Mel proc called when an edge is double clicked. Proc signature is procName (string $editor, string $edge).
edgeDimmedDblClickCommand (edd) unicode ../../../_images/create.gif ../../../_images/edit.gif
 
Mel proc called when a dimmed edge is double clicked. Proc signature is procName (string $editor, string $edge).
edgeDropCommand (edr) unicode  
   
edgePressCommand (ep) unicode  
   
edgeReleaseCommand (er) unicode  
   
enableAutomaticLayout (eal) bool ../../../_images/create.gif ../../../_images/edit.gif
 
Rebuild the graph if a node is added or removed from the graph via drag and drop or dg messages. Default is true.
exists (ex) bool ../../../_images/create.gif
 
Returns true|false depending upon whether the specified object exists. Other flags are ignored.
expandContainer (ec) bool ../../../_images/create.gif ../../../_images/edit.gif
 
Expands containers selected in DG graph.
feedbackGadget (fbg) unicode ../../../_images/query.gif
 
Returns the name of the current gadget.
feedbackNode (fbn) unicode ../../../_images/query.gif
 
Returns the name of the current feedback or highlight node.
filter (f) unicode ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Specifies the name of an itemFilter object to be placed on this editor. This filters the information coming onto the main list of the editor.
filterDetail (fd) unicode, bool ../../../_images/create.gif ../../../_images/edit.gif
 
This flag is obsolete. Use the showConstraints, showExpressions, showDeformer, showInvisible, showShapes and showUnderworld flags instead.
fitImageToHeight (fih) bool ../../../_images/create.gif
 
Changes position and scale of background image, so its height fits current editor view.
fitImageToWidth (fiw) bool ../../../_images/create.gif
 
Changes position and scale of background image, so its width fits current editor view.
focusCommand (fc) unicode ../../../_images/create.gif ../../../_images/edit.gif
 
Mel proc to be run when the mouse is clicked in the hyper graph. Primarily of use in setting the window focus.
fold (fo) bool ../../../_images/create.gif ../../../_images/edit.gif
 
Folds (Collapses) selected object.
forceMainConnection (fmc) unicode ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 

Specifies the name of a selectionConnection object which the editor will use as its source of content. The editor will only display items contained in the selectionConnection object. This is a variant of the -mainListConnection flag in that it will force a change even when the connection is locked. This flag is used to reduce the overhead when using the -unlockMainConnection , -mainListConnection, -lockMainConnection flags in immediate succession.

forceRefresh (frf) bool ../../../_images/create.gif ../../../_images/edit.gif
 
Forces the hypergraph to refresh (redraw) its contents.
forward (fow) bool  
   
frame (fr) bool ../../../_images/create.gif ../../../_images/edit.gif
 
Frames the selected objects
frameBranch (frb) bool ../../../_images/create.gif ../../../_images/edit.gif
 
Frames the the branch from the selected node on downward.
frameGraph (fg) bool ../../../_images/create.gif ../../../_images/edit.gif
 
Frames the entire graph.
frameGraphNoRebuild (fgn) bool  
   
frameHierarchy (frh) bool ../../../_images/create.gif ../../../_images/edit.gif
 
Frames the hierarchy that contains the selected node.
freeform (fre) bool ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Enable freeform layout mode.
fromAttr (fat) unicode ../../../_images/query.gif
 
Returns the name of the source attribute in a drag and drop connection, when called during processing of a drop.
fromNode (frn) unicode  
   
getNodeList (gnl) bool ../../../_images/query.gif
 
Returns a string array that represents a list of all the nodes in the graph.
getNodePosition (gnp) unicode ../../../_images/query.gif
 

Returns the position of a specified node in x,y graph coords. This flag and its argument must be passed to the command before the -q flag (see examples). In query mode, this flag can accept a value.

graphDescription (gd) bool  
   
graphLayoutStyle (gls) unicode ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Selects the graph layout style : circularLayout|hierarchicalLayout|orthogonalLayout|symmetricLayout|treeLayout
graphType (gt) unicode ../../../_images/query.gif
 
Returns the type name of the current graph in the view (either DAG or DG).
heatMapDisplay (hmd) bool  
   
highlightConnection (hlc) unicode ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 

Specifies the name of a selectionConnection object which the editor will synchronize with its highlight list. Not all editors have a highlight list. For those that do, it is a secondary selection list.

iconSize (ics) unicode ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Set or query the icon size for this hyper graph editor. The currently allowed icon sizes are small, mediumand large.
image (img) unicode ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Specify background image to be loaded from the project image directory.
imageEnabled (ime) bool ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Enable display of a loaded background image (Freeform DAG view or DG view)
imageForContainer (ifc) bool ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Specify that the following flags work on selected containers instead of the whole image: -imageScale,-imagePosition, fitImageToWidth, -fitImageToHeight, -image
imagePosition (imp) float, float ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Position of the background image.
imageScale (ims) float ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Uniform scale of the background image.
initializeScript (ini) unicode  
   
isHotkeyTarget (iht) bool ../../../_images/query.gif
 
For internal use.
layout (lay) bool ../../../_images/create.gif ../../../_images/edit.gif
 
Perform an automatic layout on the graph.
layoutSelected (lsl) unicode ../../../_images/create.gif ../../../_images/edit.gif
 
Perform an automatic layout on the selected object. circularLayout|hierarchicalLayout|orthogonalLayout|symmetricLayout|treeLayout
layoutSubtree (lsb) bool  
   
limitGraphTraversal (lgt) int  
   
lockMainConnection (lck) bool ../../../_images/create.gif ../../../_images/edit.gif
 

Locks the current list of objects within the mainConnection, so that only those objects are displayed within the editor. Further changes to the original mainConnection are ignored.

look (loo) float, float ../../../_images/create.gif ../../../_images/edit.gif
 
Look at a coordinate in the graph view
mainListConnection (mlc) unicode ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 

Specifies the name of a selectionConnection object which the editor will use as its source of content. The editor will only display items contained in the selectionConnection object.

mergeConnections (mc) bool ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Merge groups of connections into ‘fat’ connections.
navigateHome (hom) bool ../../../_images/create.gif ../../../_images/edit.gif
 
Navigate to the home (DAG) view.
navup (nu) bool  
   
newInputConnection (nin) unicode  
   
newOutputConnection (nou) unicode  
   
nextView (nvw) bool ../../../_images/create.gif ../../../_images/edit.gif
 
Changes the view to the next DAG view.
nodeConnectCommand (nco) unicode  
   
nodeDblClickCommand (ndc) unicode  
   
nodeDropCommand (ndr) unicode ../../../_images/create.gif ../../../_images/edit.gif
 
Set the command to be called when a node is dropped in the hypergraph window.
nodeMenuCommand (nm) unicode  
   
nodePressCommand (np) unicode ../../../_images/create.gif ../../../_images/edit.gif
 
Set the command to be called when the user presses a mouse button while the cursor is over a node in the hypergraph window.
nodeReleaseCommand (nr) unicode ../../../_images/create.gif ../../../_images/edit.gif
 
Set the command to be called when the user releases a mouse button while the cursor is over a node in the hypergraph window.
opaqueContainers (opc) bool ../../../_images/query.gif ../../../_images/edit.gif
 
Sets expanded container background opacity.
orientation (orientation) unicode ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Selects orientation style of graph: horiz|vert
panView (pan) float, float  
   
panel (pnl) unicode ../../../_images/create.gif ../../../_images/query.gif
 

Specifies the panel that the editor belongs to. By default if an editor is created in the create callback of a scripted panel it will belong to that panel. If an editor doesn’t belong to a panel it will be deleted when the window that it is in is deleted.

parent (p) unicode ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Specifies the parent layout for this editor. This flag will only have an effect if the editor is currently un-parented.
popupMenuScript (pms) unicode ../../../_images/create.gif ../../../_images/edit.gif
 

Set the script to be called to register the popup menu with the control for this hypergraph. The script will be called with a string argument which gives the name of the hypergraph whose control the popup menu should be parented to.

previousView (pvw) bool ../../../_images/create.gif ../../../_images/edit.gif
 
Changes the view back to the previous DAG view.
range (rg) float, float ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 

Limits the display of nodes to only those within the range. There are two float values expected, the first the lower threshold of the range and the second the upper threshold of the range. The values are absolute timing values, not percentages.

rebuild (rb) bool ../../../_images/create.gif ../../../_images/edit.gif
 
Rebuilds graph
removeNode (rmn) unicode ../../../_images/create.gif ../../../_images/edit.gif
 
Removes the node identified by string from the graph.
rename (rn) bool ../../../_images/create.gif ../../../_images/edit.gif
 
Pops up text field over selected object for renaming
resetFreeform (rf) bool ../../../_images/create.gif ../../../_images/edit.gif
 
Resets freeform position on all nodes.
restoreBookmark (rbk) unicode ../../../_images/create.gif ../../../_images/edit.gif
 
Restore the view corresponding to the bookmark.
scrollUpDownNoZoom (snz) bool ../../../_images/create.gif ../../../_images/edit.gif
 
Specify if we want to be in the scroll along y only with no free zooming mode. By default, hyper graph editor allows user to pan left and right.
selectionConnection (slc) unicode ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 

Specifies the name of a selectionConnection object which the editor will synchronize with its own selection list. As the user selects things in this editor, they will be selected in the selectionConnection object. If the object undergoes changes, the editor updates to show the change.

setNodePosition (snp) unicode, float, float ../../../_images/create.gif ../../../_images/edit.gif
 

Sets the node identified by string to the (x,y) position in the window specified by the two floats. If the node is not in the graph than it will be added to the graph and then moved to the new position.

showCachedConnections (scc) bool  
   
showConstraints (shc) bool ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Show constraint relationships in the DAG.
showDeformers (shd) bool ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Show deformer or geometry filter relationships in the DAG.
showExpressions (shx) bool ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Show expression relationships in the DAG.
showInvisible (shi) bool ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Show invisible nodes in the DAG.
showRelationships (shr) bool ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Show relationship (message) connections.
showShapes (shs) bool ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Show shape nodes in the DAG.
showUnderworld (shu) bool ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Show underworld graphs in the DAG.
stateString (sts) bool ../../../_images/query.gif
 

Query only flag. Returns the MEL command that will edit an editor to match the current editor state. The returned command string uses the string variable $editorName in place of a specific name.

toAttr (tat) unicode  
   
toNode (ton) unicode  
   
transitionFrames (tfr) int ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Specify te number of transition frames for animate transitions.
unParent (up) bool ../../../_images/create.gif ../../../_images/edit.gif
 
Specifies that the editor should be removed from its layout. This cannot be used with query.
unfold (uf) bool ../../../_images/create.gif ../../../_images/edit.gif
 
Unfolds (expands) selected object.
unfoldAll (ua) bool ../../../_images/create.gif ../../../_images/edit.gif
 
Unfolds everything under selected object.
unfoldAllShapes (uas) bool  
   
unfoldHidden (ufh) bool  
   
unlockMainConnection (ulk) bool ../../../_images/create.gif ../../../_images/edit.gif
 
Unlocks the mainConnection, effectively restoring the original mainConnection (if it is still available), and dynamic updates.
updateMainConnection (upd) bool ../../../_images/create.gif ../../../_images/edit.gif
 
Causes a locked mainConnection to be updated from the orginal mainConnection, but preserves the lock state.
updateNodeAdded (una) bool ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Update graph when a new node is added to the database
updateSelection (us) bool ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Update selection state in the graph when the selection state of database changes.
upstream (ups) bool ../../../_images/create.gif ../../../_images/edit.gif
 
Show upstream dependency graph of selected node(s).
useDrawOverrideColor (drc) bool  
   
useFeedbackList (ufl) bool ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Use feedback or highlight list as the target selection when processing other hypergraph command-line options.
useTemplate (ut) unicode ../../../_images/create.gif
 
Force the command to use a command template other than the current one.
viewOption (vo) unicode ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Set or query the view option for this hyper graph editor. The currently allowed views are asIconsand asList.
visibility (vis) bool ../../../_images/create.gif ../../../_images/edit.gif
 
Set the visible state of the selected node(s).
zoom (zm) float ../../../_images/create.gif ../../../_images/edit.gif
 
Specify the zoom factor for animating transitions Flag can have multiple arguments, passed either as a tuple or a list.

Derived from mel command maya.cmds.hyperGraph

Example:

import pymel.core as pm

# The hyperGraph command is not one which would commonly be used
# by the user.
pm.polySphere( r=1, sx=20, sy=20, ax=(0, 1, 0), tx=2, ch=1 )
# Result: [nt.Transform(u'pSphere1'), nt.PolySphere(u'polySphere1')] #

# Gets the position of the node in the graph.
maya.mel.eval( "HypergraphHierarchyWindow" )
position = pm.hyperGraph( 'hyperGraphPanel1HyperGraphEd', query=True, getNodePosition='pSphere1' )
print position

Previous topic

pymel.core.windows.hudSliderButton

Next topic

pymel.core.windows.hyperPanel

Core

Core Modules

Other Modules

This Page