-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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
Clean up/refactor GraphNode and make it more flexible #79311
Conversation
95a5183
to
809ecce
Compare
809ecce
to
804c347
Compare
804c347
to
50688fa
Compare
Rebased. |
I'll review it this week, but for now I wanted to mention that grid toggle icons shouldn't be a part of this. They were added (though originally missing) in #79308. |
404cdec
to
9cc5663
Compare
I fixed the icons and added some missing renames. I noticed some existing inconsistencies with closing/deleting, and unified them using the term closing, closable as it makes the most sense from the perspective of the graph itself. We can discuss this, but at least it's all consistent now and doesn't use both terms interchangeably. I also finalized and simplified some of the changes in the visual shader editor plugin, though it would've been better to never include anything other than necessary renames and whatnot in this PR. From a quick look at visual shaders everything works fine. So I'll continue with my review. PS. I think the names that we've picked for updated classes are good, but we can ask for more opinions. |
9cc5663
to
ff0b620
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Documentation and theme review.
Please when you make changes do not rebase against the master, otherwise it would be a hell to untangle what has been actually changed between force pushes. Alternatively, making it into separate commits for now is also fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code review. As with GraphEdit
it's still missing the manual theme cache, but I guess I'll add it after all this rework.
We should also add compatibility exceptions for the new renames and other public API changes, see #80168. I plan to follow this up with a PR that adds compatibility methods where possible, but for now adding exceptions should be fine.
I haven't checked the code too closely, but it seems mostly fine outside of outlined problems. This is to say that once those are addressed, I think we can go ahead with this, and use public testing to help us identify if there remain any typos or calculation mistakes. What remains to test is using GraphEdit in a project, customizing it, extending elements and configuring the titlebar. I will do this tomorrow. |
This comment was marked as resolved.
This comment was marked as resolved.
@RodZill4
This will definitely be the case. You can probably implement a basic comment node right now (without fancy sorting or automatic resizing) using the new base class
I have plans to construct an API around connections, but this has to wait for 4.3+. |
I think singleton exists for this specific purpose, so you can check the state of the input at any point. So I don't have a problem with just copying the logic from |
@Geometror This PR is still missing compatibility exceptions in the |
69da0b5
to
5f1742e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than the grammar fixes above this LGTM
Split GraphNode into GraphElement and GraphNode, add custom titlebar, and adjust theming.
fe2236b
to
5afe78b
Compare
Should be good to go now after it (hopefully) passes CI. @YuriSizov The snapping was already fixed (when resizing). @AThousandShips I just tried out the "Commit suggestion" feature for the first time. I hope I haven't spammed you with dozens of notifications :) |
No worries! Next time try out the "Add suggestion to batch" option to do all in one commit |
Thanks! |
I don't see any relevant changes and you haven't pushed anything before I asked the last time 👀 |
@Geometror Just to re-confirm, because I've just tested it on master, but there is no snapping when resizing. I think you haven't pushed the fixed that you've described before. |
@YuriSizov btw that never happened, might be worth doing before the upcoming release? |
In fact several changes have happened since and it's still in flux |
Leaving it as experimental gives us room to tweak and fix, my suggestion is to leave it until 4.2.1 at the earliest to get some more field testing of it done |
We decided to keep it marked as experimental until 4.3, but there shouldn't be major breaking changes. It's just to account for possible feedback from GraphEdit users, who aren't many. |
@YuriSizov ah yeah that kinda makes sense, the main issue i see with it is just that currently the most common feedback is "i'm scared to become a GraphEdit user, because it literally tells me to wait for an undetermined amount of time before i do so, when will the rework finally happen so i can start using it?" |
Well then wait for the warning to disappear if you're uncertain :) We just want to give time existing users to update their tools and make sure nothing requires further breaking changes. Those people understand the current status. |
Updating Material Maker for Godot 4.2 has been pretty smooth on the GraphEdit/GraphNode side. Didn't notice any problem (and graph nodes are used A LOT). The only aspect I didn't dig into yet is converting comment nodes into GraphElements. |
@RodZill4 Comment nodes are likely going to be difficult to implement just with |
@Geometror can you please take a look at this issue which was probably introduced due to this pull? I'm not familiar with the codebase, so I could do with some help understanding the |
Split from #67152. Depends on #79308.
This PR contains the rework of GraphNode.
Detailed changes:
GraphNode
intoGraphElement
andGraphNode
set/get_connection_input/output_x
methods toset/get_port_input/output_x
get_port_input/output_height
as it was not necessary (basically returned the height of the slot of the given port which is the height of the child in that slot)get_port_input/output_position
returns no longer the position premultiplied with the scale