Files
AnyImage/tools/nodes/arrangement/connections.py
nan 09778c4b48 Refactor geometry node arrangement system
- Removed obsolete files: sections.py, semantics.json, and sources.py.
- Introduced new modules: branches.py and layout.py for improved calculation block identification and layout planning.
- Implemented a unified layout strategy for geometry nodes, ensuring consistent spacing and organization.
- Added comprehensive documentation for the new layout design and its goals.
- Established a migration plan for transitioning existing assets to the new layout system.
- Updated tests to validate the new arrangement logic and ensure compatibility with existing geometry node structures.
2026-09-13 23:42:12 +08:00

21 lines
687 B
Python

"""Socket endpoints for the node preview."""
from .flow import socket_links
def socket_position(socket, positions, sizes):
node = socket.node
x, y = positions[node]
if node.bl_idname == "NodeReroute":
return x + 8, y - 8
return x + (sizes[node].width if socket.is_output else 0), y - sizes[node].sockets[socket]
def link_endpoints(link, positions, sizes):
start = socket_position(link.from_socket, positions, sizes)
x, y = socket_position(link.to_socket, positions, sizes)
if link.to_socket.is_multi_input:
siblings = socket_links(link.to_socket)
y -= (siblings.index(link) - (len(siblings) - 1) / 2) * 8
return start, (x, y)