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
This commit is contained in:
Wannes Malfait 2021-03-30 10:15:23 -05:00 committed by Hans Goudey
parent 6ea09db7a1
commit 6ddd280b21
1 changed files with 6 additions and 0 deletions

View File

@ -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);