has been shut down on the 6th of March 2021. You can read a bit more about it here.

You are currently reading an archived copy of the latest content, with all the usernames deleted.

Returning the current selected connection in Node Editor?

by user36 posted 30-12-2017 | 2 comments

I'm coding a bit of ui in PyMel to make connecting nodes on the fly a bit easier, and I'm curious if anyone knows a way to return the nodes/plugs information based on a selection of the connection curves in the node editor. There doesn't seem to be a lot of examples in the documentation for the node editor, and everything I've tried so far is giving me nothing. It looks like the node editor is one of the few windows PyMel doesn't have a dedicated class for.


by user122 posted 15-01-2018

Pymel NodeEditor

Maya Help on NodeEditor

import pymel.core as pm

# Get list of nodeEditors,
ne = pm.getPanel(scriptType='nodeEditorPanel')

# Then we can query the node editor for say, all nodes in view of main nodeEditor, 
nodeList = pm.nodeEditor('{}NodeEditorEd'.format(ne[0]), q=True, getNodeList=True)

By the looks of it one should be able to get this from either the "highlightList" or "selectionList" but I didn't manage to get it work. Hope you solve it because I gave up on something similar.


by user3 posted 05-01-2018

I remember some time ago I had a look at things that I can do in the node editor, but I didn't find a lot, so I kind of left it there. That being said, I'd imagine that you could be able to retrieve some information using PySide.

Unfortunately, I doubt there is an easy to use interface for it anywhere in pymel or cmds, but if you find anything, please share it.