Is there a way to get the position (x/y coordinates) of a socket on a node in the node editor?
I'm working on auto layout functionality and having the actual socket position would make it much more useful.
Blender Stack Exchange is a question and answer site for people who use Blender to create 3D graphics, animations, or games. It only takes a minute to sign up.Sign up to join this community
You can get the location of a Node as well as the width and height, but the position of the socket does not seem to be available. This is likely to be because nodes can be in collapsed or expanded states and so a particular socket may or may not be visible at any given time.
You should be able to get pretty far knowing the dimensions and location of the node itself though. You know that all inputs are on the left side and all outputs on the right, and you can find out which nodes are linked to which, so you could do a topological sort and arrange the nodes with some minimum amount of spacing.