From b78b37ed3fc016aea7db696511f416a06ec3f917 Mon Sep 17 00:00:00 2001 From: Yuri Roubinsky Date: Fri, 14 Feb 2020 15:11:55 +0300 Subject: Refactor node processing in visual shader member dialog --- doc/classes/VisualShaderNodeCustom.xml | 12 +- editor/plugins/visual_shader_editor_plugin.cpp | 197 +++++++++++-------------- editor/plugins/visual_shader_editor_plugin.h | 16 +- scene/resources/visual_shader.cpp | 1 - 4 files changed, 95 insertions(+), 131 deletions(-) diff --git a/doc/classes/VisualShaderNodeCustom.xml b/doc/classes/VisualShaderNodeCustom.xml index 0d1bcc754f..6e6e56dcb0 100644 --- a/doc/classes/VisualShaderNodeCustom.xml +++ b/doc/classes/VisualShaderNodeCustom.xml @@ -20,8 +20,8 @@ - Override this method to define the category of the associated custom node in the Visual Shader Editor's members dialog. - Defining this method is [b]optional[/b]. If not overridden, the node will be filed under the "Custom" category. + Override this method to define the path to the associated custom node in the Visual Shader Editor's members dialog. The path may looks like [code]"MyGame/MyFunctions/Noise"[/code]. + Defining this method is [b]optional[/b]. If not overridden, the node will be filed under the "Addons" category. @@ -135,14 +135,6 @@ Defining this method is [b]optional[/b]. If not overridden, no return icon is shown. - - - - - Override this method to define the subcategory of the associated custom node in the Visual Shader Editor's members dialog. - Defining this method is [b]optional[/b]. If not overridden, the node will be filed under the root of the main category (see [method _get_category]). - - diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp index 826af88571..e228f25c62 100644 --- a/editor/plugins/visual_shader_editor_plugin.cpp +++ b/editor/plugins/visual_shader_editor_plugin.cpp @@ -116,7 +116,7 @@ void VisualShaderEditor::clear_custom_types() { } } -void VisualShaderEditor::add_custom_type(const String &p_name, const Ref