Skip to content
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 connection related functionality to VisualShader (deleting, dropping/inserting a node) #83510

Merged
merged 1 commit into from
Jan 22, 2024

Conversation

Geometror
Copy link
Member

@Geometror Geometror commented Oct 17, 2023

VS Connections
To demonstrate the new connection functionality, I went ahead and implemented some UX improvements for VS.

Depends on #86158 [merged] #83508.

  • Add a context menu for connections in the VisualShader editor consisting of
    • Disconnect: Deletes the connection
    • Insert New Node: Opens the "Create Shader Node" dialog and inserts the chosen node by splitting the original connection.

TODO:

  • Allow dragging fully unconnected nodes on connections to insert them
  • Polish

@YuriSizov
Copy link
Contributor

Amazing! Do you think adding a knife tool would be hard to implement here?

@Geometror
Copy link
Member Author

Not really so I might look into that, although it probably needs another method in GraphEdit to fetch all connections intersecting with a given line (using Geometry2D::segment_intersects_segment). But it would be much faster than before since the AABBs can be used to accelerate the intersection checks.

@Geometror Geometror force-pushed the vs-connection-ops branch 2 times, most recently from a92193a to 6638759 Compare October 19, 2023 23:57
@Geometror
Copy link
Member Author

Small update: Unconnected nodes can now be dropped on connections!
VS Connections DROP

@Geometror Geometror changed the title [WIP] Add connection related functionality to VisualShader (deleting, splitting/inserting a node) Add connection related functionality to VisualShader (deleting, dropping/inserting a node) Oct 22, 2023
@Geometror Geometror marked this pull request as ready for review October 22, 2023 01:57
@Geometror Geometror requested review from a team as code owners October 22, 2023 01:57
@QbieShay
Copy link
Contributor

QbieShay commented Oct 22, 2023

OMG YES! Thank you for this!!

Copy link
Member

@AThousandShips AThousandShips left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

editor/plugins/visual_shader_editor_plugin.cpp Outdated Show resolved Hide resolved
@YuriSizov
Copy link
Contributor

YuriSizov commented Dec 19, 2023

Needs a rebase, and a squash I think.

@Geometror
Copy link
Member Author

Geometror commented Dec 19, 2023

@YuriSizov Rebased, but this PR depends on #86158. That one needs to be merged first, this PR is already squashed and just based on the connections rework branch.

@YuriSizov
Copy link
Contributor

Okay, I'll mark it as a draft for the time being then.

@YuriSizov YuriSizov marked this pull request as draft December 20, 2023 11:22
@Geometror Geometror marked this pull request as ready for review January 19, 2024 00:11
@Geometror Geometror requested a review from a team as a code owner January 19, 2024 00:11
@Geometror
Copy link
Member Author

Geometror commented Jan 19, 2024

Rebased after #86158 got merged.
Tested and it looks like all features still work like they should.

Edit: Adjusted the commit message as well.

@Geometror Geometror force-pushed the vs-connection-ops branch 2 times, most recently from 75e9289 to 522cf6e Compare January 19, 2024 00:16
editor/plugins/visual_shader_editor_plugin.cpp Outdated Show resolved Hide resolved
editor/plugins/visual_shader_editor_plugin.cpp Outdated Show resolved Hide resolved
editor/plugins/visual_shader_editor_plugin.cpp Outdated Show resolved Hide resolved
editor/plugins/visual_shader_editor_plugin.cpp Outdated Show resolved Hide resolved
- Insert a node in a connection
- Drop an unconnected node on a connection to insert it
- Delete a connection
@YuriSizov YuriSizov merged commit feb1157 into godotengine:master Jan 22, 2024
16 checks passed
@YuriSizov
Copy link
Contributor

Thanks! If there are further changes required in the VS plugin, we can do them in a follow-up.

(And I personally still want this knife tool :P )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants