diff --git a/doc/classes/VisualShaderNodeCustom.xml b/doc/classes/VisualShaderNodeCustom.xml index 5db0dfb32778..ddd43d09d38b 100644 --- a/doc/classes/VisualShaderNodeCustom.xml +++ b/doc/classes/VisualShaderNodeCustom.xml @@ -107,7 +107,7 @@ - Override this method to define the name of the associated custom node in the Visual Shader Editor's members dialog and graph. + Override this method to define the name of the associated custom node in the Visual Shader Editor's members dialog and graph. See also [method _get_shortcut_notation]. Defining this method is [b]optional[/b], but recommended. If not overridden, the node will be named as "Unnamed". @@ -172,6 +172,15 @@ Defining this method is [b]optional[/b]. If not overridden, no return icon is shown. + + + + Override this method to define the shortcut notation that is displayed next to the node name within square brackets. This can be used to quickly find a node in the node creation dialog by entering its shortcut notation instead of its name. See also [method _get_name]. + A good shortcut notation is easy to type, easy to remember and is unique among all nodes. The convention is to use uppercase characters for the first characters of each "word", and lowercase characters for additional characters that are present for context. + Examples of shortcuts used for built-in nodes: [code]V3Ct[/code] for [code]Vector3Constant[/code], [code]IPMx[/code] for [code]InvProjectionMatrix[/code], [code]GXp[/code] for [code]GlobalExpression[/code]. + Defining this method is [b]optional[/b], but recommended. If not overridden, the node won't have any shortcut notation. + + diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp index bf1d441c6f96..a4a770d55fc9 100644 --- a/editor/plugins/visual_shader_editor_plugin.cpp +++ b/editor/plugins/visual_shader_editor_plugin.cpp @@ -1595,7 +1595,7 @@ void VisualShaderEditor::clear_custom_types() { } } -void VisualShaderEditor::add_custom_type(const String &p_name, const String &p_type, const Ref