Blender V4.5
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
5#include "BLI_string.h"
6
9
10#include "BKE_lib_id.hh"
11#include "BKE_node_runtime.hh"
12
13#include "BLI_math_vector.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(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(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
224bNodeSocket &Vector::build(bNodeTree &ntree, bNode &node) const
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
275bNodeSocket &Vector::update_or_build(bNodeTree &ntree, bNode &node, bNodeSocket &socket) const
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
352bNodeSocket &Color::build(bNodeTree &ntree, bNode &node) const
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
386bNodeSocket &Color::update_or_build(bNodeTree &ntree, bNode &node, bNodeSocket &socket) const
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
454bNodeSocket &Matrix::build(bNodeTree &ntree, bNode &node) const
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
489bNodeSocket &Matrix::update_or_build(bNodeTree &ntree, bNode &node, bNodeSocket &socket) const
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;
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/* -------------------------------------------------------------------- */
612
614{
616 node,
617 this->in_out,
619 PROP_NONE,
620 this->identifier.c_str(),
621 this->name.c_str());
622 this->set_common_flags(socket);
623 return socket;
624}
625
626bool Bundle::matches(const bNodeSocket &socket) const
627{
628 if (!this->matches_common_data(socket)) {
629 return false;
630 }
631 if (socket.type != SOCK_BUNDLE) {
632 return false;
633 }
634 return true;
635}
636
637bool Bundle::can_connect(const bNodeSocket &socket) const
638{
639 if (!sockets_can_connect(*this, socket)) {
640 return false;
641 }
642 return ELEM(socket.type, SOCK_BUNDLE);
643}
644
646{
647 if (socket.type != SOCK_BUNDLE) {
648 BLI_assert(socket.in_out == this->in_out);
649 return this->build(ntree, node);
650 }
651 this->set_common_flags(socket);
652 return socket;
653}
654
656
657/* -------------------------------------------------------------------- */
660
662{
664 node,
665 this->in_out,
667 PROP_NONE,
668 this->identifier.c_str(),
669 this->name.c_str());
670 this->set_common_flags(socket);
671 return socket;
672}
673
674bool Closure::matches(const bNodeSocket &socket) const
675{
676 if (!this->matches_common_data(socket)) {
677 return false;
678 }
679 if (socket.type != SOCK_CLOSURE) {
680 return false;
681 }
682 return true;
683}
684
685bool Closure::can_connect(const bNodeSocket &socket) const
686{
687 if (!sockets_can_connect(*this, socket)) {
688 return false;
689 }
690 return ELEM(socket.type, SOCK_CLOSURE);
691}
692
694{
695 if (socket.type != SOCK_CLOSURE) {
696 BLI_assert(socket.in_out == this->in_out);
697 return this->build(ntree, node);
698 }
699 this->set_common_flags(socket);
700 return socket;
701}
702
704
705/* -------------------------------------------------------------------- */
708
710{
712 ntree, node, this->in_out, this->idname, this->identifier.c_str(), this->name.c_str());
713 if (this->default_value_fn) {
714 ID *id = this->default_value_fn(node);
715 /* Assumes that all ID sockets like #bNodeSocketValueObject and #bNodeSocketValueImage have the
716 * ID pointer at the start of the struct. */
717 *static_cast<ID **>(socket.default_value) = id;
718 id_us_plus(id);
719 }
720 this->set_common_flags(socket);
721 return socket;
722}
723
725{
726 if (!this->matches_common_data(socket)) {
727 return false;
728 }
729 if (!STREQ(socket.idname, this->idname)) {
730 return false;
731 }
732 return true;
733}
734
736{
737 return sockets_can_connect(*this, socket) && STREQ(socket.idname, this->idname);
738}
739
741 bNode &node,
742 bNodeSocket &socket) const
743{
744 if (StringRef(socket.idname) != this->idname) {
745 BLI_assert(socket.in_out == this->in_out);
746 return this->build(ntree, node);
747 }
748 this->set_common_flags(socket);
749 return socket;
750}
751
753
754/* -------------------------------------------------------------------- */
757
759{
760 bNodeSocket &socket = *bke::node_add_socket(ntree,
761 node,
762 this->in_out,
763 "NodeSocketGeometry",
764 this->identifier.c_str(),
765 this->name.c_str());
766 this->set_common_flags(socket);
767 return socket;
768}
769
770bool Geometry::matches(const bNodeSocket &socket) const
771{
772 if (!this->matches_common_data(socket)) {
773 return false;
774 }
775 if (socket.type != SOCK_GEOMETRY) {
776 return false;
777 }
778 return true;
779}
780
781bool Geometry::can_connect(const bNodeSocket &socket) const
782{
783 return sockets_can_connect(*this, socket) && socket.type == SOCK_GEOMETRY;
784}
785
787{
788 return supported_types_;
789}
790
792{
793 return only_realized_data_;
794}
795
797{
798 return only_instances_;
799}
800
806
809{
810 decl_->supported_types_ = supported_types;
811 return *this;
812}
813
815{
816 decl_->only_realized_data_ = value;
817 return *this;
818}
819
821{
822 decl_->only_instances_ = value;
823 return *this;
824}
825
827
828/* -------------------------------------------------------------------- */
831
833{
835 ntree, node, this->in_out, "NodeSocketShader", this->identifier.c_str(), this->name.c_str());
836 this->set_common_flags(socket);
837 return socket;
838}
839
840bool Shader::matches(const bNodeSocket &socket) const
841{
842 if (!this->matches_common_data(socket)) {
843 return false;
844 }
845 if (socket.type != SOCK_SHADER) {
846 return false;
847 }
848 return true;
849}
850
851bool Shader::can_connect(const bNodeSocket &socket) const
852{
853 if (!sockets_can_connect(*this, socket)) {
854 return false;
855 }
856 /* Basic types can convert to shaders, but not the other way around. */
857 if (this->in_out == SOCK_IN) {
858 return ELEM(
860 }
861 return socket.type == SOCK_SHADER;
862}
863
865
866/* -------------------------------------------------------------------- */
869
871{
872 bNodeSocket &socket = *bke::node_add_socket(ntree,
873 node,
874 this->in_out,
875 "NodeSocketVirtual",
876 this->identifier.c_str(),
877 this->name.c_str());
878 return socket;
879}
880
881bool Extend::matches(const bNodeSocket &socket) const
882{
883 if (socket.identifier != this->identifier) {
884 return false;
885 }
886 return true;
887}
888
889bool Extend::can_connect(const bNodeSocket & /*socket*/) const
890{
891 return false;
892}
893
895 bNode & /*node*/,
896 bNodeSocket &socket) const
897{
898 return socket;
899}
900
902
903/* -------------------------------------------------------------------- */
906
908{
910 ntree, node, this->in_out, idname_, this->identifier.c_str(), this->name.c_str());
911 if (this->init_socket_fn) {
912 this->init_socket_fn(node, socket, "interface");
913 }
914 return socket;
915}
916
917bool Custom::matches(const bNodeSocket &socket) const
918{
919 if (!this->matches_common_data(socket)) {
920 return false;
921 }
922 if (socket.type != SOCK_CUSTOM) {
923 return false;
924 }
925 if (socket.typeinfo->idname != idname_) {
926 return false;
927 }
928 return true;
929}
930
931bool Custom::can_connect(const bNodeSocket &socket) const
932{
933 return sockets_can_connect(*this, socket) && STREQ(socket.idname, idname_);
934}
935
937{
938 if (socket.typeinfo->idname != idname_) {
939 return this->build(ntree, node);
940 }
941 this->set_common_flags(socket);
942 return socket;
943}
944
946
947} // namespace blender::nodes::decl
void id_us_plus(ID *id)
Definition lib_id.cc:353
#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:688
#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:221
@ PROP_FILEPATH
Definition RNA_types.hh:224
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
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 & build(bNodeTree &ntree, bNode &node) 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
bNodeSocket & build(bNodeTree &ntree, bNode &node) 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
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
bNodeSocket & build(bNodeTree &ntree, bNode &node) const override
#define input
#define this
#define filter
#define output
bNodeSocket * node_add_socket(bNodeTree &ntree, bNode &node, eNodeSocketInOut in_out, StringRefNull idname, StringRefNull identifier, StringRefNull name)
Definition node.cc:3136
bNodeSocketType * node_socket_type_find(StringRef idname)
Definition node.cc:2794
bNodeSocket * node_add_static_socket(bNodeTree &ntree, bNode &node, eNodeSocketInOut in_out, int type, int subtype, StringRefNull identifier, StringRefNull name)
Definition node.cc:3529
std::optional< StringRefNull > node_static_socket_type(int type, int subtype, std::optional< int > dimensions=std::nullopt)
Definition node.cc:3167
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)
VecBase< float, 3 > float3
Definition DNA_ID.h:404
bNodeSocketRuntimeHandle * runtime
bNodeSocketTypeHandle * typeinfo
void * default_value
char identifier[64]
char idname[64]
Defines a socket type.
Definition BKE_node.hh:152