[Bf-blender-cvs] [31a505d1a5e] master: Functions: add debug utility for lazy function graphs

Jacques Lucke noreply at git.blender.org
Fri Jan 20 13:39:58 CET 2023


Commit: 31a505d1a5ead4522460aaaef595ad1dea8841f6
Author: Jacques Lucke
Date:   Fri Jan 20 13:39:10 2023 +0100
Branches: master
https://developer.blender.org/rB31a505d1a5ead4522460aaaef595ad1dea8841f6

Functions: add debug utility for lazy function graphs

This makes it easier to print information about a socket. Just the
socket name is sometimes not enough information to know where
it is in the graph.

===================================================================

M	source/blender/functions/FN_lazy_function_graph.hh
M	source/blender/functions/intern/lazy_function_graph.cc

===================================================================

diff --git a/source/blender/functions/FN_lazy_function_graph.hh b/source/blender/functions/FN_lazy_function_graph.hh
index 6d66afafe82..a532f0dc7c3 100644
--- a/source/blender/functions/FN_lazy_function_graph.hh
+++ b/source/blender/functions/FN_lazy_function_graph.hh
@@ -78,6 +78,7 @@ class Socket : NonCopyable, NonMovable {
   const CPPType &type() const;
 
   std::string name() const;
+  std::string detailed_name() const;
 };
 
 class InputSocket : public Socket {
diff --git a/source/blender/functions/intern/lazy_function_graph.cc b/source/blender/functions/intern/lazy_function_graph.cc
index e07cce7204b..0047359ed26 100644
--- a/source/blender/functions/intern/lazy_function_graph.cc
+++ b/source/blender/functions/intern/lazy_function_graph.cc
@@ -147,6 +147,14 @@ std::string Socket::name() const
   return fallback_name;
 }
 
+std::string Socket::detailed_name() const
+{
+  std::stringstream ss;
+  ss << node_->name() << ":" << (is_input_ ? "IN" : "OUT") << ":" << index_in_node_ << ":"
+     << this->name();
+  return ss.str();
+}
+
 std::string Node::name() const
 {
   if (this->is_function()) {



More information about the Bf-blender-cvs mailing list