Blender V5.3
node_geo_index_switch.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#include <fmt/format.h>
6
9
10#include "UI_interface_c.hh"
12#include "UI_resources.hh"
13
15#include "NOD_rna_define.hh"
16#include "NOD_socket.hh"
21
22#include "RNA_enum_types.hh"
23#include "RNA_prototypes.hh"
24
25#include "BLO_read_write.hh"
26
29
30#include "COM_node_operation.hh"
31#include "COM_result.hh"
32#include "COM_utilities.hh"
33
34#include "GPU_material.hh"
35
36namespace blender {
37
39
41
42static void draw_item_socket(CustomSocketDrawParams &params, const int index)
43{
44 if (!params.menu_switch_source_by_index_switch) {
45 params.draw_standard(params.layout);
46 return;
47 }
48 const bNode *menu_switch_node = params.menu_switch_source_by_index_switch->lookup_default(
49 &params.node, nullptr);
50 if (!menu_switch_node) {
51 params.draw_standard(params.layout);
52 return;
53 }
54 const auto &menu_switch_storage = *static_cast<const NodeMenuSwitch *>(
55 menu_switch_node->storage);
56 BLI_assert(menu_switch_storage.data_type == SOCK_INT);
57 const NodeEnumItem *found_item = nullptr;
58 for (const int i : IndexRange(menu_switch_storage.enum_definition.items_num)) {
59 const NodeEnumItem &item = menu_switch_storage.enum_definition.items_array[i];
60 const bNodeSocket &menu_switch_input_socket = menu_switch_node->input_socket(1 + i);
61 if (menu_switch_input_socket.is_directly_linked()) {
62 params.draw_standard(params.layout);
63 return;
64 }
65 const auto &menu_switch_input_socket_value = *static_cast<const bNodeSocketValueInt *>(
66 menu_switch_input_socket.default_value);
67 if (menu_switch_input_socket_value.value == index) {
68 if (found_item) {
69 /* Found multiple items, so there is not a unique label for this index. */
70 params.draw_standard(params.layout);
71 return;
72 }
73 found_item = &item;
74 }
75 }
76 if (!found_item) {
77 params.draw_standard(params.layout);
78 return;
79 }
80 const std::string label = fmt::format("{}: {}", index, found_item->name);
81 params.draw_standard(params.layout, label);
82}
83
85{
86 const bNodeTree *ntree = b.tree_or_null();
87 const bNode *node = b.node_or_null();
88 if (!node) {
89 return;
90 }
91 const NodeIndexSwitch &storage = node_storage(*node);
92 const eNodeSocketDatatype data_type = storage.data_type;
93 const bool supports_fields = socket_type_supports_fields(data_type) &&
94 ntree->type == NTREE_GEOMETRY;
95
96 StructureType value_structure_type = StructureType::Dynamic;
97 StructureType index_structure_type = value_structure_type;
98
99 if (ntree->type == NTREE_COMPOSIT) {
100 const bool is_single_compositor_type = compositor::Result::is_single_value_only_type(
102 if (is_single_compositor_type) {
103 value_structure_type = StructureType::Single;
104 }
105 index_structure_type = StructureType::Single;
106 }
107
108 const Span<IndexSwitchItem> items = storage.items_span();
109 auto &index =
110 b.add_input<decl::Int>("Index"_ustr).min(0).max(std::max<int>(0, items.size() - 1));
111 if (supports_fields) {
112 index.structure_type(index_structure_type);
113 }
114
115 for (const int i : items.index_range()) {
116 const std::string identifier = IndexSwitchItemsAccessor::socket_identifier_for_item(items[i]);
117 auto &input = b.add_input(data_type, UString(std::to_string(i)), UString(identifier));
118 input.custom_draw(
119 [index = i](CustomSocketDrawParams &params) { draw_item_socket(params, index); });
120 /* Labels are ugly in combination with data-block pickers and are usually disabled. */
121 input.optional_label(ELEM(data_type,
126 SOCK_FONT,
129 SOCK_MASK,
130 SOCK_SOUND));
131 input.structure_type(value_structure_type);
132 if (ntree->type == NTREE_COMPOSIT) {
133 input.compositor_realization_mode(CompositorInputRealizationMode::None);
134 }
135 }
136
137 b.add_output(data_type, "Output"_ustr)
138 .propagate_all()
139 .inferred_structure_type()
140 .structure_type(value_structure_type);
141
142 b.add_input<decl::Extend>(""_ustr, "__extend__"_ustr)
143 .custom_draw(socket_items::ui::draw_extend_socket_fn<IndexSwitchItemsAccessor>());
144}
145
146static void node_layout(ui::Layout &layout, bContext * /*C*/, PointerRNA *ptr)
147{
148 layout.prop(ptr, "data_type", UI_ITEM_NONE, "", ICON_NONE);
149}
150
151static void node_layout_ex(ui::Layout &layout, bContext *C, PointerRNA *ptr)
152{
153 layout.prop(ptr, "data_type", UI_ITEM_NONE, "", ICON_NONE);
154 bNode &node = *static_cast<bNode *>(ptr->data);
155 NodeIndexSwitch &storage = node_storage(node);
156 if (ui::Layout *panel = layout.panel(C, "index_switch_items", false, IFACE_("Items"))) {
157 panel->op("node.index_switch_item_add", IFACE_("Add Item"), ICON_ADD);
158 ui::Layout *col = &panel->column(false);
159 for (const int i : IndexRange(storage.items_num)) {
160 ui::Layout *row = &col->row(false);
161 row->label(node.input_socket(i + 1).name, ICON_NONE);
162 PointerRNA op_ptr = row->op("node.index_switch_item_remove", "", ICON_REMOVE);
163 RNA_int_set(&op_ptr, "index", i);
164 }
165 }
166}
167
174
175static void node_init(bNodeTree *tree, bNode *node)
176{
177 NodeIndexSwitch *data = MEM_new<NodeIndexSwitch>(__func__);
178 data->data_type = tree->type == NTREE_GEOMETRY ? SOCK_FLOAT : SOCK_RGBA;
179 data->next_identifier = 0;
180
181 BLI_assert(data->items == nullptr);
182 const int default_items_num = 2;
183 data->items = MEM_new_array<IndexSwitchItem>(default_items_num, __func__);
184 for (const int i : IndexRange(default_items_num)) {
185 data->items[i].identifier = data->next_identifier++;
186 }
187 data->items_num = default_items_num;
188
189 node->storage = data;
190}
191
193{
194 if (params.in_out() == SOCK_OUT) {
195 params.add_item(IFACE_("Output"), [](LinkSearchOpParams &params) {
196 bNode &node = params.add_node("GeometryNodeIndexSwitch"_ustr);
197 node_storage(node).data_type = params.socket.type;
198 params.update_and_connect_available_socket(node, "Output"_ustr);
199 });
200 }
201 else {
202 const eNodeSocketDatatype other_type = params.other_socket().type;
203 int value_weight = 0;
204 if (params.node_tree().typeinfo->validate_link(other_type, SOCK_INT)) {
205 params.add_item(IFACE_("Index"), [](LinkSearchOpParams &params) {
206 bNode &node = params.add_node("GeometryNodeIndexSwitch"_ustr);
207 params.update_and_connect_available_socket(node, "Index"_ustr);
208 });
209 /* Make sure the index input comes first in the search for integer sockets. */
210 value_weight--;
211 }
212
213 bke::bNodeTreeType &tree_type = *params.node_tree().typeinfo;
215 if (socket_type &&
216 (!tree_type.valid_socket_type || tree_type.valid_socket_type(&tree_type, socket_type)))
217 {
218 params.add_item(
219 IFACE_("Value"),
220 [](LinkSearchOpParams &params) {
221 bNode &node = params.add_node("GeometryNodeIndexSwitch"_ustr);
222 node_storage(node).data_type = params.socket.type;
224 },
225 value_weight);
226 }
227 }
228}
229
230constexpr int value_inputs_start = 1;
231
232class IndexSwitchFunction : public mf::MultiFunction {
233 mf::Signature signature_;
234 Array<std::string> debug_names_;
235
236 public:
237 IndexSwitchFunction(const CPPType &type, const int items_num)
238 {
239 mf::SignatureBuilder builder{"Index Switch", signature_};
240 builder.single_input<int>("Index");
241 debug_names_.reinitialize(items_num);
242 for (const int i : IndexRange(items_num)) {
243 debug_names_[i] = std::to_string(i);
244 builder.single_input(debug_names_[i].c_str(), type);
245 }
246 builder.single_output("Output", type);
247 this->set_signature(&signature_);
248 }
249
250 void call(const IndexMask &mask, mf::Params params, mf::Context /*context*/) const override
251 {
252 const int inputs_num = signature_.params.size() - 2;
253 const VArray<int> indices = params.readonly_single_input<int>(0, "Index");
254
255 GMutableSpan output = params.uninitialized_single_output(
256 signature_.params.index_range().last(), "Output");
257 const CPPType &type = output.type();
258
259 if (const std::optional<int> i = indices.get_if_single()) {
260 if (IndexRange(inputs_num).contains(*i)) {
261 const GVArray inputs = params.readonly_single_input(value_inputs_start + *i);
263 }
264 else {
265 type.fill_construct_indices(type.default_value(), output.data(), mask);
266 }
267 return;
268 }
269
270 /* Use one extra mask at the end for invalid indices. */
271 const int invalid_index = inputs_num;
272 IndexMaskMemory memory;
273 Array<IndexMask> masks(inputs_num + 1);
275 mask,
276 memory,
277 [&](const int64_t i) {
278 const int index = indices[i];
279 return IndexRange(inputs_num).contains(index) ? index : invalid_index;
280 },
281 masks);
282
283 for (const int i : IndexRange(inputs_num)) {
284 if (!masks[i].is_empty()) {
285 const GVArray inputs = params.readonly_single_input(value_inputs_start + i);
286 inputs.materialize_to_uninitialized(masks[i], output.data());
287 }
288 }
289
290 type.fill_construct_indices(type.default_value(), output.data(), masks[invalid_index]);
291 }
292
294 {
295 ExecutionHints hints;
296 hints.allocates_array = true;
297 return hints;
298 }
299};
300
301class LazyFunctionForIndexSwitchNode : public LazyFunction {
302 private:
303 const bNode &node_;
304 bool can_be_field_ = false;
305 const CPPType *field_base_type_;
306
307 public:
310 : node_(node)
311 {
312 const NodeIndexSwitch &storage = node_storage(node);
313 const eNodeSocketDatatype data_type = storage.data_type;
314 const bNodeSocket &index_socket = node.input_socket(0);
315 const bNodeSocket &output_socket = node.output_socket(0);
316 const CPPType &cpp_type = CPPType::get<SocketValueVariant>();
317
318 debug_name_ = node.name;
319 can_be_field_ = socket_type_supports_fields(data_type);
320 field_base_type_ = output_socket.typeinfo->base_cpp_type;
321
322 MutableSpan<int> lf_index_by_bsocket = lf_graph_info.mapping.lf_index_by_bsocket;
323
324 lf_index_by_bsocket[index_socket.index_in_tree()] = inputs_.append_and_get_index_as(
325 "Index", CPPType::get<SocketValueVariant>(), lf::ValueUsage::Used);
326 lf_index_by_bsocket[output_socket.index_in_tree()] = outputs_.append_and_get_index_as(
327 "Value", cpp_type);
328
329 for (const int i : storage.items_span().index_range()) {
330 const bNodeSocket &input = node.input_socket(value_inputs_start + i);
331 lf_index_by_bsocket[input.index_in_tree()] = inputs_.append_and_get_index_as(
332 input.identifier, cpp_type, lf::ValueUsage::Maybe);
333 }
334 }
335
336 void execute_impl(lf::Params &params, const lf::Context & /*context*/) const override
337 {
338 SocketValueVariant index_variant = params.get_input<SocketValueVariant>(0);
339 if (index_variant.is_context_dependent_field() && can_be_field_) {
340 this->execute_field(index_variant.ensure_type<Field<int>>(), params);
341 }
342 else {
343 this->execute_single(index_variant.ensure_type<int>(), params);
344 }
345 }
346
347 int values_num() const
348 {
349 return inputs_.size() - value_inputs_start;
350 }
351
352 void execute_single(const int index, lf::Params &params) const
353 {
354 const int values_num = this->values_num();
355 for (const int i : IndexRange(values_num)) {
356 if (i != index) {
357 params.set_input_unused(value_inputs_start + i);
358 }
359 }
360
361 /* Check for an invalid index. */
362 if (!IndexRange(values_num).contains(index)) {
364 return;
365 }
366
367 /* Request input and try again if unavailable. */
368 void *value_to_forward = params.try_get_input_data_ptr_or_request(index + value_inputs_start);
369 if (value_to_forward == nullptr) {
370 return;
371 }
372
373 const CPPType &type = *outputs_[0].type;
374 void *output_ptr = params.get_output_data_ptr(0);
375 type.move_construct(value_to_forward, output_ptr);
376 params.output_set(0);
377 }
378
379 void execute_field(Field<int> index, lf::Params &params) const
380 {
381 const int values_num = this->values_num();
383 for (const int i : IndexRange(values_num)) {
384 input_values[i] = params.try_get_input_data_ptr_or_request<SocketValueVariant>(
386 }
387 if (input_values.as_span().contains(nullptr)) {
388 /* Try again when inputs are available. */
389 return;
390 }
391
392 Vector<GField> input_fields({std::move(index)});
393 for (const int i : IndexRange(values_num)) {
394 input_fields.append(input_values[i]->extract<GField>());
395 }
396
397 std::unique_ptr<mf::MultiFunction> switch_fn = std::make_unique<IndexSwitchFunction>(
398 *field_base_type_, values_num);
399 GField output_field(FieldOperation::from(std::move(switch_fn), std::move(input_fields)));
400
401 void *output_ptr = params.get_output_data_ptr(0);
402 SocketValueVariant::construct_in(output_ptr, std::move(output_field));
403 params.output_set(0);
404 }
405};
406
407using namespace blender::compositor;
408
410 public:
412
413 void execute() override
414 {
415 Result &output = this->get_result("Output");
416 const int index = this->get_input("Index").get_single_value_default<int>();
417 const NodeIndexSwitch &storage = node_storage(node());
418
419 if (!IndexRange(storage.items_num).contains(index)) {
420 output.allocate_invalid();
421 return;
422 }
423
424 const std::string identifier = IndexSwitchItemsAccessor::socket_identifier_for_item(
425 storage.items[index]);
426 const Result &input = this->get_input(identifier);
427 output.share_data(input);
428 }
429};
430
432{
433 return new IndexSwitchOperation(context, node);
434}
435
437 PointerRNA *ptr,
438 PropertyRNA * /*prop*/,
439 bool *r_free)
440{
441 *r_free = true;
442 const bNodeTree &ntree = *reinterpret_cast<bNodeTree *>(ptr->owner_id);
443 bke::bNodeTreeType *ntree_type = ntree.typeinfo;
444 return enum_items_filter(
447 return ntree_type->valid_socket_type(ntree_type, socket_type);
448 });
449}
450
451static void node_rna(StructRNA *srna)
452{
454 "data_type",
455 "Data Type",
456 "",
461}
462
464{
466 MEM_delete(reinterpret_cast<NodeIndexSwitch *>(node->storage));
467}
468
469static void node_copy_storage(bNodeTree * /*dst_tree*/, bNode *dst_node, const bNode *src_node)
470{
471 const NodeIndexSwitch &src_storage = node_storage(*src_node);
472 auto *dst_storage = MEM_new<NodeIndexSwitch>(__func__, dna::shallow_copy(src_storage));
473 dst_node->storage = dst_storage;
474
476}
477
483
484static void node_blend_write(const bNodeTree & /*tree*/, const bNode &node, BlendWriter &writer)
485{
487}
488
493
495 const bNode &node,
496 const bNodeSocket & /*output_socket*/)
497{
498 const NodeIndexSwitch &src_storage = node_storage(node);
499 if (src_storage.items_num == 0) {
500 return nullptr;
501 }
502 /* Default to the 0 input. */
503 return &node.input_socket(1);
504}
505
506static void register_node()
507{
508 static bke::bNodeType ntype;
509
510 common_node_type_base(&ntype, "GeometryNodeIndexSwitch"_ustr, GEO_NODE_INDEX_SWITCH);
511 ntype.ui_name = "Index Switch";
512 ntype.ui_description = "Choose between an arbitrary number of values with an index";
513 ntype.enum_name_legacy = "INDEX_SWITCH";
515 ntype.declare = node_declare;
516 ntype.initfunc = node_init;
529
530 node_rna(ntype.rna_ext.srna);
531}
533
534} // namespace nodes::node_geo_index_switch_cc
535
536namespace nodes {
537
538std::unique_ptr<LazyFunction> get_index_switch_node_lazy_function(
539 const bNode &node, GeometryNodesLazyFunctionGraphInfo &lf_graph_info)
540{
541 using namespace node_geo_index_switch_cc;
542 BLI_assert(node.type_legacy == GEO_NODE_INDEX_SWITCH);
543 return std::make_unique<LazyFunctionForIndexSwitchNode>(node, lf_graph_info);
544}
545
546StructRNA **IndexSwitchItemsAccessor::item_srna = &RNA_IndexSwitchItem;
547
549{
550}
551
555
556} // namespace nodes
557
558Span<IndexSwitchItem> NodeIndexSwitch::items_span() const
559{
561}
562
563MutableSpan<IndexSwitchItem> NodeIndexSwitch::items_span()
564{
566}
567
568} // namespace blender
#define NODE_CLASS_CONVERTER
Definition BKE_node.hh:484
#define NODE_STORAGE_FUNCS(StorageT)
Definition BKE_node.hh:1353
#define GEO_NODE_INDEX_SWITCH
#define IFACE_(msgid)
#define NOD_REGISTER_NODE(REGISTER_FUNC)
#define NOD_storage_enum_accessors(member)
#define C
Definition RandGen.cpp:29
#define UI_ITEM_NONE
__forceinline float extract(const int4 &b)
Definition binning.cpp:27
#define ELEM(...)
#define output
Span< T > as_span() const
Definition BLI_array.hh:254
static const CPPType & get()
void fill_construct_indices(const void *value, void *dst, const IndexMask &mask) const
const void * default_value() const
void move_construct(void *src, void *dst) const
void materialize_to_uninitialized(void *dst) const
static void from_groups(const IndexMask &universe, LinearAllocator<> &memory, Fn &&get_group_index, MutableSpan< IndexMask > r_masks)
constexpr IndexRange()=default
constexpr MutableSpan()=default
constexpr Span()=default
constexpr int64_t size() const
Definition BLI_span.hh:256
constexpr IndexRange index_range() const
Definition BLI_span.hh:405
UString()=default
std::optional< T > get_if_single() const
NodeOperation(Context &context, const bNode &node)
Result & get_result(StringRef identifier)
Definition operation.cc:40
Result & get_input(StringRef identifier) const
Definition operation.cc:35
static bool is_single_value_only_type(ResultType type)
Definition result.cc:51
void set_signature(const Signature *signature)
static FieldOperationPtr from(std::shared_ptr< const mf::MultiFunction > fn, Vector< GField > inputs)
Definition field.cc:252
void add_item(std::string socket_name, SocketLinkOperation::LinkSocketFn fn, int weight=0)
void update_and_connect_available_socket(bNode &new_node, UString socket_name)
static SocketValueVariant & construct_in(void *ptr, T &&value)
void call(const IndexMask &mask, mf::Params params, mf::Context) const override
LazyFunctionForIndexSwitchNode(const bNode &node, GeometryNodesLazyFunctionGraphInfo &lf_graph_info)
void execute_impl(lf::Params &params, const lf::Context &) const override
#define storage(slot, qualifiers)
void node_register_type(bNodeType &ntype)
Definition node.cc:2920
bNodeSocketType * node_socket_type_find_static(int type, int subtype=0)
Definition node.cc:2975
void node_type_storage(bNodeType &ntype, std::optional< StringRefNull > storagename, void(*freefunc)(bNode *node), void(*copyfunc)(bNodeTree *dest_ntree, bNode *dest_node, const bNode *src_node))
Definition node.cc:6166
ResultType socket_data_type_to_result_type(const eNodeSocketDatatype data_type, const std::optional< int > dimensions=std::nullopt)
Definition utilities.cc:39
internal::ShallowDataConstRef< T > shallow_copy(const T &other)
Definition DNA_defs.h:147
static void node_copy_storage(bNodeTree *, bNode *dst_node, const bNode *src_node)
static void node_layout_ex(ui::Layout &layout, bContext *C, PointerRNA *ptr)
static void node_blend_read(bNodeTree &, bNode &node, BlendDataReader &reader)
static void node_layout(ui::Layout &layout, bContext *, PointerRNA *ptr)
static void node_gather_link_searches(GatherLinkSearchOpParams &params)
static bool node_insert_link(bke::NodeInsertLinkParams &params)
static void node_declare(NodeDeclarationBuilder &b)
static void node_blend_write(const bNodeTree &, const bNode &node, BlendWriter &writer)
static void node_init(bNodeTree *tree, bNode *node)
static void draw_item_socket(CustomSocketDrawParams &params, const int index)
static const EnumPropertyItem * data_type_items_callback(bContext *, PointerRNA *ptr, PropertyRNA *, bool *r_free)
static const bNodeSocket * node_internally_linked_input(const bNodeTree &, const bNode &node, const bNodeSocket &)
static NodeOperation * get_compositor_operation(Context &context, const bNode &node)
void blend_write(BlendWriter *writer, const bNode &node)
void blend_read_data(BlendDataReader *reader, bNode &node)
void copy_array(const bNode &src_node, bNode &dst_node)
bool try_add_item_via_any_extend_socket(bNodeTree &ntree, bNode &extend_node, bNode &storage_node, bNodeLink &link, const std::optional< StringRef > socket_identifier=std::nullopt, typename Accessor::ItemT **r_new_item=nullptr)
std::unique_ptr< LazyFunction > get_index_switch_node_lazy_function(const bNode &node, GeometryNodesLazyFunctionGraphInfo &lf_graph_info)
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 &params, const bNode &node)
const EnumPropertyItem * enum_items_filter(const EnumPropertyItem *original_item_array, FunctionRef< bool(const EnumPropertyItem &item)> fn)
BMesh Iterators.
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
__int64 int64_t
Definition BKE_text.h:90
void RNA_int_set(PointerRNA *ptr, const char *name, int value)
BMesh const char void * data
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)
#define min(a, b)
Definition sort.cc:38
bke::bNodeSocketType * typeinfo
eNodeSocketDatatype type
bke::bNodeTreeType * typeinfo
eNodeTree_Type type
Defines a socket type.
Definition BKE_node.hh:163
const CPPType * base_cpp_type
Definition BKE_node.hh:210
bool(*) valid_socket_type(bNodeTreeType *ntreetype, bNodeSocketType *socket_type)
Definition BKE_node.hh:569
bool(*) validate_link(eNodeSocketDatatype from, eNodeSocketDatatype to)
Definition BKE_node.hh:566
Defines a node type.
Definition BKE_node.hh:265
NodeInternallyLinkedInputFunction internally_linked_input
Definition BKE_node.hh:415
void(*) draw_buttons(ui::Layout &, bContext *C, PointerRNA *ptr)
Definition BKE_node.hh:290
NodeBlendWriteFunction blend_write_storage_content
Definition BKE_node.hh:421
void(*) register_operators()
Definition BKE_node.hh:448
std::string ui_description
Definition BKE_node.hh:271
NodeBlendDataReadFunction blend_data_read_storage_content
Definition BKE_node.hh:422
NodeGetCompositorOperationFunction get_compositor_operation
Definition BKE_node.hh:379
void(*) draw_buttons_ex(ui::Layout &, bContext *C, PointerRNA *ptr)
Definition BKE_node.hh:292
void(*) initfunc(bNodeTree *ntree, bNode *node)
Definition BKE_node.hh:320
const char * enum_name_legacy
Definition BKE_node.hh:274
NodeGatherSocketLinkOperationsFunction gather_link_search_ops
Definition BKE_node.hh:409
NodeDeclareFunction declare
Definition BKE_node.hh:393
bool ignore_inferred_input_socket_visibility
Definition BKE_node.hh:453
bool(*) insert_link(NodeInsertLinkParams &params)
Definition BKE_node.hh:364
static std::string socket_identifier_for_item(const IndexSwitchItem &item)
static void blend_read_data_item(BlendDataReader *reader, ItemT &item)
static void blend_write_item(BlendWriter *writer, const ItemT &item)
void label(StringRef name, int icon)
PointerRNA op(wmOperatorType *ot, std::optional< StringRef > name, int icon, wm::OpCallContext context, eUI_Item_Flag flag)
PanelLayout panel(const bContext *C, StringRef idname, bool default_closed)
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)
Layout & column(bool align)
Layout & row(bool align)