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/modifiers | |
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/modifiers')
-rw-r--r-- | source/blender/modifiers/intern/MOD_nodes.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/modifiers/intern/MOD_nodes.cc b/source/blender/modifiers/intern/MOD_nodes.cc index 87fce26c45e..d46ac4c0a8b 100644 --- a/source/blender/modifiers/intern/MOD_nodes.cc +++ b/source/blender/modifiers/intern/MOD_nodes.cc @@ -1133,6 +1133,18 @@ static void panel_draw(const bContext *C, Panel *panel) } } + /* Draw node warnings. */ + if (nmd->runtime_eval_log != nullptr) { + const geo_log::ModifierLog &log = *static_cast<geo_log::ModifierLog *>(nmd->runtime_eval_log); + log.foreach_node_log([layout](const geo_log::NodeLog &node_log) { + for (const geo_log::NodeWarning &warning : node_log.warnings()) { + if (warning.type != geo_log::NodeWarningType::Info) { + uiItemL(layout, warning.message.c_str(), ICON_ERROR); + } + } + }); + } + modifier_panel_end(layout, ptr); } |