30 b.use_custom_socket_order();
31 b.allow_any_socket_order();
33 b.add_default_layout();
44 b.add_input(data_type,
"Value"_ustr).hide_value().structure_type(StructureType::Dynamic);
45 b.add_output(data_type,
"Value"_ustr)
46 .align_with_previous()
47 .inferred_structure_type()
65 debug_name_ =
node.name;
66 r_lf_index_by_bsocket[
node.input_socket(0).index_in_tree()] = inputs_.append_and_get_index_as(
68 r_lf_index_by_bsocket[
node.input_socket(1).index_in_tree()] = inputs_.append_and_get_index_as(
70 r_lf_index_by_bsocket[
node.output_socket(0).index_in_tree()] =
74 void execute_impl(lf::Params ¶ms,
const lf::Context & )
const override
81 const bool keep = enable_variant.
copy_as<
bool>();
92 params.set_output(0, std::move(*value_variant));
116 output.allocate_invalid();
128 const bNode &
node = query_input.owner_node();
129 switch (
node.type_legacy) {
133 if (query_input.index() == 0) {
136 return &
node.output_socket(0);
145 outputs_to_check.
push(&value_output_socket);
148 while (!outputs_to_check.
is_empty()) {
150 if (!visited_sockets.
add(&output_socket)) {
153 for (
const bNodeSocket *target_socket : output_socket.logically_linked_sockets()) {
154 const bNode &target_node = target_socket->owner_node();
155 if (target_node.is_group_output()) {
159 if (!passthrough_socket) {
163 outputs_to_check.
push(passthrough_socket);
171 params.
tree.ensure_topology_cache();
173 if (!output_socket.is_directly_linked()) {
178 row.
text =
RPT_(
"Invalid Output Link");
180 "This node should be linked to the group output node, optionally through switch nodes.");
181 row.
icon = ICON_STATUS_ERROR;
182 params.
rows.append(std::move(row));
218 return node.input_by_identifier(output_socket.identifier_ustr());
226 ntype.
ui_name =
"Enable Output";
227 ntype.
ui_description =
"Either pass through the input value or output the fallback value";
250 return std::make_unique<LazyFunctionForEnableOutputNode>(
#define NODE_CLASS_INTERFACE
#define GEO_NODE_MENU_SWITCH
#define GEO_NODE_INDEX_SWITCH
#define NOD_REGISTER_NODE(REGISTER_FUNC)
#define NOD_inline_enum_accessors(member)
static const CPPType & get()
void push(const T &value)
NodeOperation(Context &context, const bNode &node)
Result & get_result(StringRef identifier)
Result & get_input(StringRef identifier) const
T get_single_value_default() const
StructureType structure_type
NodeOperation(Context &context, const bNode &node)
LazyFunctionForEnableOutputNode(const bNode &node, MutableSpan< int > r_lf_index_by_bsocket)
void execute_impl(lf::Params ¶ms, const lf::Context &) const override
void node_register_type(bNodeType &ntype)
bNodeSocketType * node_socket_type_find_static(int type, int subtype=0)
static void node_register()
static void node_declare(NodeDeclarationBuilder &b)
static void node_init(bNodeTree *, bNode *node)
static const EnumPropertyItem * data_type_items_callback(bContext *, PointerRNA *ptr, PropertyRNA *, bool *r_free)
static bool is_linked_to_group_output(const bNodeSocket &value_output_socket)
static const bNodeSocket * get_passthrough_socket(const bNodeSocket &query_input)
static void node_rna(StructRNA *srna)
static NodeOperation * get_compositor_operation(Context &context, const bNode &node)
static void node_extra_info(NodeExtraInfoParams ¶ms)
static void node_layout(ui::Layout &layout, bContext *, PointerRNA *ptr)
static const bNodeSocket * node_internally_linked_input(const bNodeTree &, const bNode &node, const bNodeSocket &output_socket)
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)
void set_default_remaining_node_outputs(lf::Params ¶ms, const bNode &node)
std::unique_ptr< LazyFunction > get_enable_output_node_lazy_function(const bNode &node, GeometryNodesLazyFunctionGraphInfo &own_lf_graph_info)
const EnumPropertyItem * enum_items_filter(const EnumPropertyItem *original_item_array, FunctionRef< bool(const EnumPropertyItem &item)> fn)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
const EnumPropertyItem rna_enum_node_socket_data_type_items[]
void common_node_type_base(bke::bNodeType *ntype, UString idname, const std::optional< int16_t > legacy_type)
bke::bNodeTreeType * typeinfo
bool(*) valid_socket_type(bNodeTreeType *ntreetype, bNodeSocketType *socket_type)
NodeInternallyLinkedInputFunction internally_linked_input
void(*) draw_buttons(ui::Layout &, bContext *C, PointerRNA *ptr)
std::string ui_description
NodeGetCompositorOperationFunction get_compositor_operation
NodeExtraInfoFunction get_extra_info
void(*) initfunc(bNodeTree *ntree, bNode *node)
NodeDeclareFunction declare
bool ignore_inferred_input_socket_visibility
Array< int > lf_index_by_bsocket
GeometryNodeLazyFunctionGraphMapping mapping
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)