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 math operators to Visual Shader node names for easier and simpler searching #67905

Merged
merged 1 commit into from
Oct 26, 2022

Conversation

alfredbaudisch
Copy link
Contributor

This change makes it easy, in the "Create Shader Node" dialog, to search for VS nodes by just typing the operator. For example, instead of typing "multiply", you can just type "*" and multiply nodes will be listed.

Searching by name still works as you can see in the example video.

This feature is inspired by Unreal Engine node graph editor's UX.

Implements and closes godotengine/godot-proposals#5663

godot-search-operator.mp4

This change makes it easy, in the "Create Shader Node" dialog, to search for VS nodes by just typing the operator. For example, instead of typing "multiply", you can just type "*" and multiply nodes will be listed.

This feature is inspired by Unreal Engine node graph editor's UX.

Implements and closes godotengine/godot-proposals#5663
@alfredbaudisch alfredbaudisch requested a review from a team as a code owner October 26, 2022 15:39
@alfredbaudisch alfredbaudisch changed the title Add math operators to Visual Shader node names Add math operators to Visual Shader node names for easier and simpler searching Oct 26, 2022
@KoBeWi KoBeWi added this to the 4.0 milestone Oct 26, 2022
@QbieShay
Copy link
Contributor

@Chaosus does this break compatibility?

@alfredbaudisch
Copy link
Contributor Author

@Chaosus does this break compatibility?

@QbieShay what does it affect in this case? Because the original Node names are still preserved in the graph, the names with operators appear only in the "Create Shader Node" dialog and in the search.

@alfredbaudisch
Copy link
Contributor Author

alfredbaudisch commented Oct 26, 2022

@Chaosus does this break compatibility?

@QbieShay I figured it out here. From what I tested, it doesn't break compat:

  • I created a project and a Visual Shader with Godot4-beta3.
  • I then opened the project with Godot with this change and it works.
  • Then vice-versa.
[sub_resource type="VisualShaderNodeFloatOp" id="VisualShaderNodeFloatOp_j0vv5"]
operator = 2

The reason is that the Nodes in the graph do not keep the names with the operators, the operators appear only in the add dialog, i.e. add_options.push_back, where AddOption("Equal (==)" is just the title of the dialog option.

Ex:

add_options.push_back(AddOption("Equal (==)", "Conditional/Functions", "VisualShaderNodeCompare", vformat(compare_func_desc, TTR("Equal (==)")), { VisualShaderNodeCompare::FUNC_EQUAL }, VisualShaderNode::PORT_TYPE_BOOLEAN));

image
image

@Chaosus
Copy link
Member

Chaosus commented Oct 26, 2022

does this break compatibility?

Nah, it's just a some sort of small UI enhancement. Make sense to me.

@clayjohn clayjohn merged commit 06cad89 into godotengine:master Oct 26, 2022
@clayjohn
Copy link
Member

Looks great, thanks!

@Calinou
Copy link
Member

Calinou commented Oct 26, 2022

Out of curiosity, can this PR be remade for 3.x as well?

@alfredbaudisch
Copy link
Contributor Author

Out of curiosity, can this PR be remade for 3.x as well?

I'm checking it out.

alfredbaudisch added a commit to alfredbaudisch/godot that referenced this pull request Oct 27, 2022
This change makes it easy, in the "Create Shader Node" dialog, to search for VS nodes by just typing the operator. For example, instead of typing "multiply", you can just type "*" and multiply nodes will be listed.

This feature is inspired by Unreal Engine node graph editor's UX.

Backported from godotengine#67905
alfredbaudisch added a commit to alfredbaudisch/godot that referenced this pull request Oct 27, 2022
This change makes it easy, in the "Create Shader Node" dialog, to search for VS nodes by just typing the operator. For example, instead of typing "multiply", you can just type "*" and multiply nodes will be listed.

This feature is inspired by Unreal Engine node graph editor's UX.

Backported from godotengine#67905
@alfredbaudisch alfredbaudisch deleted the vs-operand-aliases-dev branch October 27, 2022 06:56
alfredbaudisch added a commit to alfredbaudisch/godot that referenced this pull request Dec 15, 2022
This change makes it easy, in the "Create Shader Node" dialog, to search for VS nodes by just typing the operator. For example, instead of typing "multiply", you can just type "*" and multiply nodes will be listed.

This feature is inspired by Unreal Engine node graph editor's UX.

Backported from godotengine#67905
Deozaan pushed a commit to Deozaan/godot that referenced this pull request Jan 6, 2023
This change makes it easy, in the "Create Shader Node" dialog, to search for VS nodes by just typing the operator. For example, instead of typing "multiply", you can just type "*" and multiply nodes will be listed.

This feature is inspired by Unreal Engine node graph editor's UX.

Backported from godotengine#67905
Riordan-DC pushed a commit to Riordan-DC/godot that referenced this pull request Jan 23, 2023
This change makes it easy, in the "Create Shader Node" dialog, to search for VS nodes by just typing the operator. For example, instead of typing "multiply", you can just type "*" and multiply nodes will be listed.

This feature is inspired by Unreal Engine node graph editor's UX.

Backported from godotengine#67905
Riordan-DC pushed a commit to Riordan-DC/godot that referenced this pull request Jan 24, 2023
This change makes it easy, in the "Create Shader Node" dialog, to search for VS nodes by just typing the operator. For example, instead of typing "multiply", you can just type "*" and multiply nodes will be listed.

This feature is inspired by Unreal Engine node graph editor's UX.

Backported from godotengine#67905
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants