From f402e1e6754088d92f9b191c5e8951edc95c34ac Mon Sep 17 00:00:00 2001 From: Yuri Roubinsky Date: Sun, 4 Oct 2020 12:11:58 +0300 Subject: Added VisualShaderNodeCurve to easy gather data from a CurveTexture --- editor/plugins/visual_shader_editor_plugin.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'editor/plugins/visual_shader_editor_plugin.h') diff --git a/editor/plugins/visual_shader_editor_plugin.h b/editor/plugins/visual_shader_editor_plugin.h index cecee70ca9..73bebcd192 100644 --- a/editor/plugins/visual_shader_editor_plugin.h +++ b/editor/plugins/visual_shader_editor_plugin.h @@ -33,6 +33,7 @@ #include "editor/editor_node.h" #include "editor/editor_plugin.h" +#include "editor/plugins/curve_editor_plugin.h" #include "editor/property_editor.h" #include "scene/gui/button.h" #include "scene/gui/graph_edit.h" @@ -74,6 +75,7 @@ private: LineEdit *uniform_name; OptionButton *const_op; CodeEdit *expression_edit; + CurveEditor *curve_editor; }; Ref visual_shader; @@ -93,6 +95,7 @@ public: void register_default_input_button(int p_node_id, int p_port_id, Button *p_button); void register_constant_option_btn(int p_node_id, OptionButton *p_button); void register_expression_edit(int p_node_id, CodeEdit *p_expression_edit); + void register_curve_editor(int p_node_id, CurveEditor *p_curve_editor); void clear_links(); void set_shader_type(VisualShader::Type p_type); bool is_preview_visible(int p_id) const; @@ -111,6 +114,7 @@ public: void set_input_port_default_value(VisualShader::Type p_type, int p_node_id, int p_port_id, Variant p_value); void update_uniform_refs(); void set_uniform_name(VisualShader::Type p_type, int p_node_id, const String &p_name); + void update_curve(int p_node_id); void update_constant(VisualShader::Type p_type, int p_node_id); void set_expression(VisualShader::Type p_type, int p_node_id, const String &p_expression); int get_constant_index(float p_constant) const; @@ -254,6 +258,7 @@ class VisualShaderEditor : public VBoxContainer { int texture2d_array_node_option_idx; int texture3d_node_option_idx; int custom_node_option_idx; + int curve_node_option_idx; List keyword_list; List uniform_refs; @@ -265,6 +270,8 @@ class VisualShaderEditor : public VBoxContainer { void _add_texture2d_node(const String &p_path); void _add_texture2d_array_node(const String &p_path); void _add_texture3d_node(const String &p_path); + void _add_curve_node(const String &p_path); + VisualShaderNode *_add_node(int p_idx, int p_op_idx = -1); void _update_options_menu(); void _set_mode(int p_which); -- cgit v1.2.3