diff options
author | Hans Goudey <h.goudey@me.com> | 2021-07-23 00:53:35 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-07-23 00:53:35 +0300 |
commit | 49e68f15f204a18a1c983cacf535d3315d742732 (patch) | |
tree | 41018ad9fded96a15d76c311e51876577339dcd0 /source/blender/nodes/intern | |
parent | f76dfe8fb45c9c270c295ff76f6fd058e2b64d0d (diff) |
Geometry Nodes: Display Node Warnings in Modifier
With this commit, node warnings added to nodes during evaluation
(not "Info" warnings) will also draw in the modifier. In the future
there could be a "search for this node" button as well.
Differential Revision: https://developer.blender.org/D11983
Diffstat (limited to 'source/blender/nodes/intern')
-rw-r--r-- | source/blender/nodes/intern/geometry_nodes_eval_log.cc | 18 |
1 files changed, 18 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 3024cc51cad..7487f11d77d 100644 --- a/source/blender/nodes/intern/geometry_nodes_eval_log.cc +++ b/source/blender/nodes/intern/geometry_nodes_eval_log.cc @@ -99,6 +99,13 @@ SocketLog &ModifierLog::lookup_or_add_socket_log(LogByTreeContext &log_by_tree_c return socket_log; } +void ModifierLog::foreach_node_log(FunctionRef<void(const NodeLog &)> fn) const +{ + if (root_tree_logs_) { + root_tree_logs_->foreach_node_log(fn); + } +} + const NodeLog *TreeLog::lookup_node_log(StringRef node_name) const { const destruct_ptr<NodeLog> *node_log = node_logs_.lookup_ptr_as(node_name); @@ -122,6 +129,17 @@ const TreeLog *TreeLog::lookup_child_log(StringRef node_name) const return tree_log->get(); } +void TreeLog::foreach_node_log(FunctionRef<void(const NodeLog &)> fn) const +{ + for (auto node_log : node_logs_.items()) { + fn(*node_log.value); + } + + for (auto child : child_logs_.items()) { + child.value->foreach_node_log(fn); + } +} + const SocketLog *NodeLog::lookup_socket_log(eNodeSocketInOut in_out, int index) const { BLI_assert(index >= 0); |