diff options
author | Jacques Lucke <jacques@blender.org> | 2022-04-14 17:31:09 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2022-04-14 17:31:09 +0300 |
commit | c71013082d096968d33ba977a0fdbcfbfb0690d1 (patch) | |
tree | df09bab6e0405ab79779fe74a21991381ed137e6 /source/blender/nodes/intern/geometry_nodes_eval_log.cc | |
parent | a9b94e5f81ced89381033fd8d13ef6e3489e2665 (diff) |
Geometry Nodes: show used named attributes in nodes
This adds a new node editor overlay that helps users to see where
named attributes are used. This is important, because named
attributes can have name collisions between independent node
groups which can lead to hard to find issues.
Differential Revision: https://developer.blender.org/D14618
Diffstat (limited to 'source/blender/nodes/intern/geometry_nodes_eval_log.cc')
-rw-r--r-- | source/blender/nodes/intern/geometry_nodes_eval_log.cc | 14 |
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 13f38c3352e..378bac894e8 100644 --- a/source/blender/nodes/intern/geometry_nodes_eval_log.cc +++ b/source/blender/nodes/intern/geometry_nodes_eval_log.cc @@ -62,6 +62,13 @@ ModifierLog::ModifierLog(GeoLogger &logger) NodeLog &node_log = this->lookup_or_add_node_log(log_by_tree_context, debug_message.node); node_log.debug_messages_.append(debug_message.message); } + + for (NodeWithUsedNamedAttribute &node_with_attribute_name : + local_logger.used_named_attributes_) { + NodeLog &node_log = this->lookup_or_add_node_log(log_by_tree_context, + node_with_attribute_name.node); + node_log.used_named_attributes_.append(std::move(node_with_attribute_name.attribute)); + } } } @@ -486,6 +493,13 @@ void LocalGeoLogger::log_execution_time(DNode node, std::chrono::microseconds ex node_exec_times_.append({node, exec_time}); } +void LocalGeoLogger::log_used_named_attribute(DNode node, + std::string attribute_name, + NamedAttributeUsage usage) +{ + used_named_attributes_.append({node, {std::move(attribute_name), usage}}); +} + void LocalGeoLogger::log_debug_message(DNode node, std::string message) { node_debug_messages_.append({node, std::move(message)}); |