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
Question
Which (if any) of the above methods currently exist?
I'll edit this post if my own research turns up anything useful.
Related
-
Hi,
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.
Cheers,
Manuel -
Not the answer I was hoping for, but helpful nonetheless! Thank you.
-
Hello @dskeith,
without any further questions and other postings, we will consider this topic as solved and flag it as such by Friday, 17/06/2022.
Thank you for your understanding,
Ferdinand