Blender V5.0
node_socket_declarations.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
7
8#include "BKE_lib_id.hh"
9#include "BKE_node_runtime.hh"
10
11#include "BLI_math_vector.h"
12#include "BLI_string.h"
13#include "BLI_string_utf8.h"
14
16
24{
25 if (output.output_field_dependency.field_type() == OutputSocketFieldType::FieldSource) {
26 if (input.input_field_type == InputSocketFieldType::None) {
27 return false;
28 }
29 }
30 return true;
31}
32
33static bool sockets_can_connect(const SocketDeclaration &socket_decl,
34 const bNodeSocket &other_socket)
35{
36 /* Input sockets cannot connect to input sockets, outputs cannot connect to outputs. */
37 if (socket_decl.in_out == other_socket.in_out) {
38 return false;
39 }
40
41 if (other_socket.runtime->declaration) {
42 if (socket_decl.in_out == SOCK_IN) {
43 if (!field_types_are_compatible(socket_decl, *other_socket.runtime->declaration)) {
44 return false;
45 }
46 }
47 else {
48 if (!field_types_are_compatible(*other_socket.runtime->declaration, socket_decl)) {
49 return false;
50 }
51 }
52 }
53
54 return true;
55}
56
57static bool basic_types_can_connect(const SocketDeclaration & /*socket_decl*/,
58 const bNodeSocket &other_socket)
59{
61}
62
63static void modify_subtype_except_for_storage(bNodeSocket &socket, int new_subtype)
64{
65 const StringRefNull idname = *bke::node_static_socket_type(socket.type, new_subtype);
66 STRNCPY_UTF8(socket.idname, idname.c_str());
68 socket.typeinfo = socktype;
69}
70
71static void modify_subtype_except_for_storage(bNodeSocket &socket, int subtype, int dimensions)
72{
73 const StringRefNull idname = *bke::node_static_socket_type(socket.type, subtype, dimensions);
74 STRNCPY_UTF8(socket.idname, idname.c_str());
76 socket.typeinfo = socktype;
77}
78
79/* -------------------------------------------------------------------- */
82
84{
86 node,
87 this->in_out,
89 this->subtype,
90 this->identifier.c_str(),
91 this->name.c_str());
92 this->set_common_flags(socket);
94 value.min = this->soft_min_value;
95 value.max = this->soft_max_value;
96 value.value = this->default_value;
97 return socket;
98}
99
100bool Float::matches(const bNodeSocket &socket) const
101{
102 if (!this->matches_common_data(socket)) {
103 return false;
104 }
105 if (socket.type != SOCK_FLOAT) {
106 return false;
107 }
108 if (socket.typeinfo->subtype != this->subtype) {
109 return false;
110 }
112 if (value.min != this->soft_min_value) {
113 return false;
114 }
115 if (value.max != this->soft_max_value) {
116 return false;
117 }
118 return true;
119}
120
121bool Float::can_connect(const bNodeSocket &socket) const
122{
123 if (!sockets_can_connect(*this, socket)) {
124 return false;
125 }
126 if (this->in_out == SOCK_OUT && socket.type == SOCK_ROTATION) {
127 return true;
128 }
129 return basic_types_can_connect(*this, socket);
130}
131
133{
134 if (socket.type != SOCK_FLOAT) {
135 BLI_assert(socket.in_out == this->in_out);
136 return this->build(ntree, node);
137 }
138 if (socket.typeinfo->subtype != this->subtype) {
140 }
141 this->set_common_flags(socket);
143 value.min = this->soft_min_value;
144 value.max = this->soft_max_value;
145 value.subtype = this->subtype;
146 return socket;
147}
148
150
151/* -------------------------------------------------------------------- */
154
156{
158 node,
159 this->in_out,
160 SOCK_INT,
161 this->subtype,
162 this->identifier.c_str(),
163 this->name.c_str());
164 this->set_common_flags(socket);
166 value.min = this->soft_min_value;
167 value.max = this->soft_max_value;
168 value.value = this->default_value;
169 return socket;
170}
171
172bool Int::matches(const bNodeSocket &socket) const
173{
174 if (!this->matches_common_data(socket)) {
175 return false;
176 }
177 if (socket.type != SOCK_INT) {
178 return false;
179 }
180 if (socket.typeinfo->subtype != this->subtype) {
181 return false;
182 }
184 if (value.min != this->soft_min_value) {
185 return false;
186 }
187 if (value.max != this->soft_max_value) {
188 return false;
189 }
190 return true;
191}
192
193bool Int::can_connect(const bNodeSocket &socket) const
194{
195 if (!sockets_can_connect(*this, socket)) {
196 return false;
197 }
198 return basic_types_can_connect(*this, socket);
199}
200
202{
203 if (socket.type != SOCK_INT) {
204 BLI_assert(socket.in_out == this->in_out);
205 return this->build(ntree, node);
206 }
207 if (socket.typeinfo->subtype != this->subtype) {
209 }
210 this->set_common_flags(socket);
212 value.min = this->soft_min_value;
213 value.max = this->soft_max_value;
214 value.subtype = this->subtype;
215 return socket;
216}
217
219
220/* -------------------------------------------------------------------- */
223
225{
227 SOCK_VECTOR, this->subtype, this->dimensions);
229 ntree, node, this->in_out, idname, this->identifier.c_str(), this->name.c_str());
230 this->set_common_flags(socket);
232 std::copy_n(&this->default_value[0], this->dimensions, value.value);
233 value.dimensions = this->dimensions;
234 value.min = this->soft_min_value;
235 value.max = this->soft_max_value;
236 return socket;
237}
238
239bool Vector::matches(const bNodeSocket &socket) const
240{
241 if (!this->matches_common_data(socket)) {
242 return false;
243 }
244 if (socket.type != SOCK_VECTOR) {
245 return false;
246 }
247 if (socket.typeinfo->subtype != this->subtype) {
248 return false;
249 }
250 const bNodeSocketValueVector &value = *static_cast<const bNodeSocketValueVector *>(
251 socket.default_value);
252 if (value.dimensions != this->dimensions) {
253 return false;
254 }
255 if (value.min != this->soft_min_value) {
256 return false;
257 }
258 if (value.max != this->soft_max_value) {
259 return false;
260 }
261 return true;
262}
263
264bool Vector::can_connect(const bNodeSocket &socket) const
265{
266 if (!sockets_can_connect(*this, socket)) {
267 return false;
268 }
269 if (socket.type == SOCK_ROTATION) {
270 return true;
271 }
272 return basic_types_can_connect(*this, socket);
273}
274
276{
277 if (socket.type != SOCK_VECTOR) {
278 BLI_assert(socket.in_out == this->in_out);
279 return this->build(ntree, node);
280 }
281 if (socket.typeinfo->subtype != this->subtype) {
283 }
284 this->set_common_flags(socket);
286 if (value.dimensions != this->dimensions) {
288 }
289 value.subtype = this->subtype;
290 value.dimensions = this->dimensions;
291 value.min = this->soft_min_value;
292 value.max = this->soft_max_value;
293 return socket;
294}
295
297
298/* -------------------------------------------------------------------- */
301
303{
305 node,
306 this->in_out,
308 PROP_NONE,
309 this->identifier.c_str(),
310 this->name.c_str());
311 this->set_common_flags(socket);
313 value.value = this->default_value;
314 return socket;
315}
316
317bool Bool::matches(const bNodeSocket &socket) const
318{
319 if (!this->matches_common_data(socket)) {
320 return false;
321 }
322 if (socket.type != SOCK_BOOLEAN) {
323 return false;
324 }
325 return true;
326}
327
328bool Bool::can_connect(const bNodeSocket &socket) const
329{
330 if (!sockets_can_connect(*this, socket)) {
331 return false;
332 }
333 return basic_types_can_connect(*this, socket);
334}
335
337{
338 if (socket.type != SOCK_BOOLEAN) {
339 BLI_assert(socket.in_out == this->in_out);
340 return this->build(ntree, node);
341 }
342 this->set_common_flags(socket);
343 return socket;
344}
345
347
348/* -------------------------------------------------------------------- */
351
353{
355 node,
356 this->in_out,
357 SOCK_RGBA,
358 PROP_NONE,
359 this->identifier.c_str(),
360 this->name.c_str());
361 this->set_common_flags(socket);
363 copy_v4_v4(value.value, this->default_value);
364 return socket;
365}
366
367bool Color::matches(const bNodeSocket &socket) const
368{
369 if (!this->matches_common_data(socket)) {
370 return false;
371 }
372 if (socket.type != SOCK_RGBA) {
373 return false;
374 }
375 return true;
376}
377
378bool Color::can_connect(const bNodeSocket &socket) const
379{
380 if (!sockets_can_connect(*this, socket)) {
381 return false;
382 }
383 return basic_types_can_connect(*this, socket);
384}
385
387{
388 if (socket.type != SOCK_RGBA) {
389 BLI_assert(socket.in_out == this->in_out);
390 return this->build(ntree, node);
391 }
392 this->set_common_flags(socket);
393 return socket;
394}
395
397/* -------------------------------------------------------------------- */
400
402{
404 node,
405 this->in_out,
407 PROP_NONE,
408 this->identifier.c_str(),
409 this->name.c_str());
410 this->set_common_flags(socket);
411 bNodeSocketValueRotation &value = *static_cast<bNodeSocketValueRotation *>(socket.default_value);
413 return socket;
414}
415
416bool Rotation::matches(const bNodeSocket &socket) const
417{
418 if (!this->matches_common_data(socket)) {
419 return false;
420 }
421 if (socket.type != SOCK_ROTATION) {
422 return false;
423 }
424 return true;
425}
426
427bool Rotation::can_connect(const bNodeSocket &socket) const
428{
429 if (!sockets_can_connect(*this, socket)) {
430 return false;
431 }
432 if (this->in_out == SOCK_IN) {
434 }
436}
437
439{
440 if (socket.type != SOCK_ROTATION) {
441 BLI_assert(socket.in_out == this->in_out);
442 return this->build(ntree, node);
443 }
444 this->set_common_flags(socket);
445 return socket;
446}
447
449
450/* -------------------------------------------------------------------- */
453
455{
457 node,
458 this->in_out,
460 PROP_NONE,
461 this->identifier.c_str(),
462 this->name.c_str());
463 this->set_common_flags(socket);
464 return socket;
465}
466
467bool Matrix::matches(const bNodeSocket &socket) const
468{
469 if (!this->matches_common_data(socket)) {
470 return false;
471 }
472 if (socket.type != SOCK_MATRIX) {
473 return false;
474 }
475 return true;
476}
477
478bool Matrix::can_connect(const bNodeSocket &socket) const
479{
480 if (!sockets_can_connect(*this, socket)) {
481 return false;
482 }
483 if (this->in_out == SOCK_IN) {
485 }
486 return ELEM(socket.type, SOCK_MATRIX, SOCK_VECTOR, SOCK_MATRIX);
487}
488
490{
491 if (socket.type != SOCK_MATRIX) {
492 BLI_assert(socket.in_out == this->in_out);
493 return this->build(ntree, node);
494 }
495 this->set_common_flags(socket);
496 return socket;
497}
498
500
501/* -------------------------------------------------------------------- */
504
506{
508 node,
509 this->in_out,
511 this->subtype,
512 this->identifier.c_str(),
513 this->name.c_str());
514 STRNCPY(((bNodeSocketValueString *)socket.default_value)->value, this->default_value.c_str());
515 this->set_common_flags(socket);
516 return socket;
517}
518
519bool String::matches(const bNodeSocket &socket) const
520{
521 if (!this->matches_common_data(socket)) {
522 return false;
523 }
524 if (socket.type != SOCK_STRING) {
525 return false;
526 }
527 if (socket.typeinfo->subtype != this->subtype) {
528 return false;
529 }
530 return true;
531}
532
533bool String::can_connect(const bNodeSocket &socket) const
534{
535 return sockets_can_connect(*this, socket) && socket.type == SOCK_STRING;
536}
537
539{
540 if (socket.type != SOCK_STRING) {
541 BLI_assert(socket.in_out == this->in_out);
542 return this->build(ntree, node);
543 }
544 if (socket.typeinfo->subtype != this->subtype) {
546 }
547 this->set_common_flags(socket);
549 value.subtype = this->subtype;
550 return socket;
551}
552
554{
555 BLI_assert(decl_->subtype == PROP_FILEPATH);
556 decl_->path_filter = std::move(filter);
557 return *this;
558}
559
561
562/* -------------------------------------------------------------------- */
565
567{
569 node,
570 this->in_out,
571 SOCK_MENU,
572 PROP_NONE,
573 this->identifier.c_str(),
574 this->name.c_str());
575
576 ((bNodeSocketValueMenu *)socket.default_value)->value = this->default_value.value;
577 this->set_common_flags(socket);
578 return socket;
579}
580
581bool Menu::matches(const bNodeSocket &socket) const
582{
583 if (!this->matches_common_data(socket)) {
584 return false;
585 }
586 if (socket.type != SOCK_MENU) {
587 return false;
588 }
589 return true;
590}
591
592bool Menu::can_connect(const bNodeSocket &socket) const
593{
594 return sockets_can_connect(*this, socket) && socket.type == SOCK_MENU;
595}
596
598{
599 if (socket.type != SOCK_MENU) {
600 BLI_assert(socket.in_out == this->in_out);
601 return this->build(ntree, node);
602 }
603 this->set_common_flags(socket);
604 return socket;
605}
606
608{
609 /* Using a global map ensures that the same runtime data is used for the same static items.
610 * This is necessary because otherwise each node would have a different (incompatible) menu
611 * definition. */
612 static Mutex mutex;
614 items_by_enum_ptr;
615
616 std::lock_guard lock{mutex};
617 decl_->items = items_by_enum_ptr.lookup_or_add_cb(items, [&]() {
619 for (const EnumPropertyItem *item = items; item->identifier; item++) {
620 bke::RuntimeNodeEnumItem runtime_item;
621 runtime_item.name = item->name;
622 runtime_item.description = item->description;
623 runtime_item.identifier = item->value;
624 runtime_items->items.append(std::move(runtime_item));
625 }
627 });
628 return *this;
629}
630
632
633/* -------------------------------------------------------------------- */
636
638{
640 node,
641 this->in_out,
643 PROP_NONE,
644 this->identifier.c_str(),
645 this->name.c_str());
646 this->set_common_flags(socket);
647 return socket;
648}
649
650bool Bundle::matches(const bNodeSocket &socket) const
651{
652 if (!this->matches_common_data(socket)) {
653 return false;
654 }
655 if (socket.type != SOCK_BUNDLE) {
656 return false;
657 }
658 return true;
659}
660
661bool Bundle::can_connect(const bNodeSocket &socket) const
662{
663 if (!sockets_can_connect(*this, socket)) {
664 return false;
665 }
666 return ELEM(socket.type, SOCK_BUNDLE);
667}
668
670{
671 if (socket.type != SOCK_BUNDLE) {
672 BLI_assert(socket.in_out == this->in_out);
673 return this->build(ntree, node);
674 }
675 this->set_common_flags(socket);
676 return socket;
677}
678
680{
681 BLI_assert(this->is_output());
682 decl_->pass_through_input_index = std::move(index);
683 return *this;
684}
685
687
688/* -------------------------------------------------------------------- */
691
693{
695 node,
696 this->in_out,
698 PROP_NONE,
699 this->identifier.c_str(),
700 this->name.c_str());
701 this->set_common_flags(socket);
702 return socket;
703}
704
705bool Closure::matches(const bNodeSocket &socket) const
706{
707 if (!this->matches_common_data(socket)) {
708 return false;
709 }
710 if (socket.type != SOCK_CLOSURE) {
711 return false;
712 }
713 return true;
714}
715
716bool Closure::can_connect(const bNodeSocket &socket) const
717{
718 if (!sockets_can_connect(*this, socket)) {
719 return false;
720 }
721 return ELEM(socket.type, SOCK_CLOSURE);
722}
723
725{
726 if (socket.type != SOCK_CLOSURE) {
727 BLI_assert(socket.in_out == this->in_out);
728 return this->build(ntree, node);
729 }
730 this->set_common_flags(socket);
731 return socket;
732}
733
735
736/* -------------------------------------------------------------------- */
739
741{
743 ntree, node, this->in_out, this->idname, this->identifier.c_str(), this->name.c_str());
744 if (this->default_value_fn) {
745 ID *id = this->default_value_fn(node);
746 /* Assumes that all ID sockets like #bNodeSocketValueObject and #bNodeSocketValueImage have the
747 * ID pointer at the start of the struct. */
748 *static_cast<ID **>(socket.default_value) = id;
749 id_us_plus(id);
750 }
751 this->set_common_flags(socket);
752 return socket;
753}
754
756{
757 if (!this->matches_common_data(socket)) {
758 return false;
759 }
760 if (!STREQ(socket.idname, this->idname)) {
761 return false;
762 }
763 return true;
764}
765
767{
768 return sockets_can_connect(*this, socket) && STREQ(socket.idname, this->idname);
769}
770
772 bNode &node,
773 bNodeSocket &socket) const
774{
775 if (StringRef(socket.idname) != this->idname) {
776 BLI_assert(socket.in_out == this->in_out);
777 return this->build(ntree, node);
778 }
779 this->set_common_flags(socket);
780 return socket;
781}
782
784
785/* -------------------------------------------------------------------- */
788
790{
791 bNodeSocket &socket = *bke::node_add_socket(ntree,
792 node,
793 this->in_out,
794 "NodeSocketGeometry",
795 this->identifier.c_str(),
796 this->name.c_str());
797 this->set_common_flags(socket);
798 return socket;
799}
800
801bool Geometry::matches(const bNodeSocket &socket) const
802{
803 if (!this->matches_common_data(socket)) {
804 return false;
805 }
806 if (socket.type != SOCK_GEOMETRY) {
807 return false;
808 }
809 return true;
810}
811
812bool Geometry::can_connect(const bNodeSocket &socket) const
813{
814 return sockets_can_connect(*this, socket) && socket.type == SOCK_GEOMETRY;
815}
816
818{
819 return supported_types_;
820}
821
823{
824 return only_realized_data_;
825}
826
828{
829 return only_instances_;
830}
831
837
840{
841 decl_->supported_types_ = supported_types;
842 return *this;
843}
844
846{
847 decl_->only_realized_data_ = value;
848 return *this;
849}
850
852{
853 decl_->only_instances_ = value;
854 return *this;
855}
856
858
859/* -------------------------------------------------------------------- */
862
864{
866 ntree, node, this->in_out, "NodeSocketShader", this->identifier.c_str(), this->name.c_str());
867 this->set_common_flags(socket);
868 return socket;
869}
870
871bool Shader::matches(const bNodeSocket &socket) const
872{
873 if (!this->matches_common_data(socket)) {
874 return false;
875 }
876 if (socket.type != SOCK_SHADER) {
877 return false;
878 }
879 return true;
880}
881
882bool Shader::can_connect(const bNodeSocket &socket) const
883{
884 if (!sockets_can_connect(*this, socket)) {
885 return false;
886 }
887 /* Basic types can convert to shaders, but not the other way around. */
888 if (this->in_out == SOCK_IN) {
889 return ELEM(
891 }
892 return socket.type == SOCK_SHADER;
893}
894
896
897/* -------------------------------------------------------------------- */
900
902{
903 bNodeSocket &socket = *bke::node_add_socket(ntree,
904 node,
905 this->in_out,
906 "NodeSocketVirtual",
907 this->identifier.c_str(),
908 this->name.c_str());
909 return socket;
910}
911
912bool Extend::matches(const bNodeSocket &socket) const
913{
914 if (socket.identifier != this->identifier) {
915 return false;
916 }
917 return true;
918}
919
920bool Extend::can_connect(const bNodeSocket & /*socket*/) const
921{
922 return false;
923}
924
926 bNode & /*node*/,
927 bNodeSocket &socket) const
928{
929 return socket;
930}
931
933
934/* -------------------------------------------------------------------- */
937
939{
941 ntree, node, this->in_out, idname_, this->identifier.c_str(), this->name.c_str());
942 if (this->init_socket_fn) {
943 this->init_socket_fn(node, socket, "interface");
944 }
945 return socket;
946}
947
948bool Custom::matches(const bNodeSocket &socket) const
949{
950 if (!this->matches_common_data(socket)) {
951 return false;
952 }
953 if (socket.type != SOCK_CUSTOM) {
954 return false;
955 }
956 if (socket.typeinfo->idname != idname_) {
957 return false;
958 }
959 return true;
960}
961
962bool Custom::can_connect(const bNodeSocket &socket) const
963{
964 return sockets_can_connect(*this, socket) && STREQ(socket.idname, idname_);
965}
966
968{
969 if (socket.typeinfo->idname != idname_) {
970 return this->build(ntree, node);
971 }
972 this->set_common_flags(socket);
973 return socket;
974}
975
977
978} // namespace blender::nodes::decl
void id_us_plus(ID *id)
Definition lib_id.cc:358
#define BLI_assert(a)
Definition BLI_assert.h:46
MINLINE void copy_v4_v4(float r[4], const float a[4])
MINLINE void copy_v3_v3(float r[3], const float a[3])
char * STRNCPY(char(&dst)[N], const char *src)
Definition BLI_string.h:693
#define STRNCPY_UTF8(dst, src)
#define ELEM(...)
#define STREQ(a, b)
@ SOCK_OUT
@ SOCK_IN
@ SOCK_INT
@ SOCK_VECTOR
@ SOCK_CLOSURE
@ SOCK_BOOLEAN
@ SOCK_SHADER
@ SOCK_MATRIX
@ SOCK_FLOAT
@ SOCK_CUSTOM
@ SOCK_BUNDLE
@ SOCK_GEOMETRY
@ SOCK_ROTATION
@ SOCK_STRING
@ SOCK_RGBA
@ SOCK_MENU
@ PROP_NONE
Definition RNA_types.hh:233
@ PROP_FILEPATH
Definition RNA_types.hh:236
volatile int lock
Value & lookup_or_add_cb(const Key &key, const CreateValueF &create_value)
Definition BLI_map.hh:620
constexpr const char * c_str() const
bool matches_common_data(const bNodeSocket &socket) const
void set_common_flags(bNodeSocket &socket) const
bNodeSocket & build(bNodeTree &ntree, bNode &node) const override
bool matches(const bNodeSocket &socket) const override
bNodeSocket & update_or_build(bNodeTree &ntree, bNode &node, bNodeSocket &socket) const override
bool can_connect(const bNodeSocket &socket) const override
BundleBuilder & pass_through_input_index(std::optional< int > index)
bNodeSocket & build(bNodeTree &ntree, bNode &node) const override
bool can_connect(const bNodeSocket &socket) const override
bool matches(const bNodeSocket &socket) const override
bNodeSocket & update_or_build(bNodeTree &ntree, bNode &node, bNodeSocket &socket) const override
bNodeSocket & build(bNodeTree &ntree, bNode &node) const override
bool matches(const bNodeSocket &socket) const override
bool can_connect(const bNodeSocket &socket) const override
bNodeSocket & update_or_build(bNodeTree &ntree, bNode &node, bNodeSocket &socket) const override
bNodeSocket & update_or_build(bNodeTree &ntree, bNode &node, bNodeSocket &socket) const override
bool can_connect(const bNodeSocket &socket) const override
bNodeSocket & build(bNodeTree &ntree, bNode &node) const override
bool matches(const bNodeSocket &socket) const override
bNodeSocket & build(bNodeTree &ntree, bNode &node) const override
bool matches(const bNodeSocket &socket) const override
bNodeSocket & update_or_build(bNodeTree &ntree, bNode &node, bNodeSocket &socket) const override
std::function< void(bNode &node, bNodeSocket &socket, const char *data_path)> init_socket_fn
bool can_connect(const bNodeSocket &socket) const override
bool can_connect(const bNodeSocket &socket) const override
bool matches(const bNodeSocket &socket) const override
bNodeSocket & update_or_build(bNodeTree &ntree, bNode &node, bNodeSocket &socket) const override
bNodeSocket & build(bNodeTree &ntree, bNode &node) const override
bool can_connect(const bNodeSocket &socket) const override
bNodeSocket & build(bNodeTree &ntree, bNode &node) const override
bNodeSocket & update_or_build(bNodeTree &ntree, bNode &node, bNodeSocket &socket) const override
bool matches(const bNodeSocket &socket) const override
GeometryBuilder & only_realized_data(bool value=true)
GeometryBuilder & only_instances(bool value=true)
GeometryBuilder & supported_type(bke::GeometryComponent::Type supported_type)
bNodeSocket & build(bNodeTree &ntree, bNode &node) const override
bool can_connect(const bNodeSocket &socket) const override
Span< bke::GeometryComponent::Type > supported_types() const
bool matches(const bNodeSocket &socket) const override
std::function< ID *(const bNode &node)> default_value_fn
bool can_connect(const bNodeSocket &socket) const override
bNodeSocket & build(bNodeTree &ntree, bNode &node) const override
bNodeSocket & update_or_build(bNodeTree &ntree, bNode &node, bNodeSocket &socket) const override
bool matches(const bNodeSocket &socket) const override
bool can_connect(const bNodeSocket &socket) const override
bNodeSocket & build(bNodeTree &ntree, bNode &node) const override
bool matches(const bNodeSocket &socket) const override
bNodeSocket & update_or_build(bNodeTree &ntree, bNode &node, bNodeSocket &socket) const override
bool can_connect(const bNodeSocket &socket) const override
bNodeSocket & build(bNodeTree &ntree, bNode &node) const override
bNodeSocket & update_or_build(bNodeTree &ntree, bNode &node, bNodeSocket &socket) const override
bool matches(const bNodeSocket &socket) const override
MenuBuilder & static_items(const EnumPropertyItem *items)
bool can_connect(const bNodeSocket &socket) const override
bool matches(const bNodeSocket &socket) const override
bNodeSocket & build(bNodeTree &ntree, bNode &node) const override
bNodeSocket & update_or_build(bNodeTree &ntree, bNode &node, bNodeSocket &socket) const override
bNodeSocket & build(bNodeTree &ntree, bNode &node) const override
bool matches(const bNodeSocket &socket) const override
bool can_connect(const bNodeSocket &socket) const override
bNodeSocket & update_or_build(bNodeTree &ntree, bNode &node, bNodeSocket &socket) const override
bool can_connect(const bNodeSocket &socket) const override
bNodeSocket & build(bNodeTree &ntree, bNode &node) const override
bool matches(const bNodeSocket &socket) const override
StringBuilder & path_filter(std::optional< std::string > filter)
bool can_connect(const bNodeSocket &socket) const override
bool matches(const bNodeSocket &socket) const override
bNodeSocket & build(bNodeTree &ntree, bNode &node) const override
bNodeSocket & update_or_build(bNodeTree &ntree, bNode &node, bNodeSocket &socket) const override
bool can_connect(const bNodeSocket &socket) const override
bool matches(const bNodeSocket &socket) const override
bNodeSocket & build(bNodeTree &ntree, bNode &node) const override
bNodeSocket & update_or_build(bNodeTree &ntree, bNode &node, bNodeSocket &socket) const override
ThreadMutex mutex
#define input
#define filter
#define output
bNodeSocket * node_add_socket(bNodeTree &ntree, bNode &node, eNodeSocketInOut in_out, StringRefNull idname, StringRefNull identifier, StringRefNull name)
Definition node.cc:2804
bNodeSocketType * node_socket_type_find(StringRef idname)
Definition node.cc:2462
bNodeSocket * node_add_static_socket(bNodeTree &ntree, bNode &node, eNodeSocketInOut in_out, int type, int subtype, StringRefNull identifier, StringRefNull name)
Definition node.cc:3197
std::optional< StringRefNull > node_static_socket_type(int type, int subtype, std::optional< int > dimensions=std::nullopt)
Definition node.cc:2835
static bool basic_types_can_connect(const SocketDeclaration &, const bNodeSocket &other_socket)
static void modify_subtype_except_for_storage(bNodeSocket &socket, int new_subtype)
static bool field_types_are_compatible(const SocketDeclaration &input, const SocketDeclaration &output)
static bool sockets_can_connect(const SocketDeclaration &socket_decl, const bNodeSocket &other_socket)
std::mutex Mutex
Definition BLI_mutex.hh:47
VecBase< float, 3 > float3
const char * identifier
Definition RNA_types.hh:657
Definition DNA_ID.h:414
bNodeSocketRuntimeHandle * runtime
bNodeSocketTypeHandle * typeinfo
void * default_value
char identifier[64]
char idname[64]
Vector< RuntimeNodeEnumItem > items
Defines a socket type.
Definition BKE_node.hh:158