Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2021-11-24 15:39:09 +0300
committerJacques Lucke <jacques@blender.org>2021-11-24 15:39:20 +0300
commit65f547c3fc116860b9c7eaf6e3d8abd2651f5168 (patch)
tree2b93be1b725f0f941af45f215c861fbf01c63166 /source/blender/nodes/intern
parent9fc5a9c78f57f11d72ab6dbaf819945c862367e1 (diff)
Geometry Nodes: add utility to show debug messages in node editor
This is only meant to be used for development purposes for now, not to show warnings to the user. Differential Revision: https://developer.blender.org/D13348
Diffstat (limited to 'source/blender/nodes/intern')
-rw-r--r--source/blender/nodes/intern/geometry_nodes_eval_log.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/nodes/intern/geometry_nodes_eval_log.cc b/source/blender/nodes/intern/geometry_nodes_eval_log.cc
index 4cba9669647..f504dbfd4b4 100644
--- a/source/blender/nodes/intern/geometry_nodes_eval_log.cc
+++ b/source/blender/nodes/intern/geometry_nodes_eval_log.cc
@@ -72,6 +72,11 @@ ModifierLog::ModifierLog(GeoLogger &logger)
node_with_exec_time.node);
node_log.exec_time_ = node_with_exec_time.exec_time;
}
+
+ for (NodeWithDebugMessage &debug_message : local_logger.node_debug_messages_) {
+ NodeLog &node_log = this->lookup_or_add_node_log(log_by_tree_context, debug_message.node);
+ node_log.debug_messages_.append(debug_message.message);
+ }
}
}
@@ -484,4 +489,13 @@ void LocalGeoLogger::log_execution_time(DNode node, std::chrono::microseconds ex
node_exec_times_.append({node, exec_time});
}
+/**
+ * Log a message that will be displayed in the node editor next to the node. This should only be
+ * used for debugging purposes and not to display information to users.
+ */
+void LocalGeoLogger::log_debug_message(DNode node, std::string message)
+{
+ node_debug_messages_.append({node, std::move(message)});
+}
+
} // namespace blender::nodes::geometry_nodes_eval_log