Skip to content

Commit

Permalink
Add shortcut notation to create nodes quickly in the visual shader ed…
Browse files Browse the repository at this point in the history
…itor
  • Loading branch information
Calinou committed Dec 23, 2024
1 parent 216b330 commit 023666d
Show file tree
Hide file tree
Showing 6 changed files with 602 additions and 572 deletions.
11 changes: 10 additions & 1 deletion doc/classes/VisualShaderNodeCustom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
<method name="_get_name" qualifiers="virtual const">
<return type="String" />
<description>
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".
</description>
</method>
Expand Down Expand Up @@ -172,6 +172,15 @@
Defining this method is [b]optional[/b]. If not overridden, no return icon is shown.
</description>
</method>
<method name="_get_shortcut_notation" qualifiers="virtual const">
<return type="String" />
<description>
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.
</description>
</method>
<method name="_is_available" qualifiers="virtual const">
<return type="bool" />
<param index="0" name="mode" type="int" enum="Shader.Mode" />
Expand Down
Loading

0 comments on commit 023666d

Please sign in to comment.