25 b.use_custom_socket_order();
26 b.allow_any_socket_order();
28 b.add_default_layout();
31 b.add_output<
decl::Bool>(
"Show"_ustr).align_with_previous();
41 debug_name_ =
"Warning";
43 inputs_.append_as(
"Show", type, lf::ValueUsage::Used);
44 inputs_.append_as(
"Message", type);
45 outputs_.append_as(
"Show", type);
48 void execute_impl(lf::Params ¶ms,
const lf::Context &context)
const override
51 const bool show = show_variant.
copy_as<
bool>();
53 params.set_output(0, show_variant);
58 if (!message_variant) {
62 std::string message = message_variant->
extract<std::string>();
65 context.local_user_data);
67 tree_logger->node_warnings.append(
68 *tree_logger->allocator,
69 {node_.identifier, {NodeWarningType(node_.custom1), std::move(message)}});
72 params.set_output(0, show_variant);
91 const std::string message = this->
get_input(
"Message").get_single_value_default<std::string>();
126 name =
N_(
"Unknown");
158 return std::make_unique<LazyFunctionForWarningNode>(
node);
#define NODE_CLASS_INTERFACE
#define NOD_REGISTER_NODE(REGISTER_FUNC)
#define NOD_inline_enum_accessors(member)
static const CPPType & get()
NodeOperation(Context &context, const bNode &node)
void add_warning(nodes::NodeWarningType type, std::string message)
const bNode & node() const
Result & get_result(StringRef identifier)
Result & get_input(StringRef identifier) const
void share_data(const Result &source)
T get_single_value_default() const
void execute_impl(lf::Params ¶ms, const lf::Context &context) const override
LazyFunctionForWarningNode(const bNode &node)
NodeOperation(Context &context, const bNode &node)
void node_register_type(bNodeType &ntype)
static void node_register()
static NodeOperation * get_compositor_operation(Context &context, const bNode &node)
static void node_rna(StructRNA *srna)
static void node_declare(NodeDeclarationBuilder &b)
static void node_layout(ui::Layout &layout, bContext *, PointerRNA *ptr)
static void node_label(const bNodeTree *, const bNode *node, char *label, int label_maxncpy)
std::unique_ptr< LazyFunction > get_warning_node_lazy_function(const bNode &node)
PropertyRNA * RNA_def_node_enum(StructRNA *srna, const char *identifier, const char *ui_name, const char *ui_description, const EnumPropertyItem *static_items, const EnumRNAAccessors accessors, std::optional< int > default_value, const EnumPropertyItemFunc item_func, const bool allow_animation)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
const EnumPropertyItem rna_enum_node_warning_type_items[]
char * BLI_strncpy_utf8(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
bool RNA_enum_name(const EnumPropertyItem *item, const int value, const char **r_name)
void common_node_type_base(bke::bNodeType *ntype, UString idname, const std::optional< int16_t > legacy_type)
void(*) draw_buttons(ui::Layout &, bContext *C, PointerRNA *ptr)
std::string ui_description
void(*) labelfunc(const bNodeTree *ntree, const bNode *node, char *label, int label_maxncpy)
NodeGetCompositorOperationFunction get_compositor_operation
const char * enum_name_legacy
NodeDeclareFunction declare
eval_log::NodeTreeLogger * try_get_tree_logger(const GeoNodesUserData &user_data) const
void use_property_decorate_set(bool is_decorate)
void use_property_split_set(bool is_sep)
void prop(PointerRNA *ptr, PropertyRNA *prop, int index, int value, eUI_Item_Flag flag, std::optional< StringRef > name_opt, int icon, std::optional< StringRef > placeholder=std::nullopt)