diff options
Diffstat (limited to 'source/blender/modifiers/intern/MOD_nodes.cc')
-rw-r--r-- | source/blender/modifiers/intern/MOD_nodes.cc | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/source/blender/modifiers/intern/MOD_nodes.cc b/source/blender/modifiers/intern/MOD_nodes.cc index 6b976b016e1..8c02c83d479 100644 --- a/source/blender/modifiers/intern/MOD_nodes.cc +++ b/source/blender/modifiers/intern/MOD_nodes.cc @@ -68,6 +68,8 @@ #include "UI_interface.h" #include "UI_resources.h" +#include "BLT_translation.h" + #include "WM_types.h" #include "RNA_access.h" @@ -1090,17 +1092,29 @@ static void panel_draw(const bContext *C, Panel *panel) } /* Draw node warnings. */ + bool has_legacy_node = false; 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) { + log.foreach_node_log([&](const geo_log::NodeLog &node_log) { for (const geo_log::NodeWarning &warning : node_log.warnings()) { - if (warning.type != geo_log::NodeWarningType::Info) { + if (warning.type == geo_log::NodeWarningType::Legacy) { + has_legacy_node = true; + } + else if (warning.type != geo_log::NodeWarningType::Info) { uiItemL(layout, warning.message.c_str(), ICON_ERROR); } } }); } + if (USER_EXPERIMENTAL_TEST(&U, use_geometry_nodes_fields) && has_legacy_node) { + uiLayout *row = uiLayoutRow(layout, false); + uiItemL(row, IFACE_("Node tree has legacy node"), ICON_ERROR); + uiLayout *sub = uiLayoutRow(row, false); + uiLayoutSetAlignment(sub, UI_LAYOUT_ALIGN_RIGHT); + uiItemO(sub, "", ICON_VIEWZOOM, "NODE_OT_geometry_node_view_legacy"); + } + modifier_panel_end(layout, ptr); } |