-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Reroutes #301
Add Reroutes #301
Conversation
- Initial Reroute implementation - LLink and Reroute both implement the new LinkSegment interface - LinkSegments can have a parentId, which always points to a Reroute
Use extras.reroutes to store additional data
Add keepReroutes option to prevent Reroute GC
Improves link render time
For the "shift-click drag link from link" feature
Temporary workaround
Add enum for link markers -> Pointing the way forward -> Set default centre marker to arrow
Works at root of all canvas interactions, should leave existing reroutes untouched but invisible until e.g. links are edited / changed.
Not to get terribly off-topic in this PR, but I think it may be worth considering looking at how other applications like Blender handle this, which supports creating multiple links at once (often for the purpose of grouping a single output going to multiple inputs), and more importantly, in a less mouse-precise way (node links are quite thin and require cursor accuracy). The same tool can also be used to quickly remove links. blender_2024-11-11_12-52-03.mp4 |
That is a bit off-topic for this PR. However, having not actually used blender reroutes or nodes, I am extremely happy to hear that a feature I was imagining is already out there and well-regarded. I was thinking of dragging the mouse (some kind of combo perhaps), and having it collect links and bunch them up - animated as you went. Drawing a line and bunching without animation would be much simpler. What this PR does is extend existing mouse interaction code and add Reroutes to the framework. It does not block features from being added, and is definitely not intended as a complete answer (but it certainly is a lot of it). Would you mind transferring that to an "enhancement" issue? It helps greatly to have tracking on these things. |
Made one here, can't add the label on my end. Let me know if I should mention anything else. #303 |
@huchenlei Tests are all green locally - just flaky. |
Do we have a plan to convert the legacy reroute in the frontend repo to this new format? |
100%! An optional switch that will convert all reroutes on load. This is a feature I need - I'm definitely writing it. |
Link Reroutes
Native reroutes are added by this PR, along with the supporting framework. Much of this work can be extended to implement new canvas types.
Scope
This PR gets the core infrastructure for reroutes in and testable, without touching
a thousandtwo thousand lines of code.More ways create & manage reroutes are planned.
Enabling
Alt drag from a link to create a reroute
reroute-alt-drag.mp4
Shift drag from a reroute to create another link
reroute-shift-drag.mp4
Link centre markers
Bug fixes