Blender V5.3
warning.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2025 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#include "BLT_translation.hh"
10
11#include "BKE_report.hh"
12
13#include "DNA_node_types.h"
14
15#include "NOD_warning.hh"
16
17#include "RNA_access.hh"
18#include "RNA_enum_types.hh"
19
20#include "UI_resources.hh"
21
22namespace blender::nodes {
23
25{
26 switch (report.type) {
27 case RPT_ERROR:
29 break;
30 default:
32 break;
33 }
34 this->message = report.message;
35}
36
38{
39 switch (type) {
41 return ICON_STATUS_ERROR_FILLED;
43 return ICON_STATUS_WARNING_FILLED;
45 return ICON_STATUS_INFO_FILLED;
46 }
48 return ICON_STATUS_ERROR_FILLED;
49}
50
52{
53 switch (type) {
55 return 3;
57 return 2;
59 return 1;
60 }
62 return 0;
63}
64
66{
67 const char *name = nullptr;
70 BLI_assert(name);
71 return name;
72}
73
75 const NodeWarningType warning_type)
76{
77 switch (propagation) {
79 return true;
81 return false;
83 return warning_type == NodeWarningType::Error;
86 }
88 return true;
89}
90
91} // namespace blender::nodes
#define BLT_I18NCONTEXT_DEFAULT
#define BLI_assert_unreachable()
#define ELEM(...)
int node_warning_type_severity(const NodeWarningType type)
Definition warning.cc:51
int node_warning_type_icon(const NodeWarningType type)
Definition warning.cc:37
bool warning_is_propagated(const NodeWarningPropagation propagation, const NodeWarningType warning_type)
Definition warning.cc:74
StringRefNull node_warning_type_name(const NodeWarningType type)
Definition warning.cc:65
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
const EnumPropertyItem rna_enum_node_warning_type_items[]
@ NODE_WARNING_PROPAGATION_NONE
@ NODE_WARNING_PROPAGATION_ONLY_ERRORS_AND_WARNINGS
@ NODE_WARNING_PROPAGATION_ALL
@ NODE_WARNING_PROPAGATION_ONLY_ERRORS
bool RNA_enum_name_gettexted(const EnumPropertyItem *item, int value, const char *translation_context, const char **r_name)
const char * message
Definition BKE_report.hh:73