pymel.core.general.selectionConnection

selectionConnection(*args, **kwargs)

This command creates a named selectionConnection object. This object is simply a shared selection list. It may be used by editors to share their highlight data. For example, an outliner may attach its selected list to one of these objects, and a graph editor may use the same object as a list source. Then, the graph editor would only display objects that are selected in the outliner. Selection connections are UI objects which contain a list of model objects. Selection connections are useful for specifying which objects are to be displayed within a particular editor. Editor’s have three plug socketswhere a selection connection may be attached. They are: mainListConnectionan inputsocket which contains a list of objects that are to be displayed within the editorselectionConnectionan outputsocket which contains a list of objects that are selectedwithin the editorhighlightConnectionan inputsocket which contains a list of objects that are to be highlightedwithin the editorThere are several different types of selection connections that may be created. They include: activeLista selection connection which contains a list of everything in the model which is active (which includes geometry objects and keys)modelLista selection connection which contains a list of all the geometry (i.e. excluding keys) objects that are currently activekeyframeLista selection connection which contains a list of all the keys that are currently activeworldLista selection connection which contains a list of all the objects in the worldobjectLista selection connection which contains one model object (which may be a set)listLista selection connection which contains a list of selection connectionseditorLista selection connection which contains a list of objects that are attached to the mainListConnection of the specified editorsetLista selection connection which contains a list of all the sets in the worldcharacterLista selection connection which contains a list of all the characters in the worldhighlightLista selection connection which contains a list of objects to be highlighted in some fashionBelow is an example selectionConnection network between two editors. Editor 1 is setup to display objects on the activeList. Editor 2 is setup to display objects which are selected within Editor 1, and objects that are selected in Editor 2 are highlighted within Editor 1: – Editor 1– – Editor 2– inputList–| main | | |-| main | | | | sele |–| | | sele |–| |-| high | | | high | | | | ————- ————- | |————- fromEditor2 ————-| The following commands will establish this network: selectionConnection -activeList inputList; selectionConnection fromEditor1; selectionConnection fromEditor2; editor -edit -mainListConnection inputList Editor1; editor -edit -selectionConnection fromEditor1 Editor1; editor -edit -mainListConnection fromEditor1 Editor2; editor -edit -selectionConnection fromEditor2 Editor2; editor -edit -highlightConnection fromEditor2 Editor1; Note: to delete a selection connectionuse the deleteUI commandNote: commands which expect objects may be given a selection connection instead, and the command will operate upon the objects wrapped by the selection connectionNote: the graph editor and the dope sheet are the only editors which can use the editor connection to the highlightConnection of another editorWARNING: some flag combinations may not behave as you expect. The command is really intended for internal use for managing the outliner used by the various editors.

Flags:
  • activeCacheList : atc (bool) [create]

    Specifies that this connection should reflect the cache that objects on the active list belong to.

  • activeCharacterList : acl (bool) [create]

    Specifies that this connection should reflect the characters that objects on the active list belong to.

  • activeList : act (bool) [create]

    Specifies that this connection should reflect the active list (geometry objects and keys).

  • addScript : addScript (callable) [create,query,edit]

    Specify a script to be called when something is added to the selection.

  • addTo : add (unicode) [create,edit]

    The name of a selection connection that should be added to this list of connections.

  • characterList : cl (bool) [create]

    Specifies that this connection should reflect all the characters in the world.

  • clear : clr (bool) [create,edit]

    Remove everything from the selection connection.

  • connectionList : lst (bool) [create,query]

    Specifies that this connection should contain a list of selection connections.

  • defineTemplate : dt (unicode) [create]

    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.

  • deselect : d (PyNode) [create,edit]

    Remove something from the selection. Flag can have multiple arguments, passed either as a tuple or a list.

  • editor : ed (unicode) [create,query,edit]

    Specifies that this connection should reflect the -mainListConnection of the specified editor.

  • exists : ex (bool) [create]

    Returns true|false depending upon whether the specified object exists. Other flags are ignored.

  • filter : f (unicode) [create,query,edit]

    Optionally specifies an itemFilter for this connection. An empty string () clears the current filter. If a filter is specified, all the information going into the selectionConnection must first pass through the filter before being accepted. NOTE: filters can only be attached to regular selectionConnections. They cannot be attached to any connection created using the -act, -mdl, -key, -wl, -sl, -cl, -lst, -obj, or -ren flags. We strongly recommend that you do not attach filters to a selectionConnection — it is better to attach your filter to the editor that is using the selectionConnection instead.

  • findObject : fo (PyNode) [query]

    Find a selection connection in this list that wraps the specified object.

  • g : g (bool) [create,query,edit]

    A global selection connection cannot be deleted by any script commands.

  • highlightList : hl (bool) [create]

    Specifies that this connection is being used as a highlight list.

  • identify : id (bool) [query]

    Find out what type of selection connection this is. May be: activeList | modelList | keyframeList | worldList | objectList listList | editorList | connection | unknown

  • keyframeList : key (bool) [create]

    Specifies that this connection should reflect the animation portion of the active list.

  • lock : lck (bool) [create,query,edit]

    For activeList connections, locking the connection means that it will not listen to activeList changes.

  • modelList : mdl (bool) [create]

    Specifies that this connection should reflect the modeling (i.e. excluding keys) portion of the active list.

  • object : obj (PyNode) [create,query,edit]

    Specifies that this connection should wrap around the specified object (which may be a set). Query will return all the members of the selection connection (if the connection wraps a set, the set members will be returned)

  • parent : p (unicode) [create,query,edit]

    The name of a UI object this should be attached to. When the parent is destroyed, the selectionConnection will auto- delete. If no parent is specified, the connection is created in the current controlLayout.

  • remove : rm (unicode) [create,edit]

    The name of a selection connection that should be removed from this list of connections.

  • removeScript : rs (callable) [create,query,edit]

    Specify a script to be called when something is removed from the selection.

  • select : s (PyNode) [create,edit]

    Add something to the selection. This does not replace the existing selection.

  • setList : sl (bool) [create]

    Specifies that this connection should reflect all the sets in the world.

  • switch : sw (bool) [create,query]

    Acts as a modifier to -connectionList which sets the list of objects to be the first non-empty selection connection. selection connections are tested in the order in which they are added.

  • useTemplate : ut (unicode) [create]

    Force the command to use a command template other than the current one.

  • worldList : wl (bool) [create]

    Specifies that this connection should reflect all objects in the world.

Derived from mel command maya.cmds.selectionConnection

Previous topic

pymel.core.general.selectedNodes

Next topic

pymel.core.general.setAttr

Core

Core Modules

Other Modules

This Page