diff options
author | Wannes Malfait <Wannes> | 2021-03-30 18:15:23 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-03-30 18:15:23 +0300 |
commit | 6ddd280b21025cdce981f64cabae35348804b95c (patch) | |
tree | 6bef5086714b805f272810d34abef2ce118f9859 /source/blender | |
parent | 6ea09db7a1e62be0fad18cf2aed9976bc1f7336f (diff) |
Nodes: Expose multi input socket in python API
It was not possible to determine if a socket was multi input previously
with BPY. This patch exposes the flag as a read-only property of a node
socket. This is important for addons which automatically add connections
between nodes.
Differential Revision: https://developer.blender.org/D10847
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/makesrna/intern/rna_nodetree.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index 32b75243537..277cfada44d 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -9697,6 +9697,12 @@ static void rna_def_node_socket(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Linked", "True if the socket is connected"); + prop = RNA_def_property(srna, "is_multi_input", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", SOCK_MULTI_INPUT); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text( + prop, "Multi Input", "True if the socket can accept multiple ordered input links"); + prop = RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE); RNA_def_property_flag(prop, PROP_NO_DEG_UPDATE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SOCK_COLLAPSED); |