summaryrefslogtreecommitdiff
path: root/editor/plugins/visual_shader_editor_plugin.h
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-10-19 14:58:45 +0200
committerGitHub <noreply@github.com>2020-10-19 14:58:45 +0200
commit6b208599848d4e32cf198ce707519fcd7b326b0f (patch)
treeca666d8a062c5b607c26e18a7fe1d2b0bf4bb729 /editor/plugins/visual_shader_editor_plugin.h
parentbc8300d20197081bcf7ef0f9495107bf6dbf9acd (diff)
parentf402e1e6754088d92f9b191c5e8951edc95c34ac (diff)
Merge pull request #42558 from Chaosus/vs_curve
Added visual shader node to easy gather data from a CurveTexture
Diffstat (limited to 'editor/plugins/visual_shader_editor_plugin.h')
-rw-r--r--editor/plugins/visual_shader_editor_plugin.h7
1 files changed, 7 insertions, 0 deletions
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<VisualShader> 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<String> keyword_list;
List<VisualShaderNodeUniformRef> 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);