Seneral / Node_Editor_Framework

A flexible and modular Node Editor Framework for creating node based displays and editors in Unity
https://nodeeditor.seneral.dev
MIT License
2.01k stars 415 forks source link

How to remove connections when using ConnectionCount.Multi? #145

Closed RomanZhu closed 6 years ago

RomanZhu commented 6 years ago

For example, i have that situation:

ciwafnflrgirwrnvyokwtg

And i want to remove one of connections. As i see there is no way built-in :(

I wrote dirty fix to get it semi-working and continue on writing extension

dsoux64wrquuqpxcjbabjq

Is there a way to remove connections which i'm missing? Like holding some button and dragging left mouse over wires? (Which is desired behavior, as it's used in many other applications)

RomanZhu commented 6 years ago

I'm using develop branch

Seneral commented 6 years ago

From multi connection knobs, there is unfortunately now way, no. Before the revamp, there were only Mult-Single connections so it was 'create from multi and delete from single'. Since that became interchangeable, single-single connections were also supported, but for multi-multi a new concept was required. This is not yet implemented, but it will be similar to what you said. Do you require multi-multi? Then I might try to do that whenever I have time soon:)

RomanZhu commented 6 years ago

Yeah we need it :D I can get away with my solution while developing extension, but i'll need properly working one at the end.

What i'm doing is parsing UnityEvents from scene objects and building tree procedurally with custom nodes, then modifying those events when connections changes in node editor

Seneral commented 6 years ago

Ok, will try it at some point. Core is the hit detection for the bezier curves. Then, what would you prefer? Clicking the curve to delete or dragging a line to detach all connections under it? Last would be nice but would require an additional key to hold...

RomanZhu commented 6 years ago

I prefer line-cuts with preview of that line (if we dragging mouse and button). Main reason for that is high possibility of random missed clicks.

Also it would be good to fast remove connection when clicking on them while holding same button (not too close to Knobs in case of multi connections (as that editor has no undo and random)

One more common way is selecting wire and deleting it by context menu or buttons

RomanZhu commented 6 years ago

https://youtu.be/XKbSu5PC8VA?t=633

Just to visualize what i mean

Seneral commented 6 years ago

Btw, you can check out #148, which is a good temporary workaround:)

RomanZhu commented 6 years ago

Yeah, i saw that :) Will check it out tomorrow