aboutsummaryrefslogtreecommitdiff
path: root/scene/resources/shader_graph.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 /scene/resources/shader_graph.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 'scene/resources/shader_graph.cpp')
-rw-r--r--scene/resources/shader_graph.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/scene/resources/shader_graph.cpp b/scene/resources/shader_graph.cpp
index 108aad3c5..952266769 100644
--- a/scene/resources/shader_graph.cpp
+++ b/scene/resources/shader_graph.cpp
@@ -142,6 +142,15 @@ ShaderGraph::GraphError ShaderGraph::get_graph_error(ShaderType p_type) const {
return shader[p_type].error;
}
+int ShaderGraph::node_count(ShaderType p_which, int p_type)
+{
+ int count=0;
+ for (Map<int,Node>::Element *E=shader[p_which].node_map.front();E;E=E->next())
+ if (E->get().type==p_type)
+ count++;
+ return count;
+}
+
void ShaderGraph::_bind_methods() {
ObjectTypeDB::bind_method(_MD("_update_shader"),&ShaderGraph::_update_shader);