The defaultNavigation command defines default behaviours when creating or manipulating connections between nodes and when navigating between nodes via those connections. This command is primarily used by attribute editors.
Long name (short name) | Argument Types | Properties | |
---|---|---|---|
connectToExisting (ce) | bool | ||
Connect the destination (which is a node.attribute or simply node) to an existing source. If the source is specified (as node.attribute or simply as node), the command will proceed immediately. If the source is not specified, the user will be prompted to specify one. Once a source has been specified, a best guess will be made about what the user is trying to accomplish by connecting the two, based on the type of source and type of destination. The command will connect the nodes/attributes according to the best guess. The destination is specified using the destinationflag and the source specified using the sourceflag. |
|||
createNew (cn) | bool | ||
|
|||
defaultAttribute (da) | bool | ||
|
|||
defaultTraversal (dtv) | bool | ||
Returns the name of the node to which it would make the most sense to navigate to from the destination node.attribute specified. The destination is specified using the destinationflag. Returns a string. |
|||
defaultWorkingNode (dwn) | bool | ||
Returns the name of the node which the user is most likely to want to work with if they are interested in the attributes of the destination node. The destination is specified using the destinationflag. Returns a string. |
|||
delete (delete) | bool | ||
|
|||
destination (d) | PyNode | ||
|
|||
disconnect (dis) | bool | ||
force (f) | bool | ||
If set to true, then an attempt to connect a source attribute to a destination attribute which already has a source will cause the existing source to be disconnected and the new source to be connected in its place. Default value is true. |
|||
ignore (i) | bool | ||
|
|||
navigatorDecisionString (nds) | unicode | ||
This is your opportunity to pass the navigator a string that can help it decide what behaviour to execute.Flag can appear in Create mode of commandFlag can have multiple arguments, passed either as a tuple or a list. |
|||
quiet (qt) | bool | ||
|
|||
relatedNodes (ren) | bool | ||
List nodes which are conceptually related to the node.attribute specified by the destination. Related nodes may include, but are not limited to, nodes which are directly or indirectly connected to the destination. The destination is specified using the destinationflag. Returns an array of strings. |
|||
source (s) | PyNode | ||
|
|||
unignore (u) | bool | ||
|
Derived from mel command maya.cmds.defaultNavigation
Example:
import pymel.core as pm
# Create a poly plane
pm.polyPlane(w=10, h=10, sx=10, sy=10, n='pPlane1')
# Result: [nt.Transform(u'pPlane1'), nt.PolyPlane(u'polyPlane1')] #
# This will open the Create Render Node window from which you can select a node that you want to connect to the existing lambert1.color attribute
pm.defaultNavigation(createNew=True, destination='lambert1.color')
# Select the Checker Node, you will find "checker1.outColor" is connected to "lambert1.color"
# Break the connection between "checker1.outColor" and "lambert1.color" you have just established
pm.disconnectAttr('checker1.outColor', 'lambert1.color')
# Connect "checker1" to "lambert1". Only node is specified here, but the command will make a best guess.
# So "checker1.outColor" and "lambert1.color" are connected
pm.defaultNavigation(connectToExisting=True, source='checker1', destination='lambert1')
pymel.core.windows.defaultLightListCheckBox
Enter search terms or a module, class or function name.