UNSOLVED Node Editor API - View Bounds, Node Positions, Node Sizes

I'm looking to create some node alignment scripts (Align Vertical, Align Horizontal), and to do that, I believe I'll need the following information:

Get Methods

  • Current Node Editor + View Context (asked in a separate post)
  • Selected Nodes within the Currently Active Node Editor + Context
  • Node Position (Along with information on where the axis is relative to the node)
  • Node Width/Height (So that I can calculate bounds and add even gaps between nodes)
  • Node Editor Bounds (What's visible min/max)
  • Grid spacing + positioning
  • Nearest Grid Point (for snapping to grid if Snap to Grid is on/active)

Set Methods

  • Node position (ideally w/ option to snap to the nearest grid point)
  • Node Editor Bounds / Zoom + Pos


Which (if any) of the above methods currently exist?

I'll edit this post if my own research turns up anything useful.



As i said in the other thread, the current active node editor can't be retrieve.

The selected nodes are information that is not stored inside the editor itself but inside the node system. So you can retrieve them using GetSelectedNodes. Be sure to use the one in the GraphModelHelper class and not the old one.

Grid spacing + positioning

I'm not sure you can define your own grid spacing.

All the other questions cannot be answer if you cannot retrieve the active node editor.


Not the answer I was hoping for, but helpful nonetheless! Thank you.