Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

Query selected connections in the node editor with python

Query selected connections in the node editor with python

Anonymous
Not applicable
1,318 Views
4 Replies
Message 1 of 5

Query selected connections in the node editor with python

Anonymous
Not applicable

Hello,

 

I was wondering if there is a way to query the selected connections in the node editor via python ?

 

NodeEditorConnection.JPG

The connection which are yellow I would like to get.

 

 

Cheers

Marcell

 

 

1,319 Views
4 Replies
Replies (4)
Message 2 of 5

mspeer
Consultant
Consultant

Hi!

 

It should be possible to get the connected nodes based on connected Attribute(s), but not on the color used for connection display.

0 Likes
Message 3 of 5

batarg
Advocate
Advocate

any luck with querying selected connection? im trying to make simple tool for focusing on two nodes on both ends.

i think it should be under the hood of qt... but can't figure out where start to dig

Message 4 of 5

batarg
Advocate
Advocate

oh god) that was not exactly what i searched but my main goal was achieved 

 

select connections in node editor and run[mel]:

 

 

 

string $ned = `getCurrentNodeEditor`;
nodeEditor -e -selectConnectionNodes $ned;

// with pinning and clearing
//nodeEditor -e -pinSelectedNodes 1 $ned;
//NodeEditorGraphClearGraph;

// just clearing and adding
NodeEditorGraphClearGraph;
nodeEditor -e -frameSelected -addNode "" $ned;

 

 

0 Likes
Message 5 of 5

batarg
Advocate
Advocate

wow.... found even simplier »out of the box« method (same, just select connection(s)) [mel]:

 

 

 

nodeEditor -e -graphSelectedConnections `getCurrentNodeEditor`;

 

 

 

0 Likes