aboutsummaryrefslogtreecommitdiff
path: root/tools/editor/plugins/shader_graph_editor_plugin.cpp
diff options
context:
space:
mode:
authorMariano Javier Suligoy2015-07-25 22:05:45 -0300
committerMariano Javier Suligoy2015-07-25 22:05:45 -0300
commitadd0105c4e89e586fb3d3a9646a9ffc747d2e881 (patch)
treedfa9ce644c0b391459afd1edd513daffb94edc3b /tools/editor/plugins/shader_graph_editor_plugin.cpp
parent5ffd818fb195a6e9bea48ec03ad52a77080a8d25 (diff)
downloadgodot-add0105c4e89e586fb3d3a9646a9ffc747d2e881.tar.gz
godot-add0105c4e89e586fb3d3a9646a9ffc747d2e881.tar.zst
godot-add0105c4e89e586fb3d3a9646a9ffc747d2e881.zip
Little fix: don't create an empty undo/redo command when trying to add a second Input GraphNode
Diffstat (limited to 'tools/editor/plugins/shader_graph_editor_plugin.cpp')
-rw-r--r--tools/editor/plugins/shader_graph_editor_plugin.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/editor/plugins/shader_graph_editor_plugin.cpp b/tools/editor/plugins/shader_graph_editor_plugin.cpp
index 3ab536ab6..370688d6f 100644
--- a/tools/editor/plugins/shader_graph_editor_plugin.cpp
+++ b/tools/editor/plugins/shader_graph_editor_plugin.cpp
@@ -2162,6 +2162,9 @@ void ShaderGraphView::_notification(int p_what) {
void ShaderGraphView::add_node(int p_type, const Vector2 &location) {
+ if ((p_type==ShaderGraph::NODE_INPUT||p_type==ShaderGraph::NODE_INPUT) && graph->node_count(type, p_type)>0)
+ return;
+
List<int> existing;
graph->get_node_list(type,&existing);
existing.sort();