25 b.use_custom_socket_order();
26 b.allow_any_socket_order();
28 b.add_default_layout();
31 const bNode *node =
b.node_or_null();
37 auto &input_value =
b.add_input(data_type,
"Value").hide_value();
38 auto &output_value =
b.add_output(data_type,
"Value").align_with_previous();
41 input_value.supports_field();
45 output_value.propagate_all();
49 output_value.reference_pass_all();
52 input_value.structure_type(StructureType::Dynamic);
53 output_value.structure_type(StructureType::Dynamic);
70 r_lf_index_by_bsocket[node.input_socket(0).index_in_tree()] =
inputs_.append_and_get_index_as(
72 r_lf_index_by_bsocket[node.input_socket(1).index_in_tree()] =
inputs_.append_and_get_index_as(
74 r_lf_index_by_bsocket[node.output_socket(0).index_in_tree()] =
85 const bool keep = enable_variant.
get<
bool>();
96 params.set_output(0, std::move(*value_variant));
117 output.share_data(
input);
120 output.allocate_invalid();
132 params.tree.ensure_topology_cache();
134 if (!output_socket.is_directly_linked()) {
137 for (
const bNodeSocket *target_socket : output_socket.logically_linked_sockets()) {
138 const bNode &target_node = target_socket->owner_node();
139 if (!target_node.is_group_output() && !target_node.is_reroute()) {
141 row.
text =
RPT_(
"Invalid Output Link");
142 row.
tooltip =
TIP_(
"This node should be linked to the group output node");
143 row.
icon = ICON_ERROR;
144 params.rows.append(std::move(row));
182 return node.input_by_identifier(output_socket.
identifier);
190 ntype.
ui_name =
"Enable Output";
191 ntype.
ui_description =
"Either pass through the input value or output the fallback value";
214 return std::make_unique<LazyFunctionForEnableOutputNode>(
#define NODE_CLASS_INTERFACE
#define NOD_REGISTER_NODE(REGISTER_FUNC)
#define NOD_inline_enum_accessors(member)
static const CPPType & get()
NodeOperation(Context &context, DNode node)
Result & get_result(StringRef identifier)
Result & get_input(StringRef identifier) const
T get_single_value_default(const T &default_value) const
Vector< Output > outputs_
StructureType structure_type
NodeOperation(Context &context, DNode node)
LazyFunctionForEnableOutputNode(const bNode &node, MutableSpan< int > r_lf_index_by_bsocket)
void execute_impl(lf::Params ¶ms, const lf::Context &) const override
bool can_contain_reference(eNodeSocketDatatype socket_type)
bool can_contain_referenced_data(eNodeSocketDatatype socket_type)
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 NodeOperation * node_get_compositor_operation(Context &context, DNode node)
static void node_layout(uiLayout *layout, bContext *, PointerRNA *ptr)
static void node_rna(StructRNA *srna)
static void node_extra_info(NodeExtraInfoParams ¶ms)
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)
bool socket_type_supports_fields(const eNodeSocketDatatype socket_type)
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)
void geo_cmp_node_type_base(blender::bke::bNodeType *ntype, std::string idname, const std::optional< int16_t > legacy_type)
const EnumPropertyItem rna_enum_node_socket_data_type_items[]
bNodeTreeTypeHandle * typeinfo
bool(* valid_socket_type)(bNodeTreeType *ntreetype, bNodeSocketType *socket_type)
NodeInternallyLinkedInputFunction internally_linked_input
std::string ui_description
NodeGetCompositorOperationFunction get_compositor_operation
void(* initfunc)(bNodeTree *ntree, bNode *node)
NodeExtraInfoFunction get_extra_info
void(* draw_buttons)(uiLayout *, bContext *C, PointerRNA *ptr)
NodeDeclareFunction declare
bool ignore_inferred_input_socket_visibility
Array< int > lf_index_by_bsocket
GeometryNodeLazyFunctionGraphMapping mapping
void use_property_decorate_set(bool is_sep)
void use_property_split_set(bool value)
void prop(PointerRNA *ptr, PropertyRNA *prop, int index, int value, eUI_Item_Flag flag, std::optional< blender::StringRef > name_opt, int icon, std::optional< blender::StringRef > placeholder=std::nullopt)