summaryrefslogtreecommitdiffstats
path: root/editor/plugins/visual_shader_editor_plugin.cpp
diff options
context:
space:
mode:
authorYuri Roubinsky <chaosus89@gmail.com>2021-08-12 21:23:18 +0300
committerGitHub <noreply@github.com>2021-08-12 21:23:18 +0300
commitb2b33ce4f6c6f32681f7fa71a8af78242cbf7c19 (patch)
tree411d69942091138ff300c4700763987ba78ac4f5 /editor/plugins/visual_shader_editor_plugin.cpp
parent71873057bcfa2ba3091813949b228e91c8b3c2f3 (diff)
parentc43b7c113f1158db6c4436122550d6402c92abd7 (diff)
downloadredot-engine-b2b33ce4f6c6f32681f7fa71a8af78242cbf7c19.tar.gz
Merge pull request #51572 from Chaosus/vs_fix_transform_instance
Fix printing error about unsupported modifier on `TransformUniform`
Diffstat (limited to 'editor/plugins/visual_shader_editor_plugin.cpp')
-rw-r--r--editor/plugins/visual_shader_editor_plugin.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp
index 37a04a1844..d6ac238414 100644
--- a/editor/plugins/visual_shader_editor_plugin.cpp
+++ b/editor/plugins/visual_shader_editor_plugin.cpp
@@ -592,6 +592,14 @@ void VisualShaderGraphPlugin::add_node(VisualShader::Type p_type, int p_id) {
}
if (vsnode->is_use_prop_slots()) {
+ String error = vsnode->get_warning(visual_shader->get_mode(), p_type);
+ if (error != String()) {
+ Label *error_label = memnew(Label);
+ error_label->add_theme_color_override("font_color", VisualShaderEditor::get_singleton()->get_theme_color(SNAME("error_color"), SNAME("Editor")));
+ error_label->set_text(error);
+ node->add_child(error_label);
+ }
+
return;
}
custom_editor = nullptr;
@@ -2029,6 +2037,8 @@ void VisualShaderEditor::_uniform_line_edit_changed(const String &p_text, int p_
undo_redo->add_undo_method(node.ptr(), "set_uniform_name", node->get_uniform_name());
undo_redo->add_do_method(graph_plugin.ptr(), "set_uniform_name", type, p_node_id, validated_name);
undo_redo->add_undo_method(graph_plugin.ptr(), "set_uniform_name", type, p_node_id, node->get_uniform_name());
+ undo_redo->add_do_method(graph_plugin.ptr(), "update_node_deferred", type, p_node_id);
+ undo_redo->add_undo_method(graph_plugin.ptr(), "update_node_deferred", type, p_node_id);
undo_redo->add_do_method(this, "_update_uniforms", true);
undo_redo->add_undo_method(this, "_update_uniforms", true);