[Bf-blender-cvs] [a4a95c8d36b] master: Docs: Add comments to node socket struct header
Hans Goudey
noreply at git.blender.org
Mon Jan 10 19:29:19 CET 2022
Commit: a4a95c8d36ba705d19735ed25f2ad5afdba59017
Author: Hans Goudey
Date: Mon Jan 10 12:29:09 2022 -0600
Branches: master
https://developer.blender.org/rBa4a95c8d36ba705d19735ed25f2ad5afdba59017
Docs: Add comments to node socket struct header
===================================================================
M source/blender/makesdna/DNA_node_types.h
M source/blender/makesrna/intern/rna_nodetree.c
===================================================================
diff --git a/source/blender/makesdna/DNA_node_types.h b/source/blender/makesdna/DNA_node_types.h
index a2b8546f623..b44366642f3 100644
--- a/source/blender/makesdna/DNA_node_types.h
+++ b/source/blender/makesdna/DNA_node_types.h
@@ -106,15 +106,21 @@ typedef struct bNodeSocket {
/** MAX_NAME. */
char name[64];
- /* XXX deprecated, only used for the Image and OutputFile nodes,
- * should be removed at some point.
- */
- /** Custom storage. */
+ /** Only used for the Image and OutputFile nodes, should be removed at some point. */
void *storage;
- short type, flag;
- /** Max. number of links. Read via nodeSocketLinkLimit,
- * because the limit might be defined on the socket type. */
+ /**
+ * The socket's data type. #eNodeSocketDatatype.
+ */
+ short type;
+ /** #eNodeSocketFlag */
+ short flag;
+ /**
+ * Maximum number of links that can connect to the socket. Read via #nodeSocketLinkLimit, because
+ * the limit might be defined on the socket type, in which case this value does not have any
+ * effect. It is necessary to store this in the socket because it is exposed as an RNA property
+ * for custom nodes.
+ */
short limit;
/** Input/output type. */
short in_out;
@@ -123,6 +129,10 @@ typedef struct bNodeSocket {
/** Runtime type identifier. */
char idname[64];
+ /**
+ * The location of the sockets, in the view-space of the node editor.
+ * \note These are runtime data-- only calculated when drawing, and could be removed from DNA.
+ */
float locx, locy;
/** Default input value used for unlinked sockets. */
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c
index d7da36295c1..e7307e6e058 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -3070,7 +3070,6 @@ static bool rna_NodeSocket_is_output_get(PointerRNA *ptr)
static void rna_NodeSocket_link_limit_set(PointerRNA *ptr, int value)
{
- /* Does not have any effect if the link limit is defined in the socket type. */
bNodeSocket *sock = ptr->data;
sock->limit = (value == 0 ? 0xFFF : value);
}
More information about the Bf-blender-cvs
mailing list