1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-13 13:31:48 +00:00

Make custom visual shader nodes automatically updates from script

This commit is contained in:
Yuri Rubinsky
2022-12-07 21:50:28 +03:00
parent cf093f8e47
commit ab17f197f0
2 changed files with 250 additions and 54 deletions

View File

@@ -133,6 +133,7 @@ public:
void update_curve_xyz(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;
Ref<Script> get_node_script(int p_node_id) const;
void update_node_size(int p_node_id);
void update_theme();
VisualShader::Type get_shader_type() const;
@@ -190,6 +191,9 @@ class VisualShaderEditor : public VBoxContainer {
PanelContainer *error_panel = nullptr;
Label *error_label = nullptr;
bool _block_update_options_menu = false;
bool _block_rebuild_shader = false;
Point2 saved_node_pos;
bool saved_node_pos_dirty = false;
@@ -497,6 +501,9 @@ class VisualShaderEditor : public VBoxContainer {
void _update_parameter_refs(HashSet<String> &p_names);
void _update_varyings();
void _update_options_menu_deferred();
void _rebuild_shader_deferred();
void _visibility_changed();
protected:
@@ -504,7 +511,6 @@ protected:
static void _bind_methods();
public:
void update_nodes();
void add_plugin(const Ref<VisualShaderNodePlugin> &p_plugin);
void remove_plugin(const Ref<VisualShaderNodePlugin> &p_plugin);
@@ -513,6 +519,9 @@ public:
void clear_custom_types();
void add_custom_type(const String &p_name, const Ref<Script> &p_script, const String &p_description, int p_return_icon_type, const String &p_category, bool p_highend);
Dictionary get_custom_node_data(Ref<VisualShaderNodeCustom> &p_custom_node);
void update_custom_type(const Ref<Resource> &p_resource);
virtual Size2 get_minimum_size() const override;
void edit(VisualShader *p_visual_shader);
VisualShaderEditor();